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

Use React 17 with Docusaurus v2 #3617

Closed
HonkingGoose opened this issue Oct 21, 2020 · 1 comment · Fixed by #4218
Closed

Use React 17 with Docusaurus v2 #3617

HonkingGoose opened this issue Oct 21, 2020 · 1 comment · Fixed by #4218
Labels
proposal This issue is a proposal, usually non-trivial change

Comments

@HonkingGoose
Copy link
Contributor

💥 Proposal

Use React 17 with Docusaurus v2.

Have you read the Contributing Guidelines on issues?

Yes.

Relevant quotes from the React 17 official blog post:

No New Features

The React 17 release is unusual because it doesn’t add any new developer-facing features. Instead, this release is primarily focused on making it easier to upgrade React itself.

In particular, React 17 is a “stepping stone” release that makes it safer to embed a tree managed by one version of React inside a tree managed by a different version of React.

It also makes it easier to embed React into apps built with other technologies.


Gradual Upgrades

React 17 enables gradual React upgrades. When you upgrade from React 15 to 16 (or, this time, from React 16 to 17), you would usually upgrade your whole app at once. This works well for many apps. But it can get increasingly challenging if the codebase was written more than a few years ago and isn’t actively maintained. And while it’s possible to use two versions of React on the page, until React 17 this has been fragile and caused problems with events.

References:

Official React blog post about version 17

I'm already using React 17 with a simple site

I'm already using React 17 with Docusuarus v2 for a very simple documentation site, and that seems to work fine for my limited use-case. The build passes, and the site is not obviously broken.

The main thing that I'm noticing now, is that Yarn shouts at me when I run yarn install because I'm using React 17 instead of 16 like Docusaurus v2 wants me to: warning " > @docusaurus/[email protected]" has incorrect peer dependency "react@^16.8.4". and so on for all Docusaurus v2 packages.

@HonkingGoose HonkingGoose added status: needs triage This issue has not been triaged by maintainers proposal This issue is a proposal, usually non-trivial change labels Oct 21, 2020
@slorber
Copy link
Collaborator

slorber commented Oct 21, 2020

As I don't see any new React 17 feature that we would benefit much from, I'd rather not be an early adopter and wait a bit to make this upgrade safer. We'll do it, but it does not need to be right now.

@slorber slorber linked a pull request Feb 12, 2021 that will close this issue
@Josh-Cena Josh-Cena removed the status: needs triage This issue has not been triaged by maintainers label Mar 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal This issue is a proposal, usually non-trivial change
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants