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

Enable generators #238

Merged
merged 2 commits into from
Jul 27, 2016
Merged

Enable generators #238

merged 2 commits into from
Jul 27, 2016

Conversation

gaearon
Copy link
Contributor

@gaearon gaearon commented Jul 27, 2016

This bundles the regenerator runtime when you use the generator syntax.
It would fix #125 and be the first step towards #51.

One issue I’m seeing right now is that minified bundle increases by 5kB min+gzip even if you don’t use generators because transform-runtime currently externalizes Babel helpers whether you want it or not, and they bring in some stuff from core-js including Symbol.

@kittens said he’s open to fixing it on Babel side by adding helpers: [true] to transform-runtime so we can turn them off.

@ghost ghost added the CLA Signed label Jul 27, 2016
@sebmck
Copy link

sebmck commented Jul 27, 2016

@kittens said he’s open to fixing it on Babel side by adding helpers: [true] to transform-runtime so we can turn them off.

helpers: false babel/babel#3603

@taion
Copy link

taion commented Jul 27, 2016

@gaearon @kittens

That doesn't seem like the right fix. Wouldn't it make more sense to either compile babel-runtime without the runtime transform, or else not pull in polyfills in helpers when polyfilling is disabled?

Those helpers shouldn't be pulling in polyfills via sniffing for their existence.

All else being the same, just externalizing the helpers ought to decrease bundle size.

@taion
Copy link

taion commented Jul 27, 2016

It seems like a bug that using babel-runtime makes https://github.com/babel/babel/blob/v6.11.6/packages/babel-helpers/src/helpers.js#L8-L12 pull in a Symbol polyfill.

@ghost ghost added the CLA Signed label Jul 27, 2016
@hzoo
Copy link

hzoo commented Jul 27, 2016

Released babel-plugin-transform-runtime@6.12.0 with the PR ^

@ghost ghost added the CLA Signed label Jul 27, 2016
@gaearon gaearon changed the title (Do not merge) Enable generators Enable generators Jul 27, 2016
@ghost ghost added the CLA Signed label Jul 27, 2016
@gaearon gaearon merged commit 11894dc into master Jul 27, 2016
@gaearon gaearon added this to the 0.2.0 milestone Jul 27, 2016
@gaearon gaearon deleted the generators branch July 29, 2016 16:10
@Timer Timer mentioned this pull request Sep 25, 2018
@lock lock bot locked and limited conversation to collaborators Jan 22, 2019
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.

Document or build with babel-polyfill
4 participants