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

Refactor/es modules #307

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

Andarist
Copy link
Contributor

This fixes #302

@benjamn
So Im mostly done when it comes to refactoring regenerator-runtime.

The missing piece is to change regenerator-transform so it adds an import statement to the regenerator-runtime module. Im not strong with AST (although I know the basics) so an advice how this should be handled would be greatly appreciated! :)

Whats the best way to add a single import statement for a file with multiple generators?
How we differentiate what type of import (es/cjs) should be added?
Do we need to support a use case of including the regenerator itself in the outputted bundle? When?

@benjamn
Copy link
Collaborator

benjamn commented Jul 24, 2017

Could we copy the logic of babel-plugin-transform-runtime? Hopefully that should work even if transform-runtime is not otherwise being used.

@Andarist
Copy link
Contributor Author

@benjamn ive finished working on this, please take a look - aint sure if regenerator-transform adjustments were made in the best possible way, but its working 🎉

Please review and let me know if there is anything I need to do to advance it further :)

Once this gets merged (and published) I'll try to update most notable projects depending on those packages.

@Andarist Andarist force-pushed the refactor/es-modules branch 3 times, most recently from 82cc7a0 to 8c46659 Compare August 3, 2017 22:18
@Andarist
Copy link
Contributor Author

@benjamn rebased against recent master

@Andarist
Copy link
Contributor Author

Andarist commented Sep 8, 2017

@benjamn any chances this could get reviewed? 😃

Unfortunately at the moment Im not sure why travis is failing, because locally everything is working fine. It would be great to debug it in ssh mode, but I dont have needed permissions to do it myself.

@Andarist
Copy link
Contributor Author

Hey @benjamn . I know you are extremely busy, I'm just pinging friendly here about this PR :)

@brettz9
Copy link

brettz9 commented May 4, 2019

Could this be (rebased and) reviewed? With @babel/polyfill deprecated, there is no (direct) ESM replacement.

@agilgur5
Copy link

agilgur5 commented Mar 2, 2022

@benjamn is there any chance you or someone from FB would be able to resurrect this? Don't mean to necro or force any work, but was hoping there might be a way to prioritize this especially as this is still under FB's org (and therefore theoretically supported by a very large company).
A lot of issues in the community end up pointing here to this PR that was never reviewed, so it doesn't seem as if there's much the community can do right now (other than fork) 😕

In particular, as #302 (comment) / babel/babel-polyfills#59 point out, this PR would enable a "pure" polyfill. Currently all usage of regenerator-runtime causes pollution of global scope, which is not ideal for library authors.

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

Successfully merging this pull request may close these issues.

[refactor] es modules, no global polution
5 participants