Skip to content

Upgrade React to v18 #1093

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

Merged
merged 2 commits into from
Jun 23, 2025
Merged

Upgrade React to v18 #1093

merged 2 commits into from
Jun 23, 2025

Conversation

Mr0grog
Copy link
Member

@Mr0grog Mr0grog commented Jun 21, 2025

There were a few minor code changes needed for React 18 to work, and a lot of changes needed to keep tests working (most really have no major runtime impact, although a handful do probably make things slightly more robust).

A lot more stuff under the hood in React has become async, so a lot of these test changes are about timing and making sure a component fully renders and goes through its loading lifecycle (and cancels async API calls if the component is prematurely unloaded, as they are in some tests). Similarly, lots of test code also needed to now be wrapped in act(() => (do a thing)).

I also updated some of the JS class syntax for a couple components that needed more invasive work for data/state loading while I was in there (for example, diff-view.jsx).

@Mr0grog
Copy link
Member Author

Mr0grog commented Jun 23, 2025

I think this is probably good to go. I’d wanted to look into using the new <Suspense> component, but the docs (even for React 19) still say that “Suspense-enabled data fetching without the use of an opinionated framework is not yet supported” and do not document publicly how to manage Suspense’s state except via the use hook, and we don’t generally utilize hooks because this app largely predates function components. So no suspense for now. 🙁

@Mr0grog Mr0grog merged commit 1d79d75 into main Jun 23, 2025
5 checks passed
@Mr0grog Mr0grog deleted the upgrade-react-18 branch June 23, 2025 15:50
@github-project-automation github-project-automation bot moved this from Inbox to Done in Web Monitoring Jun 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant