1. 13 Feb, 2026 29 commits
    • nextjs-bot's avatar
      v16.2.0-canary.44 · 1ea3233a
      nextjs-bot authored
      1ea3233a
    • Hendrik Liebau's avatar
      Run fast immediates during prerender abort to fix flaky I/O stack traces (#89969) · e0668e46
      Hendrik Liebau authored
      Follow-up for #89834.
      
      In `prerenderAndAbortInSequentialTasks`, React's `finishHalt` (scheduled
      via `setImmediate` from `abort()`) could race with the component's
      pending `setTimeout` callback. When both ended up in the same timer
      phase, the component timer would fire after `abort()` but before
      `finishHalt`, linking the async graph and producing the more precise
      `await` location (21:9). When `finishHalt` won the race, it read an
      unlinked graph and fell back to the function declaration (20:16).
      
      Adding `DANGEROUSLY_runPendingImmediatesAfterCurrentTask()` to the abort
      task captures `finishHalt` as a fast immediate, ensuring it runs right
      after `abort()` before any other timers. This makes the result
      deterministic at the cost of always producing the less precise stack
      frame (function declaration instead of `await` expression). The resolve
      step is split into a separate task because it needs to wait for the
      abort's fast immediates to complete.
      
      When using `--debug-prerender`, we're also re-adding the hint to run
      `next dev` for even better stack traces, since dev mode can produce the
      precise `await` location by running the render to completion and
      resolving the I/O promises.
      
      [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.type%3A%22nextjs%22%20%40test.status%3A%22fail%22%20%40test.suite%3A%22Cache%20Components%20Errors%22%20%40git.branch%3Acanary%20-%40ci.pipeline.name%3Atest-e2e-deploy-release&agg_m=count&agg_m_source=base&agg_t=count&currentTab=overview&eventStack=&fromUser=false&index=citest&start=1770404554855&end=1771009354855&paused=false)
      e0668e46
    • JJ Kasper's avatar
      Fix missing incremental cache in middleware unstable_cache (#89980) · 69d63edc
      JJ Kasper authored
      ## Summary
      - pass `IncrementalCache` into the shared middleware template adapter so
      middleware/proxy modules initialize `globalThis.__incrementalCache`
      - add regression coverage for `unstable_cache` usage inside both
      deprecated `middleware` (edge) and `proxy` (node) fixtures
      - verify both e2e suites pass without hitting `Invariant:
      incrementalCache missing in unstable_cache`
      
      ## Verification
      - `pnpm build`
      - `NEXT_SKIP_ISOLATE=1 NEXT_TEST_MODE=dev pnpm testonly
      test/e2e/app-dir/app-middleware/app-middleware.test.ts`
      - `NEXT_SKIP_ISOLATE=1 NEXT_TEST_MODE=dev pnpm testonly
      test/e2e/app-dir/app-middleware-proxy/app-middleware-proxy.test.ts`
      69d63edc
    • JJ Kasper's avatar
      Turbopack hmr: preserve group factory consistency for compressed modules (#89976) · ad7d27ec
      JJ Kasper authored
      ## Summary
      - update `installCompressedModuleFactories` to reuse an existing factory
      in a compressed ID group when filling missing IDs
      - keep `newModuleId` notifications aligned with actual IDs installed
      (`newModuleId(id)`)
      - add an execution regression test for the mixed-group case where one ID
      already has a factory and another is missing
      - regenerate affected runtime snapshots
      (runtime/debug-ids/workers/preset_env)
      
      Aims to fix cases like this being seen recently:
      
      ```sh
      Error: Module 8896 was instantiated because it was required from module 18500, but the module factory is not available.
      ```
      
      ```
      
      ## Test Plan
      - `cargo test -p turbopack-tests --test execution test_tests__execution__turbopack__runtime__factory_group_existing_factory__input__index_js -- --nocapture`
      - `cargo test -p turbopack-tests --test snapshot test_tests__snapshot__runtime__default_build_runtime__input__index_js -- --nocapture`
      - `cargo test -p turbopack-tests --test snapshot test_tests__snapshot__runtime__default_dev_runtime__input__index_js -- --nocapture`
      - `cargo test -p turbopack-tests --test snapshot test_tests__snapshot__debug_ids -- --nocapture`
      - `cargo test -p turbopack-tests --test snapshot test_tests__snapshot__swc_transforms__preset_env__input__index_js -- --nocapture`
      - `cargo test -p turbopack-tests --test snapshot test_tests__snapshot__workers__ -- --nocapture`
      ad7d27ec
    • Benjamin Woodruff's avatar
      Turbopack: Fix flake in task_statistics unit test (#89981) · 6df0b7b9
      Benjamin Woodruff authored
      If we don't explicitly return a `Vc::cell(())` here, then `<() as dyn
      turbo_tasks::vc::default::ValueDefault>::value_default` gets called in a
      non-deterministic way.
        
      That's not something we care about testing here, so just add a an
      explicit `Vc::cell(())` call to avoid it.
      6df0b7b9
    • Josh Story's avatar
      Model abandoning by signal (#89971) · d45f83fb
      Josh Story authored
      Stacked on #89970
      
      The staged rendering class will be used for more soon in more contexts
      (prod prerendering for runtime prefetches for example). This changes the
      interface for render abandonment to not use the presence of the render
      abort signal
      d45f83fb
    • Luke Sandberg's avatar
      [turbopack] use type_ids to register turbo task traits on value types (#89964) · a7f5106f
      Luke Sandberg authored
      Tiny optimization, there is no need to use global names for this usecase and we can save a bit of memory and time.
      a7f5106f
    • Josh Story's avatar
      Rename node extension utils for clarity (#89970) · e6d27d4a
      Josh Story authored
      finding the file with sync IO utils is tricky because it is called
      `utils`. this change gives the file a more clear name.
      e6d27d4a
    • nextjs-bot's avatar
      v16.2.0-canary.43 · ea3e11bc
      nextjs-bot authored
      ea3e11bc
    • Benjamin Woodruff's avatar
      Turbopack: Use `std::any::type_name` for global naming of turbo-task items (#89874) · 14c1f8c6
      Benjamin Woodruff authored
      _I wrote this PR by hand, because I wanted to make sure I got all the details right._  
        
      The previous approach for computing global names was `module path` + `item name`.
      
      Since @lukesandberg added support for inventory, we can now nest `turbo_task::function` and `turbo_task::value` macros inside any arbitrary scope:
      
      ![Screenshot 2026-02-11 at 2.57.26 PM.png](https://app.graphite.com/user-attachments/assets/1f5a4b80-bd45-4a95-8ac7-881c58d02f60.png)
      
      This is a fantastic feature, but it does mean that our global names are no longer unique.
      
      @mmastrac suggested using `std::any::type_name` with a dummy marker type to get a full path. This PR attempts to do that.
      14c1f8c6
    • JJ Kasper's avatar
      Fix parallel routes with deferred entries (#89967) · ba08f5fe
      JJ Kasper authored
      These were being filtered unexpectedly causing build failures with the
      deferredEntries flag.
      
      x-ref: [slack
      thread](https://vercel.slack.com/archives/C09125LC4AX/p1771010370849309?thread_ts=1770975846.539109&cid=C09125LC4AX)
      ba08f5fe
    • Tobias Koppers's avatar
      Turbopack: Add inline loader configuration via import attributes (#89644) · 740d55cd
      Tobias Koppers authored
      ## What?
      
      Adds support for inline loader configuration in Turbopack via import attributes. Developers can apply webpack-compatible loaders to individual imports using the `with` clause, without needing global `turbopack.rules` configuration.
      
      ```tsx
      import rawText from '../data.txt' with { turbopackLoader: 'raw-loader', turbopackAs: '*.js' }
      import value from '../data.js' with {
        turbopackLoader: 'string-replace-loader',
        turbopackLoaderOptions: '{"search":"PLACEHOLDER","replace":"replaced value"}'
      }
      ```
      
      ## Why?
      
      Global `turbopack.rules` applies loaders to all files matching a pattern. This PR provides per-import granularity — useful when only a specific import needs special treatment, avoiding side effects on other imports of the same file type.
      
      ## How?
      
      ### Import attributes parsing (`turbopack-ecmascript/src/analyzer/imports.rs`)
      - Extended `ImportAnnotations` to parse four new attributes: `turbopackLoader`, `turbopackLoaderOptions`, `turbopackAs`, `turbopackModuleType`
      - All values are strings per TC39 import attributes spec (`turbopackLoaderOptions` is a JSON-encoded string)
      - Added unit tests for the parser
      
      ### New structured loader type (`turbopack-core/src/loader.rs`)
      - Added `WebpackLoaderItem` struct shared between inline and global loader paths
      
      ### Reference type plumbing (`turbopack-core/src/reference_type.rs`, `turbopack-ecmascript/src/references/esm/base.rs`)
      - Added `ImportWithTurbopackUse` variant to `EcmaScriptModulesReferenceSubType` carrying the parsed loader, rename_as, and module_type
      - ESM reference resolution maps the parsed annotations to this new subtype
      
      ### Loader execution (`turbopack/src/lib.rs`)
      - In `process_default_internal`, detects `ImportWithTurbopackUse` references and applies the loader as a source transform via the existing webpack loader infrastructure
      - Requires `enable_webpack_loaders` to be configured (same as global rules)
      - Supports `turbopackAs` (re-processes with new extension) and `turbopackModuleType` (directly sets module type)
      - Avoids infinite recursion by switching to plain `Import` reference type on re-processing
      
      ### Documentation (`docs/.../turbopack.mdx`)
      - Added section documenting the four import attributes with examples
      - Added version history entry for v16.2.0
      
      ### Testing (`test/development/app-dir/turbopack-import-assertions-use/`)
      - E2e test covering raw loader, replace loader with options, `turbopackModuleType: 'ecmascript'`, and `turbopackModuleType: 'json'`
      - Turbopack-only (skipped for webpack)
      740d55cd
    • nextjs-bot's avatar
      v16.2.0-canary.42 · 9abda03e
      nextjs-bot authored
      9abda03e
    • Niklas Mischkulnig's avatar
      Include deployment id query string for preloaded fonts (#89960) · 7784b11e
      Niklas Mischkulnig authored
      This caused two requests and the preloading to not be effective at all
      
      https://github.com/vercel/next.js/pull/89771 added the dpl id in CSS for `url()`s
      7784b11e
    • Luke Sandberg's avatar
      Enable backtraces in turbopack integration tests (#89935) · af4ceab6
      Luke Sandberg authored
      ## Enable Rust backtraces in CI tests
      
      ### What?
      Added `RUST_BACKTRACE=1` environment variable to all Turbopack-related test workflows.
      
      ### Why?
      This change enables detailed Rust backtraces when Turbopack encounters errors during CI tests, making it easier to diagnose and fix issues that occur in the Rust components.
      
      Notably, some assertions/panics are about detecting race conditions, e.g.
      ```
      thread 'tokio-runtime-worker' (1056161) panicked at turbopack/crates/turbo-tasks-backend/src/backend/operation/mod.rs:426:13:
      Concurrent task lock acquisition detected. This is not allowed and indicates a bug. It can lead to deadlocks.
      note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
      ```
      
      Rather than painfully attempting to reproduce locally we can just run with the env var all the time and perhaps that will be enough to figure out rare issues
      af4ceab6
    • Hendrik Liebau's avatar
      Build with dev runtimes when `--debug-prerender` is set (#89834) · e9b96b41
      Hendrik Liebau authored
      When running `next build --debug-prerender`, React owner stacks are now
      captured and displayed in prerender error output. This makes it much
      easier to diagnose which component triggered uncached I/O or accessed
      request data without Suspense. Previously, `--debug-prerender` only
      enabled source maps and disabled minification. Now it also auto-enables
      `allowDevelopmentBuild` and sets `NODE_ENV=development`, which loads
      React development builds where `captureOwnerStack()` is available.
      
      The main challenge is that with `NODE_ENV=development`, both server and
      client bundles include dev-only code paths (HMR, WebSocket connections,
      dev overlay, debug channel, etc.) that expect a running dev server. We
      don't want these when using `next start`. To solve this, we introduce
      `process.env.__NEXT_DEV_SERVER`, an internal env var that is truthy only
      during `next dev`. In client bundles, it's inlined at build time (`'1'`
      for `next dev`, `''` for `next build`). In production server runtime
      bundles, it's inlined as `''` for dead-code elimination. In development
      server runtime bundles, it's left as a runtime check because those
      bundles are shared between `next dev` (where it's set) and `next build
      --debug-prerender` (where it's not). Meanwhile, `NODE_ENV` continues to
      control React's dev/prod mode and error formatting, which is exactly
      what we want for `--debug-prerender`.
      
      This also replaces the previous `renderOpts.dev` / `workStore.dev`
      pattern, which was unreliable because `RouteModule.isDev` was derived
      from `NODE_ENV` at compile time. When `allowDevelopmentBuild` set
      `NODE_ENV=development`, `isDev` would be compiled as `true` and
      incorrectly activate all dev guards during `next start`.
      
      Key changes:
      
      - `config.ts` auto-enables `allowDevelopmentBuild` and sets
      `NODE_ENV=development` when `--debug-prerender` is active
      - `define-env.ts` inlines `__NEXT_DEV_SERVER` into all bundles (truthy
      for dev, falsy for build) so dev-server features are dead-code
      eliminated in production and `--debug-prerender` builds
      - `next-dev.ts` and `next.ts` set `__NEXT_DEV_SERVER` in the process
      environment for externalized server-side code
      - `renderOpts.dev` and `workStore.dev` are removed — all consumers now
      use `__NEXT_DEV_SERVER` (for dev-server features) or `NODE_ENV` (for
      error formatting that should work in both dev and `--debug-prerender`
      builds)
      - `patch-error-inspect.ts` devirtualizes React server URLs in source map
      URLs so they display as readable file paths
      e9b96b41
    • Joseph's avatar
      docs: Activity boundary guide (#89126) · b737b046
      Joseph authored
      b737b046
    • Tobias Koppers's avatar
      Turbopack: Move turbopackIgnoreIssue from experimental to turbopack.ignoreIssue (#89817) · b05a35a7
      Tobias Koppers authored
      ## What?
      
      Moves the `turbopackIgnoreIssue` config from `experimental` to the stable `turbopack` config as `turbopack.ignoreIssue`.
      
      ## Why?
      
      Reviewers on #89682 agreed the API is stable enough to graduate from experimental. Also addresses a docs wording suggestion.
      
      ## How?
      
      - **TypeScript types**: Moved `ignoreIssue` field from `ExperimentalConfig` to `TurbopackOptions` in `config-shared.ts`
      - **Zod schema**: Moved validation from `experimentalSchema` to `zTurbopackConfig` in `config-schema.ts`
      - **Serialization**: Moved RegExp serialization logic into the turbopack block in `build/swc/index.ts`
      - **Rust**: Moved `ignore_issue` field from `ExperimentalConfig` to `TurbopackConfig` in `next_config.rs`, updated the `turbopack_ignore_issue_rules()` method to read from `self.turbopack`
      - **Tests**: Updated config in test to use `turbopack.ignoreIssue` instead of `experimental.turbopackIgnoreIssue`
      - **Docs**: Removed `version: experimental`, updated all code examples, moved entry from experimental table to stable config list in turbopack.mdx, fixed "Good to know" wording to say "prefer using more specific `path` patterns" (since `path` is already required)
      b05a35a7
    • Luke Sandberg's avatar
      fix: support multiple icon formats with same base name (icon.png + icon.svg) (#89504) · fe39a3c4
      Luke Sandberg authored
      ## What?
      
      Fixes a crash in Turbopack and incorrect behavior in Webpack when users have multiple icon files with the same base name but different extensions (e.g., `icon.png` and `icon.svg`) in their app directory.
      
      ## Why?
      
      This is a valid use case for browser fallback support - modern browsers can use SVG icons while older browsers (Safari <26) need to fall back to PNG. Previously:
      
      - **Turbopack**: Crashed during `next build` with "Dependency tracking is disabled so invalidation is not allowed"
      - **Webpack**: Silently ignored all but one format
      
      ## How?
      
      **Turbopack**: Changed virtual source filename from `{stem}--route-entry.js` to `{filename}--route-entry.js` (e.g., `icon.png--route-entry.js` and `icon.svg--route-entry.js`) to avoid file conflicts that triggered invalidation.
      
      **Webpack**: Changed `MetadataResolver` to return all matching files instead of just the first one.
      
      Both icon formats are now properly rendered:
      ```html
      <link rel="icon" type="image/png" sizes="114x114" href="/icon.png">
      <link rel="icon" type="image/svg+xml" sizes="any" href="/icon.svg">
      ```
      
      Fixes #85496
      Fixes NEXT-4816
      fe39a3c4
    • Jinsoo Lee's avatar
      docs: document cacheLife expire omission behavior and fix default preset value (#89913) · 5c589abd
      Jinsoo Lee authored
      ## Summary
      - Add note that omitting `expire` in `cacheLife` results in cache never
      expiring
      - Fix `default` preset table: `expire` was documented as "1 year" but
      actual code uses `INFINITE_CACHE` (never)
      - Add mention of expire omission behavior in custom profiles section
      
      ## Why
      The `expire` property is optional (`expire?: number`), but the
      documentation didn't explain
      what happens when it's omitted. The source code shows it defaults to
      `INFINITE_CACHE` (0xfffffffe),
      meaning the cache never expires. Additionally, the preset profile table
      incorrectly listed
      the `default` profile's expire as "1 year" when the actual value is
      `INFINITE_CACHE`.
      
      ### Source code references
      - `packages/next/src/lib/constants.ts:45` — `INFINITE_CACHE =
      0xfffffffe`
      - `packages/next/src/server/config-shared.ts:1580` — `default.expire:
      INFINITE_CACHE`
      - `packages/next/src/server/use-cache/cache-life.ts:156` — only sets
      `explicitExpire` when `expire !== undefined`
      - `packages/next/src/server/use-cache/use-cache-wrapper.ts:477-479` —
      falls back to `defaultCacheLife.expire` (INFINITE_CACHE)
      
      ---------
      Co-authored-by: 's avatarJoseph <joseph.chamochumbi@vercel.com>
      5c589abd
    • Niklas Mischkulnig's avatar
      Turbopack: fix CSS dependency locations (#89761) · 9e4e6d6f
      Niklas Mischkulnig authored
      For some locations LightningCSS is 1-indexed (but not all of them, the rustdoc describes it though)
      IssueSource is always 0-indexed
      
      Previously, it looked like this
      ```
      Error: Turbopack build failed with 1 errors:
      ./bench/basic-app/app/[variants]/styles.css:7:12
      Module not found: Can't resolve './test1.png'
        5 | .style {
        6 |   cursor: url(./test1.png);
      > 7 | }
          |  ^
        8 |
      ```
      9e4e6d6f
    • Niklas Mischkulnig's avatar
      Upgrade to swc 56 (#89111) · 1fac9a1b
      Niklas Mischkulnig authored
      1fac9a1b
    • Joseph's avatar
    • Joseph's avatar
    • 熊谷 凌's avatar
    • nextjs-bot's avatar
      v16.2.0-canary.41 · 8b2b0a6f
      nextjs-bot authored
      8b2b0a6f
    • Will Binns-Smith's avatar
      Turbopack hmr: fix missing factories (#89934) · dbb7791e
      Will Binns-Smith authored
      This fixes a bug introduced in d77eb040 where
      installCompressedModuleFactories would skip installing factories for an
      entire group of module IDs if any ID in the group already had a factory
      registered.
      
      Test Plan: build
      https://github.com/vercel/workflow/tree/main/workbench/nextjs-turbopack
      dbb7791e
    • Matt Mastracci's avatar
      [turbopack] Add #[derive(ValueToString)] and convert ~45 manual impls (#89788) · 5070ad0d
      Matt Mastracci authored
      ## What
      
      Add a `#[derive(ValueToString)]` proc macro and convert ~45 manual `ValueToString` implementations across turbopack crates to use it (-660 lines of boilerplate, 49 files touched).
      
      ## Why
      
      Nearly every `ValueToString` impl follows the same pattern: format some fields into a string, possibly awaiting `Vc` values first. These hand-written impls are noisy boilerplate that obscure the actual format string.
      
      ## How
      
      The derive macro generates the `#[turbo_tasks::value_impl] impl ValueToString` block automatically. A helper trait `ValueToStringify` with a blanket impl for `Display` and specializations for `Vc<T>`/`ResolvedVc<T>` handles async resolution of fields.
      
      ### Supported forms
      
      - **No attribute** — delegates to `Display::to_string(&self)`
      - `#[value_to_string("constant")]` — emits `rcstr!` directly
      - `#[value_to_string("{field} text {other_field}")]` — auto-resolves named/positional fields via `ValueToStringify`
      - `#[value_to_string("fmt {}", expr1, expr2)]` — explicit expressions as format args
      - `#[value_to_string(expr)]` — single expression delegation
      
      Enums support per-variant attributes (defaulting to variant name) or a single top-level attribute.
      5070ad0d
    • Joseph's avatar
      docs: adapterPath amends (#89930) · 02f2183d
      Joseph authored
      - use experimental versioning
      - fix spacing for graphs
      - spacing in [!NOTE]
      02f2183d
  2. 12 Feb, 2026 11 commits
    • nextjs-bot's avatar
      v16.2.0-canary.40 · ea8651a7
      nextjs-bot authored
      ea8651a7
    • Luke Sandberg's avatar
      Add a better error message for when turbopack cannot be loaded (#89633) · 462b116a
      Luke Sandberg authored
      Add a more direct error message when next is running on a platform that turbopack doesn't support
      
      document supported turbopack platforms
      
      ## Testing
      
      To test i just set `NEXT_TEST_WASM=1` and ran a build
      
      ```
      Error: Turbopack is not supported on this platform (darwin/arm64) because native bindings are not available. Only WebAssembly (WASM) bindings were loaded, and Turbopack requires native bindings.
      
      To use Next.js on this platform, use Webpack instead:
        next dev --webpack
      
      For more information, see: https://nextjs.org/docs/app/api-reference/turbopack#supported-platforms
          at ignore-listed frames
      
      ```
      so it should work.  Messaging probably could be better (there is also a messge about not being able to set the lockfile) but this should be much better
      
      Fixes #89305
      462b116a
    • nextjs-bot's avatar
    • nextjs-bot's avatar
      v16.2.0-canary.39 · ceb281e1
      nextjs-bot authored
      ceb281e1
    • Will Binns-Smith's avatar
      Trace upload: include experimental flag states (#89845) · b3774eae
      Will Binns-Smith authored
      This includes the set of experimental flag states in events sent to the
      trace upload receiver when `--experimental-trace-upload` is set. It only
      includes a subset of experimental flags (so things like the trace upload
      flag itself isn't meaninglessly sent).
      
      Since reporting is often limited to the scope of a single span, the flag
      state attributes are denormalized and copied onto every descendent span.
      Limiting the set of flags prevents this from being unnecessarily large.
      
      Test Plan: Added `test/development` test and built an app and verified
      these tags are sent with `NEXT_TRACE_UPLOAD_DEBUG`
      
      ---------
      Co-authored-by: 's avatarvercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
      Co-authored-by: 's avatarLuke Sandberg <lukesandberg@users.noreply.github.com>
      b3774eae
    • Andreas Lubbe's avatar
      Fix memory leak in dev mode caused by fast-set-immediate (#89779) · 8266e03a
      Andreas Lubbe authored
      ## Summary
      
      Fixes dev-time memory retention in `fast-set-immediate` caused by module
      re-evaluation chaining patched globals.
      
      ## Root Cause
      
      In dev/HMR, `fast-set-immediate.external` can be re-evaluated multiple
      times.
      On each evaluation, it captured `globalThis.setImmediate`,
      `globalThis.clearImmediate`, and `process.nextTick` as “originals”. If
      those were already patched, new patched closures referenced older
      patched closures, retaining old module graphs.
      
      I have 2GB local heapdump from a few minutes before the local dev server
      crashed OOM that looks like this because of it:
      <img width="632" height="253" alt="Screenshot 2026-02-10 at 18 49 24"
      src="https://github.com/user-attachments/assets/8162b042-ae5a-4289-9166-b11d6374a57a"
      />
      
      ## What Changed
      
      - Added a process-wide sentinel of base/original timer functions on
      `globalThis`:
        - `Symbol.for('next.fast-set-immediate.originals')`
      - `originalSetImmediate`, `originalClearImmediate`, and
      `originalNextTick` now always resolve from that base sentinel, not from
      currently patched globals.
      - Kept the existing patch behavior/API surface:
        - `install()` still runs at module load
      - `DANGEROUSLY_runPendingImmediatesAfterCurrentTask`,
      `expectNoPendingImmediates`, and `unpatchedSetImmediate` exports remain
      available
      
      ## Tests
      
      `module re-evaluation` test now verifies `unpatchedSetImmediate` remains
      bound to the same base/original function across repeated
      `jest.resetModules()` reloads, and is not rebound to the previously
      patched global.
      8266e03a
    • Janka Uryga's avatar
      [Instant] Fix crash with search params (#89922) · f9d5df3b
      Janka Uryga authored
      In dev validation, we're disassembling a payload from a dynamic render.
      If the request had search params, page segments in the router state will
      have them attached: `__PAGE__?{"q":"123"}`. In
      `findNavigationsToValidate`, we do the equivalent of constructing a
      flightRouterState, so we need to match that, otherwise we'll name the
      segment `__PAGE__` instead and then can't look it up in the cache, and
      crash during validation.
      f9d5df3b
    • Luke Sandberg's avatar
      Change UrlBehavior.static_suffix to ResolvedVc<Option<RcStr>> (#89921) · 14865920
      Luke Sandberg authored
      ## Summary
      
      Changes `UrlBehavior.static_suffix` from `Option<RcStr>` to `ResolvedVc<Option<RcStr>>` so that `css_url_suffix` stays as a Vc longer instead of being eagerly resolved at the call site. This improves caching behavior by keeping the value cell-based through the chunking context construction.
      
      - Updated `UrlBehavior` struct definition in `turbopack-core`
      - Updated default fallbacks in browser/nodejs chunking contexts
      - Updated CSS url reference consumer to `.await?` the `ResolvedVc`
      - Replaced `.owned().await?` with `.to_resolved().await?` in next-core callers
      14865920
    • nextjs-bot's avatar
      v16.2.0-canary.38 · 002f5197
      nextjs-bot authored
      002f5197
    • Matt Mastracci's avatar
      [turbopack] Simplify JS `ChunkItem` with a single impl in most cases (#89548) · ff636469
      Matt Mastracci authored
      # What
      
      Removes the vast majority of `ChunkItem` implementations in favour of
      one `EcmascriptModuleChunkItem`.
      
      # Why
      
      Almost all of the `ChunkItem` implementations are trivial and were, for
      the most part, just places where additional traits could be implemented.
      
      By removing all of the various, trivial implementations, this might open
      up opportunities to better implement other features across the entire
      codebase.
      
      # How
      
      Most chunk items are migrated over to EcmascriptModuleChunkItem. The
      EcmascriptChunkPlaceable trait gains three new methods that modules can
      optionally override:
      
        -  `chunk_item_content()` - generates the chunk item's JavaScript code
      - `chunk_item_content_ident()` - returns the content identity for cache
      invalidation
      - `chunk_item_output_assets()` - returns output assets the chunk item
      depends on
      
      The generic EcmascriptModuleChunkItem delegates to these trait methods,
      eliminating the need for per-module wrapper structs.
      ff636469
    • Tobias Koppers's avatar
      Turbopack: Pass asset_suffix_path as Vc (#89899) · 9b0277f0
      Tobias Koppers authored
      ## Summary
      - Pass `asset_suffix_path` as `Vc<Option<RcStr>>` instead of eagerly resolving it to `Option<RcStr>` in the chunking context option structs
      - Add filesystem cache size growth assertions to e2e tests to detect unbounded cache growth regressions
      
      ## Why
      
      Previously, `css_url_suffix` was eagerly awaited in `project.rs` before being passed into `ClientChunkingContextOptions`, `ServerChunkingContextOptions`, and `EdgeChunkingContextOptions`. This caused a new chunking context `Vc` to be created for every build, duplicating the entire build in cache and recompiling it.
      
      By keeping it as a `Vc`, the chunking context identity is stable across builds, preventing unnecessary cache duplication.
      
      ## How
      
      - Changed `css_url_suffix` field from `Option<RcStr>` to `Vc<Option<RcStr>>` in all three chunking context option structs
      - Removed `.owned().await?.clone()` in `project.rs` (3 call sites), passing the `Vc` directly
      - Added `.owned().await?` at the point of use in the 5 context builder functions
      - Added cache size measurements to `filesystem-cache.test.ts`: normal changes limited to 10% growth, renames allow up to 50% due to dead cache entries
      9b0277f0