Use regenerator-transform to implement babel-plugin-transform-regenerator#4881
Use regenerator-transform to implement babel-plugin-transform-regenerator#4881hzoo merged 3 commits intobabel:masterfrom
Conversation
|
Note that |
Current coverage is 89.14% (diff: 100%)
|
|
facebook/regenerator#259 has now been merged, so I believe this PR is ready for serious consideration! |
77dad0d to
5aab8da
Compare
|
Here are three bugs that I've fixed in https://github.com/facebook/regenerator since merging facebook/regenerator#259:
These bugs would also be fixed in Babel when/if this PR gets merged! |
5aab8da to
8d4e01e
Compare
|
What should we do about tests, etc? Right now we are just going to be calling out to regenerator-transform. I guess we can delete Also realized npmignore didn't ignore |
|
I think the tests in https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-regenerator/test are still useful as integration tests, but |
…ator. Though I believe this is safe to merge, you may want to wait to merge it until facebook/regenerator#259 is merged. That pull request also provides more explanation of why I think moving the implementation of Regenerator back to its original repository is a good idea. I'm happy to compromise on anything necessary to make this happen. Note that the regenerator-transform version is pegged to an exact version (0.9.7). Past experience has taught me that releasing new versions of Regenerator is almost impossible if client projects are allowed to pull in new patch versions automatically. I will happily submit a pull request whenever a new version is released.
d4d5407 to
0e70395
Compare
|
Cool 😄 |
| export default function () { | ||
| return require("./visit"); | ||
| } | ||
| export default require("regenerator-transform"); |
There was a problem hiding this comment.
Looking at https://unpkg.com/babel-plugin-transform-regenerator@6.16.1/lib/index.js
I think due to module.exports = exports["default"]; this needs to be .default? Although not sure why there aren't any failing tests
or we use import and the export it? @benjamn
There was a problem hiding this comment.
What about export { default } from "regenerator-transform"? Or even export * from "regenerator-transform"?
|
Alright let's do it then 🎉 thanks for taking this on @benjamn |
* master: make installing runtime/transform-runtime clearer [skip ci] (babel#4991) Add example to es2015-unicode-regex [skip ci] (babel#4983) v6.20.3 Calculate the correct arity for async functions with destructuring - fixes babel#4977 (babel#4978) v6.20.2 fix object spread (babel#4976) fix clean lib update readme [skip ci] v6.20.1 Fix nested object spread (babel#4974) v6.20.0 v6.20.0 changelog [skip ci] (babel#4971) Raise limit on code size before compacting (babel#4965) Use regenerator-transform to implement babel-plugin-transform-regenerator (babel#4881) Add getBindingIdentifierPaths/getOuterBindingIdentifierPaths (babel#4876) Hoist generateDeclaredUidIdentifier helper function (babel#4934)
* master: (89 commits) fix sizing [skip ci] typo [skip ci] changelog for v6.20.1 to v6.20.3 [skip ci] mention repl/link [skip ci] add semver label [skip ci] Fix links in CONTRIBUTING.md [skip ci] (babel#4989) make installing runtime/transform-runtime clearer [skip ci] (babel#4991) Add example to es2015-unicode-regex [skip ci] (babel#4983) v6.20.3 Calculate the correct arity for async functions with destructuring - fixes babel#4977 (babel#4978) v6.20.2 fix object spread (babel#4976) fix clean lib update readme [skip ci] v6.20.1 Fix nested object spread (babel#4974) v6.20.0 v6.20.0 changelog [skip ci] (babel#4971) Raise limit on code size before compacting (babel#4965) Use regenerator-transform to implement babel-plugin-transform-regenerator (babel#4881) ...
…ator (babel#4881) * Use regenerator-transform to implement babel-plugin-transform-regenerator. Though I believe this is safe to merge, you may want to wait to merge it until facebook/regenerator#259 is merged. That pull request also provides more explanation of why I think moving the implementation of Regenerator back to its original repository is a good idea. I'm happy to compromise on anything necessary to make this happen. Note that the regenerator-transform version is pegged to an exact version (0.9.7). Past experience has taught me that releasing new versions of Regenerator is almost impossible if client projects are allowed to pull in new patch versions automatically. I will happily submit a pull request whenever a new version is released. * Remove never-used babel-plugin-transform-regenerator/.test directory. * regenerator-transform to 0.9.8
I'm very happy to say I finally got around to finishing the work that @kittens prototyped in facebook/regenerator#222.
Just as
babel-runtimenow depends on the externalregenerator-runtimepackage, I believe it makes sense forbabel-plugin-transform-regeneratorto become a thin wrapper aroundregenerator-transform, a pure-Babel plugin implementing exactly the same logic as before, without any extraneous dependencies likedefs,recast, orast-types.Though I believe this pull request is safe to merge, you should probably wait to merge it until facebook/regenerator#259 is merged. That pull request also provides more explanation of why I think moving the implementation of Regenerator back to its original repository is a good idea. I'm happy to compromise on anything necessary to make this happen.
Note that the
regenerator-transformversion is pegged to an exact version (0.9.7). Past experience has taught me that releasing new versions of Regenerator is almost impossible if client projects are allowed to pull in new patch versions automatically. I will happily submit a pull request whenever a new version is released.