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
Run transform-runtime on the standalone bundle so it stays ES5-compatible. #8024
Conversation
loganfsmyth
commented
May 24, 2018
•
edited
edited
Q | A |
---|---|
Fixed Issues? | Refs #7607 |
Patch: Bug Fix? | Y |
Major: Breaking Change? | N |
Minor: New Feature? | |
Tests Added + Pass? | Yes |
Documentation PR | |
Any Dependency Changes? | |
License | MIT |
466641c
to
132f9cf
Compare
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/8727/ |
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/8167/ |
132f9cf
to
b0442e8
Compare
// The runtime transform shouldn't process its own runtime or core-js. | ||
exclude: [ | ||
"packages/babel-runtime", | ||
/[\\/]node_modules[\\/](?:@babel\/runtime|babel-runtime|core-js)[\\/]/, |
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.
Aren't paths normalized to always use /
instead of \\
? If not [\\/]
should also be used in @babel\/runtime
.
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.
Good question, maybe I just shouldn't worry about it for now then. And you're right that I missed the slash in the middle anyway.
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.
Having looked into this now, the input filename is normalized before validation, so on Windows it would be \\
. Node does not normalize paths to always be /
.
I finally had time to test this patch. It almost works :-) The only remaining issue is a usage of |
That one not sure how we would fix since it's a instance method (also a dependency), I think that would be just using babel-polyfill instead of transform-runtime. |
b0442e8
to
3d01f20
Compare
I think we should land this as-is, and continue exploring what we're missing for ES5 support. The PR for the corejs 3.x runtime has a bunch of work to handle instance methods if I remember right, so hopefully we can consider switching to that once it lands. |
3d01f20
to
4995a7a
Compare