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

Update GLTFExporter / GLTFLoader signatures #196

Merged
merged 4 commits into from
May 2, 2022

Conversation

0b5vr
Copy link
Contributor

@0b5vr 0b5vr commented Mar 7, 2022

Will resolve #170

Why

To catch up with the latest GLTFExporter / GLTFLoader APIs

What

Links for clues are inside of each commit logs

Points need review

  • I've used ErrorEvent for the error type of onError. I've just followed how it was in GLTFLoader definitions but have no confidence about it
    • Other possible candidates are Error or any

Checklist

  • Checked the target branch (current goes master, next goes dev)
    • These are master changes
  • Added myself to contributors table
  • Ready to be merged

Comment on lines 85 to 92
/**
* @deprecated parse() expects options as the fourth argument now.
*/
parse(
input: Object3D | Object3D[],
onDone: (gltf: { [key: string]: any }) => void,
options?: GLTFExporterOptions,
): void;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

how do you think about this @deprecated signature?

Copy link
Member

Choose a reason for hiding this comment

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

I would get rid of this, because if someone used the method like this it would not work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It does work since the compat is still implemented: https://github.com/mrdoob/three.js/blob/c7d06c02e302ab9c20fe8b33eade4b61c6712654/examples/jsm/exporters/GLTFExporter.js#L93-L122

I assume that your potential opinion alternatives can be:

  • "Using deprecated functions must be punished from TypeScript type checking".
  • "We just don't want to track deprecated functions in the repository".

I will agree in either way.
Just want to make sure your / the repository's opinion for my further contributions 😄

Copy link
Member

@joshuaellis joshuaellis Mar 20, 2022

Choose a reason for hiding this comment

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

"We just don't want to track deprecated functions in the repository".

I think this is the most straight forward for us.

Copy link
Contributor Author

@0b5vr 0b5vr Apr 25, 2022

Choose a reason for hiding this comment

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

done ✅ @ 11227b7

Comment on lines 85 to 92
/**
* @deprecated parse() expects options as the fourth argument now.
*/
parse(
input: Object3D | Object3D[],
onDone: (gltf: { [key: string]: any }) => void,
options?: GLTFExporterOptions,
): void;
Copy link
Member

Choose a reason for hiding this comment

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

I would get rid of this, because if someone used the method like this it would not work.

@0b5vr
Copy link
Contributor Author

0b5vr commented Apr 25, 2022

I'm sorry for leaving this one for a long time, gonna fix this

@0b5vr
Copy link
Contributor Author

0b5vr commented Apr 25, 2022

rebased

@0b5vr 0b5vr requested a review from joshuaellis April 25, 2022 10:30
@0b5vr
Copy link
Contributor Author

0b5vr commented Apr 25, 2022

@joshuaellis re-requested the review 🙇

@joshuaellis joshuaellis merged commit a7499f6 into three-types:master May 2, 2022
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.

GLTFExporter - Add onError parameter to .parse()
2 participants