forked from jaredpalmer/tsdx
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change: replace useBuiltIns with polyfill-regenerator
- preset-env's useBuiltIns isn't pure, so it pollutes the global env when used - TSDX is used by libraries, and libraries really shouldn't pollute their consumers' global envs - so use the fairly recent babel-plugin-polyfill-regenerator with its usage-pure option instead - since we're not using useBuiltIns, we don't need core-js either, and can remove it, reverting back to the previous behavior - this ensures that the PR is less breaking and does not really introduce new behavior, just replaces async-to-promises with regenerator - useBuiltIns was previously unset, i.e. defaulted to false, so @babel/polyfill was an extraneous package and we don't need to add that back - change the rollup-plugin-commonjs usage to account for existence of bundled regenerator-runtime instead of core-js - core-js is removed now. not sure why this didn't error / wasn't needed for regenerator-runtime with useBuiltIns - existing generator test was erroring without this due to CJS usage - also add a comment to explain the plugin's usage - ensure that customOptions.targets is passed into polyfill-regenerator's config so it's the same targets as preset-env - so there's some work/discussion upstream in Babel on consolidating targets, but maybe we should have polyfill-regenerator inherit preset-env's targets if it were customized... - problem with that is that it may be breaking once we switch babelPluginTsdx to an actual preset... - modify existing generator integration test to account for the fact that regenerator is bundled automatically now - @babel/plugin-transform-runtime is no longer useful for this purpose and will be removed in the next commit during a small refactor
- Loading branch information
Showing
5 changed files
with
64 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters