1. 30 Jan, 2026 31 commits
    • nextjs-bot's avatar
      v16.2.0-canary.22 · fc60622f
      nextjs-bot authored
      fc60622f
    • Hendrik Liebau's avatar
      [test] Deflake `browser-log-forwarding verbose level` test suite (#89324) · f9173727
      Hendrik Liebau authored
      [flakiness
      metric](https://app.datadoghq.com/ci/test/runs?query=test_level%3Atest%20%40git.repository.id%3A%22github.com%2Fvercel%2Fnext.js%22%20%40test.name%3A%22browser-log-forwarding%20verbose%20level%20should%20forward%20all%20logs%20to%20terminal%22%20%40test.type%3A%22nextjs%22%20%40test.status%3Afail&agg_m=count&agg_m_source=base&agg_t=count&fromUser=false&index=citest&start=1769207121512&end=1769811921512&paused=false)
      
      The test frequently failed because it snapshot-asserted on the forwarded
      browser logs before the final debug message was forwarded. This is
      because the initial assertion inside the `retry` block would pass
      because it falsely matched the debug message inside the error code frame
      (line 11):
      
      ```
      [browser] browser error: this is an error message
          at Page.useEffect (app/page.tsx:10:13)
         8 |     console.info('browser info: this is an info message')
         9 |     console.warn('browser warn: this is a warning message')
      > 10 |     console.error('browser error: this is an error message')
           |             ^
        11 |     console.debug('browser debug: this is a debug message')
        12 |   }, [])
        13 | (app/page.tsx:10:13)
      ```
      
      By adding the `[browser] ` prefix to all expected log messages, we
      ensure that the test only passes when the actual log messages are
      forwarded, and not when they appear inside code frames.
      
      <!-- 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 #
      
      -->
      f9173727
    • Hendrik Liebau's avatar
      Apply server actions transform to `node_modules` in route handlers (#89316) · bb41cbd6
      Hendrik Liebau authored
      The server actions transform, which handles the `'use cache'` directive,
      was not being applied to `node_modules` when imported from route
      handlers. This caused `'use cache'` functions from dependencies to fail
      with errors like `"cacheLife() can only be called inside a 'use cache'
      function"``.
      
      The issue was that the `AppRoute` context used `internal_custom_rules`
      for its foreign code module options, which did not include the server
      actions transform. This is inconsistent with `AppRSC` (App Router
      pages), which correctly uses `foreign_next_server_rules` that includes
      the transform.
      
      The fix extends `foreign_next_server_rules` with `internal_custom_rules`
      and uses it for the foreign code context in `AppRoute`, matching the
      pattern used by `AppRSC`.
      bb41cbd6
    • nextjs-bot's avatar
      v16.2.0-canary.21 · cf7cfe27
      nextjs-bot authored
      cf7cfe27
    • Niklas Mischkulnig's avatar
      Revert "Replace build id in Pages data routes with deployment id (#88959)" (#89323) · 303e38ec
      Niklas Mischkulnig authored
      `test/e2e/middleware-redirects` has 404s on the data route
      303e38ec
    • JJ Kasper's avatar
      Add failing test to deploy-tests-manifest (#89318) · 994406ea
      JJ Kasper authored
      This test is also very flakey so adds it to the manifest as well
      994406ea
    • nextjs-bot's avatar
      v16.2.0-canary.20 · 7e33c44b
      nextjs-bot authored
      7e33c44b
    • Luke Sandberg's avatar
      Improve consistency of how Flag typed fields are handled in the macro to more… · 479877d6
      Luke Sandberg authored
      Improve consistency of how Flag typed fields are handled in the macro to more structurally prevent bugs like what was fixed in #89228 (#89255)
      
      # Fix inconsistencies in flag handling
      
      ## What?
      This PR refactors the task flags bitfield implementation to properly separate flags by category (meta vs data) during serialization and deserialization.
      
      It also regularizes the way accessors are generated to try to prevent future bugs like what was fixed in #89228
      479877d6
    • Vercel Release Bot's avatar
      Update Rspack production test manifest (#89277) · 80ace0fe
      Vercel Release Bot authored
      This auto-generated PR updates the production integration test manifest used when testing Rspack.
      80ace0fe
    • Vercel Release Bot's avatar
      Update Rspack development test manifest (#89278) · 1e4ed99d
      Vercel Release Bot authored
      This auto-generated PR updates the development integration test manifest used when testing Rspack.
      1e4ed99d
    • Neha Prasad's avatar
      Fix/zlib mem node (#89099) · abfd9945
      Neha Prasad authored
      - What?
      Fixes zlib memory leak in Node.js 24 when requests are aborted.
      
      - Why?
      Compression streams weren't cleaned up on abort, causing memory to
      accumulate.
      
      - How?
      Destroy the response on request abort/close to clean up compression
      streams.
      
      Closes NEXT-
      fixes: #89091
      abfd9945
    • nextjs-bot's avatar
      v16.2.0-canary.19 · eb828c68
      nextjs-bot authored
      eb828c68
    • Andrew Clark's avatar
      Add experimental.varyParams feature flag (#89307) · e3e6f358
      Andrew Clark authored
      ## Summary
      
      - Adds `experimental.varyParams` feature flag (defaults to `false`)
      - When disabled, the client skips vary params rekeying and treats params
      as unknown
      - Allows internal rollout with easy revert if regressions occur during
      dogfooding
      
      The flag only gates the client-side rekeying logic in `cache.ts`.
      Server-side param tracking continues regardless.
      
      ## Test plan
      
      - Enabled the flag in the vary-params and optimistic-routing test
      fixtures
      e3e6f358
    • Tobias Koppers's avatar
      Turbopack: add `rules.*.type` config to allow changing the type of a module (#88788) · 99eae38f
      Tobias Koppers authored
      ### What?
      
      This PR adds support for the `type` option in Turbopack rules, enabling users to set the module type directly without requiring a custom loader. This mirrors webpack's [`type`](https://webpack.js.org/configuration/module/#ruletype) option (e.g., `type: 'asset/resource'`).
      
      Users can now configure how files are processed by setting the module type directly:
      
      ```js
      // next.config.js
      module.exports = {
        turbopack: {
          rules: {
            '*.svg': {
              type: 'asset',
            },
          },
        },
      }
      ```
      
      When using type: 'asset', importing the file returns its URL:
      
      ```
      import svgUrl from './icon.svg'
      
      export default function Page() {
        return <img src={svgUrl} alt="Icon" />
      }
      ```
      
      More types are available. See docs
      99eae38f
    • Tobias Koppers's avatar
      Turbopack: improve print_cache_item_size (#89279) · f7e33143
      Tobias Koppers authored
      ### What?
      
      * Convert it to a markdown table
      * Show counts for all meta items
      * Show size of output
      f7e33143
    • JJ Kasper's avatar
      Inline handler dependencies instead of tracing (#89269) · c9dde8c3
      JJ Kasper authored
      This updates to remove extra tracing that was being done in
      `build-complete` for deployment adapters to allow importing internal
      `node-environment` modules. Instead this exposes `next/setup-node-env`
      to adapters outputs that can be used instead and are traced through our
      normal bundling/tracing flow.
      c9dde8c3
    • nextjs-bot's avatar
    • Niklas Mischkulnig's avatar
      Replace build id in Pages data routes with deployment id (#88959) · 6766a270
      Niklas Mischkulnig authored
      Closes PACK-6537
      
      When a deployment id is available, don't put the data routes at `_next/data/<BUILDID>/page.json`, but at `_next/data/page.json`.
      Deployment skew (forcing a MPA nav instead of a SPA nav if a deployment happened inbetween) is handled by comparing a header on the client side.
      
      
      If you use `output:export` and set `config.deploymentId` (i.e. enable skew protection) you are still expected to set these headers.
      
      ---
      
      - [x] Find the right place where the header should be added for prerendered static RSC responses (route manifest)
      6766a270
    • Sebastian "Sebbie" Silbermann's avatar
    • Jiachi Liu's avatar
      Improve lock dir error message (#89119) · af18c32b
      Jiachi Liu authored
      af18c32b
    • nextjs-bot's avatar
      v16.2.0-canary.18 · 7517e3ec
      nextjs-bot authored
      7517e3ec
    • Andrew Clark's avatar
      Track vary params during static prerendering (#89267) · 64328fe9
      Andrew Clark authored
      During prerendering, track which route params each segment accesses.
      Params that are NOT accessed can be omitted from the client router's
      cache key for that segment, allowing it to be shared across multiple
      pages and reducing the number of prefetch requests.
      
      For example, if a page at /shop/[category]/[itemId] only accesses
      `category` but not `itemId`, navigating between /shop/electronics/phone
      and /shop/electronics/tablet can reuse the same cached page segment,
      since only `category` affects its output.
      
      Most of the client-side changes were already implemented in previous
      PRs; the core mechanism was already being used for omitting search
      params from the cache keys of static segments. This generalizes the
      mechanism for all params. So this PR is primarily about adding per-param
      tracking on the server and wiring up the logic to send the params to the
      client.
      
      Each segment's CacheNodeSeedData contains its own VaryParamsThenable
      that resolves to a Set<string> of accessed param names. The thenable is
      a mutable tracker during render that accumulates param accesses, then
      resolves when rendering completes. The response also includes an `h`
      field for head vary params, which tracks params accessed by
      generateMetadata/generateViewport separately from segment body access.
      
      The trickiest part of this implementation is the timing. The vary params
      thenables represent metadata about the response, but they're also part
      of the response itself - they're streamed alongside the segment data. We
      can't know which params were accessed until rendering completes, but we
      need to resolve all thenables before aborting the stream, or else the
      client would block waiting for data that will never arrive.
      
      We address this on both sides. On the server, we resolve all thenables
      immediately before aborting. On the client, we read vary params
      synchronously using a React Flight optimization: calling
      thenable.then(noop) forces Flight to transition from 'resolved_model' to
      'fulfilled' without scheduling a microtask. If the thenable still isn't
      fulfilled after this, we fall back to null (unknown) rather than
      blocking. This ensures the client never suspends on these thenables,
      providing a safe fallback if something goes wrong with server timing.
      
      A key distinction is null vs empty Set. An empty Set means the segment
      accesses no params and can be shared across all param values - this is
      the case for client components (when Cache Components is enabled),
      segments without user code, etc. A null value means tracking failed -
      either because it's not wired up yet (like runtime prefetches), or due
      to some edge case where the thenables weren't resolved in time.
      
      For segments where we know upfront that no params will be accessed, we
      use a singleton emptyVaryParamsTracker that's already resolved. This
      ensures these segments resolve correctly even if other tracking fails.
      
      In the future, we'll likely optimize the response format by sending a
      bitmask instead of a Set of param names. But this is mostly just an
      optimization — sending the Set doesn't expose anything new since the
      param names are already embedded in the route tree (although that's also
      something we could obfuscate in the future).
      
      This does not yet implement vary param tracking during runtime
      prefetches - the abort timing needs additional coordination. Deferred to
      a separate PR.
      64328fe9
    • Tobias Koppers's avatar
      Turbopack: refactor extend transforms (#89116) · 0ed1edd8
      Tobias Koppers authored
      ### What?
      
      Stop rules when module type is set.
      Apply ecmascript transforms before module type is set. (no more errors when trying to apply a transform on non-ecmascript type)
      Fix ordering of transform apply.
      Reorder module rules to match previous order. They are applied in order now.
      0ed1edd8
    • Deni Mintsaev's avatar
      91bf0493
    • Sebastian "Sebbie" Silbermann's avatar
    • Tobias Koppers's avatar
      Turbopack: add support for contentType condition for webpack loaders (#89156) · c6de6240
      Tobias Koppers authored
      ### What?
      
      Add `contentType` condition
      
      This allows to apply webpack loaders to data urls
      
      ### Usage Example
      
      ```
      module.exports = {
        turbopack: {
          rules: {
            '*': [
              {
                condition: { contentType: 'text/*' },  // glob match
                loaders: ['text-loader'],
                as: '*.js'
              },
              {
                condition: { contentType: /^image\// },  // regex match
                loaders: ['image-loader'],
                as: '*.js'
              },
            ],
          },
        },
      }
      ```
      c6de6240
    • Vercel Release Bot's avatar
      Update font data (#89272) · e765c80b
      Vercel Release Bot authored
      Co-authored-by: 's avatarnextjs-bot <it+nextjs-bot@vercel.com>
      e765c80b
    • Tobias Koppers's avatar
      Turbopack: Trace task modifications (#89229) · 6a1bfc29
      Tobias Koppers authored
      ### What?
      
      add a feature flag `trace_task_modification` which adds the reason why a task was marked as modified to the tracing
      6a1bfc29
    • Vercel Release Bot's avatar
      Update font data (#89200) · 1711bb36
      Vercel Release Bot authored
      This auto-generated PR updates font data with latest available
      Co-authored-by: 's avatarnextjs-bot <it+nextjs-bot@vercel.com>
      1711bb36
    • jaffar keikei's avatar
      fix(router): support BigInt in query parameters (#89213) · a1e95898
      jaffar keikei authored
      **What changed?**
      `stringifyUrlQueryParam` now handles `bigint` type properly.
      
      **Why?**
      BigInt is a valid JavaScript primitive but was being converted to empty
      string:
      
      Before:
      ```js
      stringifyUrlQueryParam(123n) // '' ❌
      ```
      
      After:
      ```js
      stringifyUrlQueryParam(123n) // '123' ✓
      ```
      
      **Use case:**
      Query parameters with large integers (IDs, timestamps) often use BigInt
      to avoid precision loss.
      
      **Testing**
      Manual testing with BigInt values.
      a1e95898
    • Luke Sandberg's avatar
      [turbopack] Make shrinking logic declarative and optimize for immutable tasks (#89222) · 16087898
      Luke Sandberg authored
      Use field annotations to drive what fields get 'shrunk' when a task completes.
      
      Doing this also optimizes the implementation since instead of scanning for each field we care about we walk all fields and handle the correct subset as we find them.  
      
      Also take advantage of some features of immutable tasks (which account for about 25% of all tasks), and more aggressively drop some fields
      
      Saves quite a bit of memory and maybe a little bit of time
      
      ![image.png](https://app.graphite.com/user-attachments/assets/0eb0c6ef-c2a1-4ec3-a79c-3494484a9b97.png)
      16087898
  2. 29 Jan, 2026 9 commits