-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
Examples: Convert effects to ES6. #21610
Conversation
|
||
scene.updateMatrixWorld(); | ||
this.render = function ( scene, camera ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The internal variables could be defined outside of the class like here, scope
can be replaced just by this
, and render
and setSize
could become class methods, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this kind of refactoring is wanted. It requires that a lot of variables are added to the public namespace so they are accessible by all methods.
If the current code structure does not interfere with tree-shaking, I would like to avoid changing it (and just develop new classes differently).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It requires that a lot of variables are added to the public namespace
Public namespace? ES modules are locally scoped 😇
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean variables are defined in the constructor's scope. It would be necessary to add them to this
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marcofugaro Don't mess with Mugen's flow! 😁 Feel free to do a second pass later 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay! didn't mean to criticize Mugen's work in any way 😄 those ES6 PRs are awesome! keep it up!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm totally fine when this is revisited at a later point. @marcofugaro Feel free to tackle this if you like 😊 .
Thanks! |
Related issue: -
Description
Converts the
effects
directory to ES6 syntax.