Skip to content
This repository has been archived by the owner on Feb 1, 2025. It is now read-only.

[refactor] es modules, no global polution #302

Open
Andarist opened this issue Jul 21, 2017 · 2 comments · May be fixed by #307
Open

[refactor] es modules, no global polution #302

Andarist opened this issue Jul 21, 2017 · 2 comments · May be fixed by #307

Comments

@Andarist
Copy link
Contributor

Andarist commented Jul 21, 2017

this would mean breaking change

So basically what I would like to do (I can prepare PRs) is to refactor packages. Changes should be pretty straightforward and would include:

  • including 2 distributions of regenerator-runtime, both commonjs and es
  • stop auto pollution of global object - we can distribute also umd bundle if somebody needs it
  • rewrite regenerator-transform to add an import for regenerator-runtime to the transformed module if needed - we can support old way (using global) with an option to the transform

Benefits:

  • no more weirdo code ;)
  • tree-shakability of the regenerator-runtime - when one uses i.e. only normal generators then parts about async functions could be tree-shaken easily

I think the module is stable and this would make for a great v1 release.

@benjamn
Copy link
Contributor

benjamn commented Jul 23, 2017

Please feel free to submit a PR for this!

@utrolig
Copy link

utrolig commented Feb 8, 2021

Any update on this? With regenerator-runtime auto pollutes the global-scope, there's no way to achieve a 100% pure polyfilling without scope pollution as described in babel/babel-polyfills#59

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants