-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
ES6 Classes: Add support for class fields #20129
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
Conversation
|
Ugh, unit tests are failing because they're not recognizing the class fields, let me investigate |
|
Note that the build outputs have a header, |
|
@donmccurdy believe it or not, I've been dealing with that by hand forever 😅 |
|
Sadly I can't see the diff on github, but I find it suspicious that |
|
Glad to see that you actively using E2E tests in this migration. |
|
@mrdoob time to automate it 😝 Thanks for the suggestion @munrocket, I've added it as a JSDoc comment so google closure compiler doesn't remove it. BTW I could move the google closure compiler step in the rollup.config.js via rollup-plugin-closure-compiler so that we have only one build command.
It was showing that diff because it was removing all the whitespace. I've added the option to preserve the whitespace as much as possible now. |
|
To fix the CI issue, I had to update the node version of the CI to 12, the latest LTS release. This is because class fields are supported from node 12. |
|
Looking at |
46e1892 to
dbface3
Compare
|
@mrdoob didn't notice that, should be fixed now. |
|
Hmm, I'm still seeing the spaces in many parts of the file: |
|
@mrdoob oops, there was a bug in the cleanup code, check again! |
|
Ideally the diff for |
|
That's a major part of why people would choose Bublé over Babel, I think? Bublé just "does less" by design. But Bublé seems to be in maintenance mode, so perhaps it's best to try to find a Babel configuration that provides something similar. @marcofugaro perhaps check out how the Microbundle's "modern" mode is implemented? The |
39831f5 to
88b1fb0
Compare
88b1fb0 to
45c111f
Compare
|
@mrdoob Yeah that was the Said so, I've added an Take a look now, I think the result is much more acceptable.
I've sniffed the source of that library, and the most of the "modern" mode is being done here, it basically uses @babel/preset-modules under the hood, which is the same of the @donmccurdy I've enabled the |
|
After the new changes in the rollup.config.js, this PR is outdated. Opened a new one #20395 |

As explained in #19986 (comment), let's switch to @rollup/plugin-babel to support the class fields.
I also updated
babelCleanup()which unwraps the classes, everything should be more or less like before.I included the build files to do a check, but I can remove them from this PR if you guys don't want them.