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

Upgrade to React 18 #3231

Merged
merged 11 commits into from
Jan 28, 2025
Merged

Upgrade to React 18 #3231

merged 11 commits into from
Jan 28, 2025

Conversation

johnnyomair
Copy link
Collaborator

@johnnyomair johnnyomair commented Jan 20, 2025

Description

Upgrade React to v18. Followed the official migration guide on how to upgrade.

Note: This upgrades Docusaurus as well. After spending quite some time trying to fix issues between React 17 and React 18 types, I've decided that it's easier to upgrade Docusaurus in this PR. Sorry for the many changes 😬

Acceptance criteria

Open TODOs/questions

  • Should we drop support for React 17?
  • Do we need an upgrade script?
  • Do we need a section in the migration guide?

Further information

@johnnyomair johnnyomair marked this pull request as draft January 20, 2025 15:36
@johnnyomair
Copy link
Collaborator Author

I tried to fix the type errors by only adapting types, not changing behavior. So in theory this should still support React 17. Should we remove support for React 17 anyway?

@johnnyomair johnnyomair marked this pull request as ready for review January 21, 2025 10:14
@johnnyomair johnnyomair mentioned this pull request Jan 21, 2025
4 tasks
Copy link
Member

@thomasdax98 thomasdax98 left a comment

Choose a reason for hiding this comment

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

Should we drop support for React 17?

I'm fine either way. We recommend upgrading to React 18. So I see no real benefit in keeping the support for 17. But since the changes seem to be minimal, we can also keep it.

Do we need an upgrade script?

I'd say: No. Though we could create an upgrade script that executes the React codemods

Do we need a section in the migration guide?

Yes. At least a reference to the React migration guide

@johnnyomair
Copy link
Collaborator Author

I'm fine either way. We recommend upgrading to React 18. So I see no real benefit in keeping the support for 17. But since the changes seem to be minimal, we can also keep it.

I'd say let's keep it. Maybe a project needs to upgrade to Comet 8 urgently. The upgrade to React 18 can be performed later (like we did for App Router).

I'm fine either way. We recommend upgrading to React 18. So I see no real benefit in keeping the support for 17. But since the changes seem to be minimal, we can also keep it.

These codemods aren't from the React itself and not safe in every scenario. IMO devs should explicitly decide to run them. I've mentioned them in the migration guide though.

@johnnyomair johnnyomair merged commit 682a674 into next Jan 28, 2025
12 checks passed
@johnnyomair johnnyomair deleted the react-18 branch January 28, 2025 11:23
@johnnyomair johnnyomair mentioned this pull request Jan 29, 2025
1 task
@johnnyomair johnnyomair mentioned this pull request Jan 29, 2025
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants