1. 10 Feb, 2026 14 commits
    • nextjs-bot's avatar
      v16.2.0-canary.35 · 381aa36e
      nextjs-bot authored
      381aa36e
    • Will Binns-Smith's avatar
      Turbopack: extract core hmr client logic into shared runtime (#88912) · d77eb040
      Will Binns-Smith authored
      This PR mostly moves existing code. Most of the diff churn is from re-recording shapshots. This PR is nowhere as scary as the diffstat would have you believe.
      
      This extracts the core HMR client logic, abstracting away hooks for platform-specific features like the websocket transport and page reload.
          
      In a future PR this will be implemented as an in-process backend for nodejs server hmr.
          
      Test Plan: CI, existing hmr tests
      d77eb040
    • Janka Uryga's avatar
      [Instant] Validation on client navs (#89777) · f7dd09fd
      Janka Uryga authored
      This PR makes instant validation work for client navigations, albeit in
      a pretty inefficent way. If we're navigating and have an `instant`
      config somewhere in the tree, we won't skip shared layouts like a client
      navigation usually would. Instead, we render all the shared segments too
      (via `createFullTreeFlightDataForNavigation`, a very simplified
      variation of `walkTreeWithFlightRouterState`) and use them to perform
      instant validation on the current page. The client router doesn't mind
      getting extra segments -- `startPPRNavigation` (and
      `updateCacheNodeOnNavigation` specifically) ignore segments that are
      already present in the old tree.
      
      This approach has some downsides:
      - It doesn't match prod behavior (parent layouts don't render there), so
      it could lead to user confusion
      - We're validating using different segments that the browser actually
      has, so we could see an error in the validation that isn't present in
      the browser
      
      but we'll iterate on this later. We only do this when a page is using
      `instant`, so for now the impact is narrowed down to early adopters.
      
      ### Test changes
      
      For each test case we have, we now run it both on initial load and on
      client nav.
      
      This got somewhat noisy because i had to reorganize the test files a
      bit. We use the index pages to test client navigations, but in order to
      do that, we need the source and the target to be inside the same root
      layout -- otherwise, they'd be an MPA nav.
      f7dd09fd
    • Will Binns-Smith's avatar
      Turbopack: Reorganize runtime files into shared/runtime directory (#89461) · 4385ed36
      Will Binns-Smith authored
      This change moves runtime code that does not use a module system and is concatenated by Rust into a dedicated `runtime/` directory so it's not confused with other code. 
      
      It also codifies this in a README and instructs agents to read nearby READMEs so they enforce this convention.
      
      **This change only moves code and does not refactor any further.** Snapshot updates reflect the new file paths in the generated runtime code.
      
      **Test Plan:** CI, existing tests
      4385ed36
    • Will Binns-Smith's avatar
      Turbopack: Server HMR infrastructure (#88870) · aac4ebb7
      Will Binns-Smith authored
      This adds some basic JavaScript/TypeScript infrastructure for Next to receive and handle server-side HMR updates from Turbopack.
      
      This:
      - Renames some existing hmr code as explicitly client hmr
      - Adds counterpart apis for server hmr (e.g. subscribe to server HMR events via `project.serverHmrEvents()`)
      - Add `__turbopack_server_hmr_apply__` runtime function (this is a stub for now, just logs on updates)
      
      **Alternatives considered**
      A single firehose for hmr events, pushing the filtering to the JS side. I figured separate dedicated apis would be cleaner since they’d have to be filtered and switched on anyway.
      
      **In future PRs**
      - Rust: Make Turbopack send 'partial' updates for server file changes
      - Node dev runtime: Implement module factory replacement in `__turbopack_server_hmr_apply__`
      - add client notification to trigger re-fetch of rsc
      - e2e tests
      aac4ebb7
    • nextjs-bot's avatar
      v16.2.0-canary.34 · a9ecc09b
      nextjs-bot authored
      a9ecc09b
    • Will Binns-Smith's avatar
      Tracing: trace render times as render-path (#89763) · 4d3ccd6a
      Will Binns-Smith authored
      Analagous to the existing compile-path, which records compile times for
      each path in development, we now record path render times as
      `render-path`. It corresponds with the value we write to the tty when
      rendering routes (e.g. `GET / 200 in 228ms (compile: 129ms, render:
      99ms)`).
      
      This change also adds tests for recording hmr data in the trace file.
      
      Test Plan:
      - CI
      - Made changes in a test app and verified the trace file included valid
        entries for these. Confirmed the duration matched what was shown in
      the cli.
      4d3ccd6a
    • Niklas Mischkulnig's avatar
      Improve not-found-with-pages test (#89538) · e8372967
      Niklas Mischkulnig authored
      The fixture contains both App and Pages router
      But the assertions only ever tested the App endpoints
      
      Fixed by https://github.com/vercel/vercel/pull/14878
      
      There is still a bug in the builder:
      ```
      FAIL webpack test/e2e/app-dir/not-found-with-pages-i18n/not-found-with-pages.test.ts (57.396 s)
        not-found-with-pages-i18n
          ✕ should prefer the app router 404 over the pages router 404 when both are present - browser /app-dir/foo (3528 ms)
          ✕ should prefer the app router 404 over the pages router 404 when both are present - browser /foo (401 ms)
          ✓ should prefer the app router 404 over the pages router 404 when both are present - SSR /app-dir/foo (141 ms)
          ✕ should prefer the app router 404 over the pages router 404 when both are present - SSR /foo (249 ms)
      
        ● not-found-with-pages-i18n › should prefer the app router 404 over the pages router 404 when both are present - browser /app-dir/foo
      
          expect(received).toBe(expected) // Object.is equality
      
          Expected: "APP ROUTER - 404 PAGE"
          Received: "PAGES ROUTER - 404 PAGE"
      
            27 |
            28 |       await browser.loadPage(next.url)
          > 29 |       expect(await browser.elementByCss('h1').text()).toBe(
               |                                                       ^
            30 |         'APP ROUTER - 404 PAGE'
            31 |       )
            32 |     }
      
            at toBe (e2e/app-dir/not-found-with-pages-i18n/not-found-with-pages.test.ts:29:55)
      
        ● not-found-with-pages-i18n › should prefer the app router 404 over the pages router 404 when both are present - browser /foo
      
          expect(received).toBe(expected) // Object.is equality
      
          Expected: "APP ROUTER - 404 PAGE"
          Received: "PAGES ROUTER - 404 PAGE"
      
            22 |     async (s) => {
            23 |       const browser = await next.browser(s)
          > 24 |       expect(await browser.elementByCss('h1').text()).toBe(
               |                                                       ^
            25 |         'APP ROUTER - 404 PAGE'
            26 |       )
            27 |
      
            at toBe (e2e/app-dir/not-found-with-pages-i18n/not-found-with-pages.test.ts:24:55)
      
        ● not-found-with-pages-i18n › should prefer the app router 404 over the pages router 404 when both are present - SSR /foo
      
          expect(received).toContain(expected) // indexOf
      
          Expected substring: "APP ROUTER - 404 PAGE"
          Received string:    "<!DOCTYPE html><html lang=\"en\" data-dpl-id=\"dpl_BM4HgVbmReroGBTz3augsyMX43xG\"><head><meta charSet=\"utf-8\" data-next-head=\"\"/><meta name=\"viewport\" content=\"width=device-width\" data-next-head=\"\"/><noscript data-n-css=\"\"></noscript><script defer=\"\" noModule=\"\" src=\"/_next/static/chunks/polyfills-42372ed130431b0a.js?dpl=dpl_BM4HgVbmReroGBTz3augsyMX43xG\"></script><script src=\"/_next/static/chunks/webpack-70c336f9a46f13b1.js?dpl=dpl_BM4HgVbmReroGBTz3augsyMX43xG\" defer=\"\"></script><script src=\"/_next/static/chunks/framework-8c604becf61eba86.js?dpl=dpl_BM4HgVbmReroGBTz3augsyMX43xG\" defer=\"\"></script><script src=\"/_next/static/chunks/main-16ce12b5863057b2.js?dpl=dpl_BM4HgVbmReroGBTz3augsyMX43xG\" defer=\"\"></script><script src=\"/_next/static/chunks/pages/_app-688aa0c7241baf30.js?dpl=dpl_BM4HgVbmReroGBTz3augsyMX43xG\" defer=\"\"></script><script src=\"/_next/static/chunks/pages/404-b7a49e5d00a03545.js?dpl=dpl_BM4HgVbmReroGBTz3augsyMX43xG\" defer=\"\"></script><script src=\"/_next/static/_buildManifest.js?dpl=dpl_BM4HgVbmReroGBTz3augsyMX43xG\" defer=\"\"></script><script src=\"/_next/static/_ssgManifest.js?dpl=dpl_BM4HgVbmReroGBTz3augsyMX43xG\" defer=\"\"></script></head><body><div id=\"__next\"><div><h1>PAGES ROUTER - 404 PAGE</h1><p>This page is using the PAGES ROUTER</p><p>Custom message fetched at build time</p></div></div><script id=\"__NEXT_DATA__\" type=\"application/json\">{\"props\":{\"pageProps\":{\"message\":\"Custom message fetched at build time\"},\"__N_SSG\":true},\"page\":\"/404\",\"query\":{},\"buildId\":\"build-TfctsWXpff2fKS\",\"isFallback\":false,\"isExperimentalCompile\":false,\"gsp\":true,\"locale\":\"en\",\"locales\":[\"en\",\"en-GB\"],\"defaultLocale\":\"en\",\"scriptLoader\":[]}</script></body></html>"
      
            38 |       const ssr = await next.fetch(s)
            39 |       expect(ssr.status).toEqual(404)
          > 40 |       expect(await ssr.text()).toContain('APP ROUTER - 404 PAGE')
               |                                ^
            41 |     }
            42 |   )
            43 | })
      
            at toContain (e2e/app-dir/not-found-with-pages-i18n/not-found-with-pages.test.ts:40:32)
      ```
      e8372967
    • Tim Neutkens's avatar
      Add 2nd cloned body to FinalizationRegistry. Only used RuntimeStyles component for webpack (#88577) · 53481e3f
      Tim Neutkens authored
      ### What?
      
      Reduces memory retention in two areas: response stream cleanup in
      `cloneResponse` and unnecessary runtime style initialization in
      Turbopack mode. Also adds a test fixture for standalone mode fetch
      memory leak detection.
      
      ### Why?
      
      Based on the reproduction provided in #85914, investigating potential
      sources of memory retention. When a `ReadableStream` is tee'd, both
      branches must be cancelled to release connection resources — previously
      only one branch was registered for GC cancellation. Additionally,
      `RuntimeStyles` and `_N_E_STYLE_LOAD` were always initialized even in
      Turbopack mode where they are unused.
      
      ### How?
      
      **`clone-response.ts`**: Register both `cloned1` and `cloned2` bodies
      with the `FinalizationRegistry` so that when either response is garbage
      collected, its stream branch is properly cancelled.
      
      **`app-router.tsx`**: Guard `_N_E_STYLE_LOAD` and style tracking `Set`
      initialization behind `!process.env.TURBOPACK && typeof window !==
      'undefined'`. Rename the component to `RuntimeStylesForWebpack` and skip
      rendering it entirely when using Turbopack.
      
      Fixes #85914
      
      ---------
      Co-authored-by: 's avatarUnghee Lee <unghee66@gmail.com>
      53481e3f
    • Hendrik Liebau's avatar
      [test] Add regression test for segment cache prefetch memory leak (#89756) · a2409549
      Hendrik Liebau authored
      Follow-up to #89610.
      
      Adds an e2e test that detects linear heap growth caused by unclosed
      prefetch response streams. The test cycles through mounting/unmounting
      links to trigger repeated prefetches and LRU evictions, then uses CDP
      heap profiling with linear regression to verify the heap plateaus rather
      than growing steadily.
      
      
      ![heap-growth-chart](https://github.com/user-attachments/assets/6151c0e4-7ae1-4526-b094-8d76154be664)
      a2409549
    • Abhishek Mardiya's avatar
      clarify unstable_cache replacement with use cache (#89435) · a7a01745
      Abhishek Mardiya authored
      There’s an inconsistency in the docs:
      [unstable_cache](https://nextjs.org/docs/app/api-reference/functions/unstable_cache)
      has already been replaced by use cache, so I think the documentation
      should be updated accordingly.
      I’d appreciate it if you could look into this, should that be the case.
      @icyJoseph
      
      <!-- 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>
      a7a01745
    • Niklas Mischkulnig's avatar
      Pass shouldCache to all manifest loading calls (#89713) · c76b0fe2
      Niklas Mischkulnig authored
      A few calls were missing `shouldCache`
      c76b0fe2
    • Vercel Release Bot's avatar
      Update Rspack development test manifest (#89702) · a1cb030e
      Vercel Release Bot authored
      This auto-generated PR updates the development integration test manifest used when testing Rspack.
      a1cb030e
    • Vercel Release Bot's avatar
      Update Rspack production test manifest (#89701) · e407560d
      Vercel Release Bot authored
      This auto-generated PR updates the production integration test manifest used when testing Rspack.
      e407560d
  2. 09 Feb, 2026 9 commits
  3. 08 Feb, 2026 9 commits
  4. 07 Feb, 2026 6 commits
  5. 06 Feb, 2026 2 commits