Comments (9)
Thanks for clarifying.
Then the answer is "it's not possible until regenerator-runtime
stops polluting the global scope (facebook/regenerator#302). When it stops doing so, this plugin won't need any change but you'll just need to update your regenerator-runtime
dependency."
from babel-polyfills.
That commit would only impact CSP, not global scope.
from babel-polyfills.
It's an error on my side, I didn't realize that regenerator always defines the global.
However, this is tracked at facebook/regenerator#302.
from babel-polyfills.
This needs to be fixed in regenerator itself, since currently it doesn't expose an entry point which exports regeneratorRuntime
without also defining it as a global.
from babel-polyfills.
Thanks for the fast response - does this mean that we would have to wait until it is resolved in the issue you linked, or are you able to resolve it?
from babel-polyfills.
So there is no way to completely polyfill and transpile the code down without requiring the regeneratorRuntime
?
from babel-polyfills.
without requiring the
regeneratorRuntime
?
I'm not 100% sure I understand what you are asking. If you look at your dist/bundle.js
file, it never uses the regeneratorRuntime
global variable.
It defines it (regeneratorRuntime=r
, which is the same as window.regeneratorRuntime=r
), but then never relies on it.
from babel-polyfills.
Sorry I should've been more specific.
What I'm trying to achieve is to transpile my typescript application with async/await down to IE11 compatible code, without polluting the global scope. That includes polyfilling without scope pollution as well. There doesn't seem to be too much information about that on the web in general
from babel-polyfills.
A new version v0.13.9 of regenerator-runtime
has been released recently, including this commit.
Does it solve this issue?
from babel-polyfills.
Related Issues (20)
- [Bug]: `babel-plugin-polyfill-corejs3` injects imports from non-existent modules in `core-js-pure` when `version` is specified HOT 2
- preset-env doesn't import "array.push" polyfill HOT 1
- [Bug]: The documentation for babel-plugin-polyfill-corejs3 seems to have an error description? HOT 1
- `usage-pure` has incorrect optimization logic HOT 4
- No matching version found for @babel/helper-define-polyfill-provider@^0.4.1 HOT 1
- Switch semver from @nicolo-ribaudo/semver-v6 to original one HOT 1
- core-js-pure/features/instance/to-array.js does not exist HOT 1
- Excluding `es.json.stringify` does not work
- Please release HOT 1
- dom-exception polyfill import fails HOT 7
- no matcing version HOT 1
- Sorting `core-js` modules in the order from `core-js-compat`
- Why createMetaResolver ignores object for instance polyfills HOT 1
- Does babel-polyfills have any strategy to prevent creating cycles?
- Does babel-polyfills have any strategy to deal with repeated injection of different version of core-js library?
- Does the option `helpers: true` from `@babel/plugin-transform-runtime` do the same as `babel-plugin-polyfill-regenerator`? HOT 1
- Error: Can't resolve '@babel/runtime-corejs3/helpers/asyncToGenerator' HOT 1
- useBuiltIns: 'usage' will only transpile but not polyfill my nuxt v2 app
- When I use polyfill-es-shims plugin on my code it tries to import nodeJS `util.inspect` which requires rollup-plugin-polyfill-node... HOT 3
- helper-define-polyfill-provider: Cannot read properties of undefined (reading 'includes') HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from babel-polyfills.