-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade core-js package to version 3 #15601
Comments
related issue: #12744 |
sorry about this, core-js@3 is already working with latest version of gatsby. We tested with an older version. |
Here is the current yarn only resolutions for [email protected] and other Gatsby plugins updated to current npm modules including And then you should use the latest snyk fixes for lodash and [email protected] Vulnerable module: mem Denial of Service (DoS) issues. |
I investigated some more, and it is still not possible to use core-js@3 with gatsby. Even if we can actually install it, core-js@2 will be the one that is bundled in the app. Here is a reproductionHere is a new gatsby site with core-js@3 installed: I print the core-js version from its package.json in the home page here: https://github.com/abumalick/gastby-polyfill-test/blob/master/src/pages/index.js#L14 And you can see the deployed result: Also when we import polyfills, we use old imports from core-js@2 I assume it is due to gatsby's babel configuration, I only tested with yarn. Can we start working on an upgrade ? |
The same problem for me, we have {
"name": "core-js",
"description": "Standard library",
"version": "3.1.4",
"repository": {
"type": "git",
"url": "https://github.com/zloirock/core-js.git"
},
"main": "index.js",
"license": "MIT",
...
} But when I try to print the current version of |
+1 |
This line
|
I missed your comment @wardpeet . Thank you for your feedback. I hope you will be able to merge this PR soon! |
We're now tracking dependency updates in #16840 and that includes core-js v3 so I'm closing this issue for now |
We still have to look in how to properly solve this. |
The problem here isn't that the version of core-js needs to be upgraded but rather that the internal aliasing forces dependencies to a single module resolution. If you upgrade to core-js@3 you will break every dependency that relies on core-js@2. Since the paths are completely different. Storybook has gone through the same exact issue when trying to minimize the number or bundled core-js instances. In reality, core-js v2 + v3 are a total of 60kb (minified + gzipped). It's really not worth the optimization. For those who are looking for a work around, we've internally hacked webpack config via the following:
|
Storybook appears to be using corejs-upgrade-webpack-plugin to translate corejs 2 imports to corejs 3 equivalents. |
Hi, Thanks. ref #345 |
+1 |
Also include this when deleting the alias:
|
I could barely figure out why I would like to inquire about the status of this issue, as more and more features are on the way towards ES2019+. Thanks for diving into all the details above! In the meantime, I would like to suggest documenting the usage of a deprecated core-js version with an explicit list of non-polyfilled Stage 4 language features. |
i'll be working on this, this week and next week. I'll keep you all posted. |
thanks @wardpeet :) |
Wan't to note that this is an issue when trying to integrate with Storybook 6 beta on my Gatsby Typescript setup. Thanks for taking this on @wardpeet ! |
Thanks @wardpeet looking forward to the PR against this issue. Will be happy to test and contribute to the PR. |
Thanks @wardpeet, appreciate the effort 👍 |
Hey, sorry late to join this thread. Just curious, what are the main blockers right now to fully implement this? (Stumbled onto this thread when trying to use the latest amcharts4 library in my Gatsby app and ran into issues) |
PR is up so should be in, in a few days |
Summary
core-js version 2 is deprecated, we would like to be able to use core-js version 3 with gatsby
Motivation
No one likes to use deprecated packages, Even React's documentation shows code that uses core-js@3 (and it is referenced in gatsby's documentation)
Problem
It is a breaking change and will need manual intervention of all site maintainers that uses core-js@2 to migrate their imports to version 3
core-js@2
core-js@3
If we don't want this
If we are not ready to migrate, we should include a note in documentation on how to add core-js@2 polyfills instead of redirecting the user to reactjs documentation.
https://www.gatsbyjs.org/docs/browser-support/#note-about-ie--11
Finally
I would be interested to work on this if it is ok.
The text was updated successfully, but these errors were encountered: