Comments (7)
Just direct import of polyfills, I don't see any other way. I don't know anyone package which can provide required polyfills in the required format (ES or commonjs modules for each feature).
I'm thinking about adding polyfills for a serious part of web standards to core-js
in the future since now we have tools like preset-env
and runtime
. However, if it will be done - it will be done not soon.
from babel-polyfills.
Hey @nitwhiz! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.
If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community that typically always has someone willing to help. You can sign-up here
for an invite.
from babel-polyfills.
Just interesting, how you are imagining it? polyfill-library
does not support ES or commonjs
modules, just files concatenation. It was a reason why some time ago core-js
was not added to polyfill-service
/ polyfill-library
as a polyfills source.
from babel-polyfills.
polyfill-library
has all the meta information for their polyfills. like detection for when to apply them and everything. just in a different format. I suggest the black magic @babel/babel-polyfill
is using to detect that I used a Promise
and @babel/preset-env
is set to "IE >= 11"
, so it needs to polyfill Promise
would work for stuff like ChildNode.remove
or fetch
. Retrieving the actual polyfill wouldn't be much different.
from babel-polyfills.
polyfill-library
has all the meta information for their polyfills. like detection for when to apply them and everything. just in a different format.
That's perfect and really useful. But @babel/preset-env
with useBuiltIns: usage / entries
just add imports of required polyfills as commonjs modules. It can't work with polyfill-library
.
from babel-polyfills.
So what's the supposed way to include custom polyfills? The main thing I'm after is the useBuiltIns:usage
feature so I don't need to worry about polyfills and they get done from alone. How to accomplish this with other polyfills. Can I provide more polyfills in the format core-js is using and make @babel/preset-env
use them? If yes - how?
The main goal is to keep my head free from thinking about "does this work?" "do i need to check if XMLHttpRequest exists?" - it would be nice to just write ES6 code with standards the majority (aka chrome) of browsers accept and having stuff that won't work on browsers in my browserlist transpiled to something that works from alone.
from babel-polyfills.
Nah I mean like providing them in the correct format. I would like to provide the polyfills I need in the correct format myself so babel will pick them up.
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.