- 23 Jul, 2026 2 commits
-
-
next-js-bot[bot] authored
-
dan authored
Added a bunch of stuff to the bench. --- **New metrics in the HTTP benchmark** - Report TTFB per route (time to first body byte), next to total latency. - Report each route's document size, how many bytes are inline Flight payload, and the Flight share. **New script: `pnpm bench:render-pipeline:client`** - Loads each route in Chrome with tracing and 4x CPU throttling, and breaks down where client time goes: evaluating chunks, evaluating inline Flight scripts, compiling, background parsing, GC, time to hydration, and blocking time before hydration. - Also prints FCP/LCP/DOMContentLoaded/load from the same trace, and JS transferred vs parsed. - Off by default, separate from the timing benchmark, since tracing perturbs timing. - Hydration time comes from a small client component added to the fixture root layout that calls `performance.mark`. **Bug fixes** - The benchmark was replacing the fixture's `next.config.js` with an empty one during runs. - If the port was already taken, the benchmark could silently measure whatever server was already running there. Both scripts now refuse to start if something is already on the port. - A server that died on startup used to look like a slow server; now it errors immediately. - One failed request used to abort the whole run and throw away all results. Now it costs one sample and gets counted in `errors`. - Killing an already-dead server used to hang the script. - Bad flags now error upfront instead of crashing at the end. --------- Co-authored-by:Claude Fable 5 <noreply@anthropic.com>
-
- 22 Jul, 2026 23 commits
-
-
Benjamin Woodruff authored
This file was way too huge and was wasting a ton of tokens when trying to use it with agents. `turbo-tasks-fs/src/disk.rs` is still a little bigger than I'd like, but I think this is an overall improvement.
-
Benjamin Woodruff authored
Addresses https://github.com/vercel/next.js/pull/95951/changes#r3617631291 - We often already have an `Arc<PathBuf>` here. - The data stored in the queue is temporary, so the slight extra size of `Arc<PathBuf>` is fine, and saving the clone is nice. - The other references to the `Arc<PathBuf>` are not long-lived, so convert it into a `Box<Path>` once it goes into the locked map.
-
Benjamin Woodruff authored
Turbopack: Use `swc_core::ecma::utils::prop_name_eq` for a couple of the `next-custom-transforms` (#96035) Found this helper while looking through one of @sampoder's PRs, noticed that these places could benefit from it.
-
next-js-bot[bot] authored
-
Josh Story authored
[Cache Components] Exclude dynamic params from prerenders when no generateStaticParams values is provided (#95872) Fixes an issue in self-hosted and Vercel Adapter that causes some routes that prerender static pages to include more route params than expected when running in Cache Components. For all Next.js environments any route matching a root param not already in the cache will result in a prerender that includes all params regardless of whether they were omitted from generateStaticParams. For Vercel Adapter environments any route without a fallback that has an empty shell during the build will prerender misses with all params regardless of whether they were omitted from generateStaticParams. This change fixes both issues and introduces a comprehensive test matrix to catch regressions in these kinds of prerender decisions in the future closes NAR-882
-
Andrew Clark authored
`partialFallback` is an internal flag in the build output that controls the behavior of ISR. When it's enabled, in a Cache Components app, pages that are not generated at build time are upgraded to a full ISR entry upon the first request. This is a useful feature but there's a risk it could lead to an explosion in ISR costs, because even a prefetch request is sufficient to trigger an upgrade. The desired behavior is that we only trigger an upgrade for an actual navigation request, or if a link opts into prefetching with the `prefetch` prop. Currently there's no way for ISR to differentiate between a shell prefetch request (no prefetch prop on the link) and an actual prefetch (`prefetch={true}`). The plan is to introduce additional configuration to the build output that specifies which headers should trigger which operations. So by default, this PR turns the `partialFallback` flag back off until the new mechanism is available to us. However, for apps that opt into Partial Prefetching, we will continue to set `partialFallback` to true. That's because in a Partial Prefetching app, per-link prefetch requests are always opt-in. So even without additional support at the ISR behavior, we avoid an unexpected surge in ISR costs by not sending the prefetching request in the first place. There will still be a single request per distinct route (_not_ per distinct URL!), which we will optimize later. -
Sam Poder authored
Noticed this bug where we were assuming chunks were plain strings, which may not always be the case given #95261. When putting together https://github.com/react/react/pull/37095, I noticed this was also a spot we were missing so this fixes that. Almost all of this diff is a regression test.
-
dan authored
This reduces peak memory consumption with the original repro case in [vercel/next.js#81161](https://github.com/vercel/next.js/issues/81161). If you walk the 15 routes in a quick succession and capture vmmap --summary at the end of each fast sweep (before memory is released), with this change the number reliably goes down from 3 GB to 2.6 GB: ``` before 1 3.0G 17 after 1 2.6G 16 before 2 3.0G 16 after 2 2.6G 16 before 3 3.1G 18 after 3 2.6G 17 before 4 3.1G 17 after 4 2.6G 16 before 5 3.1G 17 after 5 2.6G 17 before 6 3.0G 17 after 6 2.5G 17 before 7 3.1G 17 after 7 2.6G 17 before 8 3.0G 25 after 8 2.6G 24 before: [3.0, 3.0, 3.1, 3.1, 3.1, 3.0, 3.1, 3.0] after: [2.6, 2.6, 2.6, 2.6, 2.6, 2.5, 2.6, 2.6] mean before=3.050G after=2.587G diff=0.462G (-15.2%) exact permutation test: p = 2/12870 = 0.00016 ``` More runs on this app: <img width="938" height="623" alt="Screenshot 2026-07-22 at 20 59 12" src="https://github.com/user-attachments/assets/01c41656-eb5a-41f9-8871-b4ce262c54d5" /> And here's an internal app showing ~20% dev memory win at peak (although reclaiming memory settles it): <img width="832" height="402" alt="Screenshot 2026-07-22 at 16 45 34" src="https://github.com/user-attachments/assets/8c39f668-d431-43f9-b533-d39dfaa97c15" /> --- <details> Module source maps are serialized to a JSON rope right after code generation and treated as opaque bytes from then on. Since `sourcesContent` — the full original source text — is inlined into that JSON, every later step that modifies the map has to copy all of it: rewriting the `sources` URLs for each chunking context copies the entire map per context, and embedding the module map into a chunk's sectioned map copies it again, once per layer that includes the module. In a dev session on a dependency-heavy app, each module's source text ends up resident ~5 times over, and source maps end up dominating the memory the task store holds for codegen output (in one measured app, maps were 57% of module factory bytes, and `sourcesContent` alone was 36%). This PR stops copying the text. `StructuredSourceMap` keeps a map in field form until the moment it is actually emitted: - Fields we never touch (`mappings`, `names`, `version`, ...) are stored as verbatim raw JSON snippets, so producers' bytes round-trip untouched and re-emission is rope sharing rather than re-serialization. - `sources` is the one field rewrites modify, so it is stored typed, and the per-chunking-context "fileify" rewrites become a plain string rewrite of that field instead of a parse–modify–reserialize of the whole map. - `sourcesContent` entries are individual, already-JSON-escaped ropes. Rewritten maps and chunk maps share them; the source text is escaped once per module and never copied again. Two construction paths, chosen by where the bytes come from: maps we generate ourselves are built directly from the `swc_sourcemap` object (`from_swc_map` takes the contents out, serializes the small remainder, and never round-trips source text through JSON), while maps that arrive as bytes (prebuilt maps next to external code, the single-complete-original fast path) go through `from_json`. The emitter writes fields in exactly `swc_sourcemap`'s order and format, pinned by golden tests that assert byte-identity with `to_writer` — so emitted chunks and maps are byte-for-byte unchanged, and no snapshot fixtures change. The CSS pipeline gets the same treatment; the single-file output path is left alone since it serializes straight into the final artifact and there is nothing to share. The win is proportional to how much duplicated source-map text an app holds, so results range accordingly. On a dependency-heavy reproduction app (13 routes sharing large wallet SDKs; rapid route sweep in `next dev`, macOS physical footprint, 8 interleaved cold runs per side): 3.05 GB → 2.59 GB mean (−15%), with zero overlap between the two distributions (exact permutation test p ≈ 0.00016) and per-route latencies unchanged. On `bench/basic-app` (small first-party modules): a full sweep of all 42 routes drops the post-sweep footprint 3.4–3.5 GB → 2.4–2.5 GB (−29%, interleaved runs); cold compile −4%, idle footprint identical (eviction reclaims both sides equally at idle). On `bench/heavy-npm-deps` (heavy deps disabled in its default config) and on very large first-party apps whose memory is dominated by the JS heap and application state rather than map text, the change measures flat — as expected, since there is little duplicated text for sharing to recover. `small_apps` build benchmarks are flat except `date-fns-all` at +1–2% (~2.5 ms): that app is 1000+ tiny modules and `from_swc_map` adds one small-skeleton JSON parse per module, with no redundancy to win back in a single-context one-shot build. The single-complete-original fast path (per prebuilt module with a shipped map, and per minified chunk) is cost-neutral: the structured map is built by splitting the raw map's serde fields directly (`from_serialize`), so the serialized document is never materialized or re-parsed — 93 ms per 5 iterations on a synthetic 21.7 MB map, matching the pre-PR baseline exactly, with byte-identical output pinned by a property test. Serialized task-store size is unchanged (bincode expands sharing back out), so this is purely a live-memory change. Verified: snapshot suite passes with zero fixture changes, execution suite matches canary (the single pre-existing failure reproduces on the base tag), unit suites pass including new golden byte-identity tests, and emitted `.map` files were validated end-to-end in a running dev server (multi-section chunk maps, fileified `file://` sources, `sourcesContent` present and byte-identical between base and this branch). </details>
-
Vercel Release Bot authored
Co-authored-by:next-js-bot[bot] <279046576+next-js-bot[bot]@users.noreply.github.com>
-
Janka Uryga authored
If we're prerendering an App Shell, then url data is excluded (i.e. we don't advance beyond the `ShellRuntime` stage). however the prospective prerender was still letting params/searchParams resolve, so if those ended up being inputs to a page, they wouldn't be hanging inputs, and we'd get a cache miss for them in the final prerender. closes NAR-883 --------- Co-authored-by:Hendrik Liebau <mail@hendrik-liebau.de>
-
Aurora Scharff authored
### What? Add an optional post-adoption reference to the Cache Components adoption skill, `references/dev-only-validations.md`, and point to it from the skill's further reading. ### Why? After adoption the build passes, but dev validation (default `validationLevel: 'warning'`) still raises instant-navigation insights on every page load that never fail the build. The skill had no recipe for sweeping them, so this closes that gap as a recommended next step, offered as the smaller path to instant navigation for users who don't want to adopt Partial Prefetching. ### How? The reference details the loop: reuse the `next-dev-loop` preflight, load each route in `next dev`, read the Insights tab and dev log, and fix. The mechanics mirror the tested `next-partial-prefetching-adoption` skill (dev log record, amber Insights tab, `get_errors` not `get_request_insights`, webpack fallback). The further-reading section now recommends the sweep and drops the standalone Prefetching bullet, which the Partial Prefetching adoption skill already carries.
-
Aurora Scharff authored
Refinements to the Cache Components and Partial Prefetching adoption skills from running them cold against real apps, plus the doc changes they lean on. **Skills** - PPF: URL-data sweep reworked to feature-by-feature with a resumable hand-off, and the requires section now says unfinished Cache Components adoption doesn't gate the skill. Prerender insights are non-blocking dev signals expected on a fresh branch; only a build-blocking failure stops the run. - PPF: install `next-dev-loop` without asking, and verify a real blocker before falling back. - CC: dropped the hard-coded `agent-browser` version pin; updated the PPF cross-reference to the current enable-first flow. **Docs** - `runtime-prefetching`: the per-card server cost of `allow-runtime` grids is specific to `prefetch={true}`, with hover-triggered prefetch as the mitigation. - `use-cache`: the request-API restriction follows the call stack (`next-request-in-use-cache`, can pass build and fail under `next start`), and the nested-`cacheLife` build error with its fix. - `instant` route segment config: removed a stale `version: draft` so the page publishes. <!-- NEXT_JS_LLM_PR --> -
Hendrik Liebau authored
The `use-cache-dev` suite only covers dev-mode HMR behavior of `use cache`, so it belongs under `test/development/app-dir` alongside the other `cache-components-dev-*` suites rather than in `test/e2e`. Because `test/development` runs only in dev mode and is never deployed, the production-mode placeholder guard, the `skipDeployment` option, and the `if (skipped)` early return are all dropped. The three test manifests that referenced the old path are updated. --- <sub>Stack created with <a href="https://github.com/github/gh-stack">GitHub Stacks CLI</a> • <a href="https://gh.io/stacks-feedback">Give Feedback
💬 </a></sub> -
Hendrik Liebau authored
In development, editing a file does not evict existing `'use cache'` entries; an entry is invalidated only by re-keying, and the key includes an HMR refresh hash. That hash was delivered through the `__next_hmr_refresh_hash__` cookie, which the browser HMR client set from each server-components change and sent back on later requests. Two cases were therefore broken. First, any request that does not carry the cookie (a `curl`, a plain `fetch`, a fresh browser profile, a second device) served stale cached content after an edit, for both pages and route handlers. Second, on Turbopack a route handler served stale content even when fetched from a page whose HMR client had the cookie, because a route-handler edit never advanced the hash there and so never updated the cookie; on webpack that case happens to work, leaving only cookieless route handlers broken. The hash is server-authored to begin with (webpack's `stats.hash`, Turbopack's `hmrHash` counter), so this change sources it directly on the server and removes the cookie entirely. The hot-reloader exposes it, and `base-server` attaches it to each request with `addRequestMeta`, next to `serverComponentsHmrCache`, so it reaches every render, including the internal Cache Components validation and warmup renders. It is threaded onto the request store the same way `serverComponentsHmrCache` is, so `'use cache'` is invalidated for every client regardless of whether it ran the HMR client. Route handlers, whose `NextRequest` does not carry request meta, receive it through the app-route template's `renderOpts`. Editing a route handler also has to advance the hash in the first place. On webpack it already did, but on Turbopack the `app-route` entry wired no change subscription, so a route edit recompiled the module without advancing `hmrHash`; it now subscribes to the route endpoint so an edit advances the hash without broadcasting a page refresh. That subscription is also made the only thing that advances `hmrHash`: the config-invalidation and server Fast Refresh reset paths previously bumped it even without a content change, for example on a route's first load, and with the hash now read synchronously instead of bounced back through a cookie, such a bump would land between a route's cold write and warm read and evict a still-valid entry. The getter returns the counter unconditionally so the key is present and stable for every request, matching webpack's always-present `stats.hash`. With the cookie gone, the `hash` field on the `SERVER_COMPONENT_CHANGES` HMR message has no remaining consumer, so it is dropped from the message type and both bundlers. This is a short-term stopgap until the granular implementation hash (`codeHash` plus `runtimeEnvVars` plus the Next.js version) is used in `next dev`, which invalidates server-authoritatively by construction and will let this mechanism be removed. > [!TIP] > Best reviewed with hidden whitespace changes. closes NAR-894 --- <sub>Stack created with <a href="https://github.com/github/gh-stack">GitHub Stacks CLI</a> • <a href="https://gh.io/stacks-feedback">Give Feedback
💬 </a></sub> -
Hendrik Liebau authored
In dev, editing a file does not evict existing `use cache` entries; an entry is invalidated only by re-keying, which today is driven by the `__next_hmr_refresh_hash__` cookie that the browser HMR client sets after each server-component change. A client that fetches directly (curl, a plain fetch, a second device) never sends that cookie, so its `use cache` key does not change across an edit and the stale entry keeps being served even after the module recompiles. This affects both route handlers and pages. This adds two e2e tests, each with its own fixture: a route handler at `app/api/cached` fetched through `next.fetch`, and a page at `app/cached-page` rendered through `next.render$`. Both paths bypass the browser HMR client, so neither request carries the cookie. Each test edits its source, waits for the module to recompile (observed through a literal read outside `use cache`), then asserts the cached value reflects the edit. Both are marked `it.failing` because the gap is not yet fixed. They run in dev only and fail in both Turbopack and webpack. A follow-up change sources the HMR refresh hash on the server rather than via the client cookie, so the cache is invalidated for every client regardless of how it fetches. Because route handlers and pages build their request stores through different paths, covering both here guards each one; that change will flip these tests to regular `it`. closes #95931 --- <sub>Stack created with <a href="https://github.com/github/gh-stack">GitHub Stacks CLI</a> • <a href="https://gh.io/stacks-feedback">Give Feedback
💬 </a></sub> -
Hendrik Liebau authored
When `generateStaticParams` is added, removed, or edited in dev, the dev server tells connected App Router clients to re-fetch the router tree so the next render picks up the new set of statically-known params, and thus the fresh `fallbackParams` that blocking-route validation depends on. Until now this reused the `SERVER_COMPONENT_CHANGES` message, which carries a `hash` field, forcing us to pass a meaningless synthetic value (`generateStaticParams-${Date.now()}`). Because that hash flows into the `use cache` key through `getHmrRefreshHash`, reusing the message also invalidated every `use cache` entry on each static params change, which is not the intent here. This change introduces a dedicated `STATIC_PARAMS_CHANGED` HMR message that carries no hash. The App Router client handles it by refreshing the current router tree without recording an HMR refresh hash, so it reflects the new params without evicting unrelated `use cache` entries. The Pages Router client ignores it, since static params are an App Router concept. Beyond removing the unnecessary invalidation, this keeps `SERVER_COMPONENT_CHANGES` reserved for genuine server-component changes. A follow-up change makes the `use cache` HMR refresh hash server-authoritative by capturing webpack's content hash where it is produced, in `refreshServerComponents`. With the static params emit moved to its own message, that method becomes the sole producer of `SERVER_COMPONENT_CHANGES` in the webpack path, so the captured hash is complete and correct without a synthetic timestamp producer to reconcile. --- <sub>Stack created with <a href="https://github.com/github/gh-stack">GitHub Stacks CLI</a> • <a href="https://gh.io/stacks-feedback">Give Feedback💬 </a></sub> -
Hendrik Liebau authored
In dev, the server sends a `SERVER_COMPONENT_CHANGES` HMR update when `generateStaticParams` produces a different set of static paths, so the render picks up the new `fallbackParams` (added in #85741). It was emitting that update before writing the new result to `staticPathsCache`, so the refresh it triggered could read the previous, stale result and keep rendering with the old `fallbackParams` (there are `await`s for the prerender manifest between the two points, which widens the window). This moves the emit to after `staticPathsCache.set`, so the triggered refresh always observes the updated result. This also adds the end-to-end regression test that was missing for this behavior. Reusing the existing `use-cache-params/[slug]` fixture, it asserts the blocking-route redbox shown when a route reads a fallback (unknown) param outside a Suspense boundary, then adds a `generateStaticParams` covering the requested slug and asserts the redbox clears. Editing the page produces two refreshes: the one the edit itself triggers, which still renders with the stale `fallbackParams`, and the follow-up update this code emits once the new result is cached, which renders with the fresh ones. To ensure the test only passes because of the latter, `generateStaticParams` is given a deliberate delay so its recompute finishes only after the edit's own refresh has already re-rendered with the stale params. closes NAR-496 --- <sub>Stack created with <a href="https://github.com/github/gh-stack">GitHub Stacks CLI</a> • <a href="https://gh.io/stacks-feedback">Give Feedback
💬 </a></sub> -
dan authored
Adds tests verifying that`use cache` stacks get symbolicated. We noticed insufficient coverage in https://github.com/vercel/next.js/pull/95936, which should have failed the tests (it broke symbolication) but tests passed. So this restores the missing stack assertions. This also adds some new coverage that specifically verifies that symbolicating via CDP also works.
-
Tim Neutkens authored
## Summary - Strip the configured `basePath` from response URL pathnames before reconstructing fallback route parameters on the client. - Add production regression coverage for both direct hydration and client navigation with Cache Components enabled. This prevents dynamic parameters from shifting when the response URL includes a base path but the App Router tree does not. ## Verification - Added production Turbopack E2E coverage for direct visits and client navigation. <!-- NEXT_JS_LLM_PR -->
-
next-js-bot[bot] authored
-
next-js-bot[bot] authored
-
Sebastian "Sebbie" Silbermann authored
The `getPkgManager` helpers previously consulted the filesystem first for files hinting at the used package manager. Only if none were found did we check `process.env.npm_config_user_agent` and then shelled out to testing which package manager is available. This change makes all helpers check the `npm_config_user_agent` environment variable first. The variable is set by the package manager that invoked the process, so when present it is both the cheapest and the most direct signal, avoiding filesystem access and subprocess spawns entirely. `create-next-app` already used this user-agent-first approach and is unchanged. The check order is now consistent across all three implementations: yarn, pnpm, bun, npm for the user agent (the `packages/next` variant has no `bun` in its `PackageManager` type and falls through to lockfile detection there), and the same order for the codemod's lockfile walk, which previously prioritized `package-lock.json`. Because the invoking package manager now takes precedence over lockfile inference, running `npx next ...` or `npx @next/codemod ...` inside a pnpm or yarn app is now detected as npm. Use `pnpx` (or `pnpm dlx`) and `yarn dlx` instead so the detected package manager matches the project.
-
Jude Gao authored
Rewrites `skills/next-cache-components-optimizer` in place: an agentic loop that encodes the goal as a failing `@next/playwright` `instant()` e2e, works it to green one route at a time, and ships the test as the regression guard. Covers initial load (hard navigation) and client-side navigation (soft navigation) with a test variant each, a VERIFY-RED gate against tests that fail for the wrong reason, and a setup phase that records the project's build/deploy/test infrastructure in a project-local `instant-nav.rig.md`, so the skill assumes no platform. Keeps the existing skill name, so the path from adoption to optimizer stays one story and there is nothing new to announce. The previous dev-loop workflow is replaced wholesale. A PREREQS gate requires Next.js 16+ with `cacheComponents` and a matching `@next/playwright`, and directs an upgrade first when unmet. Generalized from a burn-down in the v0 codebase, where this loop ran agent-driven against CI previews; app-specific examples are scrubbed. Related: #94152 adds `instant-navs`; happy to converge the two. Also updates the one paragraph in `docs/01-app/02-guides/instant-navigation.mdx` that describes this skill to match the new loop. --------- Co-authored-by:
Aurora Scharff <66901228+aurorascharff@users.noreply.github.com> Co-authored-by:
Aurora Scharff <aurora.sofie@gmail.com>
-
- 21 Jul, 2026 15 commits
-
-
next-js-bot[bot] authored
-
Joseph authored
`App Shells` are enabled with partial prefetching is enabled.
-
Benjamin Woodruff authored
It looks like we were redundantly storing these group ids in the `FxIndexMap`, when we could just use it's entry position.
-
Benjamin Woodruff authored
We also mitigate the security impact of e2e tests by running everything in VMs, and by not reading caches in release jobs, but we should still be using `minimumReleaseAge` in e2e tests. Ideally we'd also use lockfiles here too, and I'll work on that next, but that is likely a lot more complicated because we probably need some way to merge lockfiles, since we can't pin the next.js and react versions in every test, and we need a reasonable/efficient way to bulk-update all the lockfiles for tests that need it. Depends on https://github.com/vercel/next.js/pull/95668 for a bunch of windows path representation fixes that this ends up exposing in CI, because adding workspace files causes pnpm to change the absolute path representation used in the Windows junction points that it creates.
-
Benjamin Woodruff authored
Turbopack: Fix missing canonicalization of paths and always use verbatim paths internally for Windows (#95668) I was seeing failures on https://github.com/vercel/next.js/pull/95628 and went down this rabbit hole. - We were (incorrectly) not canonicalizing the `DiskFileSystem` root dir. This happened to work out for us because pnpm also wasn't canonicalizing junction point targets, and so the root dir prefix matched. However after `#95628`, pnpm started canonicalizing junction point targets because we added `pnpm-workspace.yaml` files. This was just coincidence and indicative of much deeper problems. - `dunce` isn't a good fit for us. It picks a win32 or verbatim representation based on path length, which would mean that long paths inside of a short root path would never work because we'd never be able to strip the prefix, since we'd be looking for a win32 path prefix. Omnipath is better for what we want to do: https://docs.rs/omnipath/latest/omnipath/windows/trait.WinPathExt.html - The windows verbatim path format works with long paths (>260 characters) and behaves a lot closer to cross-platform unix paths, which is what we want. E.g. if somebody tries to import a JS module from a Windows 8.3 short path, it should fail. This will fail with verbatim paths (good!). This PR *always* uses the verbatim path format internally within `DiskFileSystem`. - `read_link` was re-inventing `try_from_sys_path` but badly. Just call `try_from_sys_path`. - `turbopack/crates/turbo-tasks-fs/src/embed/file.rs` was dead code. - `validate_path_length_inner` was incorrectly referring to verbatim paths as UNC paths. These are two different things. - Canonicalize any absolute symlink targets outside of the `DiskFileSystem` root path, resolving any symlinks they may have, normalizing case-insensitive paths, and handling Windows 8.3 short name format. ## Some Context About Windows Path Formats: - win32 paths: These are your normal user-friendly `C:\foo\blah` paths. When calling most filesystem APIs, these are limited to 260 characters unless the user has enabled long paths on the system, and avoiding the limit with these paths also requires a [`longPathAware` application manifest](https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests#longPathAware). You can mix `/` and `\` in win32 paths, and Windows will normalize the path separator for you. - verbatim paths: This is a rust-specific name (used by the stdlib) for the "extended length" prefixed paths. These are paths starting with `\\?\`. These paths can be up to ~32,767 characters long. They do not support Windows 8.3 shortnames. They do not normalize between `/` and `\`, and do not support `.` or `..` components, however [`Path::join`](https://doc.rust-lang.org/std/path/struct.Path.html#method.join) will do this normalization if given a verbatim path. - Windows 8.3 shortnames: A legacy format where paths can be represented by 8 characters, followed by a tilde and a digit (or hash in some extreme cases where there are many collisions), followed by a 3 character file extension. NTFS supports this, [ReFS](https://learn.microsoft.com/en-us/windows-server/storage/refs/refs-overview) (used by [Windows Dev Drive](https://learn.microsoft.com/en-us/windows/dev-drive/)) does not. - UNC ("Universal Naming Convention"): This is a specific representation of paths used for remote files on network servers. - `file://` URIs: These must be formed from [win32 style paths](https://docs.rs/url/latest/url/struct.Url.html#method.from_file_path), though the normal 260 character limit typically does not apply here. - canonicalize: Corresponds to [`std::fs::canonicalize`](https://doc.rust-lang.org/stable/std/fs/fn.canonicalize.html). This involves actual fs operations (that we can't easily track), and recursively resolves symlinks. It will fail if the file path does not exist. On windows, this always returns a verbatim path. - wide format: Windows paths are utf-16. Generally we don't support paths that can't be encoded to utf-8, but we should try to fail as obviously as we can in these cases. We don't have good filesystem issue handling yet though. - case sensitivity: Generally paths are not case-sensitive on Windows or macOS, but are case-sensitive on most Linux filesystems. The exact definition of how case sensitivity works with unicode paths is highly platform and filesystem dependent. - junction points: The windows equivalent of symlinks (symlinks are also supported, but require developer mode to be turned on). These can contain an arbitrary path reference in any format (win32, verbatim, etc) with any case and with windows 8.3 short names. Junction points are always target absolute paths to directories.
-
Sam Poder authored
Causes issues with `use client` it seems.
-
Benjamin Woodruff authored
We clone these `PathBuf`s a bunch of times, so use `Arc`s
-
Steven authored
## Notable changes - No more install script needed - No more dynamic require/import tracing workaround - AVIF uses [tune iq](https://aomedia.org/blog%20posts/Libavif_v1_4_0-Boasts-Major-Updates-to-Encoder-Technology/#the-tune-iq-image-quality-tuning-mode) to better match human perception ## All changes - https://github.com/lovell/sharp/releases/tag/v0.35.0 - https://github.com/lovell/sharp/releases/tag/v0.35.1 - https://github.com/lovell/sharp/releases/tag/v0.35.2 - https://github.com/lovell/sharp/releases/tag/v0.35.3 --------- Co-authored-by:
Sebastian Sebbie Silbermann <sebastian.silbermann@vercel.com>
-
Sam Poder authored
This is a common format for transpilers to produce CJS code from ESM, eg. this output: ```javascript "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var x = { color: 'red' }; ``` from https://www.typescript-training.com/course/intermediate-v2/05-modules/. This PR extends the work done in https://github.com/vercel/next.js/pull/95716 to support this syntax. -
next-js-bot[bot] authored
-
next-js-bot[bot] authored
-
next-js-bot[bot] authored
-
Vercel Release Bot authored
Co-authored-by:next-js-bot[bot] <279046576+next-js-bot[bot]@users.noreply.github.com>
-