Commit Graph

1072 Commits

Author SHA1 Message Date
Joseph c22f05b94e docs: cache life rework (#85224)
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
2025-10-31 14:21:37 +01:00
Zack Tanner 2f052b16f6 fully remove clientSegmentCache flag (#85541)
Turning this flag off would have already caused client-side invariants
because we deleted all the old codepaths. This fully removes the
remaining plumbing that supported the flag.
2025-10-30 19:49:05 -07:00
Swarnava Sengupta 1b9eb60878 [docs] Fix a typo (#85492)
Fix a small typo
2025-10-29 21:22:32 -07:00
Gus Fune b1f455719d Refactor GTM implementation to support google tag gateway (#81011)
### What?

This PR refactors the Google Tag Manager implementation on
`@next/third-parties`, it rewrites the implementation of the script url,
params and types to allow `gtmId` to be optional when a script URL is
provided.

### Why?

Google released [Google Tag Gateway for
Advertisers](https://developers.google.com/tag-platform/tag-manager/gateway/setup-guide?setup=manual)
which allows first-party tracking on GTM. When running GTM using the
current implementation, it doesn't work because the `?id=` is hardcoded
into the implementation as it doesn't consider the possibility of tag
gateway or any other setup where the ID is already part of the url.

### How?

- Expanded the types
- Refactored the initialisation of the script URL
- Updated documentation relevant to GTM

Closes #81009

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2025-10-29 12:03:31 -07:00
Sebastian "Sebbie" Silbermann 1e53071f77 Allow inspecting dev server on default port with next dev --inspect (#85037)
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-10-29 17:19:19 +01:00
Joseph eee419eaf6 docs: revalidateTag requires second argument (#85284)
Closes: https://github.com/vercel/next.js/issues/85281
2025-10-29 14:44:30 +01:00
Joseph 0adb4986a0 docs: GET handler behavior under cache components (#85389) 2025-10-29 13:46:55 +01:00
Joseph 7f503bfe0f docs: Routes are wrapped w/ Activity in Cache Components (#85309) 2025-10-29 13:37:03 +01:00
Joseph ad6907a8a3 docs: example are incorrect async function exports only (#85453) 2025-10-29 09:12:46 +01:00
Jiwon Choi afbdae65c0 [CNA] Do not prompt for Turbopack (#85404) 2025-10-28 23:36:57 +01:00
Swarnava Sengupta abec161a19 Update Proxy docs (#85439)
Looks like `_next/data` is always matched to prevent accidental security
issues with protecting the page but not the data route. Documenting
using this PR
2025-10-28 15:17:25 -07:00
Zack Tanner b55e52f1bd docs: remove inaccuracies from use cache: private (#85425)
There are a lot of things in here that aren't quite fully fleshed out
yet (eg runtime prefetching) as well as some inaccuracies (eg `use
cache: private` is not required for runtime prefetching, it's just
another thing that _can_ be runtime prefetched).

This trims the doc down until we can focus on proper guidance.
2025-10-27 17:22:33 -07:00
Mike Dyer 68e60c33ca Fix grammatical errors in updating data documentation (#85067)
<!-- 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: JJ Kasper <jj@jjsweb.site>
2025-10-27 18:16:05 +00:00
jesuistuan 777b8fa227 docs: Fix typo in SEO section of loading.mdx (#85301)
The second “used” seems unnecessary.

<!-- 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 <joseph.chamochumbi@vercel.com>
2025-10-27 11:08:14 -07:00
Joseph 8cdd4eada7 docs: point out diff in serialization types for arguments and return values (#85338)
Answers, how come I can return JSX from cache components?
2025-10-27 17:30:04 +01:00
Joseph ec0d166105 docs: fix proxy matcher overflow (#85337)
Also closes: https://github.com/vercel/next.js/issues/85344
2025-10-27 17:29:13 +01:00
Jude Gao 69e19895e3 docs: simplify MCP guide to focus on next-devtools-mcp (#85353) 2025-10-27 11:13:51 -04:00
denesbeck d0d946620e docs: regexp removed from middleware config (#85343)
Closes https://github.com/vercel/next.js/issues/84307

It seems that the `regexp` prop is not currently supported in the
matcher object
(./packages/next/src/build/segment-config/middleware/middleware-config.ts
→ MiddlewareMatcherInputSchema). Adjusting docs accordingly.

---------

Co-authored-by: devjiwonchoi <devjiwonchoi@gmail.com>
2025-10-27 15:11:21 +01:00
Joseph a135a7d513 docs: link to MCP guide from upgrade (#85308) 2025-10-24 15:52:16 +02:00
Joseph 3a44c24c98 docs: typegen next-env.d.ts feedback (#85273)
Bringing back some info lost when next lint was removed, and accounting
for `isolatedDevBuild` in v16

---------

Co-authored-by: Ismael <ismael@vercel.com>
2025-10-23 19:50:54 +02:00
Arnab Sen 90a3b82d07 Update command to install babel-plugin-react-compiler as a devDependency (#85235)
Updated command to install babel-plugin-react-compiler as a
devDependency instead of as a dependency, mirroring React's instructions
- https://react.dev/learn/react-compiler/installation
2025-10-23 14:14:32 +00:00
Joseph d1b02c6d93 Docs/v16 feedback (#85259)
Co-authored-by: Rich Haines <hello@richardhaines.dev>
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
2025-10-23 14:18:43 +02:00
Joseph eebff81932 docs: add a note that cache components is opt-in near the top (#85245)
We do mention how to enable this feature, but a little note can go a
long way, specially highlighting that it is opt-in
2025-10-23 13:52:07 +02:00
Joseph 90e41cfb26 chore: cache components feedback (#85241)
Just a couple of mistakes
2025-10-22 22:44:47 +02:00
Jiwon Choi 8ede5d0165 docs: proxy runtime defaults to nodejs (#85204)
Proxy runtime defaults to nodejs and does not allow runtime config since
https://github.com/vercel/next.js/pull/85139
2025-10-22 13:29:54 -07:00
Wyatt Johnson 27a3fa71b6 docs: added use cache: remote docs (#85145) 2025-10-22 10:32:34 -07:00
Joseph 4b45979351 Docs/use cache feedback 2 (#85222)
- [x] Update Error
2025-10-22 16:35:44 +02:00
Joseph 0b9512280c docs: revalidateTag immediate expiration in Route Handlers (#85223)
Further precision to revalidateTag signature, and escape hatch for route
handlers w/ immediate revalidation
2025-10-22 15:39:40 +02:00
Joseph 5ce476a811 docs: stabilize apis in docs (#85219) 2025-10-22 14:12:17 +02:00
Joseph 4001cc9546 docs: use cache feedback (#85169) 2025-10-22 12:51:56 +02:00
Joseph 4cae094393 docs: cache components - introduction (#85196) 2025-10-22 12:41:45 +02:00
Joseph 56136287eb docs: create-next-app react-compiler and new prompts (#85213)
update the create-next-app options and prompts
2025-10-22 11:00:04 +02:00
Joseph 48bb490d63 docs: upgrade from 15 to 16 (#85176)
Co-authored-by: Ismael <ismael@vercel.com>
Co-authored-by: Jiachi Liu <inbox@huozhi.im>
2025-10-22 00:10:29 +02:00
Joseph 400b82cb45 docs: remove experimental_ppr route segment config (#85188)
Removed on v16
2025-10-21 20:57:10 +02:00
JJ Kasper 7a8019599e Update routes generation for build-complete (#85017)
## Summary

- Adds comprehensive route generation and normalization for
build-complete adapter hooks
- Enhances adapter output types with additional metadata fields
(`sourcePage`, `wasmAssets`, `pprChain`, `parentFallbackMode`)
- Improves middleware matcher handling and revalidation bypass logic
- Adds proper tracing for shared node dependencies across pages and app
router modules
- Includes `buildId` in adapter context for build identification

## Changes

### Route Generation
- Generates complete route manifests with processed regex patterns for
headers, redirects, rewrites, and dynamic routes
- Converts routes using `@vercel/routing-utils` for consistent
formatting
- Handles RSC routes (`.rsc` suffix) for app router pages
- Supports i18n locale-specific routes and data routes
(`/_next/data/[buildId]/...`)
- Properly handles static pages with mixed app/pages router setups

### Adapter Output Enhancements
- Added `sourcePage` field to all route outputs for tracking original
source files
- Added `wasmAssets` support for bundled WebAssembly files
- Added `pprChain` and `parentFallbackMode` to prerender outputs for PPR
support
- Enhanced middleware matchers to include processed source and regex
patterns
- Improved traced assets handling with separate tracking for pages vs
app router modules

### Middleware & Revalidation
- Standardized middleware matcher format with `source`, `sourceRegex`,
`has`, and `missing` fields
- Automatically adds `x-prerender-revalidate` header bypass to
middleware matchers
- Fixed middleware pathname to always be `/_middleware` for consistency

### Asset Tracing
- Traces shared node dependencies for bootstrapping (node-environment,
require-hook, etc.)
- Separate tracing for pages router and app router module contexts
- Improved trace ignores for unnecessary files (dev builds, webpack
internals, etc.)
- Better handling of instrumentation hook assets

### Bug Fixes
- Fixed RSC fallback handling for mixed app/pages router builds
- Improved 404/500 static page detection with locale support
- Better basePath normalization with trailing slash handling
- Fixed data route generation for getServerSideProps pages with i18n
2025-10-21 10:21:25 -07:00
Tim Neutkens 08d679c23d Docs: Explain Sass tilde import difference (#85041) 2025-10-21 18:44:47 +02:00
Jiachi Liu 30503c149b docs: mcp (#85010)
Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
2025-10-21 08:25:01 -07:00
Luke Sandberg daf8b06f68 [turbopack] Remove the canary icon from the cache components docs (#85149)
Its not canary anymore.
2025-10-20 20:11:44 -07:00
Jiwon Choi 2cc5f0227b Add Learn more docs to Middleware deprecation warning (#84711)
This PR adds an error doc for the Middleware deprecation warning that it
can refer to.

  - Explain why this error occurred
  - Provide migration guide
  - Explain the rationale for the renaming to Proxy

---------

Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-10-20 19:26:30 -07:00
Wyatt Johnson 3f8febe2b5 docs: Added documentation for "use cache: private" (#85038)
Added documentation for `use cache: private`.

---------

Co-authored-by: Joseph Chamochumbi <joseph.chamochumbi@vercel.com>
2025-10-20 18:03:45 -06:00
Delba de Oliveira ca7f57ee2d Docs: Add version history for next lint deprecation and update error message (#85100)
Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
2025-10-20 19:58:07 +00:00
Maxim 43eeb928e6 docs: Update to Zod v4 syntax (#84807)
### What?
Updated Zod syntax to v4 conventions in documentation examples.

### Why?
Zod 4 deprecates `message` parameter in favor of `error`, and string
format methods like `.email()` in favor of top-level functions like
`z.email()`.

### How?
- Replaced `{ message: '...' }` with `{ error: '...' }` 
- Changed `z.string().email()` to `z.email()`

---------

Co-authored-by: Maxim Andriushin <maksim.andriushin@gmail.com>
Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
2025-10-20 21:26:52 +02:00
Joseph ada92f761e docs: no switcher for TS only examples (#85109) 2025-10-20 20:01:30 +02:00
Delba de Oliveira 4955c5dd6b Docs: Add note on tag limits for cacheTag (#85106) 2025-10-20 14:40:07 +01:00
Delba de Oliveira 02c9a7ede4 Docs: Add --debug-build-paths next build option (#85097)
Related: https://github.com/vercel/next.js/pull/85052
2025-10-20 14:40:00 +01:00
Joseph 27862f0065 docs: experimentalClientMaxBodySize (#85105)
The experimental "nature" of the flag is reflected in the version
2025-10-20 15:11:38 +02:00
Tim Neutkens 0f09c40ac9 Turbopack: Better error for sassOptions.functions as it's unsupported (#85073)
## What?

Implements an error for the case where Turbopack is used with
sassOptions.functions.

Fixes #65241
2025-10-19 14:45:40 -07:00
Zack Tanner 1b949df737 [cache components] stabilize cacheLife profiles (#85050)
As part of stabilizing `cacheComponents`, `cacheLife` profiles should
also be accessible from a top-level config. This updates the
configuration, adds the warning, and updates relevant docs.
2025-10-18 18:50:00 -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
Jiwon Choi b4080311f4 [Breaking] Rename instrumentation onRequestError context.routeType from middleware to proxy (#85006)
Follow up on https://github.com/vercel/next.js/pull/84710,
`instrumentation` docs had `onRequestError` function's param
`context.routeType` has value of `'middleware'`. As it's a user-facing
value, update it to `'proxy'`.
2025-10-17 23:31:24 +02:00