- 16 Jul, 2025 33 commits
-
-
nextjs-bot authored
-
Jiachi Liu authored
There're should be only one indicator rendered when `showIndicator` state is true, the previous condition is not correct since the previous change seem causing indicator always rendered even on SSR. since devtool bundle is also bundled on ssr layer, but the related code should not get executed. We noticed the previous condition will always render the indicator, which likely triggered some `base-ui` browser code to execute on server and crash on windows. Related #81722
-
Hendrik Liebau authored
This ensures that we show a proper error with an error stack (potentially source-mapped) when accessing `headers`/`cookies`/`draftMode` in `'use cache'`, even when caught in user-land code. For `searchParams` (currently triggering a timeout error) we'll need a slightly different solution, which will be handled in a future PR. The approach chosen here is somewhat temporary, as we'd like to implement compile-time errors instead for accessing any kind of request data in `'use cache'` functions. However, this would require a larger change to our bundlers. closes NAR-201
-
Zack Tanner authored
When we updated `experimental.strictNextHead` to be true in #65418, we did not update all spots that would default to true in the case where the value was omitted entirely. This led to the default value not being correctly applied in pages router, which resulted in duplicate metadata w/ React 19. Since we made the flag the default, we can also probably clean up this flag all together, but that can be done separately. Fixes #81655 Fixes #81689
-
Ben Gubler authored
## Update GitHub username in labeler configuration I just changed my username from "nebrelbug" to "bgub"
-
nextjs-bot authored
-
Wyatt Johnson authored
Reverts changes to the `routes-manifest.json` from #81321. Incorrect route sorting was causing some routing errors.
-
Sebastian "Sebbie" Silbermann authored
Co-authored-by:Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com>
-
Luke Sandberg authored
## Add a regression test for when a not-found component depends on css and triggers a bug in turbopack To correctly serve js and css resources during server side rendering we construct a client manifest that lists all the server components and their required resources. Turbopack has a bug where we fail to collect css that is used by the page if it is also used by a not-found page (and other error handlers as well). When a not-found component is present all pages pages implicitly depend on this module and depend on it as an early dependency of the generated `app-page.js` file. This means if a `not-found.js` file (or a global error file) would happen to depend on the same css as a normal component we would associate it as a client-reference of that component instead of any other. Then on a server side render we would simply omit it. This PR adds a regression test for this issue. See #77861 and #79535
-
Vercel Release Bot authored
This auto-generated PR updates the production integration test manifest used when testing Rspack.
-
Vercel Release Bot authored
This auto-generated PR updates the development integration test manifest used when testing Rspack.
-
Andrew Clark authored
Fixes an issue where opting into dynamic prefetching with prefetch={true} would not apply to head data (like the title), only the page data. Although the head was being sent by the server as part of the prefetch response, it wasn't being transferred correctly to the prefetch cache. The net result is that you can now fully prefetch a page with a dynamic title without any additional network requests on navigation. -
Andrew Clark authored
Fixes a problem with the internal `createRouterAct` testing helper where the `block: "reject"` option would not error correctly, leading to potential false negatives. I think I accidentally broke this when I added the ability to provide an array of expected responses.
-
nextjs-bot authored
-
Sebastian "Sebbie" Silbermann authored
-
nextjs-bot authored
-
Tim Neutkens authored
## What? Adds support for `remarkPlugins: ['remark-gfm']` and `rehypePlugins: ['rehype-slug']`. Previously you had to nest an array like `remarkPlugins: [['remark-gfm']]` but that's a bug, that case is only for passing options. Directly passing the string without options should be allowed. This PR implements that.
-
Wyatt Johnson authored
### What? Optimizes the `buildAppStaticPaths` function performance and extracts a helper function `calculateFallbackMode` to reduce code duplication. ### Why? The `buildAppStaticPaths` function had several performance bottlenecks: 1. **Repeated regex pattern compilation**: Route parameter patterns were being compiled inside the loop for every route, causing unnecessary overhead 2. **Inefficient root parameter lookups**: Using `Array.includes()` for root parameter checks resulted in O(n) lookups for each parameter 3. **Duplicated fallback mode logic**: The same fallback mode calculation was repeated in multiple places, making the code harder to maintain and prone to inconsistencies These inefficiencies became more apparent when processing large numbers of routes with complex parameter structures. ### How? **Performance optimizations:** - Pre-compile regex patterns for route parameters outside the loop and store them in a Map for O(1) lookups - Convert `rootParamKeys` to a Set for O(1) lookup time instead of O(n) array searches - Optimize the fallback parameter collection loop to break early and avoid redundant iterations **Code organization:** - Extract `calculateFallbackMode` helper function to eliminate code duplication - Add comprehensive tests for the new helper function to ensure correctness - Simplify the main loop logic by using the pre-compiled patterns and optimized data structures
-
Janka Uryga authored
`rootParams` was erroring if used in a `'prerender-client'`, but only if we had `fallbackRouteParams`. this is an edge case, but it is technically possible to hit if our compiler checks for using `rootParams` in client code are bypassed. i've also had to split `PrerenderStoreModern` into two types instead of having `type: 'prerender' | 'prerender-client'`. otherwise, typescript would think that the `case 'prerender'` branch wasn't enough to eliminate `PrerenderStoreModern` even though we already handled the `prerender-client` case at the top. this made the `prerenderStore satisfies never` assertion at the bottom fail. This is a bit tricky to explain, so i'm including a [TS playground repro](https://www.typescriptlang.org/play/?#code/C4TwDgpgBAysD2AnCAZCBzAhgYxFAvFAN5SiQBcUA5GMsgHYAmEiAtADYY4hUC+AUGWhwkEALLxmiegWKlwESjToQmLKlAA+1Wi1VTW2dgEtVwDQKGwEyWSORosuLddESp9fvwgAPMEmAoADMAV3psYGN4GQBnFgA3FgB5enYQABUAC2N6dAAKGJtFV2QASkpCxBz0Yn4oeqhjIKgCooA6K3wunRU1NiNTenNS2oax0kzEeAB3KHoIWYBRRCnEPKoAOXhAzHZ2GYhGRpkBsypSuoaBMZjp42BsTJbC0Q6FEaJL8agAeh+obCYOI9PR9QwmM5fcZ-KAAPSgAGFMPQqIFGPAJsYYlBMnooJgsDkADRQdIwKAsVbYu7AJ4AA3SCmoACJdAwDKchsyNFi5tsAfAALZgTCITAAI04pAxViorN6Bk4ThAzJc8tBUm5bTpULGMLy4oggJCwOm0EeRoA1ocJphAoagqIAIQXXUNQHA5Qa9SUT7fb7IYAhaRQZkAdQgVFsOXxUEFkhYMjZ+hYzLd9Wu-o90C97JYHC4uCovvT40DwZk4cj0ZkmCgSu4UGTfTT-qgme+zCCmBC7GAJbbNyKUBidqxQVM2PmiUQpb1-1hAH45w0YW11+KQoEyZj6JbsXSXsg6QDkSPInsoIbY-ZxAmQ7jbBBEjJafAQugnmaqIkKSZBTkdo2uK2xPP4MQxMYkrmkCEDYqWHbtvwAhAA) i'm guessing that `type: 'prerender' | 'prerender-client'` is more complex than a normal discriminator and TS was getting confused, which is why having two separate types solves it.
-
Jiachi Liu authored
-
Sebastian "Sebbie" Silbermann authored
-
Hendrik Liebau authored
When reading a cache entry, we usually check its tags against the recently revalidated tags, and dismiss it, if it has any of those tags. However, this is only needed during dynamic requests, specifically during the rendering that follows a revalidating server action. During the prerender validation in dev mode, we should not discard the cache entries based on the pending revalidation. The concurrently running dynamic rendering will handle discarding and recreating those cache entries. During build-time prerendering, there will never be any pending revalidated tags. This fixes a bug where a different value was rendered when revalidating with a server action and then reloading the page afterwards (or triggering another unrelated revalidating server action).
-
nextjs-bot authored
-
Hendrik Liebau authored
After having revalidated a prerendered route handler, on the subsequent request we must discard the prerendered data from the file system cache, as we already do for pages and fetch caches as well. > [!NOTE] > This PR is best reviewed with hidden whitespace changes.
-
Hendrik Liebau authored
When a server action or `'use cache'` function is defined as a synchronous function, the error message now only marks the function name for better clarity. Previously, the entire function body was marked, which looks fine in small test fixtures, but is pretty messy for larger functions, both in the terminal as well as in the dev error overlay. For anonymous default exports we can't optimize this and are still marking the entire function body, as we don't have a name to refer to. closes NAR-165
-
Hendrik Liebau authored
The `renderToString` function's last usage was removed in #78495.
-
nextjs-bot authored
Co-authored-by:Sebastian Sebbie Silbermann <sebastian.silbermann@vercel.com>
-
Sebastian "Sebbie" Silbermann authored
-
Hendrik Liebau authored
We're splitting the test app routes between two root layouts, one for (partially) static pages that does not wrap its children in a Suspense boundary, and one for dynamic pages that adds a Suspense boundary above `body`, which opts those pages into fully dynamic rendering. Two tests are expected to fail for now, because they revealed bugs related to revalidation, which will be fixed in follow-up PRs: - https://github.com/vercel/next.js/pull/81611 - https://github.com/vercel/next.js/pull/81621 closes NAR-171
-
Hendrik Liebau authored
We want to respect the `__NEXT_EXPERIMENTAL_PPR` and `__NEXT_EXPERIMENTAL_CACHE_COMPONENTS` environment variables in the test apps, so that we can run them locally with these features enabled without needing to modify the config files. So we're removing the requirement that `__NEXT_TEST_MODE` needs to be set at the same time. Usually you don't want to set this variable locally because it also changes other behavior in a few places. This really has no downside, because it was already possible for users to set both variables and affect the flags, and now this can be done with a single variable. It allows us to keep the noise out of the test app's next config files. We're also moving the assignments from the default config into `enforceExperimentalFeatures` to get the nice output when printing the experimental features in the CLI.
-
Prateek Choudhary authored
### What? Updated the documentation to clarify that App Router requires manual locale handling through dynamic route segments and middleware, with examples showing how to implement i18n redirects correctly. ### Why? The App Router doesn't use the i18n configuration in next.config.js like the Pages Router does. Closes NEXT- Fixes #81227 --------- Co-authored-by:
Joseph <joseph.chamochumbi@vercel.com> Co-authored-by:
Joseph <sephxd1234@gmail.com>
-
Jiachi Liu authored
Remove panel ui flag --------- Co-authored-by:RobPruzan <rapruzan@buffalo.edu>
-
Jiachi Liu authored
-
- 15 Jul, 2025 7 commits
-
-
Zack Tanner authored
Upgrades `path-to-regexp` to address backing concerns from `CVE-2024-45296`. As a result, this requires some additional pre-processing on the paths we generate for interception routes, to ensure we pass a compliant value into `path-to-regexp`.
-
JJ Kasper authored
Just fixes up the type and re-exports it so it can be imported directly from `next`. Also fixes test file not being type checked which didn't catch missing optional fields.
-
Wyatt Johnson authored
### What? Optimizes the `generateParamPrefixCombinations` function (previously `filterUniqueRootParamsCombinations`) to generate all unique sub-combinations of route parameters while ensuring partial shells include complete sets of root parameters. ### Why? The previous implementation only generated combinations at the root parameter level, which was insufficient for PPR (Partial Prerendering) shells. PPR needs all possible prefix combinations of route parameters to create effective shells for nested routes. For example, for a route `/[lang]/[region]/[slug]`, we need shells for: - `/[lang]/[region]` (complete root params) - `/[lang]/[region]/[slug]` (full route) Without proper sub-combinations, nested routes couldn't benefit from PPR shell optimization, leading to performance degradation. ### How? - Renamed `filterUniqueRootParamsCombinations` to `generateParamPrefixCombinations` to better reflect its expanded functionality - Added logic to generate all prefix combinations of route parameters, not just root-level combinations - Implemented root parameter validation to ensure partial shells only include complete sets of root parameters - Added comprehensive test coverage for edge cases including undefined parameters, missing keys, and parameter collisions - Optimized the algorithm to skip invalid combinations early when root parameters are incomplete The function now generates prefix combinations systematically while maintaining backward compatibility and preventing invalid partial routes. NAR-159 --------- Co-authored-by:Hendrik Liebau <mail@hendrik-liebau.de>
-
Steven authored
Add a warning to Next.js 15.5 to prepare for Next.js 16 when `images.qualities` is undefined and the user attempted to use set `quality` prop to something other than 75.
-
nextjs-bot authored
-
Benjamin Woodruff authored
Turbopack: Generalize `ImportedBinding` effect creation to avoid as much special-casing of SimpleAssignTarget (#81653) There was some logic here that checked for the existence of `SimpleAssignTarget`, and using that to bail out of `visit_ident`. That doesn't scale well to pattern assignments, but it turns out that we don't need to bail out, we just need to fix the codegen. Without this, https://github.com/vercel/next.js/pull/81654 breaks the test cases.
-
Stojan Dimitrovski authored
Updates the `with-supabase` example to use the new and much faster (when project is configured with asymmetric JWT support) `supabase.auth.getClaims()` function instead of `getUser()`. --------- Co-authored-by:Benjamin Woodruff <benjamin.woodruff@vercel.com>
-