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

[runtime-corejs3] Only polyfill instance methods when it might be needed #9754

Merged
merged 1 commit into from Apr 2, 2019

Conversation

nicolo-ribaudo
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo commented Mar 23, 2019

Q                       A
Fixed Issues? Fixes #9753
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature? Yes?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

This PR allows instance methods polyfills to specify on which base type they need to be applied. If Babel is 100% that it is called on another instance type, it will avoid polyfilling it.

For example, "".concat doesn't need to be polyfilled but foo.concat does because foo might be an array.
#9753 shows that polyfilling .concat breaks webpack logic to handle require calls with template literals.

Other instance methods could be optimized, but if this PR lands I'll leave it as a [good first issue] PR.

@nicolo-ribaudo nicolo-ribaudo added the PR: New Feature 🚀 A type of pull request used for our changelog categories label Mar 23, 2019
@babel-bot
Copy link
Collaborator

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

1 similar comment
@babel-bot
Copy link
Collaborator

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

Copy link
Member

@zloirock zloirock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to improve runtime in this way in the future, but with such semantics like in preset-env.

@nicolo-ribaudo nicolo-ribaudo added this to the v7.4.3 milestone Mar 25, 2019
@nicolo-ribaudo nicolo-ribaudo merged commit e03eb17 into babel:master Apr 2, 2019
@nicolo-ribaudo nicolo-ribaudo deleted the issue-9753 branch April 2, 2019 19:19
jpolitz referenced this pull request in brownplt/pyret-lang Sep 20, 2019
…nings

Right now we see: Critical dependency: the request of a dependency is an expression

I've tracked it somewhat to the need to do a big update in Stopify from
babel-core to @babel/core. That's going to be an undertaking, so allowing the
build to finish with these warnings and still deploy.
@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: New Feature 🚀 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Critical dependency: the request of a dependency is an expression
4 participants