-
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
chore: upgrade core-js to version 3 #25158
Conversation
@@ -46,7 +45,7 @@ if (semver.prerelease(version)) { | |||
report.warn( | |||
report.stripIndent(` | |||
You are currently using a prerelease version of Node (${version}), which is not supported. | |||
You can use this for testing, but we do not recommend it in production. | |||
You can use this for testing, but we do not recommend it in production. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is prettier
packages/gatsby-cli/package.json
Outdated
@@ -11,7 +11,6 @@ | |||
}, | |||
"dependencies": { | |||
"@babel/code-frame": "^7.10.1", | |||
"@babel/runtime": "^7.10.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was unused
@@ -1,6 +1,5 @@ | |||
#!/usr/bin/env node | |||
|
|||
import "@babel/polyfill" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need this anymore (node 10.13 is pretty good)
This will still trigger the warning afaik due to a long dependency chain to
|
@polarathene Great catch! I've created an issue for recipes team to handle this. #25184 |
8524100
to
aeae1ee
Compare
I need to publish a minor for babel-presets cause it's "breaking" |
@@ -614,7 +615,6 @@ module.exports = async ( | |||
`@reach/router/lib/history`, | |||
`@reach/router`, | |||
`common-tags`, | |||
/^core-js\//, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why don't we want this external anymore? or does the resolver do this somehow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw this break sometimes with gatsby-dev, never with a regular yarn install
, so more or less just a precaution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So should we bring it back then before we ship? My understanding of this array (based on the comment above) is that we force these libs into a common bundle to not bloat page bundles. Doesn't removing this line put core-js in each bundle?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before we weren't merging core-js into SSR bundles to reduce size. I'll try to add it back and see what tests say.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
General approach is looking great! It feels like this could very well break for people with edge cases. I'm wondering if we should wait for v3 on this?
I tested lots of cases haven't find any issues. It can only fail when core-js is used in the root or packages are not configured correctly. This will also become less of an issue when we merge #25159 & #25162. This improves performance so much and fixes lots of issues with people having libraries that depend on core-js@3. I'm willing to take that shot. We can always revert if I didn't do my homework |
@wardpeet that sounds good. I'm happy to see this merged if you're ready to own the reverting process if it does raise bad bugs. But I trust you did your homework and the code looks good. Getting core-js 3 will be a big win! |
i'll fix the interop and merge it tomorrow |
66c2f54
to
f37df54
Compare
c69e5b6
to
5b2a50a
Compare
5b2a50a
to
d63c0a3
Compare
@wardpeet do we need to upgrade gatsby-plugin-mdx?
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is phenomenal. Tested locally and things are working great!
This merge makes me very happy 🥳 🎉 |
Thanks a lot @wardpeet !! This is great 🥳 🎊 |
* chore: upgrade to core-js@3 * add tests to core-js resolver * update babel-preset tests
Description
Upgrade babel-preset & gatsby to core-js 3. Core-js 2 has been deprecated for a while but we never had a good story to upgrade it. Now with the polyfill work we're doing we can.
I've added a core-js resolver to make sure packages that are still compiled with core-js@2 are still working. It also makes our bundles smaller when core-js@2 is used inside the site itself.
Documentation
Nope
Related Issues
Fixes #15601
Fixes #23254
Addresses #24859