- 17 Nov, 2025 11 commits
-
-
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.
-
- 15 Nov, 2025 4 commits
-
-
nextjs-bot authored
-
Hendrik Liebau authored
By accident, the responses for server actions that fetch something and don't revalidate are currently not streamed to the browser until the `fetch` calls are fully resolved. In the simplest case this happens when a server action returns the response body of a `fetch` call. This is especially critical if that response is itself streaming, for example for a chat app. In that case the client didn't see any updates until the whole stream was resolved. It affected mostly dev mode (due to the HMR fetch cache), but also prod if the fetch was explicitly marked as cacheable. The cause of the issue is that we are awaiting `pendingRevalidates` (in which the cache-writing promise is stored) after executing the action and before rendering. However, when we skip rendering and return the action directly this is unnecessary and blocks the response. Instead, we can defer awaiting the `pendingRevalidates` using `waitUntil`, as we do after rendering. This is executed at the very end, before the response is closed.
-
Zack Tanner authored
When configuring `cacheMaxMemorySize` to disable memory caching (typically used for setups to adjust production caching behavior, especially in multi-process self-hosted setups), this inadvertently also disabled dev HMR caches which are intended as a performance optimization. As a result of this, the dev console would be spammed with "Single item size exceeds maxsize". It's still possible to use this configuration to set a larger cache, but otherwise it will have a minimum set to the previous default. Fixes NAR-463 x-ref: https://github.com/vercel/next.js/pull/85153#issuecomment-3429636751
-
nextjs-bot authored
[diff facebook/react@93fc5740...fb2177c1](https://github.com/facebook/react/compare/93fc5740...fb2177c1) <details> <summary>React upstream changes</summary> - https://github.com/facebook/react/pull/35143 - https://github.com/facebook/react/pull/35145 - https://github.com/facebook/react/pull/35140 - https://github.com/facebook/react/pull/35139 - https://github.com/facebook/react/pull/35062 - https://github.com/facebook/react/pull/35135 - https://github.com/facebook/react/pull/35134 </details>
-
- 14 Nov, 2025 17 commits
-
-
Will Binns-Smith authored
This adds an interactive Treemap-style bundle analyzer app to the Next.js codebase and writes a copy to disk when `next build --experimental-analyze` is run. * It's a separate app in `apps/bundle-analyzer` as `@next/bundle-analyzer-ui` that uses `output: 'export'` to export a purely static Next.js app * These static resources are copied into Next.js's published `dist` directory in the `next` package itself. Users never depend on `@next/bundle-analyzer-ui` * When users run `next build --experimental-analyze`, these static resources are copied into the user's `.next/diagnostics/analyze` along with the data payloads needed to visualize the user's app In an upcoming PR, we'll add `next experimental-analyze` that will create analysis files without build artifacts, as well as optionally start a static file server. Test Plan: Ran `next build --experimental-analyze` in a test app and ran a static file server to run it.
-
Tobias Koppers authored
### What? Adds a new mode for processing async imports (e. g. `import("...")`). * Nested async chunking (the existing mode): Each async import creates a new availability scope so already available modules are not included again. This leads to exploring all paths in the application to create the most efficient chunk groups. The time complexity grows with the number of paths. * Flat async chunking: Only the first async import creates a new availability scope. This makes all async imports have the same available modules (per page), no matter how deep their are nested in the application. This allows to reuse chunk groups. The time complexity is linear to the number of async imports. The nested async chunking has a benefit when download size matters. Flat async chunking has better compile time and often less total bundle size. Therefore nested async chunking is only enabled in production for client-side assets. -
nextjs-bot authored
-
Jude Gao authored
-
Hendrik Liebau authored
The `layers` feature is now enabled by default in Rspack. <img width="1490" height="580" alt="layers-warning" src="https://github.com/user-attachments/assets/42fd6575-f0d3-4249-a6b2-6073bbd7935d" />
-
Tobias Koppers authored
### What? fix the side effects false handling for other module types. Before it did only work for ecmascript modules.
-
Sebastian "Sebbie" Silbermann authored
-
Tobias Koppers authored
### What? Change AvailabilityInfo from an enum to a struct with flags.
-
nextjs-bot authored
-
Andrew Clark authored
These were temporarily disabled when removed the Link level opt-in for runtime prefetching. I fixed the tests by switching to the file-based API. prefetch-layout-sharing.test.ts still needs to be updated, in a similar way.
-
Tobias Koppers authored
### What? Refactor the OutputAssets of chunk groups to not eagerly return all referenced output assets from async loaders, but instead return a list of references that can be followed to get the full list. That solves a problem that will happen when the async loaders create cycles in the output graph.
-
Tobias Koppers authored
### What? Add a bunch of feature flags that help debugging cases where it is loosing invalidations.
-
Niklas Mischkulnig authored
This was always unnecessary. Or is this worse now as there are fewer strongly consistent reads?
-
Sebastian "Sebbie" Silbermann authored
-
Wyatt Johnson authored
## What This PR introduces build-time validation to detect ambiguous app routes that were previously going undetected until runtime. ## Why Route conflicts could occur when different dynamic segment names (e.g., `[slug]` vs `[modalSlug]`) normalize to the same routing pattern. This was particularly problematic for: - Parallel routes with different parameter names that appeared to work but had subtle conflicts - Interception routes where structural equivalence wasn't being validated - Complex routing structures where the ambiguity only manifested at runtime These conflicts would slip through the build process and cause runtime issues that were difficult to diagnose. ## How Adds a new `validateAppPaths()` function that: 1. **Normalizes paths** to detect structural equivalence (e.g., `/blog/[slug]` and `/blog/[modalSlug]` both normalize to `/blog/[*]`) 2. **Validates individual paths** for syntax errors, duplicate slug names, catch-all placement, and other issues 3. **Cross-validates paths** to detect ambiguous routes that would conflict at runtime 4. **Provides clear error messages** with actionable guidance when conflicts are detected The validation is integrated into the build process in `packages/next/src/build/index.ts` and runs automatically for all app routes. ## Changes - **New**: `validate-app-paths.ts` - Core validation logic with comprehensive path normalization and conflict detection - **New**: `validate-app-paths.test.ts` - Extensive test coverage (299 lines) covering valid configs, ambiguous routes, syntax errors, and edge cases - **Modified**: `build/index.ts` - Integration of validation into the build process - **Modified**: `get-segment-param.tsx` - Export `SegmentParam` type for reuse ## Test Coverage The test suite covers: - Valid route configurations (different segments, depths, catch-all patterns) - Ambiguous route detection (parallel routes, different dynamic segment names) - Individual path validation (syntax errors, duplicate slugs, catch-all placement) - Edge cases (empty arrays, root routes, complex nested structures) - Clear error messaging with actionable guidance
-
JJ Kasper authored
This adds the resume postpone handling into the `app-page` handler so it doesn't rely on `base-server`.
-
Lucas Felicio Adriano authored
Fixes https://github.com/vercel/next.js/issues/85416. This is a follow up to https://github.com/vercel/next.js/pull/77662, where the Node.js middleware was fixed to also support reading (and duplicating) the body's request before being passed to the server action. However, in that PR, an `await` was missed while calling the [.finalize()](https://github.com/vercel/next.js/blob/1b45163bce3dab30d7a79dff95238b84016b54c2/packages/next/src/server/body-streams.ts#L39) method, which returns a Promise. That missing `await` would sometimes cause a bug, where the server action would be invoked before the body was completely cloned, causing the bug mentioned in the issue above. --------- Co-authored-by:
JJ Kasper <jj@jjsweb.site>
-
- 13 Nov, 2025 8 commits
-
-
nextjs-bot authored
-
Wyatt Johnson authored
This updates the tests to use the accordion style link reveal technique to ensure that prefetches occur within the act and do not hang waiting for requests to be initiated.
-
Bernd Strehl authored
Remove redundant example code for overriding cache profiles. ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR.
✅ (no changes) - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide✅ ### What? Remove a redundant example in the `cacheLife` docs. ### Why? Because the redundant example is confusing. ### How? Closes NEXT- Fixes # --> -
sequencerr authored
delete is reserved word <!-- 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>
-
Jiachi Liu authored
-
nextjs-bot authored
-
Tim Neutkens authored
## What? Shares `static check` and `static generation` workers. On hello-world: Before: ``` next build test/e2e/app-dir/hello-world 7.58s user 1.07s system 332% cpu 2.603 total ``` After: ``` next build test/e2e/app-dir/hello-world 7.18s user 0.87s system 308% cpu 2.612 total ```
-
Jiachi Liu authored
-