- 05 Feb, 2025 31 commits
-
-
vercel-release-bot authored
-
Hendrik Liebau authored
When `dynamicIO` is not enabled, and only the standalone `useCache` experimental flag is enabled, we can not encode `searchParams` as hanging promises. To still avoid unused search params from making a page dynamic (due to the `searchParams` being encoded into the cache key), we set them to a promise that resolves to an empty object, while also overwriting the to-be-invoked function for generating a cache entry with a function that creates an erroring `searchParams` prop before invoking the original function. This ensures that used `searchParams` inside of cached functions would still yield an error. closes NAR-85
-
Benjamin Woodruff authored
napi-rs only uses the cdylib version: https://github.com/napi-rs/napi-rs/blob/688a266f132f947b8002e892b78decd660d8a6ec/crates/napi/README.md#building This might(?) slightly improve compile times for certain invocations of `cargo`.
-
Hendrik Liebau authored
This allows us to catch regressions and monitor progress (e.g. for NAR-85). In addition, we're consolidating all pages in the test app to use a single root layout without a suspense boundary. Before we switched the app from using the `dynamicIO` flag to the `useCache` flag, some pages needed a suspense boundary to not fail the build.
-
Tobias Koppers authored
### What? fix a previous PR that disables dependency tracking when not needed.
-
JJ Kasper authored
This is a follow-up to https://github.com/vercel/next.js/pull/75624 which ensures middleware behaves correctly in the `src/` directory. This previously wasn't an issue since edge runtime output location isn't picky since it's just output in the middleware-manifest although with node runtime it is particular.
-
JJ Kasper authored
Seems this was failing in https://github.com/vercel/next.js/pull/75693
-
Niklas Mischkulnig authored
Don't even evaluate the left side of `obj.prop` if we know that we don't have anything in the replacement maps that matches `*.prop` anyway. This particular helps in huge files with complex code and also containing many member expressions ``` testing against 0293c96cf32 canary b6f8743e 13,75 GB TURBO_ENGINE_READ_ONLY=1 NEXT_TURBOPACK_TRACING= TURBOPACK=1 TURBOPACK_BUILD= 507.86s user 77.80s system 847% cpu 1:09.11 total TURBO_ENGINE_READ_ONLY=1 NEXT_TURBOPACK_TRACING= TURBOPACK=1 TURBOPACK_BUILD= 503.13s user 77.86s system 855% cpu 1:07.90 total mischnic/analyzer-faster-members ed38e94ba2 13,75 GB TURBO_ENGINE_READ_ONLY=1 NEXT_TURBOPACK_TRACING= TURBOPACK=1 TURBOPACK_BUILD= 499.54s user 79.28s system 857% cpu 1:07.51 total TURBO_ENGINE_READ_ONLY=1 NEXT_TURBOPACK_TRACING= TURBOPACK=1 TURBOPACK_BUILD= 498.31s user 76.99s system 855% cpu 1:07.27 total ```
-
Tawsif Haque authored
-
Benjamin Woodruff authored
chore(turbo-tasks): Remove support for local_cells (a specific mode of local tasks we ended up not using) (#75672) Local cells would allow us to avoid allocating real cells for data passed to local task functions. Unfortunately, in practice, we manually resolve most arguments passed to local task functions, which would defeat this optimization. I was holding onto this in the hopes that we might end up using it, but that seems fleeting: - We could get similar benefits by scanning for unreferenced cells at the end of function execution using `TraceRawVcs` at the cost of a bit of execution time. This would work even on `Vc`s that were resolved. - For ergonomics reasons, we want to eventually rename `ResolvedVc` to `Vc` (and `Vc` to something like `UnresolvedVc`), which will probably lead to us resolving even more stuff, breaking this potential optimization even more. - Cache eviction may do a good enough job of removing cells, the bigger enemy are the harder-to-evict tasks, which our current version of local tasks does do a good job of reducing. Meanwhile, it makes the code harder to follow, and could cause issues if this codepath somehow got activated.
-
Hendrik Liebau authored
When adding or removing a `"use cache"` directive to a function or module, Turbopack was not able to finish the compilation and hung. This is now fixed, and we're adding the test to prevent regression.
-
Jiachi Liu authored
-
Donny/강동윤 authored
### What? ChangeLog: https://github.com/swc-project/swc/compare/swc_core%40v12.0.0...swc_core%40v13.0.4 ### Why? - To keep in sync - To drop `rustc-hash` v1 - To apply https://github.com/swc-project/swc/pull/9978 --------- Co-authored-by:
Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com>
-
Niklas Mischkulnig authored
-
Niklas Mischkulnig authored
Disambiguate `TaskInput::resolve` from `Vc::resolve` and `ResolvedVc::resolve`. Turns out there was only a single instance where `resolve()` turned out to be the wrong function anyway...
-
vercel-release-bot authored
-
Niklas Mischkulnig authored
Maintain a cache of `VariableId -> JsValue` (per-module), so that we don't reevaluate variables (mostly, unless it's a local variable inside a function call) ``` canary 82026906: 15,3gb TURBO_ENGINE_READ_ONLY=1 NEXT_TURBOPACK_TRACING= TURBOPACK=1 TURBOPACK_BUILD= 501.72s user 108.30s system 760% cpu 1:20.26 total TURBO_ENGINE_READ_ONLY=1 NEXT_TURBOPACK_TRACING= TURBOPACK=1 TURBOPACK_BUILD= 502.01s user 102.27s system 774% cpu 1:18.04 total mischnic/analyzer-link-cache 66d7e1f00c: 15,3gb TURBO_ENGINE_READ_ONLY=1 NEXT_TURBOPACK_TRACING= TURBOPACK=1 TURBOPACK_BUILD= 490.36s user 104.63s system 731% cpu 1:21.34 total TURBO_ENGINE_READ_ONLY=1 NEXT_TURBOPACK_TRACING= TURBOPACK=1 TURBOPACK_BUILD= 489.22s user 106.89s system 780% cpu 1:16.39 total ```
-
Niklas Mischkulnig authored
This might make a difference if the `RequireContextMap` is huge and used across many files More importantly, this seems to solve this failure in the testing backend on https://github.com/vercel/next.js/pull/75440: ``` called 'Result::unwrap()' on an 'Err' value: Cell is empty Stack backtrace: 0: <anyhow::Error>::msg::<&str> 1: <turbo_tasks::backend::TypedCellContent>::cast::<turbopack_emascript::analyzer::RequireContextValue> 2: <turbo_tasks::vc::read::ReadVcFuture<turbopack_ecmascript::analyzer::RequireContextValue> as core::future::future::Future>::poll 3: turbopack_ecmascript::analyzer::well_known::replace_well_known::{closure#0} 4: turbopack_ecmascript::analyzer::linker::visit::<mod::analyzer::bench_link::{closure#0}::{closure#0}::{closure#0}::{closure#0}, turbopack_emascript: analyzer: it {closure#0}>::{closure#0} ```
-
Niklas Mischkulnig authored
AFAICT, Next.js doesn't do this either and this seems to solve this error ``` thread '<unnamed>' panicked at turbopack/crates/turbo-tasks-backend/src/backend/mod.rs:949:13: Dependency tracking is disabled so invalidation is not allowed thread 'tokio-runtime-worker' panicked at turbopack/crates/turbo-tasks-fs/src/lib.rs:265:63: called `Result::unwrap()` on an `Err` value: PoisonError { .. } ``` -
Vercel Release Bot authored
-
Hendrik Liebau authored
[flakiness metric](https://app.datadoghq.com/ci/test/runs?query=test_level%3Atest%20env%3Aci%20%40git.repository.id%3Agithub.com%2Fvercel%2Fnext.js%20%40test.service%3Anextjs%20%40test.status%3Afail%20%40test.name%3A%22use-cache%20should%20error%20when%20cookies%2Fheaders%2FdraftMode%20is%20used%20inside%20%5C%22use%20cache%5C%22%22&agg_m=count&agg_m_source=base&agg_t=count¤tTab=overview&eventStack=&fromUser=false&graphType=flamegraph&index=citest&start=1730967696059&end=1738743696059&paused=false) The error chunks are streaming in while the page is loaded, so `waitForElementByCss` is not sufficient because the error boundary is initially rendered without content, before React replaces it with the expected error messages. https://github.com/user-attachments/assets/adb24a85-d7ac-4bcc-841d-d8f3e0644389
-
Niklas Mischkulnig authored
Meaning fewer cells and fewer tasks No measureable perf difference
-
rauno authored
This PR adds a lot of polish to the experimental Error Overlay: https://github.com/user-attachments/assets/2540b966-c61d-43eb-b816-5ef25f3ecb11 ### Motion - Stacked layers transition smoothly when switching between errors - Height transition for the dialog panel to complement the stacked layers transition - Dialog contents and the backdrop fade in as per Geist Motion Guidelines (`scale`, `opacity`) ### Design - New language icon based on file extension à la (`app.tsx`) - Shadows are clipped with translucent borders to visually be more crisp - Use `backdrop-filter: blur()` for backdrop to blend with application content - Use `font-variant-numeric: tabular-nums` for ←→ switcher to avoid layout shift - Misc alignment improvements ### Interactions - Focus is now trapped in the dialog, <kbd>Escape</kbd> will un-trap and re-focus the last `root.activeElement` - Focus states for all interactive elements - Fluid reveal & collapse of ignored Call Stack items ↓ https://github.com/user-attachments/assets/59a81cea-24ec-4fe4-be00-b911ab484757 Closes NDX-711 Closes NDX-744 --------- Co-authored-by:
devjiwonchoi <devjiwonchoi@gmail.com> Co-authored-by:
Zack Tanner <1939140+ztanner@users.noreply.github.com>
-
Donny/강동윤 authored
### What? Remove one allocation per `transform()` and `minify()`. ### Why? We don't need to allocate `Compiler` in an `Arc`, because we don't share it.
-
Tobias Koppers authored
### What? Allow to continue follow-up tasks even if a task is not completely finished. It can do task completion work in background. This enables more concurrency, especially since all task connecting is at the end of the task now.
-
Tobias Koppers authored
### What? Skip some methods for tasks without children. Reduces number of spans created in tracing.
-
Donny/강동윤 authored
### What? Use `swc_atoms::Atom` instead of `String` in `next-swc`. ### Why? `Atom` does not allocate if another instance has the same value, meaning that `clone()` is a single atomic operation. But `String` allocates regardless of any other occurrence.
-
Donny/강동윤 authored
### What? Use `swc_atoms::Atom` instead of `String` in `next-swc`. ### Why? `Atom` does not allocate if another instance has the same value, meaning that `clone()` is a single atomic operation. But `String` allocates regardless of any other occurrence.
-
Tobias Koppers authored
### What? This changes to order of operations to upper aggregation numbers before connecting children, so they can be added based on the new aggregation numbers.
-
Tobias Koppers authored
### What? Due to the thread local buffer of spans it happens that they are in unexpected order in the trace file. This sorts them by start date.
-
Tobias Koppers authored
### What? Make sure to gracefully shutdown the Turbopack process, by waiting for shutdown before killing the process. This makes sure Persistent Caching will have time to store the cache, before it's killed. That should happen in background while doing SSG. (Maybe we need to change that in future for memory reasons, but it will work for now.)
-
- 04 Feb, 2025 9 commits
-
-
Donny/강동윤 authored
### What? Use `swc_atoms::Atom` instead of `String` in `next-swc`. ### Why? `Atom` does not allocate if another instance has the same value, meaning that `clone()` is a single atomic operation. But `String` allocates regardless of any other occurrence.
-
Donny/강동윤 authored
### What? Use `swc_atoms::Atom` instead of `String` in `next-swc`. ### Why? `Atom` does not allocate if another instance has the same value, meaning that `clone()` is a single atomic operation. But `String` allocates regardless of any other occurrence.
-
Donny/강동윤 authored
### What? Use `swc_atoms::Atom` instead of `String` in `next-swc`. ### Why? `Atom` does not allocate if another instance has the same value, meaning that `clone()` is a single atomic operation. But `String` allocates regardless of any other occurrence.
-
vercel-release-bot authored
-
Wyatt Johnson authored
Designed to enable the client prefetch segments feature when deployed on Vercel, this adds additional fields and data to the manifests to allow the CLI to create the rewrite rules needed to serve the prefetch segments. The fallback routes also now emit their RSC data to disk even though only their filenames are used. We emit the routes for the prefetches using backreferences. For example, for the route: ``` /blog/[...slug].segments/$c$slug$[...slug]/__PAGE__.segment.rsc ``` We create the following Regular Expression: ```ts /^\/blog\/(?<nxtPslug>.+?)\.segments\/\$c\$slug\$\k<nxtPslug>\/__PAGE__\.segment\.rsc$/ ``` Which enforces that the named capture group `nxtPslug` is the same for both the `[...slug].segments` and the `$c$slug$[...slug]`: ``` Matching: /blog/my-post.segments/$c$slug$my-post/__PAGE__.segment.rsc /blog/hello-world.segments/$c$slug$hello-world/__PAGE__.segment.rsc /blog/2024-01.segments/$c$slug$2024-01/__PAGE__.segment.rsc Not Matching /blog/post-1.segments/$c$slug$post-2/__PAGE__.segment.rsc ``` This also fixed a bug where the client segment prefetch keys included double `//`. <!-- 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 ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # --> --------- Co-authored-by:
JJ Kasper <jj@jjsweb.site>
-
Jiachi Liu authored
-
Niklas Mischkulnig authored
No need to cell them, they are module-specific anyway. ``` testing against 0293c96cf32 canary dd676ccb: 14,7 GB TURBO_ENGINE_READ_ONLY=1 NEXT_TURBOPACK_TRACING= TURBOPACK=1 TURBOPACK_BUILD= 533.84s user 84.44s system 834% cpu 1:14.10 total TURBO_ENGINE_READ_ONLY=1 NEXT_TURBOPACK_TRACING= TURBOPACK=1 TURBOPACK_BUILD= 526.68s user 86.15s system 834% cpu 1:13.48 total plus fewer cells b5ce9afeb5: 14,3 GB TURBO_ENGINE_READ_ONLY=1 NEXT_TURBOPACK_TRACING= TURBOPACK=1 TURBOPACK_BUILD= 517.74s user 85.77s system 831% cpu 1:12.54 total TURBO_ENGINE_READ_ONLY=1 NEXT_TURBOPACK_TRACING= TURBOPACK=1 TURBOPACK_BUILD= 516.06s user 85.35s system 836% cpu 1:11.89 total plus no self reads b3370a59ca: 13,8 GB TURBO_ENGINE_READ_ONLY=1 NEXT_TURBOPACK_TRACING= TURBOPACK=1 TURBOPACK_BUILD= 516.65s user 84.11s system 834% cpu 1:12.01 total TURBO_ENGINE_READ_ONLY=1 NEXT_TURBOPACK_TRACING= TURBOPACK=1 TURBOPACK_BUILD= 518.01s user 87.55s system 839% cpu 1:12.15 total ``` <details> <summary>Old</summary> ``` canary 82026906: 15,3gb 492.59s user 103.43s system 736% cpu 1:20.90 total 495.16s user 96.50s system 739% cpu 1:20.01 total code-gen bd58ad63a7: 14,95gb 489.30s user 102.66s system 745% cpu 1:19.36 total 501.91s user 105.99s system 743% cpu 1:21.80 total ``` </details>
-
Tobias Koppers authored
### What? Defines like `process.env.NODE_ENV` were not correctly applied to turbopack-cli. This fixes it.
-
JJ Kasper authored
This allows setting `runtime: 'nodejs'` in middleware, which removes the constraint of only using edge runtime APIs for middleware. This doesn't change the signature of middleware and it still receives `(req: NextRequest, event: NextFetchEvent) => Response`. x-ref: https://github.com/vercel/next.js/discussions/71727 x-ref: https://github.com/vercel/next.js/discussions/46722
-