- 30 Jul, 2025 25 commits
-
-
nextjs-bot authored
-
Jiwon Choi authored
fix: display multiple lockfile warn if neither `outputFileTracingRoot` or `turbopack.root` option is provided (#82164) > Better to be reviewed with "Hide whitespace". This PR fixed a bug where `findRootDir()` was called and displayed multiple lockfile warnings even if the app had `turbopack.root`, as there was no `outputFileTracingRoot`. x-ref: https://github.com/vercel/next.js/pull/82164#discussion_r2240470772 Also, added information about the `outputFileTracingRoot` option and its docs to the warning, as it was omitted from https://github.com/vercel/next.js/pull/82052. Closes https://github.com/vercel/next.js/issues/81864 Closes https://github.com/vercel/next.js/issues/82096
-
Jiwon Choi authored
### Why? In `next dev`, `process.env.TURBOPACK` was set after `loadConfig`, which caused the `process.env.TURBOPACK` conditions within the initial `loadConfig` calls to be skipped unexpectedly.
-
Chad M Fennell authored
grammar nit: "an API" is singular Co-authored-by:JJ Kasper <jj@jjsweb.site>
-
Shiro Wang authored
When I was using the standalone build, the second build would delete the contents of local packages. As a result, developers had to delete the cache of local empty directories and re-download the packages. I added a condition for recursive deletion to avoid this situation. Fixes #82157
-
Benjamin Woodruff authored
This feature is unused, but I think there are also significant problems with it, which would require work for it to be used: - The `Vec` isn't very scalable and that could be a footgun. It should be an `auto_hash_map::AutoSet` or a `FxHashSet`. - It's unclear that _just_ ignoring watch events is a good idea. I understand that we don't want to allow source code to depend on outputs, but it seems like it would be better to prevent reads in the first place in the `DiskFileSystem` (e.g. pretend the file doesn't exist and emit an issue). This would not require support from the watcher, as we just wouldn't create the invalidator at all. - There's no test coverage of this feature.
-
Benjamin Woodruff authored
This only impacts the non-recursive codepath. The notify-rs docs explain that you need to watch every parent of the file/directory you care about: https://docs.rs/notify/latest/notify/#parent-folder-deletion This reduces the missing invalidations on Linux detected by my fuzzer, but does not eliminate them: ``` rm -rf /tmp/fuzz && cargo run --release -p turbo-tasks-fuzz -- fs-watcher --fs-root /tmp/fuzz ```
-
Benjamin Woodruff authored
Turbopack: Use a BTreeMap in InvalidatorMap to avoid many `O(n)` traversals when finding child paths (#82133) This fixes an `O(n)` iteration of the invalidators (which can be quite large) in `invalidate_path_and_children_execute`. It requires the nightly `btree_cursors` API. It's possible to implement this without that API, but it'd be a lot less efficient, and I'm concerned about how hot this codepath might be. This codepath is used for both the recursive and non-recursive filesystem watcher, so it impacts all platforms.
-
nextjs-bot authored
-
Benjamin Woodruff authored
Common convention in our codebase is that `Path`/`PathBuf` are used for raw OS-level paths, and `RcStr` is used for normalized paths exposed by `turbo_tasks_fs`. These are raw OS paths, so we should use `Path`/`PathBuf`. This has some benefits in that it makes the implementation of https://github.com/vercel/next.js/pull/82133 easier, because `Path`'s `Ord` implementation is better for our use-case.
-
Jiachi Liu authored
-
Jiachi Liu authored
-
Janka Uryga authored
Accessing root params in a private cache should work, but I missed it in the `next/root-params` PR. ```tsx import { lang } from 'next/root-params' async function foo() { 'use cache: private' await lang() // this is okay } ``` With this PR, we'll now allow this (and `unstable_rootParams()`) -
nextjs-bot authored
-
Sebastian "Sebbie" Silbermann authored
-
Janka Uryga authored
we define most of the app router headers with capital letters, like this: ```ts export const NEXT_ROUTER_PREFETCH_HEADER = 'Next-Router-Prefetch' as const ``` which means we have to keep lowercasing the header everywhere when checking for its presence, because node and other intermediate layers normalize all headers to lowercase: ```ts if (req.headers[NEXT_ROUTER_PREFETCH_HEADER.toLowerCase()]) { ... } ``` this seems pretty pointless -- we can just define the headers in lowercase form, and skip all those `toLowerCase()` calls. (all the above sentences have been normalized to lowercase to match the spirit of this pr) -
Joseph authored
Closes: https://linear.app/vercel/issue/DOC-4930/notes-about-app-routers-react-version --------- Co-authored-by:
Rich Haines <hello@richardhaines.dev>
-
Joseph authored
This page https://nextjs.org/docs/app has too little actionable paths to go on
-
Sayakie authored
### What? This pull request just fix typo in documentation. --------- Co-authored-by:Joseph <joseph.chamochumbi@vercel.com>
-
Benjamin Woodruff authored
This can be useful in figuring what should've been invalidated, but wasn't. `strace` can be used for figuring out what files/directories were actually modified.
-
Benjamin Woodruff authored
Turbopack: Make the "non-recursive" logic for the fs watcher a runtime flag instead of a build-time one (#82031) We use different modes on macos/windows and linux for watching files for performance reasons: https://github.com/vercel/turborepo/pull/4100 Now with `TURBO_TASKS_FORCE_WATCH_MODE=recursive` or `TURBO_TASKS_FORCE_WATCH_MODE=nonrecursive`, you can force the watcher into either mode, independent of platform. ### Why? - Platform-specific compilation flags are annoying and it's easy to accidentally break compilation on another platform. - It's actually really useful to be able to force recursive or non-recursive mode without switching platforms when testing the watcher to narrow down bugs. E.g. on Linux: ``` # this fails to receive watch events after directories are added/removed rm -rf /tmp/fuzz && RUST_BACKTRACE=1 TURBO_TASKS_FORCE_WATCH_MODE=nonrecursive cargo run --release -p turbo-tasks-fuzz -- fs-watcher --fs-root /tmp/fuzz # but this (simulating the behavior of macos/windows) works fine rm -rf /tmp/fuzz && RUST_BACKTRACE=1 TURBO_TASKS_FORCE_WATCH_MODE=recursive cargo run --release -p turbo-tasks-fuzz -- fs-watcher --fs-root /tmp/fuzz ``` - There's not all that many places this flag needs to be checked, and compared to the cost of the syscalls happening at those callsites, the impact should be basically zero.
-
M. Abdullah authored
## Improving Documentation Updated the doc to reflect the API signature of `cacheTag`, which takes one or more string values. --------- Co-authored-by:Joseph <joseph.chamochumbi@vercel.com>
-
Will Binns-Smith authored
This adds a new transform to `@next/codemod` that updates `next.config.{js,ts}` that updates the deprecated `experimental.turbo` property to the new top-level `turbopack` property. Details: - Only operates on files called next.config.js or next.config.ts, in the case the codemod tool is run on a large codebase. - Updates _any_ object literal with a `experimental.turbo` property to use `turbopack`. Since this transform is constrained to Next.js configs, there shouldn’t be many false positives. - Much of this change was written by Copilot. I simplified it, and refactored it to make it more readable and safe. Test Plan: - `pnpm run build && pnpm test -- -t next-experimental-turbo-to-turbopack` in the codemod directory - Tested on several publicly available next configs that used the deprecated property -
Will Binns-Smith authored
The previous URL 404s.
-
Jude Gao authored
-
- 29 Jul, 2025 15 commits
-
-
nextjs-bot authored
-
JJ Kasper authored
This updates to disable the `test-new-tests-` jobs for release branches as they have a lot of diffs and can stall CI heavily un-necessarily.
-
Wes authored
## Improving Documentation Updated the `Dashboard` component to be an `async` function to properly `await` the session verification process. This change ensures that the user role is retrieved correctly from `session` before rendering the component. Co-authored-by:Joseph <joseph.chamochumbi@vercel.com>
-
Remco Haszing authored
### What? Fix the signatures of `useMDXComponents`. ### Why? The `useMDXComponents` function is always called without any arguments. It’s also always supposed to be a named export, not a default export. It’s also called during render. Defining React components during render is an anti-pattern. All components that were previously defined inside of `useMDXComponents`, are now defined outside of the function. ### How? Manual fixes. --------- Co-authored-by:
graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> Co-authored-by:
Joseph <sephxd1234@gmail.com> Co-authored-by:
Joseph <joseph.chamochumbi@vercel.com>
-
Joseph authored
Encode overriding is not supported by the upstream library.
-
Jiachi Liu authored
-
Luke Sandberg authored
Have the module-cost benchmark page self identify and output into a text box to make copy-pasting the data out easier.
-
Benjamin Woodruff authored
The code block syntax in a documentation comment is interpreted as a doctest: https://doc.rust-lang.org/rustdoc/write-documentation/documentation-tests.html Tested with: ``` cargo test -p turbo-tasks-fs ```
-
JJ Kasper authored
It seems these additional fs operations/transforms on client components while tracing dependencies is causing a big perf hit which is not worth the edge case of catching fs dependencies in server actions from client components. A workaround is available without our automatic tracing via `outputFileTracingIncludes` so this reverts the tracing to alleviate the perf concern. We will be able to handle cases like this without the perf consequence with turbopack going forward. This reverts commit af0473b7. Closes: https://github.com/vercel/next.js/issues/81902
-
JJ Kasper authored
This ensures we update `nextConfig.assetPrefix` instead of `renderOpts` as we aren't relying on `renderOpts` for these values anymore. Closes: https://github.com/vercel/next.js/issues/82150
-
nextjs-bot authored
-
Vercel Release Bot authored
This auto-generated PR updates the production integration test manifest used when testing Rspack.
-
Jiachi Liu authored
Let segment explorer tests running on windows CI to ensure it works with windows. Closes NEXT-4633
-
Jiachi Liu authored
When you running `pnpm next <project path>` from the monorepo root with turbopack and the `<project path>` is not same as your root directory, this lead the unrelated paths outside of the next.js project are also included into the segment explorer file paths. Because in turbopack the current directory is changed to `[project]` after bundling so that we didn't get the correct relative path when running segment explorer. The absolute path is formatted as `<project-root>/<cwd>`, and the `<project root>` will be included into the path if the working directory is not same as the next.js directory. The PR fixes the issue by extracting the `<project-root>` from the absolute path, and also stripped from the segment explorer paths. Closes NEXT-4651
-
JJ Kasper authored
This fixes a case with i18n in pages router with deeply nested mixed `fallback: false` and `fallback: 'blocking'` routes where the internal `NoFallbackError` would be bubbled outside of the server handler causing the invariant to leak instead of rendering the 404 page like expected. Verified against our E2E deploy tests here https://github.com/vercel/vercel/actions/runs/16586881087/job/46913897238 and https://github.com/vercel/next.js/actions/runs/16586877291/job/46913935296 Closes: NEXT-4655
-