In a pull request, a framework major upgrade looks like a dependency bump. In production, it is a platform change, because rendering, caching, build tooling and error reporting can all change in one deploy. This guide shows how to measure such an upgrade: capture a baseline, agree acceptance criteria, roll out in phases with a rollback for each phase, and handle a shared UI library that blocks the apps that use it. The example is an upgrade from Next.js 15 to Next.js 16.4.6, the current version on 1 December 2026. The monitoring examples use Datadog RUM and APM. The guide is for tech leads and platform teams who run a Next.js storefront or web app in production.
Start from the support dates
A late start leaves no time to measure, so start early. Next.js keeps each major version in Maintenance LTS for two years after its first release. For Next.js 15, that end date was 21 October 2026, and Next.js has since extended security releases for Next.js 15 to 31 January 2027. Work back from that date and from your change freeze. The upgrade must be stable in production before the freeze starts, so count the time for the baseline, the phases and a stable period.
Know what changes between 15 and 16
Next.js 16 changes defaults, not only APIs. Each change below can move a signal in production. The upgrade guide says it directly: “A green build alone does not close runtime findings.”
| Change in Next.js 16 | What can move | Signal to watch |
|---|---|---|
Turbopack is the default for next dev and next build |
Build time and bundle content. A custom webpack config makes next build fail, unless you build with --webpack |
Build duration, bundle size |
Synchronous access to cookies, headers, draftMode, params and searchParams is removed |
Runtime errors in code that the codemod did not migrate | Error rate, new error signatures |
| The App Router uses the latest React canary release, with React 19.2 features | Hydration and client behaviour | Core Web Vitals, browser errors |
revalidateTag needs a cacheLife profile as second argument, and updateTag and refresh are new |
When cached data refreshes | Server render time, TTFB |
| Layout deduplication and incremental prefetching | More prefetch requests with lower total transfer | Request count per page view |
next/image defaults: minimumCacheTTL goes from 60 seconds to 4 hours, qualities allows only [75], and 16 is removed from imageSizes |
Image caching and image URLs | Image request errors, LCP |
middleware is deprecated and renamed proxy, and proxy runs only on the Node.js runtime |
Where request logic runs | Latency and errors on routes that use it |
| Node.js 20.9.0 is the minimum version | Build image and runtime image | Build success, CPU and memory |
Change one thing at a time. The upgrade guide says that React Compiler and Cache Components “are not enabled merely to complete the upgrade”. Turn them on later, as separate changes with their own measurement. The guide also says that compile times increase when you enable React Compiler, because it relies on Babel.
Capture a baseline on the current version
Take the baseline on production, on Next.js 15, over one representative week without large campaigns or incidents. Store the numbers, so you compare against real values and not against memory.
| Signal | Source | Why it matters |
|---|---|---|
| LCP, INP and CLS at p75, per locale or market | RUM | Client regressions show here first |
| Server render time and TTFB | APM, RUM | Rendering and caching defaults changed |
| Error rate and error signatures, per locale | RUM, APM, Error Tracking | Hydration and boundary errors appear as new signatures |
| CDN cache hit ratio | CDN logs or metrics | A silent drop in cache hits looks like a latency regression |
| CPU, memory and instance count | APM, infrastructure metrics | Rendering changes move cost between build and runtime |
| Build duration and bundle size | CI | They affect delivery, not customers, but they warn you early |
| Test count and pass rate per package | CI | A test runner swap can lose coverage without a failure |
| Synthetic tests for login, cart, checkout and product pages | Synthetic tests | They cover flows that have little real traffic at quiet hours |
Do these steps before the baseline week starts:
- Set
versionindatadogRum.init, and set theversiontag of Unified Service Tagging on the server. Use the same value in both places for each deploy. Datadog then shows P75 Loading Time, sessions and error rate per version on the RUM Application Overview, and requests and errors per version on the APM Service page. - Write the baseline numbers into the migration ticket or a dashboard note. Datadog compares two versions only within the past 30 days, and a phased upgrade can take longer.
- Record the duration of the build step in CI for several builds. Next.js says Turbopack gives 2 to 5 times faster production builds, so verify that claim on your own app. Turbopack filesystem caching is on by default for
next buildin Next.js 16, so record whether each build started with a restored cache. - Measure bundle size yourself.
Next.js 16 removed the size and First Load JS metrics from the next build output, because they were not accurate with React Server Components. Next.js recommends tools such as Lighthouse for route performance. For a simple CI trend, this script sums the JavaScript in .next/static:
// bundle-size.mjs: run after next build, from the app directory
import { readdirSync, readFileSync } from 'node:fs';
import { join } from 'node:path';
import { gzipSync } from 'node:zlib';
const root = '.next/static';
let files = 0;
let rawBytes = 0;
let gzipBytes = 0;
for (const path of readdirSync(root, { recursive: true })) {
if (!path.endsWith('.js')) continue;
const content = readFileSync(join(root, path));
files += 1;
rawBytes += content.length;
gzipBytes += gzipSync(content).length;
}
console.log(JSON.stringify({ files, raw_bytes: rawBytes, gzip_bytes: gzipBytes }));
Send the output to your CI metrics. The bundler changes in this upgrade, so a change in the total does not tell you what a user downloads on a page. Use the number as a trend, and use RUM and Lighthouse for page weight.
Agree acceptance criteria before the first deploy
Write the criteria down before phase 1 starts, and get agreement from the teams that ship. Decide on the numbers, not on the absence of complaints:
- p75 LCP and INP per locale do not regress beyond an agreed margin.
- The error rate is flat or lower than the baseline.
- The CDN cache hit ratio is flat or higher.
- No new error signature continues for 24 hours.
- All synthetic tests stay green for 24 hours after the deploy.
Set the numeric margin after the baseline week. Look at how much each p75 value moves from day to day in that week, and make the margin larger than that normal variation. Decide on field data from RUM, not on a single Lighthouse run. For the difference, see Lighthouse lab data vs RUM field data.
Also name one person who can stop the rollout, and the person who runs the rollback.
Roll out in phases, with a rollback for each phase
Split the upgrade into phases. Each phase needs an exit condition and a rollback, and the exit condition of one phase is the entry condition of the next.
| Phase | Work | Exit condition | Rollback |
|---|---|---|---|
| 0 | Name owners, capture the baseline, confirm the freeze calendar | Baseline stored, an owner for each area | Not needed |
| 1 | Upgrade the shared UI library | Library released, apps build against it | Pin the previous library version |
| 2 | Upgrade Next.js on a branch, apply codemods, get CI green | A preview environment serves all key routes with no new errors | Do not merge the branch |
| 3 | Package owners confirm and fix their packages | All packages compatible, tests green | Revert per package |
| 4 | Staged production rollout behind a feature flag or canary, per locale | Acceptance criteria met on all locales | Turn the flag off and restore the previous deployment |
| 5 | Remove the old version, update docs and templates | Next.js 15 is no longer built anywhere | None, this is the point of no return |
Before phase 2, check the Node.js version in your build image and in your runtime image. Next.js 16 needs Node.js 20.9.0 or later.
Start phase 5 only after phase 4 is stable for an agreed period. Until then, keep the previous version buildable and deployable, and test the rollback once before the production rollout. For rollback runbooks and the decision to roll back, see SLOs, error budgets and rollback runbooks.
When a shared UI library blocks the apps
If every app imports one shared UI library, that library sets the start date for all apps. Treat it as the entry condition for the migration, not as a parallel track.
The next@16 package accepts React 18.2 or React 19 as a peer dependency. But the upgrade guide says that the App Router uses the latest React canary release, with React 19.2 features. So components that render in the App Router must work with React 19. Check the library against the React 19 upgrade guide:
propTypesanddefaultPropsfor function components are removed. Use ES6 default parameters.- String refs are removed.
react-dom/test-utilsand the shallow rendererreact-test-renderer/shalloware removed, andreact-test-rendereris deprecated.- React warns that libraries that depend on React internals may block upgrades.
React publishes a codemod recipe for these changes: npx codemod@latest react/19/migration-recipe.
If the library also changes its test runner, for example from Jest to Vitest, compare the number of tests per package before and after. A test that does not run does not fail, so the pass rate alone can hide lost coverage.
Release the library as its own version, so the rollback for the apps is to pin the previous version. If the library code works on both React versions, a peer range such as ^18.2.0 || ^19.0.0 lets apps take the new library before they upgrade Next.js. That splits one large change into two smaller changes.
Watch the rollout
During phase 4, both versions run side by side with the same traffic, season and content. This is the best moment to compare them.
- RUM. The Deployment Tracking section on the Application Overview shows P75 Loading Time, sessions, error rate and P75 Core Web Vitals per version. The version comparison page shows error counts and Error Tracking issues for two versions.
- APM. The Service page shows requests and errors per version, and the error types that did not appear in the previous version. This section appears only when more than one version reports.
- Faulty deployments. With
versionset, Datadog can flag faulty deployments automatically. To get notified, create an Events monitor withtags:deployment_analysisin the query. - Error sources. React 19 changes how it reports errors. Uncaught errors go to
window.reportError, and errors that an Error Boundary catches go toconsole.error. The Datadog Browser SDK recordsconsoleerrors andsourceerrors (unhandled exceptions) as separate sources. So the mix of error sources can change after the upgrade. Compare errors by source and by signature, not only the total.
For the RUM and APM setup in a Next.js App Router app, see Datadog RUM and APM for the Next.js App Router.
In practice
In September 2026, we wrote the coordination plan for a Next.js 15 to 16 upgrade at an international cosmetics retailer. The plan worked back from 21 October 2026, which was then the end of Maintenance LTS for Next.js 15. An unplanned upgrade could not realistically finish before the holiday freeze, so the upgrade needed a plan.
The plan covered owners per area, sequencing, monitoring and validation, rollout and rollback, and the freeze calendar. Its output was a ticket on the shared backlog of non-functional requirements, with migration steps, a test plan and a monitoring plan. A dependency compatibility analysis already existed, and the teams that own the packages could answer the remaining questions faster than a new central review. Codemods and API details followed the upstream upgrade guide.
The largest known blocker was not Next.js. The shared UI library had to move to React 19 and from Jest to Vitest before any app could upgrade. That made the team that owns the design system the entry condition for the whole migration.
We owned monitoring and validation: the baseline, the dashboards and the acceptance criteria. The baseline was one representative week on production, on Next.js 15. The signals, acceptance criteria and phases in this guide come from that plan, and the numeric thresholds were to follow from the baseline. Open questions included the Node.js version in the build image and runtime, a rollout per locale or all at once, and one ticket or one ticket per team. This post describes the plan, so we report no results here. Read more about our work with this client in the case study.
Checklist
- Check the support dates for your current major version, and work back from your change freeze.
- Set
versionin RUM and APM before the baseline week. - Capture one representative week on production, and store the numbers outside the tool.
- Measure build duration and bundle size in CI yourself, because
next buildno longer prints sizes. - Agree acceptance criteria and a decision owner before the first deploy.
- Give every phase a rollback, and name the point of no return.
- Upgrade the shared UI library first, and compare test counts after a test runner change.
- Keep React Compiler and Cache Components off until the upgrade is stable.
- Compare both versions side by side during the rollout, by error source and signature.
For a review of how you measure performance before and after a platform change, see the web performance audit.