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

refactor: reduce exported members of docusaurus router #6651

Merged
merged 1 commit into from
Feb 11, 2022

Conversation

Josh-Cena
Copy link
Collaborator

Breaking changes

If you imported some undocumented member of @docusaurus/router (that's not one of useLocation, useHistory, matchPath, or Redirect), it is no longer be available. You need to import directly from react-router-dom instead.

Motivation

  1. This makes further refactors/upgrades less risky
  2. We are going to do breaking changes with the React router v6 migration anyways, because the useHistory hook doens't exist: https://reactrouter.com/docs/en/v6/upgrading/v5#use-usenavigate-instead-of-usehistory

Have you read the Contributing Guidelines on pull requests?

Yes

@Josh-Cena Josh-Cena added the pr: maintenance This PR does not produce any behavior differences to end users when upgrading. label Feb 10, 2022
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Feb 10, 2022
@Josh-Cena Josh-Cena added the pr: breaking change Existing sites may not build successfully in the new version. Description contains more details. label Feb 10, 2022
@netlify
Copy link

netlify bot commented Feb 10, 2022

✔️ [V2]

🔨 Explore the source changes: 376675d

🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/6204e65966f9c70008f4e828

😎 Browse the preview: https://deploy-preview-6651--docusaurus-2.netlify.app

@github-actions
Copy link

github-actions bot commented Feb 10, 2022

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟠 Performance 77
🟢 Accessibility 100
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 92

Lighthouse ran on https://deploy-preview-6651--docusaurus-2.netlify.app/

@github-actions
Copy link

Size Change: -3.2 kB (0%)

Total Size: 770 kB

Filename Size Change
website/build/assets/js/main.********.js 580 kB -3.2 kB (-1%)
ℹ️ View Unchanged
Filename Size
website/.docusaurus/globalData.json 47.8 kB
website/build/assets/css/styles.********.css 105 kB
website/build/index.html 36.7 kB

compressed-size-action

@slorber
Copy link
Collaborator

slorber commented Feb 10, 2022

don't we want to do routing breaking changes all at once? why do this in 2 steps?

@Josh-Cena
Copy link
Collaborator Author

Josh-Cena commented Feb 11, 2022

I don't even have a plan for the RR v6 transition—probably going to be quite a while, considering the difficulty. Also, this breaking change is quite low-impact and migration is quite easy, compared to the useHistory transition that's going to happen afterwards. I'd rather make the migration more progressive.

@slorber
Copy link
Collaborator

slorber commented Feb 11, 2022

ok why not, it shouldn't affect much users and there's a good workaround anyway

@slorber slorber merged commit acf4ae8 into main Feb 11, 2022
@slorber slorber deleted the jc/refactor-router branch February 11, 2022 11:16
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: breaking change Existing sites may not build successfully in the new version. Description contains more details. 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.

3 participants