Repository navigation
Move to React 18 and react-router 7, and replace react-refetch - #465
Open
stephaniehobson wants to merge 9 commits into
Open
stephaniehobson wants to merge 9 commits into
stephaniehobson wants to merge 9 commits into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One-line summary
Move to React 18 and react-router 7, and replace the four packages that capped React (react-refetch, react-metrics-graphics, react-helmet, react-ga). React 19 is deferred because it makes charts appear later.
Significant changes and points to review
src/lib/withFetch.jsx. It keeps the samedataFetchprop and behaviour:views/MetricsGraphics.jsx, which callsMG.data_graphicdirectly.react-router.Main.jsxand both decorators now useuseLocation().withTrackersends its page view from auseEffecton the pathname, not fromgetDerivedStateFromProps.createRootand the automatic JSX runtime. This removes the classic-runtime workarounds invite.config.mjs, theglobal.Reactsetup, and unusedimport Reactlines.@testing-library/dom10 and jest-dom 7.Routes.test.jsxnow waits with RTL'swaitFor: undervi.waitFor, React 18's act warning for a lazy route fails the Vitest run.HelmetProviderwraps the app and any test that renders a<Helmet>.VITE_GA_MEASUREMENT_ID, with a placeholder value.page_viewper route.docs/execplans/2026-10-26-react-18-upgrade.md.d3-transitionis still nested underd3@4.Issue / Bugzilla link
n/a
Testing
Run
npm installandnpm run build:cssfirst, thennpm start.<meta name="robots" content="noindex">is in<head>.collectrequest is sent per navigation.Please look closely at
withFetch.jsx. It now carries every metric fetch on the site.