- 19 Nov, 2025 16 commits
-
-
nextjs-bot authored
-
Benjamin Woodruff authored
`unrs-resolver`'s postinstall script is only needed for legacy versions of npm, so it's safe to ignore: https://github.com/unrs/unrs-resolver/issues/193#issuecomment-3295510146 Without this, bun blocks the postinstall script (okay) and logs a warning (not ideal, confusing to end users). This prevents it from running and suppresses the warning. This matches what we now do in `pnpm` (https://github.com/vercel/next.js/pull/83168) but for `bun`. Context: - https://vercel.slack.com/archives/C03KAR5DCKC/p1763570835510729 - https://vercel.slack.com/archives/C06DNAH5LSG/p1763580178004169 ## Before  ## After 
-
nextjs-bot authored
-
Jiwon Choi authored
### Why? When Proxy self-references itself, e.g., `__filename`, it is traced to the NFT file. However, since Next.js renames 'proxy.js' to 'middleware.js' during webpack build, the files in NFT will differ from the actual outputs. This can cause a problem when verifying the NFT. Current Behavior: https://github.com/vercel/next.js/actions/runs/19483162554/job/55760669267?pr=86214#step:34:91 ### How? Therefore, also rename the self-reference of `'proxy.js'` in `middleware.js.nft.json` to `'middleware.js'`. I don't expect other modules to be referencing the build output of Proxy, that is not recommended. Closes NEXT-4777 Closes NAR-518 --------- Co-authored-by:
Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com>
-
Sebastian "Sebbie" Silbermann authored
-
Sebastian "Sebbie" Silbermann authored
-
Hendrik Liebau authored
This PR introduces the `ServerReferenceExport` struct to replace `(Ident, Atom, Atom)` tuples for tracking exported server references. It also replaces the `Vec<(Atom, Atom)>` `export_actions` with an `FxIndexMap` for `reference_ids_by_export_name`, enabling more efficient lookups in upstack PRs. There are no functional changes.
-
Vercel Release Bot authored
This auto-generated PR updates the production integration test manifest used when testing Rspack.
-
xusd320 authored
These codes are outdated.
-
Sebastian "Sebbie" Silbermann authored
-
Zack Tanner authored
When navigating away from a page due to an MPA navigation or browser refresh, we were aborting any pending RSC requests. However, in the case where the abort was due to an MPA navigation, the browser would restore the execution context via the built-in bfcache, and the aborted fetch would cause React to get in an errored state, leading to "BodyStreamBuffer was aborted". Rather than aborting the pending requests, we instead mark that we would have aborted due to the page unloading. That still solves the original reason the flag was added (suppressing the fetch errors that get logged) Fixes NAR-519
-
Hendrik Liebau authored
Adds a test case demonstrating that `useActionState` doesn't work correctly when the `'use cache'` function is exported separately, due to wrong function arity information in the server reference information byte. This is currently a limitation of the Next.js compiler, which will be addressed in a future PR. Also cleans up `console.log` from the existing `useActionState` test.
-
Will Binns-Smith authored
The current implementation doesn't properly format IPv6 addresses, which means URLs aren't valid. - Added specific handling for IPv6 localhost addresses (`::`/`::1`) to display as `localhost:port` for display - Added proper IPv6 address formatting with square brackets: `[IPv6Address]:port` - Maintained existing handling for IPv4 addresses and string addresses Fixes PACK-5874
-
Sebastian "Sebbie" Silbermann authored
-
nextjs-bot authored
Co-authored-by:Sebastian Sebbie Silbermann <sebastian.silbermann@vercel.com>
-
Vercel Release Bot authored
This auto-generated PR updates the production integration test manifest used when testing Rspack.
-
- 18 Nov, 2025 11 commits
-
-
Andrew Clark authored
This re-implements the refresh reducer to use the Segment Cache-style flow, similar to how the navigate reducer already works. Most of the logic can be reused from what was already implemented for navigations. The bulk of the changes are related to the case where a "default" parallel route slot is not present on the current page, and so needs to be refreshed from an older page's URL. Theoretically, this should be the last remaining case where we rely on the lazy fetching logic in LayoutRouter. I think there may still be some error cases where we still rely on that, though. Once these are all addressed, we can remove the lazy-fetching mechanism entirely.
-
nextjs-bot authored
-
Tobias Koppers authored
### What? Refactor making dependencies outdated and use batch add
-
Wyatt Johnson authored
## What Fixes a bug where interception routes in parallel slots could not be prerendered using `generateStaticParams`, causing 404 responses when these routes were accessed directly. ## Why **The Problem:** Interception routes like `app/@modal/(.)photo/[id]/page.tsx` could not be prerendered even when they exported `generateStaticParams`. This was because the static path generation code only examined "children" segments in the loader tree, completely missing segments from parallel routes (like `@modal`) that actually contribute to the pathname. **Root Cause:** The previous implementation used `childrenRouteParamSegments` which only traversed the `children` branch of the loader tree: ```typescript // OLD: Only looked at children const childrenRouteParamSegments = [...segments from children only...] // This missed parallel routes like @modal that have dynamic segments ``` For a route structure like: ``` app/ [username]/ page.tsx @modal/ (.)[username]/ [id]/ page.tsx // ← This route's segments were MISSED ``` The build system couldn't discover the `[id]` parameter in the parallel route because it never traversed that branch of the tree. ## How **Solution:** Introduces `extractPathnameSegments()` which properly traverses the ENTIRE loader tree (not just children) to find ALL segments that contribute to the pathname: 1. **BFS Traversal**: Explores both `children` AND all parallel route slots (e.g., `@modal`, `@sidebar`) 2. **Depth Tracking**: Correctly tracks URL depth by: - Skipping route groups `(marketing)` - not in URL - Skipping parallel markers `@modal` - not in URL - Including interception markers `(.)photo` - ARE in URL 3. **Prefix Validation**: Ensures static segments match the target pathname before including dynamic segments 4. **Complete Parameter Discovery**: Returns all segments that contribute to pathname construction, regardless of which tree branch they're in **Example:** For `app/@modal/(.)photo/[id]/page.tsx`: - Old: Missed the `[id]` parameter entirely - New: Discovers `[id]` and enables prerendering with `generateStaticParams` ## Changes **New Module**: `extract-pathname-segments.ts` (192 lines) - Core algorithm for traversing loader tree and extracting pathname segments - Handles complex cases: parallel routes, interception routes, route groups - Well-documented with examples and algorithm explanation **Comprehensive Tests**: `extract-pathname-segments.test.ts` (897 lines) - Tests for simple cases, nested structures, parallel routes - Interception route handling in various configurations - Route group behavior and edge cases - Depth tracking validation **Integration**: `static-paths/app.ts` - Replaced `childrenRouteParamSegments` with `extractPathnameSegments()` - Updated pathname construction to use segments from parallel routes - Maintained backward compatibility **E2E Test**: Added test validating prerendering works for intercepted routes ## Test Plan The new E2E test verifies: ```typescript it('should prerender a dynamic intercepted route', async () => { // Verifies build output contains the prerendered interception route expect(next.cliOutput).toContain('/(.)john/1') // Verifies it doesn't generate the non-intercepted path expect(next.cliOutput).not.toContain('/john/1') }) ``` ## Impact **Before**: Interception routes with dynamic segments returned 404 when accessed directly, even with `generateStaticParams` **After**: These routes are properly prerendered at build time and return correct responses -
Joseph authored
Expanding on the Getting started for CC and also extending `use cache` --------- Co-authored-by:Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
-
Jonathan Ho authored
<!-- 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 # --> This PR fixes the docs' example where it used class (like cacheHandler (no s)), but cacheHandlers expect an object. --------- Co-authored-by:
Joseph <joseph.chamochumbi@vercel.com>
-
Sebastian "Sebbie" Silbermann authored
-
Joseph authored
-
Jon Meyers authored
### What? Upgrade with-supabase example to be compatible with Next.js 16 ### Why? 1. Users get console warnings about middleware vs proxy 2. Enabling Cache Components config results in build errors for async behaviour outside Suspense boundary 3. Turbopack flag is default and therefore, no longer necessary on `npm run dev` ### How? 1. Renamed all instances of `middleware` to `proxy` 2. Wraped async behaviour in Suspense boundaries 3. Removed --turbopack flag from `npm run dev` --------- Co-authored-by:JJ Kasper <jj@jjsweb.site>
-
Sebastian "Sebbie" Silbermann authored
-
Will Binns-Smith authored
For small routes, it can appear like the polyfill chunk takes up a sizable amount of data, but `polyfill-nomodule.js` is only sent to legacy browsers. This makes it clearer. This PR enhances the bundle analyzer by adding visual indicators for polyfill chunks, and noting they're conditionally sent to modern or legacy browsers. The changes include: - Adds a source map to polyfill chunks (for the large pre-bundled input only) - Visually distinguished polyfill chunks in the treemap by lightening their color - Added a "Polyfill" badge (other badges coming soon!) with text when viewing polyfill chunk details <img width="388" height="227" alt="image" src="https://github.com/user-attachments/assets/bcebfba6-1e10-459a-9364-b6b8197cd3df" /> Fixes PACK-5826
-
- 17 Nov, 2025 13 commits
-
-
nextjs-bot authored
-
Luke Sandberg authored
Handle control flow _operators_ in the turbopack analyzer in order to trigger dead code handling and trim dependencies from dead branches. This was partially implemented but we were not producing the actual effects for them. I explored adding support for `?.` as well, but it is a massive complexity issue, so for now that is deferred.
-
nextjs-bot authored
-
Tobias Koppers authored
### What? Allow to configure nested vs flat async chunking with a new config option. ``` experimental: { turbopackClientSideNestedAsyncChunking: false, turbopackServerSideNestedAsyncChunking: true, } ``` -
Will Binns-Smith authored
This implements `next experimental-analyze`, which generates bundle analyzer data without without writing chunks or other artifacts to disk. It also optionally serves the bundle analyzer so it can be browsed easily. Examples: `next experimental-analyze` - writes analyzer data and UI to `.next/diagnostics/analyze` `next experimental-analyze --serve` - writes analyzer data and UI as well as serves the files on a static file server on localhost (by default on port 4000) `next experimental-analyze --serve --port 4001` -- runs the above on port 4001
-
jokokoloko authored
Changed better match example images and to be consistent within documentation copy. <!-- 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>
-
Hamidreza Nateghi authored
<!-- 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>
-
Tobias Koppers authored
### What? We can avoid creating another async loader, when there is already an async loader available for that module. The new async loader would technically be smaller, but we don't have a way to choose the smaller one at runtime anyway. The async loader would be different for nearly every path in the application and would create a lot of ouptut files.
-
Tobias Koppers authored
### What? This implementation was broken. It did call `add` instead of `insert` and that doesn't override existing values as it should. It could also be a bit more efficient by using `extend`.
-
Hendrik Liebau authored
We use `https://next-data-api-endpoint.vercel.app` for most of our e2e test API calls. The `middleware-fetches-with-any-http-method` test suite was using `https://http-echo-kou029w.vercel.app`, which was soft-deleted recently, and that caused the tests to fail. Now we're using the `next-data-api-endpoint` for this test suite as well.
-
Tobias Koppers authored
### What? These modules can be always side effect free.
-
Sebastian "Sebbie" Silbermann authored
-
Luke Sandberg authored
Disallow cloning effects. This was only performed in one location to address an issue with modeling calls functions that had alternates. However, this had the unfortunate effect of producing duplicate `CodeGen` objects. (it also could link values redundantly). This was fixed by refactoring the recursion and moving the the effect collection to one place. Many CodeGens are naturally idempotent so this wouldn't typically cause trouble, but it is wasteful and potentially hides other bugs. For example, this also adds detection for duplicate code gens and doing so found that we were generating unreachable effects for finalizers incorrectly.
-