Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

types (GLTFLoader): add definitions about plugin system #20713

Merged
merged 5 commits into from
Dec 4, 2020

Conversation

0b5vr
Copy link
Collaborator

@0b5vr 0b5vr commented Nov 19, 2020

Add type definitions about GLTFLoader plugin system which is introduced in #19144 .

Points need review

  • I used a name GLTFLoaderPlugin as an interface name, which is not explicitly mentioned in anywhere yet. is the name appropriate?
  • I'm not sure I should have _markDefs in this definition
  • I don't have enough confidence about return type of:
    • getMaterialType, returns typeof Material | null.
    • extendMaterialParams, returns Promise<any>
    • These are working fine in my WIP project at least

@mrdoob mrdoob added this to the r123 milestone Nov 20, 2020
@mrdoob mrdoob modified the milestones: r123, r124 Nov 25, 2020
Copy link
Collaborator

@donmccurdy donmccurdy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, thank you!

@donmccurdy
Copy link
Collaborator

I'm not sure I should have _markDefs in this definition...

It might be better to hide this one.. i'd be OK with it being a public method, if someone eventually needed it, but if so it should not be prefixed with an underscore.

@takahirox
Copy link
Collaborator

takahirox commented Nov 27, 2020

Yes, _markDefs should be hidden (or we should remove the prefix '_').

When I implemented the lights extension with the plugin system, I couldn't avoid to extend _markDefs. But the method is for a bit too internal use. So I'd like to come up with a nicer way and somehow remove _markDefs extension at some point...

@donmccurdy
Copy link
Collaborator

Let's omit it from type defs for now, then. We can un-prefix it and add it later, if it turns out we can't remove it and other extensions need it.

Copy link
Collaborator

@takahirox takahirox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good to me (other than exposing _markDefs as commented)

@mrdoob
Copy link
Owner

mrdoob commented Dec 2, 2020

/ping @fms-cat

@0b5vr
Copy link
Collaborator Author

0b5vr commented Dec 2, 2020

thanks for the ping!

gonna delete the definition of _markDefs.

@0b5vr
Copy link
Collaborator Author

0b5vr commented Dec 4, 2020

@mrdoob ready!

@mrdoob mrdoob merged commit fd4c170 into mrdoob:dev Dec 4, 2020
@mrdoob
Copy link
Owner

mrdoob commented Dec 4, 2020

Thanks!

@0b5vr 0b5vr deleted the types-gltfloader-plugins branch December 5, 2020 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants