Skip to content
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 #25595

Merged
merged 3 commits into from
Jul 9, 2020
Merged

chore: upgrade core-js to version 3 #25595

merged 3 commits into from
Jul 9, 2020

Conversation

wardpeet
Copy link
Contributor

@wardpeet wardpeet commented Jul 8, 2020

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.

You can test this package by installing it like this

yarn add --registry=https://registry.wardpeet.dev gatsby@core-js

Documentation

Nope

Related Issues

Fixes #15601
Fixes #23254
Addresses #24859

@wardpeet wardpeet requested review from a team as code owners July 8, 2020 07:31
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jul 8, 2020
@wardpeet wardpeet changed the title Feat/core js resolver chore: upgrade core-js to version 3 Jul 8, 2020
const target = resolver.ensureHook(`resolve`)
const coreJsModulePath = this._coreJSNodeModulesPath

function resolve(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved resolve from a class function to an inline function and everything started to work

@wardpeet wardpeet added status: needs core review Currently awaiting review from Core team member topic: webpack/babel Webpack or babel and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Jul 8, 2020
@wardpeet
Copy link
Contributor Author

wardpeet commented Jul 8, 2020

Everything is green
www gatsbyjs com_dashboard_organization_568d1831-1a7c-48af-af37-8fd02cf598f3_sites (2)

Copy link
Contributor

@LekoArts LekoArts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested out my (previously failing) themes projects with the canary release and they all work in gatsby develop/build 👍

@wardpeet wardpeet merged commit 46e7988 into master Jul 9, 2020
@wardpeet wardpeet deleted the feat/core-js-resolver branch July 9, 2020 06:44
pragmaticpat pushed a commit to pragmaticpat/gatsby that referenced this pull request Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs core review Currently awaiting review from Core team member topic: webpack/babel Webpack or babel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Can't resolve" importing errors when using canvg Upgrade core-js package to version 3
2 participants