Skip to content

chore: upgrade to next.js 16 + new findable-ui major (phase 2 from findable-ui#952) (#3087)#3090

Open
frano-m wants to merge 2 commits into
mainfrom
fran/3087-next-16-findable-ui-upgrade
Open

chore: upgrade to next.js 16 + new findable-ui major (phase 2 from findable-ui#952) (#3087)#3090
frano-m wants to merge 2 commits into
mainfrom
fran/3087-next-16-findable-ui-upgrade

Conversation

@frano-m

@frano-m frano-m commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Closes #3087
Parent epic: DataBiosphere/findable-ui#952 (Phase 2 — Next 16 rollout across consumers)
Grandparent: DataBiosphere/findable-ui#884 (Next 16 upgrade plan)

Follow-ups (this repo):

Reference PRs for the same upgrade on prior consumers:

Summary

  • Bumps next ^16 family, next-mdx-remote ^6, @databiosphere/findable-ui ^54.1.
  • Wires MUI Emotion cache for SSR via AppCacheProvider (_app.tsx) + DocumentHeadTags / documentGetInitialProps (_document.tsx).
  • Pins next dev / next build to webpack — tracks vercel/next.js#82607.
  • Migrates .eslintrc.json + .eslintignoreeslint.config.mjs (flat config, ESLint v9). Swaps eslint-plugin-eslint-comments@eslint-community/eslint-plugin-eslint-comments, eslint-plugin-typescript-sort-keyseslint-plugin-perfectionist ^4. Bumps react-hooks ^7, jsdoc ^63, sort-destructure-keys ^3.
  • Bumps engines.node to 22.13.0; adds .nvmrc; updates CI workflow.
  • Drops the redundant glob ^11.0.4 override.

Data-portal-specific surfaces fixed in this PR

  • pages/_app.tsxErrorBoundary import path → errorBoundary/errorBoundary (v54 dropped the directory barrel).
  • utils/docPages.ts — pass blockJS: false to next-mdx-remote/serialize options (v6 default silently strips JSX expression attributes).
  • components/.../Publication/publication.tsx — findable-ui v54 removed the Markdown component. Verified the data: of 24 publication titles in constants/biccn-publications.json, 23 are plain strings; one had embedded <sup>+</sup> HTML with stray whitespace from a Crossref scrape. Cleaned that title to use Unicode , and switched the renderer to plain text — <CardTitle>{publication.title}</CardTitle> etc. Sanitization of future Crossref fetches tracked in Sanitize Crossref-fetched publication titles in complete-biccn-publications script #3089.
  • views/SearchView/hooks/useSearch.tsreact-hooks v7 flags the useEffect → setRequestURL sync as set-state-in-effect. The deeper fix (move searchIndex into the URL) is out of scope for the upgrade; suppressed inline with // eslint-disable-next-line ... -- track via #3088.
  • theme/typography/constants.ts@media (...) keys kept after letter keys via inline // eslint-disable-next-line sort-keys -- disabling key order for readability (mirrors findable-ui's own convention).
  • Several JSDoc additions, sort-keys reorderings, return-type annotations, and one sonarjs/no-nested-template-literals fix to satisfy the new rule set.
  • viewModelBuilders/dataDictionaryMapper/accessorFn.ts — return type of buildTierNSource widened from inferred to ReactNode (matches actual LinkProps['children'] type; no behavior change).
  • Uninstalled isomorphic-dompurify (no longer needed once the local Markdown component / MarkdownRenderer path was dropped).

npm audit fix

Ran npm audit fix (no --force); 6 moderate vulns remain, all transitive postcss via next. No fix available until Next ships an update. To be handled separately.

Test plan

  • npm run build-dev:data-portal succeeds (verified locally)
  • npm run lint — 0 errors, 8 pre-existing TODO warnings (verified locally)
  • tsc --noEmit clean (verified locally)
  • CI green on this branch
  • Deploy to staging and smoke test
  • Confirm no React hydration warnings on MUI-styled pages (validates Emotion cache wiring)
  • Spot-check /hca-bio-networks/<network>/publications — publication titles + citations render as plain text, including the cleaned Na⁺/K⁺ paper
  • Spot-check /search?q=... — search results load and pagination works (no mid-browse resets)
  • Spot-check MDX-rendered doc pages — confirm blockJS: false preserved any JSX attributes that were previously rendering

🤖 Generated with Claude Code

…ndable-ui#952) (#3087)

closes #3087

- bump next ^16, eslint-config-next ^16, @next/eslint-plugin-next ^16,
  @next/mdx ^16
- bump next-mdx-remote ^6, @databiosphere/findable-ui ^54.1
- add @mui/material-nextjs ^9 + @emotion/server ^11; wire AppCacheProvider
  in _app.tsx and DocumentHeadTags + documentGetInitialProps in _document.tsx
- pin builds to webpack via --webpack flag (tracks vercel/next.js#82607)
- migrate .eslintrc.json + .eslintignore → eslint.config.mjs (flat config),
  replace eslint-plugin-eslint-comments with @eslint-community variant,
  swap eslint-plugin-typescript-sort-keys for eslint-plugin-perfectionist ^4,
  bump eslint ^9, react-hooks ^7, jsdoc ^63, sort-destructure-keys ^3
- pass blockJS: false to next-mdx-remote serialize options (v6 default
  silently strips JSX expression attributes)
- bump engines.node to 22.13.0, add .nvmrc, update CI workflow
- drop redundant glob ^11.0.4 override
- update ErrorBoundary import path to errorBoundary/errorBoundary (v54
  dropped the directory barrel)
- replace removed findable-ui Markdown component in Publication: render
  publication.title and citation as plain strings; clean one anomalous
  biccn-publications.json title (Na+/K+ paper) to use unicode superscript;
  follow-up for crossref title sanitization tracked in #3089
- uninstall isomorphic-dompurify (no longer needed)
- suppress react-hooks/set-state-in-effect in useSearch with disable
  comment referencing follow-up #3088 (encode pagination in URL query)
- fix mechanical lint errors surfaced by the new rule set (jsdoc, sort-keys,
  explicit return types, nested template literal); typography constants
  keep their CSS-author order via inline sort-keys disables

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@frano-m frano-m requested a review from Copilot June 12, 2026 04:06
@frano-m frano-m marked this pull request as ready for review June 12, 2026 04:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Upgrades the data-portal app to Next.js 16 and the latest major @databiosphere/findable-ui, with associated tooling and SSR plumbing updates (ESLint v9 flat config, MUI Emotion cache integration, and MDX serialization behavior alignment).

Changes:

  • Bump core dependencies (Next.js 16, findable-ui v54, next-mdx-remote v6) and Node engine baseline (22.13.0), updating CI accordingly.
  • Add MUI Next.js (pages router) SSR Emotion cache wiring via AppCacheProvider (_app.tsx) and DocumentHeadTags/documentGetInitialProps (_document.tsx).
  • Migrate ESLint config to flat config (eslint.config.mjs), update lint script, and apply small code/doc tweaks to satisfy updated rule sets and removed APIs.

Reviewed changes

Copilot reviewed 22 out of 24 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
views/SearchView/hooks/useSearch.ts Suppresses react-hooks/set-state-in-effect for URL→state sync (tracked follow-up).
viewModelBuilders/viewModelBuilders.ts Adds explicit JSX return types and JSDoc param clarifications.
viewModelBuilders/dataDictionaryMapper/viewModelBuilders.ts Simplifies string building (avoids nested template literals).
viewModelBuilders/dataDictionaryMapper/columnDefs.ts Key reordering to satisfy sort rules.
viewModelBuilders/dataDictionaryMapper/accessorFn.ts Widen accessor return type to ReactNode.
utils/trackerNetwork.ts Adds JSDoc param/returns annotations.
utils/docPages.ts Sets blockJS: false for next-mdx-remote v6 serialization to preserve JSX expression attributes.
utils/availableNetworks.ts Adds @returns documentation for filtering behavior.
tsconfig.json Updates TS settings for Next 16 (moduleResolution: bundler, jsx: react-jsx).
theme/typography/constants.ts Adds scoped sort-keys suppressions to preserve readable key ordering.
site-config/data-portal/dev/config.ts Reorders dataSource block (no functional change).
pages/_document.tsx Adds MUI Next.js document helpers for Emotion SSR tags.
pages/_app.tsx Wraps app in MUI AppCacheProvider; updates findable-ui ErrorBoundary import path.
package.json Dependency bumps, webpack pin for Next CLI, ESLint v9 tooling, Node engine bump, remove unused override.
eslint.config.mjs Introduces ESLint v9 flat config replacing legacy .eslintrc.json + .eslintignore.
constants/biccn-publications.json Cleans a publication title (replaces HTML sup tags with Unicode superscripts).
components/HCABioNetworks/.../publication.tsx Removes Markdown rendering and renders publication title/citation as plain text.
apis/tracker/api.ts Adds missing @returns JSDoc lines.
apis/azul/hca-dcp/common/entities.ts Removes explicit-any suppressions; uses unknown index signatures.
.nvmrc Pins local Node version to 22.13.0.
.github/workflows/run-checks.yml Updates CI Node version to 22.13.0.
.eslintrc.json Removed (replaced by flat config).
.eslintignore Removed (replaced by flat config ignores).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread utils/trackerNetwork.ts Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

Upgrade to Next.js 16 + new findable-ui major (Phase 2 from findable-ui#952)

3 participants