1. 21 Jan, 2026 17 commits
    • nextjs-bot's avatar
      v16.2.0-canary.1 · aa8754c3
      nextjs-bot authored
      aa8754c3
    • Benjamin Woodruff's avatar
      Turbopack: Add a stress test / fuzzer that tries creating many symlinks in a tight loop (#88667) · 917ff14c
      Benjamin Woodruff authored
      In an attempt to reproduce https://github.com/vercel/next.js/discussions/88382, this tries creating and updating a bunch of symlinks/junction points in a tight loop with some parallelism. However, I've been unable to reproduce the error reported in that discussion.
      
      I don't care about the code quality here, so this was LLM-generated with very lightweight review.
      
      A simplified version of the fuzzer is also included as a unit test in `turbo-tasks-fs`. This version only does a few iterations and runs very quickly.
      917ff14c
    • nextjs-bot's avatar
    • Benjamin Woodruff's avatar
      Turbopack: Move fuzzer for fs watcher into a separate file/module (#88666) · ddd02ab9
      Benjamin Woodruff authored
      This PR just moves things around for #88667.
      
      I don't care about the code quality here, so this was LLM-generated with very lightweight review.
      ddd02ab9
    • Benjamin Woodruff's avatar
      Turbopack: Add file write invalidation tracking to filesystem watcher fuzzing (#88665) · 2912f102
      Benjamin Woodruff authored
      In addition to creating task invalidators for file reads, we also create invalidators for file writes. This extends the fuzzer to cover that.
      
      This is a bit trickier to test. Because the `write` call doesn't return anything, the caller of `write` never gets invalidated and re-executed, even though `write` does. So instead, we must observe that `write` was re-executed by looking at the contents of the file it wrote to. We write a sentinel value to files when we call the turbo-tasks-fs `write` function, and write random values to it to trigger an invalidation.
      
      I tested this on Windows and Linux.
      
      I don't care about the code quality here, so this was LLM-generated with very lightweight review.
      2912f102
    • Matt Mastracci's avatar
      Turbopack: Use a real file entrypoint for Workers (and SharedWorkers) (#88602) · d23af532
      Matt Mastracci authored
      # What
      
      Closes https://github.com/vercel/next.js/issues/84782  
      Closes https://github.com/vercel/next.js/issues/74842  
      Closes https://github.com/vercel/next.js/issues/82520
      Closes PACK-3723
      
      Replace blob URLs for web workers with real entrypoint files, fixing relative URL resolution inside workers. Implements support for `SharedWorkers` since it's now a simple variation of the `Worker` case.
      
      Note that all generated files (and shared-worker querystrings) are appropriately content-hashed and do not rely on deployment IDs and will work w/immutable resources.
      
      # Why
      
      Workers created via `new Worker(new URL('./worker.js', import.meta.url))` previously got blob URLs. This breaks relative URL resolution inside workers - WASM imports like `new URL('./file.wasm', import.meta.url)` fail because `import.meta.url` returns `blob:http://...` instead of a real path.
      
      # How
      
      We emit a real worker entrypoint file instead of blob URLs. The entrypoint reads bootstrap config from URL hash params (`#params=....`), then loads the worker's chunks via `importScripts`.
      
      The `ChunkingContext` trait gets a new `worker_entrypoint()` method returning a singleton bootstrap asset. Node.js `bail!`s for now but could implement its own in the future. The browser implementation (`EcmascriptBrowserWorkerEntrypoint`) compiles and minifies `worker-entrypoint.ts`, which parses `#params={globals,chunks}` from the URL at runtime.
      
      `WorkerLoaderChunkItem` now emits `__turbopack_worker_url__(entrypoint, chunks, shared)` instead of the old blob URL shim. SharedWorker passes `shared=true` which adds a querystring - the browser handles worker identity via URL, so same URL means same instance.
      
      Generated code changes (pseudocode):
      
      ```javascript
      __turbopack_export_value__(__turbopack_worker_blob_url__(["chunk1.js", "chunk2.js"]));
      ```
      
      After:
      
      ```javascript
      __turbopack_export_value__(__turbopack_worker_url__("worker-entrypoint.js", ["chunk1.js", "chunk2.js"], false));
      ```
      
      # Notes
      
      Webpack doesn't currently correctly support `SharedWorkers`. The e2e test behaves properly in turbopack after this change, but webpack spins up two separate workers where it should only be spinning up one.
      
      I generated snapshot tests for workers in the first and last commits to help understand the generated code better.
      
      # Testing
      
      - Snapshot tests for Worker, SharedWorker, and minified output
      - E2E tests for WASM loading in workers (`test/e2e/app-dir/worker/`)
      d23af532
    • Zack Tanner's avatar
      fix: preserve cache behavior for PPR fallback shells with root params (#88556) · c986bccc
      Zack Tanner authored
      When generating PPR fallback shells, a cache miss during warmup was
      being treated as a dynamic hole, so the warmup render never filled new
      cache entries. This caused root‑param fallback shells (e.g.
      `/en/blog/[slug]`) to suspend even though root params were already
      known.
      
      This change always creates a fresh prerender RDC for warmup and copies
      any seed hits into it. The final render then uses the warmed cache, so
      fallback shells can reuse populated entries without short‑circuiting. On
      the export side, we now choose a seed RDC by matching known params (e.g.
      locale) so /en/... fallback shells don’t get seeded with /fr/... data.
      (Previously, the RDC seed was "last-write-wins".
      
      Fixes NAR-716
      c986bccc
    • nextjs-bot's avatar
      v16.2.0-canary.0 · 3fe7d63f
      nextjs-bot authored
      3fe7d63f
    • Hendrik Liebau's avatar
      [test] Fix deploy test of `cache-components.server-action.test.ts` (#88854) · a3500c32
      Hendrik Liebau authored
      When deployed, the sentinels where showing `at runtime` instead of `at
      buildtime`. There are two reasons for this:
      
      1. The page sentinel was accidentally rendered in a client component,
      which causes a hydration mismatch, and the value toggling from `at
      buildtime` to `at runtime` when the page is hydrated before the
      assertion is done.
      2. The middleware was setting sentinel cookies that are intended for the
      `/cookies/*` pages, but not for the `/server-action-inline` page. This
      caused the server action (which is triggered in the second test) to
      consider the page as revalidated, which then led the client router to
      refetch the page. With `next start` this is not a problem because the
      RSC response is prerendered at build time, and returned as a static
      file, which contains the correct sentinel values. However, when deployed
      on Vercel, the RSC request results in an ISR cache miss for some reason,
      which causes the page to be revalidated (with runtime sentinel values),
      and then the third test fails when it receives the regenerated response
      instead of the build-time prerender result. This needs to be
      investigated separately, but for now we disable the middleware from
      setting cookies on this page to prevent the ISR revalidation request.
      
      closes #88817
      closes NAR-740
      
      > [!TIP]
      > Best reviewed with hidden whitespace changes.
      a3500c32
    • Tobias Koppers's avatar
      Turbopack: show compressed size for print_cache_item_size (#88850) · bed512a3
      Tobias Koppers authored
      ### What?
      
      Improve the feature flag to show compressed size
      bed512a3
    • Hendrik Liebau's avatar
      [ci] Fix Rspack/Turbopack test manifest generation (#88845) · 71f9bda3
      Hendrik Liebau authored
      The recent change to always run all tests without aborting on failure
      (#88435) inadvertently broke manifest generation. Previously, test
      output was emitted for all tests when `NEXT_TEST_CONTINUE_ON_ERROR` was
      set, but that variable was removed. Now test output is only emitted for
      failing tests, causing the manifest to lose all passing test entries.
      
      This adds a new `NEXT_TEST_EMIT_ALL_OUTPUT` environment variable that
      restores the full output behavior specifically for the manifest
      generation workflows.
      71f9bda3
    • Niklas Mischkulnig's avatar
    • Tobias Koppers's avatar
      Turbopack: shrink amortized (#88619) · 1bdb2e20
      Tobias Koppers authored
      ### What?
      
      Use amortized shrinking.
      
      Capacity should always be a power of 2.
      We shrink when len is capacity / 3.
      Assuming the capacity was `2^x` we shrink to `2^(x-1)` which is
      `capacity / 2`.
      Therefore capacity is still larger than len, which avoids direct
      reallocation when items are added again.
      1bdb2e20
    • Niklas Mischkulnig's avatar
      1818b104
    • Hendrik Liebau's avatar
    • Andrew Clark's avatar
      Embed static sibling info in route tree (#88692) · d3de9bce
      Andrew Clark authored
      This change adds infrastructure for a planned client-side optimization
      where the router can infer route structure from previously prefetched
      routes, avoiding redundant route tree requests.
      
      When the client prefetches /blog/post-1 and learns the route structure
      is /blog/[slug], it could potentially reuse that knowledge for
      /blog/post-2 without another server roundtrip. However, if a static
      route like /blog/featured exists at the same level, the client needs to
      know NOT to apply the dynamic template for that URL.
      
      staticSiblings provides this information. When a dynamic segment like
      [slug] has static siblings (e.g., "featured", "archive"), the server
      includes them in the prefetch response. The client can then check
      whether an incoming URL matches a known static sibling, and if so,
      recognize that the previously learned route structure does not apply.
      d3de9bce
    • Andrew Clark's avatar
      Reuse bfcache data during Full prefetches (#88606) · fc65fbb0
      Andrew Clark authored
      During a Full prefetch (`<Link prefetch={true}>`), check the bfcache for
      matching segment data before issuing a new request. The bfcache stores
      data from previous navigations, which always includes dynamic data.
      
      This optimization avoids redundant server requests when the user has
      already navigated to a route and the data is still fresh according to
      the staleTimes.dynamic configuration.
      fc65fbb0
  2. 20 Jan, 2026 17 commits
  3. 19 Jan, 2026 6 commits