107 Commits

Author SHA1 Message Date
Joseph bc1791dd7e Backport documentation fixes for v16.2 (#93804)
## Summary

Backports documentation fixes and improvements from canary to the
`next-16-2` branch.

### Included commits:
- eddbd54f90 docs: clarify that proxy/middleware matches static assets
by default (#92441)
- 43d1229d4c docs: clarify serverless runtime behavior for use cache
(#92232)
- 630d9052c6 docs: add note on React canary version to View transitions
guide (#92315)
- 08f6f62988 docs: note PPR default in cacheComponents reference
(#92378)
- 07182b567c docs: clarify cacheLife() cannot be called at module scope
(#92326)
- 7bb8e7de84 docs: add note on installing `server-only` in data security
guide (#92445)
- 6440b9e11b docs: update details about `unstable_retry()` behavior
(#91827)
- 246c5e1f5d docs: link updateTag from cacheTag reference (#92379)
- a99d7fd16e docs: native db drivers with sync queries (#92572)
- aef9105d1b docs: add Link transitionTypes version history (#92624)
- db1d2cc398 docs(cli): clarify that `--debug-build-paths` requires
route group folders in paths (#92618)
- 82f3f48880 docs: fix broken bun.sh Nextjs documentation link (#92698)
- 5a1598608e docs: add migration note for experimental cache flags to
cacheComponents (#92318)
- d1cf752c5d docs: draftMode alignment (#92794)
- ccc6d36578 docs: amends to preserving-ui-state guide (#92270)
- 44e3208add docs: link Activity guide from Cache Components migration
guide (#92571)
- 2217cbaa8c docs: add guide for displaying dates without hydration
flash (#92786)
- d233d05456 docs: remove broken error-handling overlay screenshot
(#93279)
- 356644ba06 Update 05-server-and-client-components.mdx (#93374)
- ae88a95b5e docs: clarify rendering flow in Server/Client interleaving
example (#93381)
- b4191904d8 docs: clarify proxy runtime history (#93467)
- e41fc92a76 docs: remove unreachable forms and mutations (#93509)
- 405a912968 docs: broken link from usePathname compat call out (#93528)
- 58ea3325f1 docs: escape literal triple-backticks in contribution guide
(#93584)
- d98ea7cc67 docs: clarify cacheTag limit - it is per call (#93768)
- 7988818441 docs: devIndicators with usage example (#93784)

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Joseph <icyJoseph@users.noreply.github.com>
Co-authored-by: MK <135491799+wwenrr@users.noreply.github.com>
Co-authored-by: wwenrr <wwenrr@users.noreply.github.com>
Co-authored-by: Aurora Scharff <66901228+aurorascharff@users.noreply.github.com>
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
Co-authored-by: Abhishek Mardiya <97448460+abhishekmardiya@users.noreply.github.com>
Co-authored-by: Jiwon Choi <devjiwonchoi@gmail.com>
Co-authored-by: Hamed <55133282+hamedniroomand@users.noreply.github.com>
Co-authored-by: Jimmy Lai <laijimmy0@gmail.com>
Co-authored-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>
Co-authored-by: Zana Abdi <zana.abdi@hotmail.com>
Co-authored-by: Armando A. Calderón <armandoandrecalderon@gmail.com>
2026-05-13 00:48:44 +02:00
JJ Kasper eee3f524e9 backport: Move expanded adapters docs to API reference (#92115) (#92129)
## 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

<!-- 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 #

-->
2026-03-31 08:56:27 -07: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
gsmt c10d258482 Add @sparticuz/chromium-min to default server externals (#81309)
This package needs to be externalized to have it's wasm dependencies
traced properly for node runtime so this adds it to the default list.
2025-07-09 14:27:20 -07:00
JJ Kasper d88e313cf7 Add htmlrewriter to default server externals (#80819)
This package needs to be externalized to have it's wasm dependencies
traced properly for node runtime so this adds it to our default list.

x-ref: [slack
thread](https://vercel.slack.com/archives/C07LQPFERGF/p1750713377659779?thread_ts=1750693981.162239&cid=C07LQPFERGF)
2025-06-23 21:57:34 +00:00
Delba de Oliveira 2e2ee08b60 Docs IA 2.0: Delete routing section, add BFF guide, polish getting started (#80365)
Closes:
https://linear.app/vercel/issue/DOC-4686/clean-up-routing-section
Redirects: https://github.com/vercel/front/pull/47151

---------

Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-06-16 13:42:20 +01:00
Delba de Oliveira bbaa164737 Docs IA 2.0: Move examples to middleware.js API reference (#80363)
Part of:
https://linear.app/vercel/issue/DOC-4686/clean-up-routing-section
2025-06-10 08:00:17 -05:00
Delba de Oliveira 24434f18db Docs: Add Data Security Guide (#80249)
Closes: https://linear.app/vercel/issue/DOC-4678/guide-data-security

Please merge this PR first: https://github.com/vercel/next.js/pull/80242

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
2025-06-10 06:52:38 -05:00
Delba de Oliveira 083b924c01 Docs: Linking and Navigating Page (#80103)
Closes:
https://linear.app/vercel/issue/DOC-4718/linking-and-navigating-page

This PR: 

- Adds a linking and navigating page to getting started: 
- Introduces how navigation works and the built-in Next.js optimizations
(prefetching, client-side transitions, etc)
   - Discusses what can cause slow transitions and how to optimize it. 
- Updates the loading.js API reference

Redirects: 
- https://github.com/vercel/front/pull/46788

---------

Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
2025-06-06 10:37:16 +01:00
Delba de Oliveira 63ed70ba41 Docs IA 2.0: Move Redirects page to guides (#79447)
Closes: https://linear.app/vercel/issue/DOC-4695/guide-redirects
Redirects: https://github.com/vercel/front/pull/46041
2025-05-27 12:20:11 +01:00
Delba de Oliveira f87fee7b28 Docs IA 2.0: Update template.js API reference (#79490)
Merge template.js information from BYA and update API reference to
follow the convention.

Please merge this PR first: https://github.com/vercel/next.js/pull/79453
Closes:
https://linear.app/vercel/issue/DOC-4696/routing-section-layouts-and-templates
2025-05-27 10:30:17 +01:00