-
-
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
Iterable vectors #22548
Iterable vectors #22548
Conversation
Copy English documentation where applicable. Some languages did not contain the math directory, which is where the English vector documentation is located.
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 seems the browser support for this syntax is well enough to give it a try. Builds do work and our eslint setup has no problems with this code, too.
Out of curiosity: How does Babel process such generators? Is it possible to produce ES5 builds with this syntax? |
That is an important topic since there are |
Hey, that is an important question, thanks for the inquiry. A plugin is required for it to work with ES5, it's called regenerator-runtime. I tested a class with a custom iterator and destructuring it worked as expected. Edit: This plugin is also required by an official babel package. Babel-runtime |
It appears that |
Would adding this code break things for ES5 users even if they don't use it? |
I would expect that IE11 is not able to parse JS code with generators. It would be a syntax error. |
I think at this point we no longer support IE11 but I do worry about bundlers. Do bundlers support this well? |
Browserify works fine with them, so I'd expect newer bundlers like Webpack, Parcel, and Rollup to be OK as well. They are an ES6 feature, so not actually all that new. |
Alright, lets see what happens 🤞 |
Thanks! |
Description
All vectors (
Vector2
,Vector3
andVector4
) are now iterable.