Skip to content

Spike: evaluate Next.js 16 upgrade path for findable-ui and consumers #884

@NoopDog

Description

@NoopDog

Summary

Next.js 16 (released 2025-10-21) is now latest on npm (16.2.4). findable-ui currently pins next ^15.5.13 as a peer dep. This spike scopes what a v16 upgrade costs for this library and for each consuming app (data-browser, ncpi-dataset-catalog, hca-atlas-tracker, etc.) and proposes a phased upgrade plan.

Current state (audit)

  • Peer deps: next ^15.5.13, react ^19.2.3, Node 22.12.0
  • Pages Router APIs in library: next/router, GetStaticProps*, GetStaticPaths* (in src/utils/mdx/staticGeneration/)
  • MDX: next-mdx-remote/serialize v5 — runtime serializer consumed via getStaticProps pattern
  • No App Router RSC usage: no "use client"/"use server", no next/headers, no next/cookies
  • Router-agnostic imports in use: next/link, next/head, next/image, usePathname, useSearchParams, ReadonlyURLSearchParams

Goals

  1. Go/no-go recommendation with rough effort estimate (S/M/L per consumer).
  2. Identify blockers that need upstream fixes before we can bump the peer range.
  3. Draft a phased rollout plan: library bump → per-consumer upgrades.

Deliverables

  • Compatibility matrix: findable-ui features × Next 16 changes.
  • Per-consumer impact notes (router type, MDX use, image/middleware use).
  • Proposed PR sequence + fallback plan if any consumer must stay on 15.

Areas to evaluate

1. Router strategy (biggest open question)

  • findable-ui ships Pages Router helpers. Pages Router still works in Next 16 but is clearly deprioritized (no Cache Components support, no new caching APIs, RSC/React Compiler benefits App-Router-only).
  • Audit each consumer: which are on Pages Router vs App Router vs hybrid? Decide whether findable-ui should:
    • (a) stay Pages-compatible,
    • (b) publish both Pages + App entrypoints, or
    • (c) migrate to App Router in a major version.
  • next/navigation hooks already in use work in both routers — good.

2. MDX pipeline

  • next-mdx-remote/serialize is used in src/utils/mdx/staticGeneration/ (Pages Router getStaticProps pattern). Confirm next-mdx-remote v5 supports Next 16.
  • Evaluate whether to move to the App Router <MDXRemote /> RSC variant or @next/mdx.
  • Decision affects API surface: consumers using these helpers would need to migrate if we change it.

3. Next 16 breaking changes to audit

  • Node 20.9+ required (we're on 22.12 — fine; check all consumer CI/Docker).
  • TypeScript 5.1+ minimum.
  • Async params / searchParams / cookies() / headers() / draftMode() — only matters if we add App Router code; current library code unaffected.
  • middleware.tsproxy.ts — not used in library; check consumers.
  • AMP removal — not used.
  • next lint removal — migrate ESLint invocation; adopt eslint-config-next v16 flat-config default.
  • next/image default changes:
    • new localPatterns requirement for local src with query strings
    • qualities default [75]
    • minimumCacheTTL 60s → 4h
    • maximumRedirects capped at 3
    • dangerouslyAllowLocalIP default off
    • Audit all <Image> usages in library and consumers.
  • images.domains deprecatedremotePatterns.
  • revalidateTag() signature change — not used in library; check consumers.
  • Turbopack is default bundler — verify Storybook (@storybook/nextjs-vite already Vite-based — likely fine) and any consumer webpack customizations.
  • React Compiler stable — opt-in; evaluate later.
  • Parallel routes default.js required — consumer-side only.
  • Sass modern API — check for .scss usage.
  • scroll-behavior: smooth auto-apply removed — audit global styles.

4. Peer dependency coordination

  • Bumping next peer to ^16 is breaking → findable-ui major version bump.
  • next-auth ^4.24.13 — verify v4 works with Next 16, or plan move to next-auth v5 / Auth.js.
  • @next/eslint-plugin-next, eslint-config-next — bump to 16 and migrate to flat config if not already.
  • React 19.2 features (View Transitions, Activity) — opportunities, not requirements.

5. Consumer impact survey

For each consumer (data-browser, ncpi-dataset-catalog, hca-atlas-tracker, anvil-portal, brc-analytics, hprc-data-explorer, etc.): record Next version, router in use, MDX usage, middleware usage, custom webpack config, image config, and CI Node version. This determines whether we can ship the bump as a single major or need a compat window.

6. Release & rollout

  • Proposed: publish findable-ui vNEXT-major with next ^16 peer; optionally keep a maintenance branch on v15 peer for one quarter if any consumer can't move immediately.
  • Use npx @next/codemod@canary upgrade latest on each consumer PR.

Acceptance criteria

  • Written recommendation doc in /docs or PR description
  • Per-consumer ticket filed with effort estimate
  • Decision on Pages vs App Router direction for the library

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions