Stabilize catchError and retry by removing unstable_ prefix (#94610)
### What? Promotes two experimental error-handling APIs to stable by dropping the `unstable_` prefix: - `unstable_catchError` → `catchError` (exported from `next/error`) - `unstable_retry` → `retry` (the prop Next.js injects into `error.js` / `global-error.js` boundaries and `catchError` fallbacks) ### Why? Both were introduced as `unstable_` in `v16.2.0` and are now stable as of `v16.3.0`. The experimental prefix should be removed from the stable surface. ### How? - Renamed the `next/error` export (`error.d.ts`, `error.js`, `src/api/error.ts`, `src/api/error.react-server.ts`) and the implementation in `client/components/catch-error.tsx`. - Renamed the framework-injected `retry` prop across `error-boundary.tsx`, `builtin/global-error.tsx`, the dev-overlay error boundary, and the `ErrorInfo` type. - Updated the RSC client-only export list in the SWC transform (`react_server_components.rs`) so importing `catchError` in a Server Component still produces the "only available in Client Components" error. - Updated the thrown error messages and their `errors.json` entries (codes 1138/1139), the TypeScript-plugin serialization-exemption rule, all affected tests, the rspack test manifests, and the docs. - Docs version-history tables keep the historical `unstable_` rows and add a `v16.3.0` row noting the rename to stable. This is a clean rename with **no** backward-compatible `unstable_` alias. ### Verification - Passed: pre-commit hooks (`prettier`, `eslint --fix`, `rustfmt`) on all 35 changed files. - Passed: repo-wide grep confirms no remaining `unstable_catchError` / `unstable_retry` outside the intended historical version-history rows. - In progress locally (covered by CI): `pnpm build-all` (native SWC still compiling on a fresh worktree), then `pnpm --filter=next types` and the targeted e2e suites (`app-dir/catch-error`, `app-dir/errors`, `rsc-build-errors`, typescript-plugin `client-boundary`). <!-- NEXT_JS_LLM_PR -->
Showing
This diff is collapsed.
Please
register
or
sign in
to comment