1. 11 Sep, 2025 16 commits
    • nextjs-bot's avatar
      v15.6.0-canary.2 · ea034f6f
      nextjs-bot authored
      ea034f6f
    • Mohammad Nedaeifard's avatar
      Update content-security-policy.mdx, fix development environment error (#83665) · 8348bd32
      Mohammad Nedaeifard authored
      fix _nextjsDevtools csp error which happens in development environment
      after enabling csp and following the current documents.
      
      Full Error:
      - Refused to apply inline style because it violates the following
      Content Security Policy directive: "style-src 'self'
      'nonce-YmYyMTZmYTQtMzgxNy00ZjYwLWIwMGQtYjBmYjJjNGYzZWQ1'
      'unsafe-inline'". Note that 'unsafe-inline' is ignored if either a hash
      or nonce value is present in the source list.
      
      <!-- 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
      
      ### 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: 's avatarJoseph <joseph.chamochumbi@vercel.com>
      8348bd32
    • Hendrik Liebau's avatar
      Don't create client-side debug channel if the feature is disabled (#83699) · 5abb663b
      Hendrik Liebau authored
      Creating the client-side debug channel when
      `experimental.reactDebugChannel` is falsy went unnoticed in the
      [original PR](https://github.com/vercel/next.js/pull/82748), because
      this doesn't provoke any obvious errors. The debug info is still
      correctly received through the main RSC stream. But it does create a
      memory leak, because it prevents React from closing the Flight response.
      
      On the server side, we were already guarding the feature properly using
      the feature flag.
      5abb663b
    • Luke Sandberg's avatar
      [turbopack] Lazily construct `resolved::Requests` for `EsmAssetReference` (#83662) · 1c341690
      Luke Sandberg authored
      Right now we construct `Request` objects eagerly when analyzing modules.   This is on the critical path for analysis and can be expensive if there are a lot of exports (See [thread](https://vercel.slack.com/archives/C06PPGZ0FD3/p1757517287294729))
      
      Instead just store the string and `parse` when resolving the reference.  This should have identical caching semantics and by deferring the work we may be able to avoid it altogether if certain references never get resolved due to `sideEffects` configuration.
      1c341690
    • nextjs-bot's avatar
    • Tim Neutkens's avatar
      Turbopack: Use readFileSync / writeFileSync for manifest writing (#83694) · a01ada4e
      Tim Neutkens authored
      ## What?
      
      Use sync fs methods for reading/writing manifests after a Turbopack
      writeToDisk. Next step will be not calling it when nothing changed.
      
      Before:
      
      ```
       GET / 200 in 41ms
       GET / 200 in 54ms
       GET / 200 in 57ms
       GET / 200 in 165ms
       GET / 200 in 44ms
       GET / 200 in 52ms
       GET / 200 in 42ms
       GET / 200 in 50ms
       GET / 200 in 39ms
       GET / 200 in 53ms
       GET / 200 in 39ms
       GET / 200 in 49ms
       GET / 200 in 40ms
       GET / 200 in 49ms
       GET / 200 in 40ms
       GET / 200 in 54ms
       GET / 200 in 39ms
       GET / 200 in 52ms
       GET / 200 in 47ms
       GET / 200 in 50ms
       GET / 200 in 45ms
       GET / 200 in 59ms
       GET / 200 in 44ms
       GET / 200 in 55ms
       GET / 200 in 46ms
       GET / 200 in 51ms
      ```
      
      
      After:
      
      ```
       GET / 200 in 31ms
       GET / 200 in 29ms
       GET / 200 in 32ms
       GET / 200 in 33ms
       GET / 200 in 33ms
       GET / 200 in 34ms
       GET / 200 in 32ms
       GET / 200 in 30ms
       GET / 200 in 33ms
       GET / 200 in 30ms
       GET / 200 in 31ms
       GET / 200 in 32ms
       GET / 200 in 31ms
       GET / 200 in 31ms
       GET / 200 in 30ms
       GET / 200 in 33ms
       GET / 200 in 33ms
       GET / 200 in 32ms
       GET / 200 in 29ms
       GET / 200 in 30ms
       GET / 200 in 36ms
       GET / 200 in 35ms
       GET / 200 in 34ms
       GET / 200 in 32ms
       GET / 200 in 30ms
      ```
      a01ada4e
    • nextjs-bot's avatar
    • Joshua Hannaford's avatar
      fix(Turbopack): Enable scope hoisting for large files or module counts (#83399) · cc00206c
      Joshua Hannaford authored
      # Improve BytePos encoding for large source maps
      
      This PR enhances the BytePos encoding mechanism in scope-hoisted modules
      to handle larger source maps. The previous implementation had
      limitations when dealing with large byte positions, which could cause
      errors during source map generation.
      
      ## Changes:
      
      - Added a lookup table to store byte positions and module indexes that
      are too large for the standard encoding
      - Implemented a continuation flag (using the highest bit) to indicate
      when a position is stored in the lookup table
      - Added a sign extension flag to properly handle padded values
      - Updated all relevant code paths to use the new encoding/decoding
      mechanism
      - Adjusted the header width calculation to accommodate the new flags
      - Made the encoding/decoding functions thread-safe with Arc<Mutex<>>
      
      This approach allows us to handle arbitrarily large byte positions while
      maintaining backward compatibility with the existing encoding scheme for
      smaller values to ensure performance stays as optimal as possible.
      
      Fixes PACK-5244
      Fixes #82584
      cc00206c
    • Wyatt Johnson's avatar
      Remove clientParamParsing requirement from RDC for Navigations (#83661) · c8edeb6f
      Wyatt Johnson authored
      ### What?
      
      Removes the temporary constraint that required `clientParamParsing` to
      be enabled for Resume Data Cache (RDC) for Navigations in PPR-enabled
      applications.
      
      ### Why?
      
      The upstream builder configuration issue that caused invalid query
      parameters to be passed to resume lambdas has been resolved. The
      `clientParamParsing` requirement was a temporary workaround that can now
      be safely removed.
      
      This enhancement allows more users on PPR to automatically benefit from
      RDC for RSC requests, improving performance by eliminating waterfalls
      when resuming prerendered pages without requiring additional feature
      flags.
      
      ### How?
      
      - Removed the `clientParamParsing` check from both build configuration
      and app-page template
      - Simplified the feature enablement logic for RDC in navigation
      scenarios
      
      The change affects two files:
      - `packages/next/src/build/index.ts`: Build-time configuration logic
      - `packages/next/src/build/templates/app-page.ts`: Runtime navigation
      support detection
      
      NAR-385
      c8edeb6f
    • Hendrik Liebau's avatar
      [CI] Fix GitHub Actions matrix configuration for React versions (#83677) · 6b0559f0
      Hendrik Liebau authored
      The `build-and-test` workflow runs on `canary` are currently annotated
      with the following error
      ([x-ref](https://github.com/vercel/next.js/actions/runs/17629372493)):
      
      ```
      Error when evaluating 'strategy' for job 'test-rspack-production'. .github/workflows/build_and_test.yml (Line: 412, Col: 13): Matrix exclude key 'react' does not match any key within the matrix
      ```
      
      This addresses the issue for `test-rspack-production`, and also fixes
      inconsistencies in other jobs regarding the handling of this matrix
      dimension.
      6b0559f0
    • nextjs-bot's avatar
      v15.6.0-canary.1 · 4d82a4aa
      nextjs-bot authored
      4d82a4aa
    • Tim Neutkens's avatar
      Development: Don't import app-router / hot-reloader through next/link in application code (#83656) · 8aebac17
      Tim Neutkens authored
      ## What?
      
      Removes imports from the app-ssr layer that cause transitive
      dependencies to be included during compilation in development.
      
      For the trace that I received from an application there was quite a bit
      of overhead for them because of this issue.
      
      Trace:
      
      ![CleanShot 2025-09-10 at
      21.32.27@2x.png](https://app.graphite.dev/user-attachments/assets/8a7e5323-ed3c-4aec-8723-7fbbae89a99d.png)
      8aebac17
    • Tim Neutkens's avatar
      Turbopack: Only load capsize-font-metrics once (#83654) · a64c5915
      Tim Neutkens authored
      ## What?
      
      Currently each `next/font` import would cause the capsize-font-metrics
      json to be loaded which is 4.2Mb so not super fast to load on machines
      with a slower filesystem. On one trace provided it showed 100-160ms
      spent on loading for each `next/font` import (each individual font
      imported).
      
      On my machine it was more like 10ms per font imported. Worth fixing
      either way.
      
      ---------
      Co-authored-by: 's avatarLuke Sandberg <lukesandberg@users.noreply.github.com>
      a64c5915
    • nextjs-bot's avatar
      v15.6.0-canary.0 · c654bec6
      nextjs-bot authored
      c654bec6
    • Tim Neutkens's avatar
      Turbopack: Don't add client_runtime_entries to Route Handler compilation (#83655) · 49820961
      Tim Neutkens authored
      ## What?
      
      Currently Route Handlers trigger a compile for the client-side JS
      runtime but it's not required when compiling route handlers.
      49820961
    • Niklas Mischkulnig's avatar
      Turbopack: remove `css_environment` from `Environment` (#83487) · bdb12360
      Niklas Mischkulnig authored
      Change the fix from #83334 to not have a "CSS environment" inside of every environment. I don't think that this makes sense, and it also makes the implementation more complicated.
      ```diff
        pub struct Environment {
          execution: ExecutionEnvironment,
      +   css_environment: ResolvedVc<BrowserEnvironment>,
        }
      ```
      
      Instead, we can just pass the client's `Environment` when we create the server's transform rules, to use the client's browserslist config for styled-jsx.
      
      #83334 was also missing a test case
      
      I recommend the review each commits individually.
      bdb12360
  2. 10 Sep, 2025 7 commits
    • nextjs-bot's avatar
      v15.5.1-canary.39 · 22798842
      nextjs-bot authored
      22798842
    • Jiachi Liu's avatar
    • nextjs-bot's avatar
      v15.5.1-canary.38 · 8bc22180
      nextjs-bot authored
      8bc22180
    • Niklas Mischkulnig's avatar
    • Jiwon Choi's avatar
      [dev] Serve static metadata from filesystem (#83460) · 1482af89
      Jiwon Choi authored
      Current metadata files are compiled to `route.js` files. This happens
      not only to metadata API (e.g., `icon.tsx`), but to static files as
      well, which is unnecessary. In development, this leads to confusing logs
      such as:
      
      ```
      Compiled /favicon.ico in ...ms
      ```
      
      Users may reasonably wonder why Next.js is "compiling" a static file.
      
      Static files can be served directly from the filesystem, like
      `_next/static/` assets. Therefore, in development, skip compilation of
      static metadata files and serve them as static.
      
      For production, we can follow up in a separate PR to skip compiling the
      `route.js` files and emit static files to the dist directory, and also
      serve from the filesystem there as well.
      
      Closes [NEXT-4338](https://linear.app/vercel/issue/NEXT-4338)
      
      ---
      
      TODO(s) to follow up:
      
      - Fix Cache Components failing build with metadata files inside the
      dynamic route.
      - x-ref: [slack
      thread](https://vercel.slack.com/archives/C06N3AXRQ82/p1738053808940719)
      
      ---------
      Co-authored-by: 's avatarJiachi Liu <inbox@huozhi.im>
      1482af89
    • Vercel Release Bot's avatar
      Update font data (#83631) · 345450a1
      Vercel Release Bot authored
      Co-authored-by: 's avatarnextjs-bot <it+nextjs-bot@vercel.com>
      345450a1
    • Josh Story's avatar
      Ignore unhandledRejection events for promises that reject after a React render aborts (#83590) · c5dab314
      Josh Story authored
      Currently we only abort React renders that are prerendered so this
      change in practice only affects prerendering. The intent is to not
      report unhandledRejections that are downstream of an abort because the
      signal these errors provide is very limited. If you do have unrelated
      unhandled rejections they'll usually show up before aborting or in a
      dynamic page render so even if they are incidentally supressed in the
      prerender context you should still be able to observe them.
      
      Arguably we should go further and never report unhandled rejections
      because there are still valid patterns where you initiate work
      prospectively and then abandon it by choosing a fork or by returning
      early (i.e. notFound()). This change doesn't attempt to cover every
      possible case.
      
      The implementation is a bit intense. We need the ability to stop
      propagating the event which is not natively supported with Node's
      EventEmitter interface. Instead we patch the listener methods to
      delegate the filtering to an inner listener queue. If you add/remove or
      otherwise manipulate the listener list we always ensure our listener is
      first and can opt to omit propagating the event. If you want to
      uninstall the this patch you just need to unregister this listener
      specifically which can be accessing used
      `process.listeners('unhandledRejection')[0]`
      
      This patch only exists for the node environment because we do not do any
      prerendering in edge runtimes. In the future if we add aborting to
      environments like edge runtime we may need an alternative solution to
      this problem
      c5dab314
  3. 09 Sep, 2025 17 commits