1. 08 Sep, 2025 21 commits
  2. 07 Sep, 2025 2 commits
  3. 06 Sep, 2025 2 commits
    • nextjs-bot's avatar
      v15.5.1-canary.31 · 121a2936
      nextjs-bot authored
      121a2936
    • Zack Tanner's avatar
      fix: route handlers should validate invalid exports (#83500) · f9f3afc6
      Zack Tanner authored
      When using an unsupported API in a route handler (eg, `export const
      dynamic` with `cacheComponents` enabled), we were not erroring in dev or
      failing the build. This is because the transform only asserted on pages
      & layouts, and not route handlers.
      
      This updates the handling to also check route handlers. 
      
      Fixes NAR-371
      f9f3afc6
  4. 05 Sep, 2025 12 commits
    • nextjs-bot's avatar
      v15.5.1-canary.30 · 3ef17684
      nextjs-bot authored
      3ef17684
    • Vercel Release Bot's avatar
      Update Rspack production test manifest (#83475) · 5e3959e3
      Vercel Release Bot authored
      This auto-generated PR updates the production integration test manifest used when testing Rspack.
      5e3959e3
    • Hendrik Liebau's avatar
      Use React's debug channel to transport debug info via WebSocket connection (#82748) · 0accb03c
      Hendrik Liebau authored
      In dev mode, React is sending debug info (owners, stacks, console logs
      etc.) from the server to the client so that they can be displayed in dev
      tools. By default, this info is sent as part of the main RSC payload
      (inlined into the HTML, or fetched after interaction). With this PR,
      we're now transporting the debug info in a separate debug channel. This
      channel currently consists of a unidirectional stream (writable on the
      server, readable in the client) that is serialized as binary WebSocket
      messages, which are sent through the existing WebSocket connection that
      Next.js uses for HMR messages etc.
      
      In a follow up, we will also implement the return channel (writable in
      the client, readable on the server). This allows the client to retrieve
      debug info lazily and on demand during inspection/introspection.
      
      One benefit of this approach is, that it will allow us to change our
      dynamic validation strategy. We should then be able to tee and cut off
      the dynamic RSC stream at different points in time (representing the
      static prerender, runtime prerender, and dynamic render stages), while
      still letting the complete debug info stream in through the separate
      channel. This allows us to show the same dynamic validation error
      details as before, while reducing the number of renders needed to
      accomplish that.
      
      For dogfooding purposes, the feature can be disabled by setting
      `experimental.reactDebugChannel` to `false`, in case of unexpected
      regressions in dev mode.
      
      ### An implementation note on the request ID handling
      
      On the server, at the beginning of the rendering process, we determine a
      `requestId` and an `htmlRequestId`.
      
      1. The `requestId` is a UUID that's newly generated for each incoming
      request.
      2. The `htmlRequestId` is one of two things:
          1. For the HTML request, it's the same as the `requestId`.
      2. For subsequent RSC requests (for navigations or server actions), it's
      the ID of the HTML document from where the request originates. It is
      sent as the `x-nextjs-html-request-id` request header.
      
      The HTML request ID is used to identify connected WebSocket clients.
      It's sent to the browser as the global `__next_r` variable in the script
      tag that also includes the initial RSC instructions. The browser sends
      it back to the server as `id` query param of the WebSocket request. On
      the server, we store the clients by HTML request ID. When debug chunks
      are sent to the browser, we use the HTML request ID to look up the
      correct client. (There's only one client per browser tab/window.)
      
      In the browser, we create a debug channel for each request, and we store
      them keyed by request ID. For the HTML request, the request ID from
      `__next_r` is used as key. For the RSC requests, the `requestId` is
      received as `x-nextjs-request-id` response header, and used as key. The
      server sends the current request ID as part of the WebSocket message to
      the browser, so that the chunks can be enqueued into the correct debug
      channel.
      
      closes NAR-310
      0accb03c
    • nextjs-bot's avatar
      v15.5.1-canary.29 · 437e5ef2
      nextjs-bot authored
      437e5ef2
    • Josh Story's avatar
      Include prerender interrupted error in unstable_rethrow (#83463) · a9cb9eca
      Josh Story authored
      Prerender interrupted errors are part of the control flow for Next.js
      applications and aren't intended to be caught by user code. Since we
      can't avoid it we need to include it in the rethrow API.
      a9cb9eca
    • Jiachi Liu's avatar
      ede8d1b8
    • Sebastian "Sebbie" Silbermann's avatar
    • Tim Neutkens's avatar
      Turbopack: Don't resolve tsconfig relative to file (#83484) · fe19e10c
      Tim Neutkens authored
      ## What?
      
      Changes in #83331 accidentally changed behavior of how `tsconfig.json`
      is resolved. When using Next.js we don't want it to be resolved relative
      to the current file being compiled. It should only use the application
      root.
      
      This PR fixes the behavior to match what it was before and adds a test
      that fails if it breaks again.
      fe19e10c
    • Jiachi Liu's avatar
    • Luke Sandberg's avatar
      [turbopack] enable the signal feature of `nix` (#83473) · c3232704
      Luke Sandberg authored
      This is needed by `prepared_app.rs` to manage subprocesses.  Without this we are seeing build breakages in CI e.g https://github.com/vercel/next.js/runs/49662155436
      
      This was triggered by the nix upgrade in #83414
      c3232704
    • Luke Sandberg's avatar
      [turbopack] RFC: Serialize turbopack objects as u16s instead of fully qualified… · 2a9e8426
      Luke Sandberg authored
      [turbopack] RFC: Serialize turbopack objects as u16s instead of fully qualified symbol names (#83193)
      
      Change the serialization strategy for `ValueTypeId`, `TraitTypeId` and `NativeFunction` to use `u16` values instead of the `global_name` (a fully qualified name of the object).
      
      For all these objects the value is the index+1 of the corresponding object in the set of all objects sorted by name.   This is a deterministic ordering which should ensure we can deserialize them with the same version of turbopack.
      
      Potential concerns with this approach:
      
      * debuggability in the Persistent Cache (is this even a thing?)
      * stability of ids across architectures
          * if different architectures enable/disable turbotasks then ids will change and make the PC database non-portable. 
      
      Still this should speed up serialization/deserialization by making everything smaller and faster to encode/decode
      
      On an optimized build with a fresh `.next` directory, i measured the size of the `.cache/turbopack/vxxxx` directory
      
      `benches/module-cost`:  
          change: 2.38Gb (-22%), wrote in 9.5s, compacted in 5.4s
          head:  3.06Gb bytes, wrote in 10.3s, compacted in 7.6s
      
      `vercel-site`
          change: 4.8Gb(-12%), wrote in 46ss, compacted in 6.2s
          head:  5.5Gb, wrote in 48s, compacted in 7.6s
      
      So a non-trivial size reduction as expected.  This should also speed up encoding/decoding but i didnt attempt to directly measure that.
      2a9e8426
    • Luke Sandberg's avatar
      [turbopack] Attempt #2 at making rust-analyzer happy with our macros (#83461) · 6d347938
      Luke Sandberg authored
      We are experiencing https://github.com/rust-lang/rust-analyzer/issues/19993 and Rust Analyzer is complaining about our macro gencode.  After some trial and error i determined the issue was our use of the `concat!` and specifically the inclusion of the crate name macro so this works around that.
      
      Apparently Rust Analyzers implementation of concat! or maybe token tree parsing can get confused by string literals with `-` characters in them.  Simply avoiding that for rust analyzer is a reasonable short term workaround
      6d347938
  5. 04 Sep, 2025 3 commits