- 04 Jun, 2025 14 commits
-
-
vercel-release-bot authored
-
Andrew Clark authored
We're going to expand this to cover all RSC requests, not just segment prefetches. To decouple this from clientSegmentCache, I've added a new flag to control it. (Although for now, the behavior is still gated behind both flags, until we've made the check more robust.)
-
Jiachi Liu authored
-
Tim Neutkens authored
## What? Implements the same error message that we add to the webpack handling. I'm not super happy about this solution (though it matches what we do for webpack) ideally we improve the sass-loader error itself in the future but that requires upgrading sass-loader as well and introducing a breaking change. For now this unblocks the test passing.
-
Sebastian "Sebbie" Silbermann authored
No longer needed in React 18+
-
vercel-release-bot authored
-
Tim Neutkens authored
Did a bit of digging into #78756. This is a test to see if anything breaks when changing the option given that it seems we already read the file paths correctly, just needed to check it later in asset processing hook.
-
Tobias Koppers authored
### What? add more context to error messages for database failures
-
Sebastian "Sebbie" Silbermann authored
Every implementation is a no-op and we don't have any plans. Can use the same pattern as App Router when we need it.
-
Josh Story authored
When prerendering with dynamicIO we take advantage of a few things about microtask behavior to ensure that anything prerenderable in RSC is included in the HTML prerender. We found however that with large enough RSC payloads certain things that should have been prerenderable could be incorrectly excluded when paired with sync IO in the client because this causes the prerender to abort earlier than one task. To prevent this we allow the RSC response to pre-process entirely before continuing with the prerender. This is possible as long as the RSC prerender is fully complete before the HTML prerender begins. We only do this when dynamicIO is enabled and only during prerender. By construction this means that this also never happens in edge runtime.
-
Benjamin Woodruff authored
fix(turbo-persistence): Atomically mark old versioned directories for deletion before deleting them (#80082) This uses a trick similar to what I did in https://app.graphite.dev/github/pr/vercel/next.js/79425 to mark the directory for deletion using an atomic operation (a directory rename in this case) before deleting it, so that we can resume the deletion upon restart if we're interrupted while deleting the directory. This may be important as deleting large directories can take some time. I think this is the source of these user reports: https://vercel.slack.com/archives/C046HAU4H7F/p1748616184765179
-
Luke Sandberg authored
Adopt the `rcstr!` macro in turbopack Instead of `"foo".into()` call `rcstr!("foo")` while being slightly more annoying to type the macro approach is more readabie and faster as it can leverage constant folding for small strings and amortize construction of larger strings. In general these performance improvement are very small but consistent. At the same time, eliminate uses of turbo-tasks where they were amortizing construction of RcStr instances since the `rcstr!` macro can do the same thing. Generally speaking we should prefer `RcStr` over `ResolvedVc<RcStr>` as a task input since it has much more reasonable equality semantics and observationally many of these values were constructed via `Vc::cell("foo".into())`. ## Why? Generally this should be a small consistent memory and performance improvement. My understanding is that many uses of `ResolvedVc<RcStr>` actually predate `RcStr` when we were using `String` directly. In that world, turbotasks are fulfilling a vital function, but now that we can rely on RcStr this is much less needed. ## How? Mostly this was a bunch of regex replacements and manual fixups. An AstGrep rule would have been ideal but beyond matching `RcStr::from("...")` this doesn't work since it was mostly calls to `into()` which rely on type inference. Still by seeding the codebase with the pattern we can probably prevent regressions. ## Performance From measuring vercel-site this is a latency progression of a few percent. codspeed agrees!  -
Benjamin Woodruff authored
Remove unused dependencies to (hopefully) speed up the build. https://github.com/boshen/cargo-shear ``` $ cargo shear --expand --exclude=wasm Analyzing /home/bgw.linux/next.js No unused dependencies! ```
-
- 03 Jun, 2025 26 commits
-
-
Josh Story authored
When you use sync IO in the client in a way that needs to be fixed we currently still just provide you with the explanation for server components. The fixes when sync IO happens in the client are not the same as when they happen in a server component so this update adds client specific documentation for these situations. Namely, the key difference is that on the server you can add caching through "use cache" and this is not available to you in the client. sync IO in general is (going to be) allowed in client components broadly as long as Next.js has a fallback UI to prerender. This means that "fixing" sync IO access in the client will usually be solved by wrapping in a Suspense boundary. The alternative is to move the sync IO out of render or move it to the server where it can be cached.
-
vercel-release-bot authored
-
Zack Tanner authored
Fixes failing assertions related to the forked React 18 tests. [x-ref](https://github.com/vercel/next.js/actions/runs/15417191195/job/43385564776#step:34:533)
-
Benjamin Woodruff authored
This is a prerequisite for using https://github.com/boshen/cargo-shear, which uses `--all-features`. This also avoids some noise in Rust Analyzer, which also uses `--all-features`.
-
Jiachi Liu authored
-
Jiwon Choi authored
Style change in https://github.com/vercel/next.js/pull/80097 affected style when adding the "Development Section" at https://github.com/vercel/next.js/pull/80072. Therefore add the style back to the section titles, and use "General" for the existing preferernces. | Before | After | |--------|--------| |  |  |
-
Jiwon Choi authored
Better reflect why this button is needed. x-ref: [slack thread](https://vercel.slack.com/archives/C04A1276AGK/p1748977699699439?thread_ts=1748886481.971709&cid=C04A1276AGK) --------- Co-authored-by:
Zack Tanner <1939140+ztanner@users.noreply.github.com>
-
Sebastian "Sebbie" Silbermann authored
Same as with `get*Stack` implementation
-
Vitalie authored
Co-authored-by:Jiachi Liu <inbox@huozhi.im>
-
Joshua Hannaford authored
## Fail Google Fonts in Production Builds When Fetch Fails ### What? This PR changes the behavior of Google Fonts in Next.js to properly fail production builds when font fetching fails, while still allowing development to continue with fallback fonts. ### Why? Previously, font fetch failures were only logged as warnings but didn't stop production builds. This could lead to production deployments with missing fonts, creating a poor user experience. Development mode should be more forgiving to allow work to continue offline. ### How? - Added `is_dev_mode()` method to the `ChunkingContext` trait to determine the current environment - Modified the Google font fetching logic to: - In development: Show a warning and use fallback fonts when fetching fails - In production: Throw an error that fails the build when fetching fails - Passed the execution context to the font file replacer to access the chunking context This ensures that production builds will fail fast when font resources can't be fetched, while development builds can continue with appropriate fallbacks. Fixes #PACK-4667 ### Future Hopes I would hope to eventually expose an enum for the build mode rather than just a boolean flag like I have here. I started going down that path for this PR, but it was expanding the scope significantly of what would have to be done, so I have left it as a bool to fix this problem.
-
Sebastian "Sebbie" Silbermann authored
Was previously shadowed because we used an uncast `require` which results in `any`. Fixes ``` Argument of type '<T>(request: NextRequestHint, fn: () => T) => T' is not assignable to parameter of type '(req: Request, fn: () => T) => T'. Types of parameters 'request' and 'req' are incompatible. Type 'Request' is missing the following properties from type 'NextRequestHint': sourcePage, fetchMetrics, request, respondWith, and 6 more.ts(2345) ``` -
Jiachi Liu authored
-
Jiwon Choi authored
Add options from https://github.com/vercel/next.js/pull/80060 to the preferences tab as well for DX. **Restart Dev Server** https://github.com/user-attachments/assets/689441b4-46aa-418a-80e4-66ce495695cb **Reset Bundler Cache** https://github.com/user-attachments/assets/911224c6-b923-48ac-844d-52132b05ef3f Closes NEXT-4478 --------- Co-authored-by:
Benjamin Woodruff <benjamin.woodruff@vercel.com> Co-authored-by:
Sebastian "Sebbie" Silbermann <sebastian.silbermann@vercel.com>
-
Jiwon Choi authored
### Why? When the user reloads on a specific error, and that error persists, we show the restart server button as an option. This is because some errors are recoverable by restarting the server and rebuilding the app. https://github.com/user-attachments/assets/4e65d26c-8344-47b8-a6b9-1151008c271c When Turbopack persistent cache is enabled, it will also clear the bundler cache. This improves DX by replacing the need to run `rm -rf .next` manually. https://github.com/user-attachments/assets/e3f08176-5e9e-41fc-a8ce-9e731a45a6f2 Closes NEXT-4477 --------- Co-authored-by:
Benjamin Woodruff <benjamin.woodruff@vercel.com> Co-authored-by:
Sebastian "Sebbie" Silbermann <sebastian.silbermann@vercel.com>
-
devin-ai-integration[bot] authored
# Improve Turbopack webpack loader documentation ## Description This PR improves the Turbopack webpack loader documentation by: 1. Clarifying that the list of supported loaders is not exhaustive 2. Adding a more detailed example showing how to pass options to loaders using the object format 3. Adding graphql-tag/loader to the list of supported loaders based on customer feedback This addresses customer confusion about how to pass options to loaders and clarifies that many loaders beyond those explicitly listed will work. Link to Devin run: https://app.devin.ai/sessions/33095930f1f34a6daf81c2ce7eca3be0 Requested by: lee@vercel.com --------- Co-authored-by:
Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by:
lee@vercel.com <lee@vercel.com> Co-authored-by:
Tim Neutkens <tim@timneutkens.nl>
-
Donny/강동윤 authored
### What? Use precomputed data for hashing instead of rehashing everytime. ### Why? `hash` of `&str` is `O(n)`. Although it's fast, we don't need to pay the cost for memory access. --------- Co-authored-by:Tobias Koppers <tobias.koppers@googlemail.com>
-
Jiachi Liu authored
-
Sebastian "Sebbie" Silbermann authored
Same as with `get*Stack` implementation
-
Sebastian "Sebbie" Silbermann authored
Makes it easier to get types for those previously untyped `require` calls.
-
Donny/강동윤 authored
### What? Precompute hash for `RcStr` and use it for equality bailout. ### Why? We have lots of `RcStr` in key positions of the hashmap, so adding a fast bailout path to `==` improved the performance. x-ref: https://vercel.slack.com/archives/C06PPGZ0FD3/p1746715835436899?thread_ts=1746658944.635819&cid=C06PPGZ0FD3
-
Leo authored
When Preferences is in dark mode, `<option>` items in the `<select>` components were using the browser’s native white panel with white text, making them unreadable. This change explicitly adds CSS styles to the `<option>` items so they follow the dark/light theme. fixes #80024 ## After:  ## Before:  <!-- 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 ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### 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:
Jiwon Choi <devjiwonchoi@gmail.com> Co-authored-by:
Tim Neutkens <tim@timneutkens.nl>
-
rauno authored
This PR fixes a small bug with the menu keyboard interactions. Namely, if you open a sub-menu and close it, visually the correct item is highlighted but does not respond when pressing Enter. The bug is visible here on this video: https://github.com/user-attachments/assets/368311eb-1400-4a76-b42b-b59676dedef2 After this PR you can infinitely toggle between the menus: https://github.com/user-attachments/assets/9ff7f5cd-67cf-4db5-a12f-fd1bf8ebe96b
-
Sebastian "Sebbie" Silbermann authored
The stitched-errors module will live in a different layer than the dev-overlay. In that future we need to pass the `get*Stack` implementations to the dev-overlay. Right now it's not meaningful but makes future diffs smaller.
-
rauno authored
This PR implements the latest changes from @pranathip to our info popovers. | Before | After | |:------:|:-----:| |  |  |
-
Sebastian "Sebbie" Silbermann 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 ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### 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 # -->
-
Sebastian "Sebbie" Silbermann authored
In the reducer we'll later inject the implementation of `get*Stack`. The reducer will live in a different module than `stitched-errors` so we need to make sure `get*Stack` is a singleton. Dependency injection makes this easier to achieve. `getOwnerStack` will be injected in a follow-up
-