Skip to content

[AppConfig]: upgrade react router v7#1001

Open
carcruz wants to merge 14 commits into
mainfrom
chore/upgrade-react-router-v7
Open

[AppConfig]: upgrade react router v7#1001
carcruz wants to merge 14 commits into
mainfrom
chore/upgrade-react-router-v7

Conversation

@carcruz

@carcruz carcruz commented Jul 21, 2026

Copy link
Copy Markdown
Member

[AppConfig]: upgrade react router v7

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist:

  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have made corresponding changes to the documentation

carcruz added 14 commits July 21, 2026 14:59
Migrates from react-router-dom v6.30.4 to the unified react-router
package (v7.18.1) across apps/platform, apps/docs, packages/ui, and
packages/sections. react-router-dom was retired in favor of the
unified package; v8 was skipped since it requires React 19, which
would force an unrelated major upgrade. Usage is purely declarative
(BrowserRouter/Routes/Route/hooks), so this is a straightforward
import-path migration with no behavioral changes.

Also fixes tech debt surfaced while verifying this change (confirmed
unrelated to react-router, predating this branch): adds the
repo-wide-missing @types/lodash package, declares 3dmol and lodash
as explicit dependencies where they were used but undeclared
(relying on accidental hoisting), and restores skipLibCheck to true
to stop type-checking third-party packages' broken .d.ts files.
It's Yarn Berry's internal resolution cache, regenerated on every
install, and not needed since this repo doesn't use Zero-Installs
(nodeLinker: node-modules, no committed .yarn/cache).
Applies the existing lazy-wrapper pattern (already used by
Downloads/API/Projects pages) to the 8 remaining eager pages:
Disease, Drug, Target, Evidence, Variant, Study, CredibleSet, and
Analysis. Each gets a thin Wrapper that lazy-imports the real page
behind a Suspense boundary; App.tsx itself is unchanged since it
already imports pages through their directory index.

HomePage and NotFoundPage stay eager intentionally: HomePage is the
default landing route (lazy-loading it would add a loading flash for
the most common entry point), and NotFoundPage is rendered inline
without a Suspense boundary in a couple of data pages.

Cuts the main platform bundle from ~9MB (2.66MB gzip) to ~2.6MB
(767KB gzip); heavy dependencies like cytoscape (5.2MB) and the
associations network view now load on demand instead of upfront.
CI run for this PR showed the disease page header test consistently
timing out at the default 5000ms expect() timeout - Playwright's own
page snapshot at failure time showed the page still on its loading
spinner, not a broken page (other tests confirm the same page renders
correctly with more time).

Root cause: page components are now code-split (previous commit), so
the first navigation to any of the 8 newly-lazy pages needs to fetch
an extra JS chunk before rendering, on top of normal query latency.
That's normally trivial (~5-12KB gzipped) but a cold Netlify PR
preview plus CI runner contention pushed it past 5s here. The same
profile-page-header-text assertion pattern is used across multiple
page specs (disease, target, drug, etc.), so this is scoped as a
global default rather than a single-test patch.
…outer-v7

# Conflicts:
#	apps/docs/package.json
#	apps/platform/package.json
#	packages/sections/package.json
#	packages/ui/package.json
#	yarn.lock
… analysis, and implement lazy loading for Viewer component
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.

1 participant