- 15 Jan, 2026 11 commits
-
-
nextjs-bot authored
-
Janka Uryga authored
In Cache Components, bound args encryption needs to be cached (and tracked with cacheSignal) because it's tasky. We use the serialized bound args themselves as a cache key. However, in dev, the key ends up containing debug info (in particular, timing information) so it's different every time . This causes a cache miss and results in a static shell validation failure. The fix is to use a dummy debug channel to pipe the problematic debug info into the void and thus make the key be deterministic.
-
Steven authored
Based on our metrics, the P99.9 for a source image is 47 MB so we can adjust the default setting to be much lower (by changing from from 300 MB to 50 MB) in favor of reducing memory.
-
Tobias Koppers authored
### What? * Compute the approximate distance to leaf in the dependency graph * Prioritize tasks re-computing by distance to leaf, running leaf tasks first This ensures that it's less likely that tasks are re-executed multiple times due to bad ordering. This adresses the "diamond" problem where a task is invalidated multiple times due to multiple paths of invalidation to that task.
-
Niklas Mischkulnig authored
Introduce `TsConfigHandling::Disabled`
-
Matt Mastracci authored
-
Niklas Mischkulnig authored
-
Donny/강동윤 authored
Co-authored-by:
Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by:
Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com>
-
Hendrik Liebau authored
Fixes a regression from #85981 where manual deploy tests with custom tarball URLs incorrectly trigger retries and Slack notifications. Now only release-triggered runs and manually-triggered canary tests are retried/reported.
-
Tim Neutkens authored
## Summary Fixes #88291 The Pages Router fonts documentation was incorrectly showing App Router examples (`app/layout.tsx`) which don't exist in Pages Router. This confused users trying to use fonts with the Pages Router. ## Changes Updated `docs/01-app/01-getting-started/13-fonts.mdx` to include proper `<AppOnly>` and `<PagesOnly>` sections: **For Pages Router users:** - Added examples using `pages/_app.tsx` (Custom App) to wrap components with font className - Added examples using `pages/_document.tsx` (Custom Document) to apply fonts to the `<html>` element **For App Router users:** - Wrapped existing `app/layout.tsx` examples in `<AppOnly>` sections This follows the same pattern used in other shared documentation like `docs/01-app/01-getting-started/11-css.mdx` which properly separates App Router and Pages Router content.
-
Luke Sandberg authored
Add a new derive macro for `TaskStorage` a replacement for `InnerStorage` and `CachedDataItem`, currently it is unused outside of tests. ## What * add a new derive macro that generates code from the 'schema' in `storage_schema.rs` * `storage_schema.rs` defines the layout of our new struct, for each field we specify * type and name * category ('data' 'meta' or 'transient') * location (inline or lazy or flags for bitfields) * whether we should `filter_transient` when encoding (not everything can contain transient data) * Logically this is a replacement for `CachedDataItem` * From that we generate a few things * `TaskFlags` a bitfield to hold some data items as well as 'meta' information like the 'snapshot' and 'restore' bits replacing `InnerStorageState` * `LazyField` enum, defines tall the fields that we dynamically allocate * `TaskStorage` the main storage struct, along with basic accessors for all the datatypes (which helps encapsualte storage strategy) * `TaskStorageAccessors` a trait with default implementations of every accessor which also handle * access checking, via `check_access` * mutation tracking via `track_mutation` * putting these behaviors in a trait allows some of the business logic around snapshotting to remain in normal rust code that implements the trait, while all the field updating logic can be autogenerated * Serialization and encoding infrastructure * routines to encode and decode the 'meta' or 'data' subsets * routines to create partial 'snapshots' of `meta` or `data` subsets * routines to restore data from deserialized snapshots See https://gist.github.com/lukesandberg/ea35f0e92c1cdeddf80d0498f2978144 for a fully expanded version of the macro ### Why There are a few goals from this redesign of `InnerStorage` * (speculative) a single large `derive` macro will be easier to maintain than the current mix of `macro_rules` and derive macros we use for `CacheDataItem` * There is one macro to expand when inspecting and the macro generation code is pretty straightforward if voluminous * We eliminate many `match` operations on `CachedDataItem` * Today to lookup a piece of data we need to execute several matches to get the the data category and find the storage location. With this new approach those are handled by just calling the correct accessor which statically addresses the storage location * serialization performance * we don't need to 'explode' the storage into `Vec<CachedDataItem>` anymore and instead can either directly snapshot the storage or encode directly to a buffer. This should eliminate some temporary allocations and should enable a smaller serialization format * more flexibility * mostly this is the same approach as before with a few small improvements, notably `invalidator` and `immutable` are now stored as single inline bits reducing lookupcosts and memory for tasks that have these. ### How Most of the code was written by Claude with obviously a ton of feedback, so please review carefully. For now all this code is unused but future PRs will integrate it into the backend
-
- 14 Jan, 2026 20 commits
-
-
nextjs-bot authored
-
Vercel Release Bot authored
This auto-generated PR updates the development integration test manifest used when testing Rspack.
-
Vercel Release Bot authored
This auto-generated PR updates the production integration test manifest used when testing Rspack.
-
Luke Sandberg authored
# Optimize issue filtering in Next.js and Turbopack ## What? This PR introduces an `IssueFilter` system to control which issues are reported based on severity and location ## Why? To improve performance, we shouldn't spend time formatting issues that will never be displayed to a user. ## How? - Added `IssueFilter` to control which issues are displayed based on severity and location - Created a specialized `InNodeModules` context condition for better readability - Implemented `warnings_and_foreign_errors()` filter that shows: - Warnings and errors from application code - Only errors from node_modules - Applied the filter throughout Next.js and Turbopack's issue reporting system - Refactored issue collection to filter early rather than collecting everything first
-
Karl Horky authored
-
Benjamin Woodruff authored
It used to be that a cell could contain a transmuted representation. This was a hack for the previous limited generic support that I removed in https://github.com/vercel/next.js/pull/70817. Clean this up! `Repr` and `T` are always the same type!
-
Andrew Clark authored
Based on: - #87991 --- The Mutable type was used by an earlier implementation of App Router when the reducer used to run during React's render phase. It was used to prevent certain operations from running multiple times if an update was reapplied by React. Now that router "reducer" actions run outside React's render phase, we no longer need this indirection — we can compute the next state object directly. Most of the Mutable-related logic was deleted in previous PRs; this finishes the migration by inlining handleMutable into its callers.
-
nextjs-bot authored
-
Andrew Clark authored
Instead of storing old sibling CacheNodes in the CacheNode tree, thisPR puts them into a separate BFCache, backed by the same data structure and LRU that's used by the prefetch cache.
-
Tim Neutkens authored
## 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.
-
Jiachi Liu authored
-
Niklas Mischkulnig authored
-
nextjs-bot authored
-
Hendrik Liebau authored
In #87188 we upgraded lerna to v9 which no longer supports/requires the `lerna bootstrap` command. This commit removes it from the `clean` script in the root package.json to avoid errors when running `pnpm clean`. [More info](https://lerna.js.org/docs/legacy-package-management#replacing-your-usage-of-lerna-bootstraplerna-link)
-
Tim Neutkens authored
## Summary Fixes #88316 Route handlers (API routes) were generating bloated `client-reference-manifest.js` files containing unrelated client components from pages when using Webpack. This was caused by the manifest merging logic in `flight-manifest-plugin.ts` which inherited manifests from all parent path segments. ### Changes - Modified `flight-manifest-plugin.ts` to detect route handlers (`/route$` pattern) - Route handlers now only get their own group's manifest, skipping parent manifest inheritance - Pages continue to inherit manifests from parent layouts as before ### Why this works Route handlers: - Don't render React components - Return `Response` objects, not JSX - Don't need client component references from parent layouts/pages Turbopack already handles this correctly by doing targeted module graph traversal per entry. This fix aligns Webpack's behavior. ## Test Plan Added test suite `test/production/app-dir/route-handler-manifest-size/`: - Verifies pure route handlers don't include unrelated page client components - Verifies pages still include their client components - Verifies route handlers with direct client imports don't get page components - Tests pass for both Webpack and Turbopack
-
Niklas Mischkulnig authored
-
nextjs-bot authored
-
Niklas Mischkulnig authored
-
nextjs-bot authored
-
Tobias Koppers authored
### What? Fixes a edge case in production chunking performance where many dynamic imports (like https://app.unpkg.com/lucide-react@0.562.0/files/dist/esm/dynamicIconImports.js) causes builds to become very slow under specific scenarios.
-
- 13 Jan, 2026 9 commits
-
-
nextjs-bot authored
-
Tobias Koppers 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 # -->
-
Niklas Mischkulnig authored
Addresses the comments on this PR: https://github.com/vercel/next.js/pull/88474#discussion_r2687626329 "Merge when ready" had striked again This did actually find another violation
-
Niklas Mischkulnig 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 # -->
-
Benjamin Woodruff authored
I deleted the code that used this a long time ago in https://github.com/vercel/next.js/pull/70817 The rational for why I deleted the uses of this code is here (generics in turbo-tasks would be nice, but this implementation was too limited to be worth the complexity): https://github.com/vercel/turborepo/pull/8843#issuecomment-2253158412
-
Niklas Mischkulnig 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 # -->
-
Tobias Koppers authored
### What? Replaces `is_reference_used` with `unused_references` and uses the new keyed invalidation. This avoid having a `is_reference_used` for each reference in the application
-
Niklas Mischkulnig authored
This causes nondeterministic cell order
-
Benjamin Woodruff authored
In theory, `parse_quote` is really nice because it lets you use type safety to assert more things about proc macro code. However, it does invoke the syn parser, so there's probably some cost. I had Claude find and remove trivial uses of `parse_quote`. There are still more uses, but they're not as easy to remove (e.g. because we need the real type, not just a `TokenStream`, and the type is annoying to construct by hand).
-