Skip to content

chore(deps): bump next to 16 and payload to 3.86.0#448

Merged
hakalb merged 10 commits into
mainfrom
cod-401-bumb-next-to-16
Jul 25, 2026
Merged

chore(deps): bump next to 16 and payload to 3.86.0#448
hakalb merged 10 commits into
mainfrom
cod-401-bumb-next-to-16

Conversation

@hakalb

@hakalb hakalb commented Jul 21, 2026

Copy link
Copy Markdown
Member

Summary

Bumps Next.js 15 → 16 (COD-401). Because @payloadcms/next@3.86.0 requires next >=16.2.6 <17 and pins the matching payload version, the whole Payload stack is bumped in lockstep.

Dependency changes (root package.json)

  • next ^15.5.15^16.2.10
  • eslint-config-next ^15.5.15^16.2.10
  • all @payloadcms/* + payload 3.84.13.86.0
  • @nx/next (peer next >=14 <17) and @sentry/nextjs (peer already allows ^16) unchanged — already compatible

Next 16 migration

  • middleware.tsproxy.ts (middleware file convention deprecated in 16; function renamed middlewareproxy, matcher/behavior unchanged)
  • experimental.reactCompiler → top-level reactCompiler in next.config.mjs (moved out of experimental)
  • Build now runs on Turbopack (Next 16 default) — verified working with withPayload + withSentryConfig (Sentry useRunAfterProductionCompileHook runs)
  • next-env.d.ts regenerated to the Next 16 format
  • Dockerfile standalone fix: Next 16 no longer copies the repo-root package.json into the standalone output (it emits .next/package.json = {"type":"commonjs"} instead), so the CommonJS server.js already runs as CJS. Removed the now-obsolete sed 's/"type": "module"/"type": "commonjs"/' package.json step, which broke the image build (sed: can't read package.json). Verified docker compose build cms succeeds and the container boots (▲ Next.js 16.2.10 ✓ Ready).

ESLint (eslint-config-next 16)

  • v16 ships a native flat config, so apps/cms/eslint.config.mjs now imports eslint-config-next/core-web-vitals directly instead of via FlatCompat/fixupConfigRules
  • The bundled eslint-plugin-react-hooks v6 (React Compiler rules) flagged 4 existing spots; fixed each:
    • use-palette-search.ts — derive the too-short → idle/empty state instead of setState in the effect; move the queryRef write and loading update out of the synchronous effect body
    • PaletteDialog.client.tsx — reset query in a wrapped onOpenChange handler instead of a close effect
    • TenantsArrayField.tsx — build a new field object instead of mutating the clientField prop

Verification

  • nx build cms ✅ (Turbopack, Sentry hook runs)
  • nx lint cms / nx test cms ✅ (remaining 3 warnings are pre-existing)
  • nx affected -t lint test build ✅ across all affected projects
  • docker compose build cms ✅ + container boots
  • ⏳ Runtime smoke test (admin UI + site render against Postgres) and nx verify cms still to be run locally

🤖 Generated with Claude Code

Fly memory (OOM fix)

The Next 16 next-server has a higher memory baseline than 15 and OOM'd on the 512MB Fly VM during admin RSC rendering (FATAL ERROR: ... JavaScript heap out of memory → SIGABRT → machine reboot → intermittent 502s that recover on refresh). Raised the CMS VM to 1GB in fly.toml + fly.production.toml. Verified on the PR-448 preview: re-scaled the live machines to 1GB and replayed the exact load that reliably OOM'd at 512MB — all 200s, no heap error.

⚠️ Production rollout (required manual step)

fly deploy deploys the new image onto existing machines without resizing their guest — so the fly.production.toml memory bump in this PR does not resize the running production machines. Production cdwr-cms is currently 512MB, and on merge it would run the Next 16 image on 512MB → OOM (same crash as the preview).

Before/with merging, resize production to 1GB — apply the standard-memory patch via cdwr patch-config to cdwr-cms, or equivalently:

fly machine update <machine-id> --vm-memory 1024 -a cdwr-cms   # both machines

(The PR-448 preview was already resized to 1GB this way and verified OOM-free under load.) New/recreated machines pick up 1GB from fly.production.toml automatically; only the in-place resize of existing machines needs this manual step.

Copilot AI review requested due to automatic review settings July 21, 2026 08:14
@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@nx-cloud

nx-cloud Bot commented Jul 21, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit ccb69bf

Command Status Duration Result
nx affected -t chromatic ✅ Succeeded 2m 18s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-07-25 10:13:36 UTC

@github-actions github-actions Bot added the preview-deploy PR Trigger: run continuous preview deployments label Jul 21, 2026

Copilot AI left a comment

Copy link
Copy Markdown

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 CMS app’s Next.js and Payload stack to satisfy @payloadcms/next@3.86.0’s Next 16 peer requirement, while applying required/related Next 16 + ESLint v16 migration adjustments in the CMS app.

Changes:

  • Bump next/eslint-config-next to ^16.2.10 and align all @payloadcms/* + payload to 3.86.0.
  • Migrate Next 16 routing interception from middleware to proxy conventions in the CMS app.
  • Update CMS ESLint flat config consumption for eslint-config-next v16 and address React Hooks/Compiler rule violations in the palette UI.

Reviewed changes

Copilot reviewed 7 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
package.json Updates Next.js, eslint-config-next, Payload, and related @payloadcms/* versions in lockstep.
apps/cms/src/proxy.ts Renames exported entrypoint from middleware to proxy for Next 16 convention while preserving behavior/matcher.
apps/cms/src/components/TenantsArrayField.tsx Avoids mutating clientField by deriving a new field object when capping maxRows.
apps/cms/src/components/admin/palette/use-palette-search.ts Refactors debounced search hook to avoid short-query state updates and align with updated hooks rules.
apps/cms/src/components/admin/palette/PaletteDialog.client.tsx Moves “reset query on close” into an onOpenChange wrapper instead of an effect.
apps/cms/next.config.mjs Moves reactCompiler config to the new top-level location (out of experimental).
apps/cms/next-env.d.ts Regenerates Next env typings to the newer import-based format.
apps/cms/eslint.config.mjs Switches to Next v16’s native flat config import and avoids duplicate import plugin registration.

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

@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.77%. Comparing base (5097a90) to head (ccb69bf).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #448      +/-   ##
==========================================
+ Coverage   85.58%   85.77%   +0.18%     
==========================================
  Files          62       63       +1     
  Lines        1124     1139      +15     
  Branches      240      247       +7     
==========================================
+ Hits          962      977      +15     
  Misses        162      162              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI review requested due to automatic review settings July 21, 2026 21:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 10 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

apps/cms/src/proxy.ts:8

  • Next.js only picks up middleware by convention from middleware.{ts,js} (e.g. apps/cms/src/middleware.ts) and expects an export named middleware. In this PR the file is now src/proxy.ts and the function is proxy, and there is no remaining middleware.ts in apps/cms, so this logic (maintenance mode + draft cookie clearing) will not run at all.

Copilot AI review requested due to automatic review settings July 21, 2026 21:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 12 out of 14 changed files in this pull request and generated 1 comment.

Comment thread packages/nx-payload/README.md Outdated
@codeware-actions

Copy link
Copy Markdown

✨ Your pull request projects are ready for preview

Project Status Preview
cms (_default) ✅ Deployed https://cdwr-cms-pr-448.fly.dev
cms (demo) ✅ Deployed https://cdwr-cms-pr-448-demo.fly.dev
web (demo) ✅ Deployed https://cdwr-web-pr-448-demo.fly.dev

Copilot AI review requested due to automatic review settings July 24, 2026 21:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 14 out of 16 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (2)

packages/nx-payload/README.md:378

  • The compatibility note is ambiguous: “Next.js v15 is also supported from ^2.3.0” reads like a Next.js semver range. It’s clearer to state that Next 15 remains supported (or that support starts with plugin v2.3.0).
> The Next.js column lists the version installed by default. See [Next.js Version](#nextjs-version) for the full supported range (Next.js v15 is also supported from `^2.3.0`).

packages/nx-payload/README.md:382

  • The table says the default Next.js version for plugin ^2.3.0 is ^16.0.0, but the generator constant is next16Version = '^16.2.10' (packages/nx-payload/src/utils/versions.ts). Align the table with the actual default that gets installed.
| `^2.3.0`  | `22.x`    | `3.86.0`  | `^19.0.0` | `^16.0.0` |

Comment thread packages/nx-payload/README.md Outdated
Copilot AI review requested due to automatic review settings July 24, 2026 22:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 15 out of 17 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

packages/nx-payload/README.md:382

  • The compatibility table claims the default Next.js version for plugin ^2.3.0 is ^16.0.0, but the generator default in next16Version is ^16.2.10 and the README above also discusses >=16.2.6. This should match the actual installed default to avoid confusion.
| `^2.3.0`  | `22.x`    | `3.86.0`  | `^19.0.0` | `^16.0.0` |

Comment thread apps/cms/eslint.config.mjs Outdated
Copilot AI review requested due to automatic review settings July 24, 2026 22:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 15 out of 17 changed files in this pull request and generated 1 comment.

Comment thread packages/nx-payload/README.md Outdated
Copilot AI review requested due to automatic review settings July 24, 2026 23:02
@hakalb
hakalb enabled auto-merge July 24, 2026 23:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 15 out of 17 changed files in this pull request and generated no new comments.

@hakalb
hakalb force-pushed the cod-401-bumb-next-to-16 branch from f0844de to ccb69bf Compare July 25, 2026 10:10
Copilot AI review requested due to automatic review settings July 25, 2026 10:10
@hakalb
hakalb disabled auto-merge July 25, 2026 10:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 26 out of 28 changed files in this pull request and generated 1 comment.

Comment thread packages/nx-payload/src/utils/extract-version.ts
@hakalb
hakalb deployed to preview July 25, 2026 10:18 — with GitHub Actions Active
@hakalb
hakalb added this pull request to the merge queue Jul 25, 2026
Merged via the queue into main with commit d951ef0 Jul 25, 2026
22 checks passed
@hakalb
hakalb deleted the cod-401-bumb-next-to-16 branch July 25, 2026 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview-deploy PR Trigger: run continuous preview deployments

Development

Successfully merging this pull request may close these issues.

2 participants