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

Remove auto-inclusion of babel-polyfill #2755

Merged
merged 1 commit into from
Feb 27, 2017
Merged

Conversation

thymikee
Copy link
Collaborator

@thymikee thymikee commented Jan 30, 2017

Summary

Drop auto-including of babel-polyfill if available. Fixes #2693

Test plan

jest

@wtgtybhertgeghgtwtg
Copy link
Contributor

WARNING: Kneden is usable, but it's also not complete yet.

Are you sure this should go in examples?

@thymikee
Copy link
Collaborator Author

thymikee commented Feb 1, 2017

Huh, didn't notice that warning, thanks! Fallback to use babel-polyfill in that example for simplicity

@cpojer
Copy link
Member

cpojer commented Feb 7, 2017

So.. this means regeneratorRuntime will be missing… :(

@thymikee
Copy link
Collaborator Author

thymikee commented Feb 7, 2017

Hm, so why this passes locally on all node versions?

@cpojer
Copy link
Member

cpojer commented Feb 7, 2017

Can you wipe away all the node modules folders in examples folders and re-run yarn test?

@thymikee
Copy link
Collaborator Author

thymikee commented Feb 7, 2017

Removed couple of times from async example. Now tried again but for all examples and it fails indeed 😄 Fixed by importing babel-polyfill explicitly (this is not a great practice because it's huge, but it's easy to grasp for sure)

@cpojer
Copy link
Member

cpojer commented Feb 7, 2017

I don't think that's great; I would expect a lot of people are using regeneratorRuntime. The alternative is to force people to compile async to generator (instead of async to generator to regenerator) but we'd need to make it so that this works in the CLI without breaking anybody or by suggesting how to do it from the CLI.

@thymikee
Copy link
Collaborator Author

thymikee commented Feb 7, 2017

compile async to generator (instead of async to generator to regenerator)

This may be tricky, because lots of folks out there are using babel-preset-es2015 which transforms to regenerator under the hood.

Not sure how to make it better.

@codecov-io
Copy link

codecov-io commented Feb 8, 2017

Codecov Report

Merging #2755 into master will increase coverage by 0.09%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #2755      +/-   ##
==========================================
+ Coverage   68.07%   68.16%   +0.09%     
==========================================
  Files         147      147              
  Lines        5347     5347              
==========================================
+ Hits         3640     3645       +5     
+ Misses       1707     1702       -5
Impacted Files Coverage Δ
packages/jest-config/src/normalize.js 85.9% <100%> (ø)
packages/jest-runtime/src/index.js 87.04% <0%> (+2.02%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 08b8f73...cd4c41e. Read the comment docs.

@thymikee
Copy link
Collaborator Author

thymikee commented Feb 8, 2017

So maybe we could replace babel-polyfill with regenerator-runtime only? But then again it would also affect users who rely on patching some ES6 methods with core-js instead of babel presets and plugins. I don't know.

@cpojer
Copy link
Member

cpojer commented Feb 8, 2017

Yeah I think that would solve most use-cases. Everything in babel-polyfill is basically already in node4+.

@wtgtybhertgeghgtwtg
Copy link
Contributor

Is there a reason why Travis seems to segfault a lot for this project?

@thymikee
Copy link
Collaborator Author

thymikee commented Feb 9, 2017

For sure there is, but we don't know why it happens and it's only on node 4

@cpojer
Copy link
Member

cpojer commented Feb 27, 2017

Oh wow this is odd. Honestly, I thought I merged this into Jest 19. @thymikee mind rebasing so CI runs again?

@thymikee
Copy link
Collaborator Author

Rebased

@danny-andrews
Copy link

danny-andrews commented May 4, 2017

What does including regenerator-runtime do exactly? Because async functions don't seem to work. (I'm running in node 4.)

@thymikee
Copy link
Collaborator Author

thymikee commented May 4, 2017

Provides a runtime for generators. You also need a babel transform. There's a tutorial on Jest documentation

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Drop auto-inclusion of babel-polyfill
6 participants