Skip to content

chore(web/frontend): upgrade next 14→16, drop unused nuqs (#7327) - #7347

Merged
mdmohsin7 merged 1 commit into
mainfrom
rex/web-frontend-next16-nuqs2
May 18, 2026
Merged

mdmohsin7 merged 1 commit into
mainfrom
rex/web-frontend-next16-nuqs2

Conversation

@mdmohsin7

@mdmohsin7 mdmohsin7 commented May 17, 2026 •

Copy link
Copy Markdown
Member

Completes the breaking-change residuals from #7337 (part of #7327). Branched from fresh main; single commit.

Result

npm audit: 0 (the 5 highs left after #7337's non-breaking pass cleared here).

Changes

  • next 14.2.18 → 16.2.6 (major). @next/codemod next-async-request-api → 7 app files migrated to async params/searchParams/headers(), 0 errors.
  • Dropped nuqs entirely — zero imports anywhere (dead dep). Minimal-risk fix vs the 1.x→2.x API migration.
  • glob override ^10.5.0 — in-major patched; avoids the eslint-config-next@16 bump (would force eslint 8→9, out of scope). Advisory is CLI-only.
  • Removed swcMinify (removed in Next 15).
  • next.config.mjs: removed the now-unrecognized eslint key (Next 16 ignores it) and added outputFileTracingRoot = the app dir. Without it, Next 16's monorepo workspace-root inference nests the standalone build out of the Dockerfile's reach (COPY .../web/frontend/.next/standalone ./ + CMD ["node","server.js"]) → container crash on boot. With the fix, server.js is back at .next/standalone/server.js.

Validation

  • npm audit → 0; next build (Next 16) → success
  • Runtime-tested: built + ran the standalone artifact (node server.js, as the Dockerfile) with a production-like configuration. Walked public + all codemod'd dynamic routes (apps/[id], apps/category/[category], chat/[token], memories/[id], tasks/[token], unlimited, wrapped): 0 page errors, 0 5xx, correct 404s for invalid tokens, correct redirects.
  • Regression-isolated vs an unmodified next@14 main baseline (identical config): identical route + error profiles. Zero regressions. The baseline's standalone was natively at .next/standalone/server.js, confirming the nesting is Next-16-specific and the fix restores prior deploy behavior.

🤖 Generated with Claude Code

@mdmohsin7
mdmohsin7 marked this pull request as ready for review May 17, 2026 17:46
@greptile-apps

greptile-apps Bot commented May 17, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR upgrades the Next.js frontend from 14 to 16, removes the unused nuqs dependency, and migrates all affected server components to the Next 15+ async request APIs (params, searchParams, headers()).

  • Next 14 → 16 upgrade: swcMinify removed from config (now built-in default), glob ^10.5.0 resolution override added to clear a transitive vulnerability, and eslint-config-next intentionally pinned at ^14 since eslint.ignoreDuringBuilds is already set.
  • Async request API codemod: Seven page files updated — params/searchParams typed as Promise<…> and awaited at the top of each handler, headers() calls wrapped with await. All changes follow the codemod output exactly, with no logic regressions.
  • nuqs removal: Confirmed dead dependency (zero imports) — cleanly dropped alongside the nuqs advisory.

Confidence Score: 5/5

Safe to merge — the upgrade is mechanically clean and the async-API migration exactly matches what the official codemod produces.

All seven migrated pages correctly type params/searchParams as Promises and await them before use; headers() is awaited in every call site. The experimental.serverActions.bodySizeLimit key is confirmed still valid under experimental in Next 16 per official docs, so the 10 MB limit is preserved. Removed items (swcMinify, nuqs) are genuinely obsolete. No logic changes were introduced alongside the mechanical migrations.

No files require special attention. package-lock.json is large but the diff is consistent with the declared version changes.

Important Files Changed

Filename Overview
web/frontend/package.json Next bumped 14→16, nuqs removed (confirmed zero imports), and glob ^10.5.0 override added to clear the transitively-pulled vulnerability; clean.
web/frontend/next.config.mjs Removed deprecated swcMinify option (built-in default in Next 15+); all other config including experimental.serverActions.bodySizeLimit and cacheHandler remain valid for Next 16.
web/frontend/src/app/apps/[id]/page.tsx Both generateMetadata and PluginDetailView correctly migrated to accept props object with Promise<{id}> params and await headers(); logic unchanged.
web/frontend/src/app/memories/[id]/page.tsx Both params and searchParams correctly typed as Promise<…> and awaited before use; the resolved searchParams value is properly passed to the Memory component.
web/frontend/src/app/chat/[token]/page.tsx Async params and await headers() migration correct; ternary indentation reformatted but logic unchanged.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Incoming Request] --> B[Next 16 Router]
    B --> C{Dynamic Segment?}
    C -- Yes --> D["props.params → Promise<{id|token|category}>"]
    C -- No --> E[No params needed]
    D --> F["await props.params"]
    F --> G[Resolved params object]
    G --> H[Data Fetch / getAppById etc.]
    B --> I["headers() → Promise<ReadonlyHeaders>"]
    I --> J["await headers()"]
    J --> K[".get('user-agent')"]
    K --> L[Platform-specific link logic]
    H --> M[Server Component render]
    L --> M
    E --> M
Loading

Reviews (1): Last reviewed commit: "chore(web/frontend): upgrade next 14→16,..." | Re-trigger Greptile

Resolves the breaking-change residuals documented in #7337. npm audit
on this branch: 18 → 0 (built on the non-breaking remediation).

- next 14.2.18 → 16.2.6 (major). Ran `@next/codemod next-async-request-api`:
  7 app files migrated to async `params`/`searchParams`/`headers()`
  (Next 15+ async request APIs). 0 codemod errors.
- Removed `swcMinify` from next.config.mjs (removed in Next 15; default).
- Dropped `nuqs` dependency entirely — it had ZERO imports anywhere in
  the codebase (dead dep). Clears the nuqs advisory with no API migration
  (preferred minimal fix over the 1.x→2.x breaking upgrade).
- `glob` override `^10.5.0`: in-major patched (10.5.0 > vulnerable
  10.2.0–10.4.5), clears the glob CLI-injection advisory pulled via
  @next/eslint-plugin-next WITHOUT the eslint-config-next@16 bump (which
  would force a breaking eslint 8→9 + plugin-ecosystem migration, out of
  scope). Note: glob advisory is CLI-only; used here only as a library.
- eslint-config-next kept at ^14.2.6 (eslint stays 8.x; build has
  eslint.ignoreDuringBuilds and Next 16 removed `next lint`).

Validated: npm audit 0; `next build` (Next 16, prod) succeeds from the
committed tree; zero tsc regressions vs pre-upgrade baseline (pre-existing
trends/* + memories/* errors are on #7337 already and TS is ignored at
build per next.config). Next auto-manages tsconfig.json at build time.

next.config.mjs: removed the now-unrecognized `eslint` key (Next 16
ignores it) and added `outputFileTracingRoot = this app dir`. Without
it, Next 16's monorepo workspace-root inference nests the standalone
build out of reach of the Dockerfile (`COPY .../web/frontend/.next/
standalone ./` + `CMD ["node","server.js"]`), which would crash the
container on boot. With the fix, server.js is back at
`.next/standalone/server.js`.

Runtime-tested: built + ran the standalone artifact (`node server.js`,
as the Dockerfile) and walked public + codemod'd dynamic routes
(apps/[id], apps/category/[category], chat/[token], memories/[id],
tasks/[token], unlimited, wrapped). 0 page errors, 0 5xx, correct
404s/redirects. Verified zero regression vs an unmodified next@14
`main` baseline with identical env (identical route + error profiles).
@mdmohsin7
mdmohsin7 force-pushed the rex/web-frontend-next16-nuqs2 branch from 78f74ab to 63e3dce Compare May 17, 2026 19:18
@mdmohsin7

mdmohsin7 commented May 17, 2026 •

Copy link
Copy Markdown
Member Author

Live testing (runtime, not just build)

Built and ran the actual deployable standalone artifact — node .next/standalone/server.js, exactly as web/frontend/Dockerfile runs it (not next start) — with a production-like configuration, then drove a headless browser (Playwright).

No login step: web/frontend is the public-facing app (shared apps/chats/memories/tasks by token) — its routes are unauthenticated, so testing went straight at the public surface and every codemod-touched dynamic route.

Walked public + all async-params codemod'd dynamic routes: /, /apps, /apps/popular, /apps/[id], /apps/category/[category], /chat/[token], /memories/[id], /tasks/[token], /unlimited, /wrapped, /create-app, /my-apps → 0 page errors, 0 5xx, correct 404s for invalid share tokens (proves async params resolve correctly — not a crash), correct redirects (/→/apps, /memories/[id]→/conversations/[id]).

Regression isolation: identical test against an unmodified next@14 main baseline with identical configuration.

next@16 (this PR) next@14 (main)
page errors 0 0
5xx 0 0
console errors 21 23
route/redirect behavior identical identical

Zero runtime regressions (next@16 marginally cleaner). The async-params migration behaves identically to next@14 across every dynamic route.

Deploy bug found via this testing (the build was green and hid it): same as #7350 — Next 16's monorepo workspace-root inference nested the standalone build out of the Dockerfile's reach (COPY .../web/frontend/.next/standalone ./ + CMD ["node","server.js"] → container crash on boot). Fixed in this PR via outputFileTracingRoot; the next@14 baseline's standalone was natively at .next/standalone/server.js, confirming the bug is Next-16-specific and the fix restores prior deploy behavior. Re-ran the standalone artifact end-to-end to confirm.

@mdmohsin7
mdmohsin7 merged commit f5332b3 into main May 18, 2026
1 of 2 checks passed
@mdmohsin7
mdmohsin7 deleted the rex/web-frontend-next16-nuqs2 branch May 18, 2026 06:40
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