1. 16 Jul, 2025 20 commits
  2. 15 Jul, 2025 20 commits
    • Zack Tanner's avatar
      upgrade to path-to-regexp@6.3.0 (#80123) · 7bcef687
      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`.
      7bcef687
    • JJ Kasper's avatar
      Update NextAdapter type and re-export (#81692) · 8b7f4c50
      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.
      8b7f4c50
    • Wyatt Johnson's avatar
      feat(build): optimize filterUniqueParamsCombinations to generate sub-combinations (#81321) · d884398d
      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: 's avatarHendrik Liebau <mail@hendrik-liebau.de>
      d884398d
    • Steven's avatar
      feat(next/image): warn when `images.qualities` is undefined (#81690) · 2b3728f9
      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.
      2b3728f9
    • nextjs-bot's avatar
      v15.4.2-canary.1 · 8b3c9337
      nextjs-bot authored
      8b3c9337
    • Benjamin Woodruff's avatar
      Turbopack: Generalize `ImportedBinding` effect creation to avoid as much… · 43b4364f
      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.
      43b4364f
    • Stojan Dimitrovski's avatar
      chore: Update `with-supabase` example to use `getClaims()` (#81383) · 8659d47c
      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: 's avatarBenjamin Woodruff <benjamin.woodruff@vercel.com>
      8659d47c
    • Anas's avatar
      fix patch-next by adding missing script (#81430) · d0ea7129
      Anas authored
      The `patch-next.cjs` script is failing because two of its dependencies,
      `pack-util` and `build-native`, are missing their CommonJS versions,
      which are required for compatibility with the current Node.js
      environment. To fix this, i added the transpiled `pack-util.js` and
      `build-native.js` files.
      
      ---------
      Co-authored-by: 's avatargraphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
      Co-authored-by: 's avatarBenjamin Woodruff <benjamin.woodruff@vercel.com>
      d0ea7129
    • JJ Kasper's avatar
      Add create release branch workflow (#81687) · e210360b
      JJ Kasper authored
      This creates a new workflow to create a release branch and apply the
      necessary configs to allow releasing from that branch as this is quite
      common for backports.
      e210360b
    • Hendrik Liebau's avatar
      Also enforce experimental features when there's no next config file (#81679) · 3c2a1959
      Hendrik Liebau authored
      When running `next build --debug-prerender`, we also want to set the experimental features even if there is no next.config.js file present.
      
      This PR also fixes the `cloneObject` function to better handle nested optional object properties, and we're now also freezing and cloning the default config before applying changes to it.
      
      > [!NOTE]  
      > This PR is best reviewed with hidden whitespace changes.
      3c2a1959
    • Cong-Cong Pan's avatar
      perf: memorize exclude function in webpack config (#81525) · 1a0c4d08
      Cong-Cong Pan authored
      During JavaScript profiling, I identified repeated calls to the exclude
      function in the webpack configuration and implemented caching to
      optimize it.
      
      <img width="2248" height="772" alt="image"
      src="https://github.com/user-attachments/assets/1fdb03f3-2904-4195-a538-7b1f4646f0f2"
      />
      
      I tested the performance using the
      [chakra-ui-docs](https://github.com/SyMind/chakra-ui-docs) repository
      with the following steps:
        1. Execute `pnpm run dev`
        2. Wait for the server to be ready (indicated by the 'Ready' message)
        3. Run `curl` on the root endpoint (`/`)
      
      | | Webpack | Rspack |
      |-|-|-|
      |After| Compiled / in 8.3s (2682 modules) | Compiled / in 2.3s (2650
      modules) |
      |Before| Compiled / in 7.8s (2682 modules) | Compiled / in 1983ms (2650
      modules) |
      
      ---------
      Co-authored-by: 's avatarBenjamin Woodruff <github@benjam.info>
      1a0c4d08
    • sangwook's avatar
      Fix before interactive incorrectly render css (#81146) · c432d07a
      sangwook authored
      Fixing a bug
      
        - Related issues linked using fixes #81130
      - 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
      
        What?
      
      This PR fixes a bug where Next.js Script components with
      strategy="beforeInteractive" incorrectly render classname attribute
      instead of the HTML standard class attribute.
      
        Why?
      
      The beforeInteractive script strategy in App Router bypassed the
      existing setAttributesFromProps utility function that properly maps
      React prop names to DOM attribute names. This caused className props to
      be directly set as classname attributes in the HTML, which is
      non-standard and breaks CSS styling.
      
        Before (broken):
      ```
        <script classname="example-class" id="example">...</script>
      ```
        After (fixed):
      ```
        <script class="example-class" id="example">...</script>
      ```
        How?
      
      1. Identified the root cause: In
      /packages/next/src/client/app-bootstrap.ts, the loadScriptsInSequence
      function manually set attributes using a simple loop that didn't handle
      DOM attribute name mapping.
        2. Applied the fix:
          - Imported the existing setAttributesFromProps utility function
      - Replaced the manual attribute setting loop with the proper utility
      function call
          - This ensures className → class mapping works correctly
      3. Added comprehensive tests: Created e2e tests in
      /test/e2e/app-dir/script-before-interactive/ that verify:
          - Single scripts render with correct class attribute
          - Multiple scripts work correctly
          - Script execution remains unaffected
          - Scripts are properly placed in document head
      
        Code changes:
      ```
        // Before (buggy)
        if (props) {
          for (const key in props) {
            if (key !== 'children') {
              el.setAttribute(key, props[key])  // ❌ className becomes classname
            }
          }
        }
      ```
        // After (fixed)  
      ```
        if (props) {
          setAttributesFromProps(el, props)  // ✅ className becomes class
        }
      ```
        Fixes #81130
      
      ---------
      Co-authored-by: 's avatarJJ Kasper <jj@jjsweb.site>
      c432d07a
    • JJ Kasper's avatar
      Ensure custom NextServer config is honored (#81681) · a0d15704
      JJ Kasper authored
      This ensures if using NextServer or a custom-server directly we honor
      the custom config passed in correctly.
      a0d15704
    • Vercel Release Bot's avatar
      Update Rspack production test manifest (#81661) · f44efa80
      Vercel Release Bot authored
      This auto-generated PR updates the production integration test manifest used when testing Rspack.
      f44efa80
    • Vercel Release Bot's avatar
      Update Rspack development test manifest (#81660) · 899d993b
      Vercel Release Bot authored
      This auto-generated PR updates the development integration test manifest used when testing Rspack.
      899d993b
    • BYUNGI's avatar
      fix(router): Prevent redirect loop on root data requests with basePath (#81096) · 5a7cec1e
      BYUNGI authored
      Fixes #64910
      
      This PR resolves an issue where a client-side navigation to the root
      page fails when both `basePath` and `middleware` are active. This is
      caused by an incorrect redirect loop on the `/_next/data` request.
      
      The sequence of events is as follows:
      1. Next.js enforces its `trailingSlash: false` policy by adding an
      internal redirect from `{basePath}/` to `{basePath}`.
      2. For middleware to be invoked correctly, a data request for the root
      page is normalized to `/`.
      3. The path is then re-joined with the `basePath` using
      `path.posix.join(config.basePath, '/')`, which incorrectly results in
      `{basePath}/`.
      4. This malformed path triggers the redirect from step 1, causing the
      data fetch to fail with a 308 status code and resulting in empty
      `pageProps`.
      
      This fix isolates the root path (`/`) during path normalization to
      prevent an extra trailing slash from being added. By ensuring the path
      resolves to `{basePath}` instead of `{basePath}/`, the redirect loop is
      avoided.
      
      The change correctly handles the root path while leaving the logic for
      all other paths untouched.
      
      ---------
      Co-authored-by: 's avatarJJ Kasper <jj@jjsweb.site>
      5a7cec1e
    • Niklas Mischkulnig's avatar
      16011fe8
    • Hendrik Liebau's avatar
      Improve reliability of owner stacks for async I/O errors (#81501) · 465c2218
      Hendrik Liebau authored
      When running the following test isolated, and not as part of the full
      test suite, the owner stacks for async I/O errors were missing the
      top-most stack frame that's pointing at the `fetch` call.
      
      ```
      pnpm test-dev test/e2e/app-dir/dynamic-io-errors/dynamic-io-errors.test.ts -t "should show a collapsed redbox with two errors"
      ```
      
      The same could be reproduced with `pnpm next dev
      test/e2e/app-dir/dynamic-io-errors/fixtures/default` at
      http://localhost:3000/dynamic-root, unless http://localhost:3000/static
      was visited first.
      
      The likely reason for that is that React's async I/O tracking was
      recently optimized for performance reasons in facebook/react#33736 and
      facebook/react#33737.
      
      We can help React a bit with the tracking by explicitly awaiting our
      `makeHangingPromise` calls. With this fix, the case from above reliably
      works in isolation.
      465c2218
    • Ankur Datta's avatar
      Add Prisma ORM example to Next.js examples (#75290) · 92a9d284
      Ankur Datta authored
      - A Next.js starter app using [Prisma
      Postgres](https://www.prisma.io/postgres) and Prisma ORM
      
      This PR adds a new example demonstrating how to integrate Prisma ORM
      with a Next.js application. The example includes:
      
      - Setup instructions for Prisma Postgres
      - Example models and queries
      - Basic CRUD operations using Prisma
      
      ---------
      Co-authored-by: 's avatarNikolas <nikolas.burk@gmail.com>
      Co-authored-by: 's avatarAlex Martin <alex.martin@vercel.com>
      Co-authored-by: 's avatarJJ Kasper <jj@jjsweb.site>
      92a9d284
    • Steven's avatar
      chore(bot): update comment (#81672) · 90c71b46
      Steven authored
      The stale bot comment says 2 years even though its 1.5 years (or 545
      days to be precise).
      
      The exact amount of time is not as important in this message so we can
      remove it to avoid drift between the message and actual stale time.
      90c71b46