Repository navigation
chore(web/frontend): upgrade next 14→16, drop unused nuqs (#7327) - #7347
Conversation
Greptile SummaryThis PR upgrades the Next.js frontend from 14 to 16, removes the unused
Confidence Score: 5/5Safe 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
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
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).
78f74ab to
63e3dce
Compare
Live testing (runtime, not just build)Built and ran the actual deployable standalone artifact — 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- Regression isolation: identical test against an unmodified next@14
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 ( |
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/codemod next-async-request-api→ 7 app files migrated to asyncparams/searchParams/headers(), 0 errors.nuqsentirely — zero imports anywhere (dead dep). Minimal-risk fix vs the 1.x→2.x API migration.globoverride^10.5.0— in-major patched; avoids theeslint-config-next@16bump (would force eslint 8→9, out of scope). Advisory is CLI-only.swcMinify(removed in Next 15).next.config.mjs: removed the now-unrecognizedeslintkey (Next 16 ignores it) and addedoutputFileTracingRoot= 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.jsis back at.next/standalone/server.js.Validation
npm audit→ 0;next build(Next 16) → successnode 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.mainbaseline (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