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(v2): Adopt corejs 3 and only import at entry point #3055

Merged
merged 1 commit into from
Jul 14, 2020
Merged

chore(v2): Adopt corejs 3 and only import at entry point #3055

merged 1 commit into from
Jul 14, 2020

Conversation

SamChou19815
Copy link
Contributor

@SamChou19815 SamChou19815 commented Jul 14, 2020

Motivation

Core JS 2 is deprecated. It would be good if we don't stick with it forever.

I also changed to useBuiltIns to be entry for the purpose of Yarn pnp. If we use usage, babel will inject imports of core-js in literally every JS file. It will trick Yarn to believe that every single JS module depends on core-js, and therefore every package depends on core-js. Since core-js is not declared as a dependency for every package, it will trigger a lot of require errors. To patch that, you need to declare it on every package you use, like this, which doesn't scale.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

  • Preview is not broken.
  • All E2E tests are passing.

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Jul 14, 2020
@docusaurus-bot
Copy link
Contributor

Deploy preview for docusaurus-2 ready!

Built with commit 1e2fa3f

https://deploy-preview-3055--docusaurus-2.netlify.app

@docusaurus-bot
Copy link
Contributor

Deploy preview for docusaurus-2 ready!

Built with commit 877ce2d

https://deploy-preview-3055--docusaurus-2.netlify.app

@SamChou19815 SamChou19815 marked this pull request as ready for review July 14, 2020 01:32
@yangshun yangshun merged commit 7660005 into facebook:master Jul 14, 2020
@SamChou19815 SamChou19815 deleted the corejs3 branch July 14, 2020 01:39
@slorber
Copy link
Collaborator

slorber commented Jul 14, 2020

usage vs entry probably has implications on the bundle size.

With entry the initial bundle size is larger but page chunks may become smaller as polyfills are not inlined. Hard to know what is the best for the project ^^ I guess both options are acceptable

Afaik we don't have bundle metrics over time, that could be interesting to setup some monitoring

@slorber slorber added the pr: maintenance This PR does not produce any behavior differences to end users when upgrading. label Jul 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: maintenance This PR does not produce any behavior differences to end users when upgrading.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants