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

Run transform-runtime on the standalone bundle so it stays ES5-compatible. #8024

Merged
merged 1 commit into from Jul 29, 2018

Conversation

loganfsmyth
Copy link
Member

@loganfsmyth loganfsmyth commented May 24, 2018

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

@loganfsmyth loganfsmyth force-pushed the standalone-runtime branch 2 times, most recently from 466641c to 132f9cf Compare May 24, 2018 05:37
@babel-bot
Copy link
Collaborator

babel-bot commented May 24, 2018

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/8727/

@babel-bot
Copy link
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/8167/

// The runtime transform shouldn't process its own runtime or core-js.
exclude: [
"packages/babel-runtime",
/[\\/]node_modules[\\/](?:@babel\/runtime|babel-runtime|core-js)[\\/]/,
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member Author

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 /.

@hzoo hzoo added the PR: Bug Fix 🐛 A type of pull request used for our changelog categories label May 30, 2018
@arv
Copy link
Contributor

arv commented Jun 1, 2018

I finally had time to test this patch.

It almost works :-) The only remaining issue is a usage of String.prototype.repeat which comes from
https://github.com/mathiasbynens/jsesc/blob/09de8e3fc85fb3ec77a88376895081cb13a604ed/src/jsesc.js#L80

@hzoo
Copy link
Member

hzoo commented Jun 5, 2018

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.

@loganfsmyth
Copy link
Member Author

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.

@loganfsmyth loganfsmyth merged commit 02760d0 into babel:master Jul 29, 2018
@loganfsmyth loganfsmyth deleted the standalone-runtime branch July 29, 2018 23:52
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 4, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Bug Fix 🐛 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants