Commit Graph

16 Commits

Author SHA1 Message Date
Josh Story e0966df114 test: migrate caching deploy exclusions to force gates (#98154)
## Summary

- migrate Cache Components, PPR, prefetching, prerendering,
revalidation, and SSG deployment exclusions to `@force-gate`
- remove the corresponding `skipDeployment` options and `skipped`
control flow while preserving each suite's rationale

This keeps caching-related exclusions together so their deployed
semantics can be reviewed by the same owners.

## Verification

- verified on the combined top-of-stack tree with `pnpm typescript`
- compared ordinary-mode collection before and after: all 4,670 existing
test names matched
- collected all 510 affected files in deploy mode: 4,578 skipped tests,
zero failures

<!-- NEXT_JS_LLM -->
2026-09-09 08:25:36 -07:00
Zack Tanner 268ae984aa Remove legacy PPR code paths (#96868)
## Summary

`experimental.ppr` is deprecated, and Cache Components is now the only
internal path that enables partial prerendering. This makes the legacy
PPR renderer and its `prerender-ppr` work unit unreachable.

This removes that rendering path, the associated work-unit branches,
Next.js’s remaining integration with React’s deprecated
`unstable_postpone` API, the dead `__NEXT_PPR` client flag, and obsolete
legacy PPR tests.

Cache Components’ postponed-state and resume behavior remain unchanged.

<!-- NEXT_JS_LLM -->
2026-08-10 18:39:14 -07:00
Sebastian "Sebbie" Silbermann 6cc1049d4e Revert "Remove legacy PPR codepaths" (#95113) 2026-06-24 13:56:10 +02:00
Sebastian "Sebbie" Silbermann e7f4e336c0 Remove legacy PPR codepaths (#94955) 2026-06-22 19:21:10 +00:00
Hendrik Liebau c2bba0ea26 Revert legacy PPR removal (#90948)
This caused regressions. Apparently it was not a clean removal.
2026-03-05 23:15:44 +01:00
Jiwon Choi d52d9336d5 Clean up legacy PPR references in test fixtures (#90725)
Stacked on https://github.com/vercel/next.js/pull/90726

Migrate legacy PPR tests to Cache Components
2026-03-04 17:28:15 +00:00
Hendrik Liebau 9c5e3da9da Revert "refactor: consolidate PPR into cacheComponents architecture (#88243)" (#88421)
This reverts commit a85d888a77.

PR #88243 introduced deploy test regressions in the following test
suites:

-
`test/e2e/app-dir/segment-cache/prefetch-runtime/prefetch-runtime.test.ts`
- `test/e2e/app-dir/segment-cache/client-params/client-params.test.ts`
2026-01-12 14:10:51 +01:00
Wyatt Johnson a85d888a77 refactor: consolidate PPR into cacheComponents architecture (#88243)
### What?

Removes the `experimental.ppr` configuration flag and consolidates
Partial Prerendering (PPR) functionality into the `cacheComponents`
architecture.

### Why?

Having two separate systems (PPR flag and cacheComponents) created dual
code paths and complexity. PPR is now implicitly enabled when
cacheComponents is enabled, simplifying the codebase.

### How?

- Deleted `postpone.ts` and `ppr.ts` utility files
- Removed `PrerenderStorePPR` work unit type and all PPR-specific work
unit cases
- Removed React.unstable_postpone-based dynamic rendering logic
- Deprecated `experimental.ppr` config (kept for backwards
compatibility)
- Simplified build system to check only `cacheComponents` flag
- Updated tests to remove PPR-specific behavior expectations

This removes ~986 lines of code across 48 files.
2026-01-08 23:04:06 -07:00
Zack Tanner 85c3d20a91 [cache components]: move flag out of experimental (#85035)
This moves `experimental.cacheComponents` to a top level config. As part
of this, I disabled some tests in `build-output-prerender` that assert
on `cacheComponents` appearing in the experimental list. In a separate
PR, I'm going to show that Cache Components is enabled next to the
bundler info.

This also updates some docs pages to remove "experimental" language.
2025-10-18 14:13:44 -07:00
Wyatt Johnson d81ef2691c feat(breaking): Hard Deprecate PPR Configuration (#84280)
This hard deprecates the `experimental.ppr` configuration, requiring
users to opt-in instead via `experimental.cacheComponents`. This does
mean that the previous `experimental.ppr = "incremental"` will no longer
be supported.

NAR-433
2025-10-08 19:55:52 -06:00
Sebastian "Sebbie" Silbermann da2a87a25c Specify PPR test dimension via environment variable only (#74031) 2024-12-18 14:34:42 +01:00
Wyatt Johnson ddd9de497b [ppr] Stabilize Partial Prerendering Fallbacks (#71320)
This stabilizes Partial Prerendering Fallbacks (PFPR) so that when
Partial Prerendering (PPR) is enabled, so is PFPR.
2024-10-16 09:02:27 -06:00
Wyatt Johnson f4c1a406e4 Partial Fallback Prerendering (#68958)
This work introduces the new concept of **Partial Fallback Prerendering
(PFPR)**.

Traditionally, when a dynamic page needed to be routed to that wasn't
pregenerated, it required a render to generate even the first few bytes
of the static page itself. This resulted in slow page loads for pages
not frequently visited and a reduced Time to First Byte (TTFB) score on
Core Web Vitals (CWV).

PFPR takes advantage of the new systems of Partial Prerendering (PPR)
that allows the application to suspend at different points mid-render,
and resume it later. We mark any unknown parameter access as dynamic
access, and suspend the rendering up to the next suspense boundaries at
those points. Under ideal conditions (correctly placed `<Suspense />`
boundaries or `loading.jsx` files) this generates a static shell that
can be served to users as soon as the request hits Next.js, right out of
the static cache. This minimizes the TTFB for all requests, dynamic or
not for those pages that enable PPR. For example, the following page
would create a usable shell:

```jsx
// /app/users/[userID]/page.jsx
import { Suspense } from 'react'

function Profile({ params }) {
  const { userID } = params
  return <div>Hello {userID}!</div>
}

export default function ProfilePage({ params }) {
  return (
    <div>
      <h1>User Profile</h1>
      <Suspense fallback="Loading...">
        <Profile params={params} />
      </Suspense>
    </div>
  )
}
```

Due to the way that suspense works within React components, access of
params within the root page component would cause the whole page to
suspend. Thankfully, that's where the `loading.jsx` comes in handy.
Adding a `loading.jsx` at a segment will automatically wrap the
`page.jsx` with a suspense boundary, setting the contents of the root
`loading.jsx` as the fallback component to use for it. This lets you
maintain your existing style of accessing parameters at the root of the
components while also taking advantage of PFPR.

To enable this feature, you first need to enable both PPR and PFPR:

```js
module.exports = {
  experimental: {
    ppr: true,
    pprFallbacks: true,
  }
}
```

Once PFPR has stabilized with hosting providers, the experimental flag
will go away and it will become the default with the PPR flag.
2024-08-27 22:31:18 -07:00
Hendrik Liebau b8bf2c84b9 [ppr] Improve DX for static shell debugging in dev mode (#66806)
Users that experiment with PPR and might have seen #61798, or #62703, or
most recently #65483, may try the `__nextppronly=1` query param to debug
the static shell. This will lead to the following uncaught error and
blank page:

<img width="1045" alt="static shell debugging hydration error"
src="https://github.com/vercel/next.js/assets/761683/ed382d97-82ae-4a23-9930-bb4d4419e88e">

It might not be immediately obvious that javascript must be disabled to
see the static shell. To improve the DX in this scenario we can omit the
bootstrap script to skip hydration, and thus prevent the error. Then
debugging the static shell works even without disabling javascript in
the devtools.

<img width="1045" alt="static shell debugging without hydration"
src="https://github.com/vercel/next.js/assets/761683/57f6cb88-f5b4-473f-963f-7fda8c8e7f00">

In addition, we should add the closing body and html tags to the shell
so that a valid HTML document is returned.
2024-06-14 11:29:11 +00:00
Zack Tanner ac46ffe08f disable deploy tests for incompatible suites (#66776)
This disables tests that should not be run in a deployed environment,
because they use incompatible APIs or there's no reason to test them
outside of `next start`. Specifically disables for things like:

- Using `next.patchFile`, `next.renameFile`, etc.
- Attempting to use `next.cliOutput` to query runtime logs. When
deployed, these are only build-time logs.

[Latest Run](https://github.com/vercel/next.js/actions/runs/9483807368)
2024-06-12 07:38:02 -07:00
Wyatt Johnson e7694b3f3d [ppr] Enable static shell debugging in other environments (#65483)
To assist with the development and testing of the new partial
prerendering (PPR) paradigm, this introduces a stop-gap solution to let
us verify issues with pages in preview and production environments if
enabled. When a Next.js app is built and ran with the
`__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING=1` environment variable,
pages that have PPR enabled in production and preview environments can
have only their static shell served when accessed with a
`?__nextppronly=1` query parameter.

If your project is not using PPR, it will not change anything. If a page
is accessed in production or development with the query parameter but
PPR is not enabled, it will not change anything. Tests have been added
to validate that going forward.
2024-06-10 09:42:32 -07:00