Comments (6)
Defaulting to per-file
will produce an enormous output for some polyfills like es-shims
, but I can:
- Reduce the delay from 1s to maybe 100ms
- Remove the delay for
core-js
, where it's mostly not needed. - Only delay if there is actually a missing dependency to log.
from babel-polyfills.
Can you elaborate more on per-file
and why its impact varies by polyfill provider?
from babel-polyfills.
When there is a missing dependency, this package logs about it.
We collect all the missing polyfills, and then log something like
Please run
npm install polyfill-a polyfill-b polyfill-c polyfill-d
If we'd do that per-file, we cannot create a single command to copy-paste. It would look more like
Please run
npm install polyfill-a polyfill-b
Please run
npm install polyfill-c
Please run
npm install polyfill-d
Where every log comes from a different file. core-js
is a single package so it logs almost once, but for es-shims
(which is a collection of a lot of different packages), it can log a very long list of commands to run (in the worst case, max(number of files, number of polyfills)).
from babel-polyfills.
gotcha. i guess i'm not sure why this needs to be debounced here instead of just ran once after everything's finished?
from babel-polyfills.
Because Babel plugins don't have the concept of "after compiling the project" but only "in this file" (this might change in the future, but not soon).
from babel-polyfills.
ah, that's a painful limitation :-/
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.