1. 16 Jul, 2025 28 commits
  2. 15 Jul, 2025 12 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