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

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.

@babel-bot

This comment has been minimized.

Copy link
Collaborator

commented Mar 23, 2019

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

1 similar comment
@babel-bot

This comment has been minimized.

Copy link
Collaborator

commented Mar 23, 2019

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

Copy link
Member

left a comment

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
@danez
danez approved these changes Apr 2, 2019
@nicolo-ribaudo nicolo-ribaudo merged commit e03eb17 into babel:master Apr 2, 2019
5 checks passed
5 checks passed
babel/repl REPL preview is available
Details
buildsize No significant change
Details
ci/circleci Your tests passed on CircleCI!
Details
codecov/project 87.27% (target 80%)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@nicolo-ribaudo nicolo-ribaudo deleted the nicolo-ribaudo:issue-9753 branch Apr 2, 2019
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 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.
Projects
None yet
4 participants
You can’t perform that action at this time.