115 Commits

Author SHA1 Message Date
Joseph 68cfe37506 docs: remove PPR adapter page from Pages Router (#96316)
Do not mirror PPR for Pages Router, and other adjustments.
2026-07-29 10:03:49 -04:00
Joseph ec76f095ab docs: document query-only href resolution and fix with-vercel-blob (#96280)
Closes: https://github.com/vercel/next.js/issues/96204

The fix to manage rewrites introduced in
https://github.com/vercel/next.js/pull/82236 PR made it so that,
push/replace without explicit pathname broke the `as` pattern, for
example in `with-vercel-blob`.

Also documents the resolution rule in the `useRouter` API reference.
2026-07-27 17:57:37 -04:00
Joseph a37068f525 docs: note default error/not-found UI follows OS color scheme, not app theme (#95673)
Guidance for those who don't customize their own not-found page, pages
router's 404, etc, because the defaults honor the system style, not any
app-level theme settings.
2026-07-10 15:40:39 +02:00
Tim Neutkens a249dcbcee (TypeScript 7 Support) Add experimental TypeScript CLI backend (#95639)
## Summary

- add `experimental.useTypeScriptCli` so projects can explicitly run
their local `tsc` during `next build`, including TypeScript 7 while the
legacy JavaScript API is unavailable
- preserve the TypeScript API backend as the default, with TypeScript
6-compatible dependency installation and actionable TypeScript 7
migration guidance
- load effective compiler metadata through `tsc --showConfig`, preserve
inherited path origins, stream native diagnostics, redirect incremental
state, and forward worker termination to the compiler process tree
- document the experimental behavior and cover TypeScript 6/7, both
bundlers, raw diagnostics, full-project checking, dependency selection,
and cleanup

## Demo

```
pnpm build

> cna@0.1.0 build /Users/timneutkens/projects/sandbox/cna
> next build

▲ Next.js 16.3.0-canary.81 (Turbopack)
✓ Running next.config.ts took 23ms
- Cache Components enabled
- Experiments (use with caution):
  ✓ useTypeScriptCli

  Creating an optimized production build ...
✓ Compiled successfully in 3.9s
  Running TypeScript ...
app/page.tsx:8:3 - error TS2322: Type 'string' is not assignable to type 'number'.

8   return count++ + "abc";
    ~~~~~~


Found 1 error in app/page.tsx:8

Failed to type check.

Next.js build worker exited with code: 1 and signal: null
 ELIFECYCLE  Command failed with exit code 1.
```


## Verification

- `pnpm test-start-turbo
test/production/app-dir/typescript-cli/typescript-cli.test.ts`
- `pnpm test-start-webpack
test/production/app-dir/typescript-cli/typescript-cli.test.ts`
- `pnpm test-start-turbo
test/production/ci-missing-typescript-deps/index.test.ts`
- `pnpm test-dev-turbo
test/development/typescript-native-preview/index.test.ts`
- `pnpm test-start-turbo test/production/typescript-basic/index.test.ts`

<!-- NEXT_JS_LLM_PR -->
2026-07-09 18:43:12 -07:00
Marco Dotzler 1092d21556 docs: Update FormEvent to SubmitEvent in form handling example (deprecated in React 19.2.10+) (#95453) 2026-07-03 16:52:46 +02:00
Ayodele Samuel Adebayo 22fc63da72 docs: fix typos and links (#92541)
This PR cleans up small documentation and error-page issues: correct
TypeScript spelling where it was written as “Typescript”, use the proper
GitHub label in links, fix the MDN URL for `Map.prototype.values` in the
middleware upgrade guide.

No runtime or API behavior changes.
2026-05-13 10:25:23 +02:00
Joseph 8f68464f9a docs: remove unreachable forms and mutations (#93509)
Remove
/02-pages/03-building-your-application/03-data-fetching/03-forms-and-mutations.mdx
- which is not reachable from the site, because it has been replaced by
the https://nextjs.org/docs/pages/guides/forms guide.
2026-05-06 09:34:01 +02:00
christopherkindl a6782fa620 docs: remove broken error-handling overlay screenshot (#93279)
The Cloudinary URL for the overlay screenshot

(`assets.vercel.com/image/upload/v1645118290/docs-assets/static/docs/error-handling/overlay.png`)
404s. The line above it had a `{/* TODO UPDATE SCREENSHOT */}` comment,
so this was already flagged as known-stale.

Removes the broken image and its `"Here is an example of an overlay:"`
intro line. The paragraph above still explains what the overlay is, so
the page reads cleanly without the screenshot. If someone produces a
fresh screenshot later, restoring the markdown with an updated URL is a
one-line change.

### Affects

-
`nextjs.org/docs/pages/building-your-application/configuring/error-handling`
(stable, on next stable cut)
-
`nextjs.org/docs/canary/pages/building-your-application/configuring/error-handling`
(canary)

### Older versions

The same broken URL is present in v13/v14/v15 of the docs (synced from
the corresponding release tags). Backport is a separate call for
maintainers.
2026-04-27 14:29:50 +02:00
JJ Kasper 0cb1547d59 Move expanded adapters docs to API reference (#92115)
## Summary
- move adapter implementation docs from
`app/api-reference/config/next-config-js/adapters` to
`app/api-reference/adapters`
- keep `adapterPath` as an entry page that points to the new adapters
section
- add matching Pages Router pointer docs under
`pages/api-reference/adapters`
- update existing docs links that referenced old `adapterPath#...`
anchors to the new adapters routes
2026-03-30 12:54:56 -07:00
Tim Neutkens 89871864ed Rename /_next/webpack-hmr to /_next/hmr (#91415)
## What

Rename the HMR WebSocket path from `/_next/webpack-hmr` to `/_next/hmr`.

## Why

The `webpack-hmr` name is a leftover from when webpack was the only
bundler. Now that Turbopack is the default bundler for both `next dev`
and `next build`, the path name is misleading. The generic `/_next/hmr`
better reflects that this endpoint is bundler-agnostic.

## Changes

- **Client source** (`page-bootstrap.ts`, `web-socket.ts`): updated the
WebSocket connection path
- **Server** (`router-server.ts`): updated the HMR request detection
path
- **Turbopack** (`turbopack-dev-server/src/lib.rs`): updated the
fallback WebSocket path check
- **Tests**: updated all test files referencing the old path
- **Docs** (`version-12.mdx`): added a note that the path was renamed to
`/_next/hmr` in Next.js 16, while keeping the original v12 examples
intact
2026-03-19 16:39:45 +01:00
Tim Neutkens 97f420911d Move adapterPath from experimental to stable top-level config (#91535)
## Move `adapterPath` from experimental to stable

Graduates `adapterPath` from `experimental.adapterPath` to a top-level
`NextConfig` option, following the same pattern used for
`cacheHandlers`, `cacheComponents`, `typedRoutes`, and other options
that moved out of experimental.

### Changes

- **Type definition** (`config-shared.ts`): Added `adapterPath` to
`NextConfig` interface, marked `ExperimentalConfig.adapterPath` as
`@deprecated`, moved default value to top-level in `defaultConfig`,
updated `NextConfigRuntime` and `getNextConfigRuntime`
- **Zod schema** (`config-schema.ts`): Added `adapterPath` to top-level
`configSchema`
- **Backward compat** (`config.ts`): Added
`warnOptionHasBeenMovedOutOfExperimental` call so existing
`experimental.adapterPath` configs still work with a deprecation
warning, updated `applyModifyConfig` to read from `config.adapterPath`
- **Runtime references**: Updated `build/index.ts`, `app-page.ts`,
`app-route.ts`, `pages-handler.ts` to use `config.adapterPath` /
`nextConfig.adapterPath`
- **Tests**: Updated 4 test fixture `next.config` files
- **Docs**: Updated app router doc (removed `version: experimental`
frontmatter, top-level config example), pages router doc title, and v16
upgrade guide
2026-03-17 23:28:08 +01:00
Delba de Oliveira c2b4c0815c Unify caching story across the docs (#90149)
This PRs unifies the caching story across the docs, making Cache
Components the happy path, while still providing guidance to users in
the old model. However, instead of explaining the old model and its
caching layers, we've created a new guide focusing on what APIs to use
and when.

This follow-up PR aligns terminology across the docs:
https://github.com/vercel/next.js/pull/90589

## IA updates

Getting Started section: 

- Improves Getting Started progression:
- **Before:** CC → Fetching Data → Updating Data → Caching and
Revalidating (old and new model mixed)
- **After:** Fetching Data (Dynamic) → Mutating Data (Dynamic) → Caching
with CC (Prerendering) → Revalidating with CC.
- New: `caching.mdx` (CC-first)
   - Structure: 
      - Enabling Cache Components
      - Data vs UI-level caching
      - Working with request time APIs
      - Passing request values to cached functions
      - Working with non-deterministic operations
      - Working with synchronous operations
      - How rendering works (PPR and static shell story)
- New: `revalidating.mdx` (CC-first)
   - Explains how to use `cacheLife` and `cacheTag`

Guides Section: 

- New: `caching-and-revalidating.mdx` (Previous Model)
- For users who are not using CC, includes `fetch` options and route
segment config
- Moves route segment config options that don't apply to CC from API
reference to this guide (for easy archiving in the future).
- New: `migrating-to-cache-components.mdx` (WIP)
- Del: `caching.mdx` 😌 

## Terminology

We should remove caching layers from the docs. Users only needed to be
exposed to them when they were configured independently, but the new CC
APIs work across layers.

To make it easier to review this PR, I'm consolidating terminology and
fixing broken links in a new PR:
https://github.com/vercel/next.js/pull/90589

---------

Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
2026-03-03 13:14:24 +00:00
Mary Lavanitha d13d1ba23b docs: improve form guide consistency and validation examples (#90361)
### What?
Small improvements to the Forms guide for consistency and clarity.

### Why?
Some examples didn’t fully match the recommendations in the guide (e.g.
HTML validation), and there was a minor inconsistency between
`event.target` and `event.currentTarget`. This update keeps the examples
aligned and easier to follow.

### How?
- Added `required` to relevant input examples  
- Standardized usage of `event.currentTarget`  
- Made minor wording refinements for clarity

---------

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
2026-02-24 10:45:04 +01:00
Andrew D'Amelio 40b9243594 docs: fix broken blockquote formatting in API Routes page (#89966)
The second and third bullet points in the 'Good to know' callout were
incorrectly placed outside the blockquote, breaking the visual grouping
on the rendered documentation page.

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->

Co-authored-by: Andrew Damelio <andrewdamelio@users.noreply.github.com>
Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
2026-02-14 01:31:20 +01:00
Joseph 6627734522 docs: add deploymentId config and clarify encryption key for self-hosting (#89795)
Closes:
https://linear.app/vercel/issue/DOC-3953/encryption-keys-in-server-actions,
https://linear.app/vercel/issue/DOC-4975/next-server-actions-encryption-key-and-deploymentid

Closes https://github.com/vercel/next.js/discussions/88327

---------

Co-authored-by: Allen Zhou <46854522+allenzhou101@users.noreply.github.com>
2026-02-12 16:33:39 +01:00
Joseph c5c469926f docs: Move browserToTerminal into logging (#88901)
`browserToTerminal` stabilizes `browserDebugInfoInTerminal` - since it
lives under logging, let's remove the page and redirect to logging w/
fragment
2026-02-12 01:08:32 +01:00
Pavan Shinde 0fca1fa062 docs: replace 'can not' with 'cannot' (#89354) 2026-02-02 17:07:02 +00:00
Jiachi Liu f1a047fd80 IsolatedDevBuild flag removal (#89167)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: jiachi <jiachi@vercel.com>
2026-01-29 15:00:12 +01:00
Tim Neutkens 304940e987 docs: add useSearchParams and useParams documentation for Pages Router (#88429)
## Description

This PR adds dedicated documentation pages for `useSearchParams` and
`useParams` hooks in the Pages Router documentation.

### Changes

- Added
`docs/02-pages/04-api-reference/03-functions/use-search-params.mdx`
- Added `docs/02-pages/04-api-reference/03-functions/use-params.mdx`

### Why

Both `useSearchParams` and `useParams` from `next/navigation` work in
the Pages Router, but this was not well documented. The only mention was
a brief note in the App Router docs and a migration section in the Pages
Router `useRouter` docs.

### What's Documented

For both hooks:
- Basic usage with the fallback UI pattern for handling `null` during
pre-rendering
- Return values and behavior differences from App Router
- Usage with `getServerSideProps` (where params are immediately
available)
- Examples for sharing components between App Router and Pages Router

For `useParams` specifically:
- Comparison with `router.query` (which includes both dynamic params and
query string params)

### Related Test

The existing test at `test/e2e/app-dir/params-hooks-compat` validates
that these hooks work in both routers.
2026-01-14 16:15:51 +01:00
Delba de Oliveira bfeedb070a Guide: Update Optimizing Package Bundling to include new Bundle Analyzer (#87246)
This PR adds instructions on how to run and navigate the new turbopack
bundle analyzer to the existing [Optimizing package bundling guide
](https://nextjs.org/docs/app/guides/package-bundling).
Todo: 
- [x] Embed video
- [x] Add image for import chain

---------

Co-authored-by: Luke Sandberg <lukesandberg@users.noreply.github.com>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
Co-authored-by: Rich Haines <hello@richardhaines.dev>
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
2025-12-19 16:21:14 +00:00
Niklas Mischkulnig 3bb0bcbf82 Add pino-related packages to server-external-packages (#86884) 2025-12-05 22:53:56 +01:00
Yiming Cao 4a8eeab2fc Add "@zenstackhq/runtime" to server-external-packages.json (#54829)
### What?

[ZenStack](https://github.com/zenstackhq/zenstack) is a toolkit built
above Prisma ORM for adding access control and other features. This
change adds one of its packages "@zenstackhq/runtime" to the default
list of "serverComponentsExternalPackages".

### Why?

The package is frequently used in Next.js route handlers and results in
false-positive errors with Next.js's bundler (likely caused by
dynamically `require` modules).

### How?

Add the package to the default external packages list.

---------

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2025-11-28 12:37:43 +01:00
Ben b43fe3542b Add alinea to server-external-packages.json (#55006)
### What?

Adds `@alinea/generated` to the external package list

### Why?

[`Alinea`](https://github.com/alineacms/alinea) generates this package
at build time and it should not end up in a cache (much like the
`@prisma/client` package)

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2025-11-27 17:28:00 +01:00
Muhammed Al-Dulaimi 88d774f9b5 docs: fix getInitialProps execution behavior during navigation (#86387)
Closes https://github.com/vercel/next.js/issues/86386

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->

---------

Co-authored-by: Joseph <sephxd1234@gmail.com>
Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
2025-11-24 12:58:42 +00:00
Niklas Mischkulnig 10e0828fb9 Use JSONC for default server-external-packages (#86252)
So that we can then use comments to track a reason why we have added packages to this list.
2025-11-21 11:45:39 +01:00
Kazi Mahbubur Rahman 1dd580dad8 docs: add example for enabling both AVIF and WebP image formats for better image optimization (#86191)
## Title
docs: add example for enabling both AVIF and WebP image formats

## Description

### What?
This PR enhances the image component documentation by adding examples
showing how to enable both AVIF and WebP image formats together in
`next.config.js`. It also updates the `image-component` example to
demonstrate this configuration.

### Why?
Currently, the documentation only shows examples for:
- WebP only (default): `formats: ['image/webp']`
- AVIF only: `formats: ['image/avif']`

However, many developers want to enable both formats together to:
- Prefer AVIF for browsers that support it (better compression, ~20%
smaller files)
- Fall back to WebP for broader browser compatibility
- Maximize image optimization across different browsers

This configuration is a best practice but wasn't clearly documented with
an example.

### How?
- Added example configuration `formats: ['image/avif', 'image/webp']` to
App Router image component documentation
- Added the same example to Pages Router (legacy) image component
documentation for consistency
- Updated `examples/image-component/next.config.js` to demonstrate the
configuration
- Added clarification that the order matters - Next.js uses the first
format in the array that the browser supports

### Changes Made
- `docs/01-app/03-api-reference/02-components/image.mdx` - Added AVIF +
WebP example
- `docs/02-pages/04-api-reference/01-components/image-legacy.mdx` -
Added AVIF + WebP example
- `examples/image-component/next.config.js` - Added formats
configuration

### Testing
- [x] Documentation changes only - no code changes
- [x] Verified examples are syntactically correct
- [x] Checked that formatting follows Next.js documentation guidelines

### Checklist
- [x] Run `pnpm prettier-fix` to fix formatting issues (if applicable)
- [x] Documentation follows the docs guidelines
- [x] Changes are clear and helpful for developers

---------

Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
2025-11-20 23:27:07 +01:00
Jiwon Choi bc59f210b0 docs: Deprecation of Middleware (#84710)
This PR removes middleware docs and adds a "Migration to Proxy" section
to the Proxy docs, which explains the rationale for the renaming to
Proxy and provides a migration guide.

Did not remove `middleware-upgrade-docs` as it's an upgrade doc from the
legacy middleware.

Below are untouched as they need codebase changes:

- `instrumentation` docs - `onRequestError` has `context.routeType` as
`'middleware'`
- `adapterPath` docs - has `MiddlewareMatcher` type example
- `ProxyConfig` - has a user-facing `MiddlewareMatcher` type

---------

Co-authored-by: Joseph Chamochumbi <joseph.chamochumbi@vercel.com>
2025-10-17 20:03:13 +02:00
Jiwon Choi 71ce95dffa docs: Replace Middleware docs to Proxy (#84709)
> [!NOTE]
> Best reviewed by each commit for better diff view.

This PR clones the Middleware docs for Proxy and removes the Middleware docs.

Did not clone the list of docs:

- `errors/middleware-upgrade.mdx` - It's a middleware upgrade guide from v12.2
- `errors/beta-middleware.mdx` - It's an error when using middleware before v12.2
- `errors/returning-response-body.mdx` - Legacy behavior from versions < v12.2
2025-10-17 16:13:26 +02:00
Joseph 332aaf3939 docs: getting started installation and next lint removal (#84781)
- [x] verify rendering of the changes

Also addressing: #84772

---------

Co-authored-by: Jiwon Choi <devjiwonchoi@gmail.com>
2025-10-17 15:39:21 +02:00
Zack Tanner b2ce9dd9c3 tweak middlewareClientMaxBodySize handling (#84712)
This ensures we captured `middlewareClientMaxBodySize` in the config
schema and rather than triggering a hard error, it will buffer up to the
limit.
2025-10-09 17:10:41 -07:00
brock-statsig 954d40be14 add Statsig Node Core package to Server External Packages (#84157)
### What?
Statsig is a popular AB Testing/ Feature Flagging solution to use in concert with Next.js. Today, their newest Server SDK doesn't play nicely with Next as its build around a Rust library, which doesn't play nice with webpack and causes build issues.

### Why?
This'll remove a step for Statsig/Next developers having to troubleshoot and add @statsig/statsig-node-core to serverExternalPackages themselves.

### How?
Added to the list published here: https://nextjs.org/docs/app/api-reference/config/next-config-js/serverExternalPackages
2025-10-09 14:55:05 +02:00
Steven 600238f0b6 breaking(next/image)!: remove 16px from default images.imageSizes config (#84647)
We took a look at unique Next.js projects that have one or more requests
for a specific image size and here are the findings as seen from the
Image Optimization API:

- `w=16` 4.2%
- `w=32` 17.1%
- `w=48` 21.4%
- `w=64` 22.6%
- `w=96` 25.8%
- `w=128` 29.5%
- `w=256` 46.5%
- `w=384` 35.1%
- `w=640` 57.2%

Only 4.2% of Next.js projects ever made a request to a 16px width image.
This is low enough to remove from the default configuration so that all
other projects can benefit from reduced html
[srcset](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/srcset)
and fewer variations exposed from the backend API.

You might think that this means few developers are using `<Image
width={16} />` but it probably means that most displays nowadays use
devicePixelRatio 2 meaning that specifying a 16px image width will
actually fetch the 32px width to ensure it won't looking blurry on your
retina display.

BREAKING CHANGE: this is technically a breaking change but it won't
cause apps to stop working, its just 4% of them may have some requests
serve a 32px image instead of 16px. Those apps can of course opt in by
changing their `images.imageSizes` config back to allowing 16.
2025-10-09 14:31:58 +02:00
Jiwon Choi 4f19d01c52 docs: experimental.isolatedDevBuild (#84656)
This doc is mainly to provide the users with information on how to opt
out of this feature. We could later remove these docs and the option
when the need to opt out is low.

---------

Co-authored-by: Joseph Chamochumbi <joseph.chamochumbi@vercel.com>
2025-10-09 01:22:19 +02:00
Jiwon Choi ab09e87861 Reapply "[Breaking] Remove deprecated publicRuntimeConfig and serverRuntimeConfig (#83944)" (#84167) (#84637)
In addition to reapplying #83944, removed added tests and warnings from
https://github.com/vercel/next.js/pull/84168
2025-10-08 21:41:04 +02:00
Steven b41b737b24 feat(next/legacy/image)!: deprecate and warn on next/legacy/image usage (#84622)
`next/legacy/image` was introduced in Next.js 13 as way to allow
developers to upgrade from 12 to 13 with minimal effort.

Now that its been 3 years, its time to deprecate `next/legacy/image` in
Next.js 16 so we can remove it in a future version.

This will print a warning the first time the component is used.
2025-10-08 04:11:56 +00:00
JJ Kasper c0a7c84256 Add documentation for experimental adapters handling (#83737)
This adds initial documentation for the new adapter interface initially
outlined in this RFC https://github.com/vercel/next.js/discussions/77740

---------

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
Co-authored-by: Zack Tanner <1939140+ztanner@users.noreply.github.com>
2025-10-07 04:44:38 +00:00
Brian Lou c781f40bd1 Add gt-next to i18n list (#84396) 2025-10-02 14:15:05 -07:00
Jiwon Choi 2318b5e2c0 docs: Remove AMP docs (#84357)
Stacked on https://github.com/vercel/next.js/pull/84312

Removes the AMP docs, which is no longer supported.
2025-09-30 15:21:52 +02:00
Jiwon Choi aee02f850c Revert "[Breaking] Remove deprecated publicRuntimeConfig and serverRuntimeConfig (#83944)" (#84167)
This PR reverts #83944 as it was missing a deprecation warning in the
app, which is easy to miss for the users.
2025-09-24 10:21:16 +02:00
Steven 0f14e5333f BREAKING CHANGE!: bump default images.minimumCacheTTL from 1 min to 4 hours (#84105)
We have found many Next.js users are confused why images keep
revalidating so frequently (increasing cpu and cost).

The reason is usually that their upstream source images are missing the
`cache-control` header and thus fallback to the 60 second revalidation
default. This its not a great default since most images don't change
frequently.

This PR is a breaking change to bump the `images.minimumCacheTTL` config
from 60 (1 min) to 14400 (4 hours).

Why 4 hours? Because its long enough to take advantage of the durable
cache, but short enough that changing or deleting the upstream src image
will take effect on the same day.

For advanced use cases where images are changing frequently, developers
can change this behavior back by reducing `images.minimumCacheTTL` to a
lower value.
2025-09-23 10:49:34 -04:00
Benjamin Woodruff df29b988c2 docs: Fix the title/path of the turbopack page on pages router (#84001)
This option was renamed/stabilized from `experimental.turbo` to `turbopack` in 15.3.

The app router page title/path was correct, but pages router had the wrong thing.

Let me know if I should add a redirect for this somewhere?
2025-09-22 21:47:08 -07:00
Jiwon Choi 9ee864e34c [Breaking] Remove deprecated publicRuntimeConfig and serverRuntimeConfig (#83944)
This PR removed the deprecated runtime configs.

https://github.com/vercel/next.js/blob/74b226fe4afc7149901affc3c005476e9e592315/docs/02-pages/04-api-reference/04-config/01-next-config-js/runtime-configuration.mdx#L6-L8

This way, we can use the serialized next config for the prod server.
2025-09-22 20:11:58 +02:00
Aymeric PINEAU 721def6b58 Update next-intlayer reference in i18n doc (#83761)
[`next-intlayer`](https://intlayer.org/doc/environment/nextjs) is an
i18n library that adopts a per-component approach to manage multilingual
content in a next.js application.

### Changes
- Fix doc related to page-router documentation,
- And add App Router realted doc.

Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
2025-09-15 16:09:42 +02:00
우혁 4a3ea6a20d docs: change API route example file extension to .ts and add JS example with switcher prop (#83044)
## For Maintainers

### What?
Changed the API route example in the documentation to use `.ts` file
extension for the TypeScript example since it uses TypeScript types.
Added a JavaScript example with `.js` extension using the `switcher`
prop to provide both TypeScript and JavaScript variants in the docs.

### Why?
The existing example used a `.js` extension but included
TypeScript-specific type annotations which is inconsistent and could
confuse users.
Providing both TypeScript and JavaScript examples improves clarity and
usability, catering to a broader audience.

### How?
- Updated the filename in the TypeScript example code block to
`pages/api/hello.ts`.
- Added a parallel JavaScript example code block with
`pages/api/hello.js` using the `switcher` property.
- Ensured both examples show equivalent handler logic with and without
type annotations.

---------

Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
2025-08-29 16:59:30 +02:00
Joseph 533bcd1485 docs: Route props helpers, typegen and next lint deprecation (#82784)
As this lands and people learn about the new Route Props helpers, I
think we will have this period where the TypeScript snippets show the
manual typing, but in key places we introduce the helpers usage. We can
then follow up updating all TypeScript snippets showing a page, layout
or route, to use these.

---------

Co-authored-by: Ben Gubler <nebrelbug@gmail.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2025-08-19 14:32:52 -07:00
Jam Balaya 3c9c995985 docs: fix typos (#82503)
## Summary

Fix typos and spelling errors in various MDX documentation files to
improve clarity and consistency.

Documentation:
- Standardize 'cacheable' spelling across self-hosting guide
- Correct 'potentionally' to 'potentially' in image component references
- Fix 'unecessary' to 'unnecessary' in use-link-status guide

### Improving Documentation

- [x] Run `pnpm prettier-fix` to fix formatting issues before opening
the PR.
- [x] Read the Docs Contribution Guide to ensure your contribution
follows the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
2025-08-14 00:28:28 +02:00
Zack Tanner 2bca1fde21 [Deprecation Warnings]: add amp deprecation warning (#82551)
We are dropping amp support in an upcoming major. This adds a warning
for using these configuration options and updates the docs with the
warning.

---------

Co-authored-by: Sebastian "Sebbie" Silbermann <sebastian.silbermann@vercel.com>
2025-08-12 06:53:39 -07:00
Kit Foster e30dd09f29 Add path to Image documentation (#82329)
<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change


### How?

Closes NEXT-
Fixes #

-->

### What?

Add the `path` field to the App Router
https://nextjs.org/docs/app/api-reference/components/image and Pages
Router https://nextjs.org/docs/pages/api-reference/components/image
docs. This field is valid for both, and currently it's use is hidden in
the code.

### Why?

Allow people to find and use the field as it is useful for prefixing the
`/_next/image` path.

---------

Co-authored-by: Steven <steven@ceriously.com>
2025-08-08 07:41:22 -07:00
Joseph a38db346db Docs: Add more info about TW and TW 3 option (#82203)
Closes: https://linear.app/vercel/issue/DOC-4862/tailwind-css-modules

---------

Co-authored-by: Rich Haines <hello@richardhaines.dev>
2025-08-06 20:24:25 +02:00
Chad M Fennell d0b0cf0fbe Grammar fix on forms.mdx (#82209)
grammar nit: "an API" is singular

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2025-07-30 13:21:46 -07:00