Skip to content

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

Merged
yangshun merged 1 commit into
facebook:masterfrom
SamChou19815:corejs3
Jul 14, 2020
Merged

chore(v2): Adopt corejs 3 and only import at entry point#3055
yangshun merged 1 commit into
facebook:masterfrom
SamChou19815:corejs3

Conversation

@SamChou19815

@SamChou19815 SamChou19815 commented Jul 14, 2020

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

Deploy preview for docusaurus-2 ready!

Built with commit 1e2fa3f

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

@docusaurus-bot

Copy link
Copy Markdown
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
@SamChou19815 SamChou19815 requested a review from yangshun as a code owner 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

slorber commented Jul 14, 2020

Copy link
Copy Markdown
Collaborator

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
mrizwanashiq pushed a commit to mrizwanashiq/docusaurus that referenced this pull request Jun 25, 2026
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