core-js@3, babel and a look into the future #963
Replies: 26 comments 4 replies
-
I'm almost crying from happiness :) Great article, we need it. Year ago I wrote the article about the components creation and "polyfill" management topic for biggest Russian developers community- https://habr.com/ru/post/416235/ - I din't get any replies, so I was depressed both by the complexity of the problem and because of "there is nobody who try to reflect on it". Now at least I know who have a complete vision and will return to this text many times. Thank you again. P.S. Check https://github.com/SebastianS90/webpack-polyfill-injector , author has a lot of experience in dynamic loading of polyfills (on demand). |
Beta Was this translation helpful? Give feedback.
-
If I want all features from |
Beta Was this translation helpful? Give feedback.
-
@otakustay it's an interesting issue. If you don't understand the difference, just use the main entry point. If you will want to optimize polyfills size in the future, just read |
Beta Was this translation helpful? Give feedback.
-
What about element polyfills?
Any plans to support? |
Beta Was this translation helpful? Give feedback.
-
@rpokrovskij in this article you can find a note about support of web standards like this. |
Beta Was this translation helpful? Give feedback.
-
@zloirock this your note was in form of open question... so if you are still need to disccuss it, my opinion is : "it depends on your priorities" :) async dynamic loading and runtime browser detection in webpack runtime is much more complex task which I would personally avoid (since there is early mentioned https://github.com/SebastianS90/webpack-polyfill-injector - in ideal world cooperation should be possible). Then building web standart polyfils set is a good choice (but I guess boring). |
Beta Was this translation helpful? Give feedback.
-
Previously @babel/polyfill provided an umd build |
Beta Was this translation helpful? Give feedback.
-
Sure, it's a separate |
Beta Was this translation helpful? Give feedback.
-
I am setting up a new project using the latest babel and webpack, but while your article is very informative I must admit that I still have a question 😄
I am using It's a bit unclear to me from reading https://github.com/zloirock/core-js/blob/master/docs/2019-03-19-core-js-3-babel-and-a-look-into-the-future.md#usebuiltins-entry-with-corejs-3 is I have something else to do or if I need to add: import "core-js/stable";
import "regenerator-runtime/runtime"; to my entrypoint (and of course add Thanks :) |
Beta Was this translation helpful? Give feedback.
-
Updating of this documentation still in progress.
With |
Beta Was this translation helpful? Give feedback.
-
Hi Zloirock, Thanks for this great library. I have a question about IE11 support. Currently import core-js like so:
Then I set corejs to 2 in babelrc. This works fine for IE11. However, when I put it to 3 it doesn't work anymore, although I don't get any errors in the console. Is core-js@3 supposed to support IE11? |
Beta Was this translation helpful? Give feedback.
-
Sure, IE11 is supported. Even IE8- should be supported.
I can't say anything without more info or a reproducible example. Please, create a separate issue. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the reply, I adjusted the order of the imports and I see an error now: Unable to get property 'iterator' of undefined or null reference. It does work in chrome and firefox though. Should I make a new issue about this? |
Beta Was this translation helpful? Give feedback.
-
@nvdlug yes. And, please, with a reproducible example or at least a stack trace. |
Beta Was this translation helpful? Give feedback.
-
We've seen our time to interactive metric tank in our app, across multiple pages, after migrating. Note we are using Tweaking a bit more with babel-env to see if we can optimize it. |
Beta Was this translation helpful? Give feedback.
-
If someone has the latest working with babel can you post the full solution please. I've been searching/trying stuff posted in github issues and stack overflow for hours now and keep going in circles. |
Beta Was this translation helpful? Give feedback.
-
@poorpaddy What problems are you running into? |
Beta Was this translation helpful? Give feedback.
-
In other words: Any timeline on when we can expect this problem to be fixed? |
Beta Was this translation helpful? Give feedback.
-
@rjgotten now I lost any motivation to work on it or another Anyway, if your target includes old engines like IE11, you will not see any serious difference even it will be done. |
Beta Was this translation helpful? Give feedback.
-
Why a single target? You can easily use build tooling to produce a down-level build for IE11 and an up-level build for modern browsers, or even go more granular if you want and have several levels. That's the beauty of tools like Webpack and Babel, backed by high quality polyfills like CoreJS. The same source can be made to work at several levels against little additional developer effort. Practically all of it can be hidden behind write-once-use-many automation.
That though, is honestly a sad way to respond. Are you attempting to guilt-trip me because I'm critical of the work that was done? Just for the record: I'm not saying the effort was for naught, because it certainly was not. There are and will be many projects that can benefit from these updates. Just not the segment consisting of high-performance public facing websites, where download-size is a hugely important factor. And that's sad, because that's quite a big chunk of the market. There's a risk/benefits decision there and most developers will opt to forego integration with Yes; 'going global' works -- I'm using it now as well, actually. So credit where it's due 👍 -- but it brings its own problems. I'm already not looking forward to having to deal with corner cases of global polyfills failing or causing havoc 'somewhere.' But I know it's still the lesser of evils. I'd just like not to have to make that choice to begin with. |
Beta Was this translation helpful? Give feedback.
-
Nope. It was related to my current burnout and problems, see #548 (comment)
For this case, the global version is much more applicable.
Yes, for this case separate bundles and browsers targeting for As I wrote in the article, it can be implemented enough simple, but, as I wrote above, no concrete timeline. @nicolo-ribaudo has own vision of future of polyfilling in |
Beta Was this translation helpful? Give feedback.
-
Ouch. Ok. I was not aware of that. o_O
Well; that atleast is something. Thanks. 👍 |
Beta Was this translation helpful? Give feedback.
-
Yup! You can find my ideas at babel/babel#10008 |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
My project is using object.assign in node_modules. where to add the babel core-js to handle the "Object.assign is not a function" error? |
Beta Was this translation helpful? Give feedback.
-
core-js@3, babel and a look into the future
Beta Was this translation helpful? Give feedback.
All reactions