- 22 Jun, 2025 7 commits
-
-
vercel-release-bot authored
-
Jiwon Choi authored
https://github.com/user-attachments/assets/a15165f2-e340-4ec6-a3e1-a895bfac1531 Closes NEXT-4548
-
Zack Tanner authored
The goal of this UI is to surface a nudge when we think that the server might be in a bad state due to persistent caching problems. It probably doesn't make sense to show up in any other case. While we work to figure out the best way to nudge it in dev, this couples the behavior behind the persistent caching flag. --------- Co-authored-by:Sebastian "Sebbie" Silbermann <sebastian.silbermann@vercel.com>
-
Wyatt Johnson authored
The git merge driver does not expect debugging messages to output on stdout, and instead requires them to output on stderr. This changes the `console.log` to a `console.error` to account for this requirement.
-
Donny/강동윤 authored
### What? Remove `inject_helpers` passes from `apply_transforms` ### Why? We run `inject_helpers` from `fn parse` anyway, so we don't need to run it from `apply_transforms`.
-
Sebastian "Sebbie" Silbermann authored
-
Sebastian "Sebbie" Silbermann authored
-
- 21 Jun, 2025 2 commits
-
-
vercel-release-bot authored
-
Donny/강동윤 authored
### What? Remove unnecessary JSON operations. ### Why? - https://github.com/swc-project/swc/pull/10628 - https://github.com/swc-project/swc/issues/10610
-
- 20 Jun, 2025 31 commits
-
-
vercel-release-bot authored
-
Benjamin Woodruff authored
We want to show a warning to the user when we start up with an invalidated cache, letting them know why `next dev` might be a little slower than usual. This is done by writing a JSON-encoded `reason_code` value to the invalidation marker file that's then read when starting back up. I'm using @Cy-Tek's compilation event logging to log this from the JS side, so that log styling matches other Next.js warnings. This is a little tricky because of a chicken-and-egg dependency on turbo-tasks. We must invalidate the cache before constructing the turbo-tasks backend, and then emit the event after turbo-tasks is constructed. ## Testing Reset the cache using the web UI: <img src="https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/HAZVitxRNnZz8QMiPn4a/ac47b80d-d09c-48a8-bdcf-6f6f1bfd8288.png" width="500"> And see a warning logged to the terminal: <img src="https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/HAZVitxRNnZz8QMiPn4a/e1860d1a-defd-46c2-9a85-a0c64e26f634.png" width="700"> This user-requested use-case is a bit contrived, we mostly care about automatic invalidation upon panic, as those are the ones that may be surprising to the user.
-
Luke Sandberg authored
### What? Create a new `struct` `LocalTaskSpec` that holds a `LocalTaskType` as an enum. This allows us to share the common fields and push the formatting routines down to the LocalTaskType. ### Why? This allows us to avoid an `Arc::new` call when launching tasks since the `LocalTaskType` enum now becomes copyable.
-
Zack Tanner authored
Certain types of data gets stashed in the client-side `FlightRouterState`, such as the "refresh" marker alongside a URL that the client can callback to when it needs to revalidate segments that were "activated" on previously visited URLs. Additionally, query parameter data gets encoded in the `__PAGE__` segment key, but isn't actually needed by the server: `__PAGE__` segments would always be the leaf, so it wouldn't cause any unexpected behavior in the diffing logic. With large query params, this can lead to large amount of data needing to be sent to the server, only for it to not actually be used. There's a larger refactor around the server/client transport being handled in the `experimental.clientSegmentCache` flag, so this is a stop-gap until that behavior is stabilized. Closes NEXT-4521
-
Magnus authored
Add `contentSecurityPolicy` to Image Component in docs. Also follow up in on the type in `image-config.ts` to use the updated docs. --------- Co-authored-by:graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
-
Wyatt Johnson authored
This pull request introduces support for handling postponed state in dynamic React Server Components (or RSC) requests, enabling the use of the encoded Resume Data Cache (or RDC). The changes include adjustments to the server logic to better manage dynamic responses and improve caching behavior for such requests. This also updates the incremental cache to also add to the RDC when it's fetching already generated entries. This pull request introduces changes to support dynamic React Server Components (RSC) requests by enabling the use of postponed state and improving cache handling. It also includes updates to error handling, testing utilities, and incremental caching logic. ### Enhancements for Dynamic RSC Requests * Added support for resuming renders with postponed data from the cache for dynamic RSC requests, leveraging the `IncrementalCacheKind.APP_PAGE` cache type. This ensures efficient reuse of cached data when available. (`packages/next/src/server/base-server.ts`, [[1]](diffhunk://#diff-6f4291cc2bfc5073fdca12a014011769e840ee68583db1468acef075f037015aL3097-R3139) [[2]](diffhunk://#diff-6f4291cc2bfc5073fdca12a014011769e840ee68583db1468acef075f037015aL3262-R3294) * Updated cache control logic to handle dynamic RSC requests more effectively, ensuring they are not cached when containing dynamic content. (`packages/next/src/server/base-server.ts`, [packages/next/src/server/base-server.tsL3526-R3550](diffhunk://#diff-6f4291cc2bfc5073fdca12a014011769e840ee68583db1468acef075f037015aL3526-R3550)) ### Improvements to Incremental Caching * Introduced a `checkTags` method in the `IncrementalCache` class to determine if a tag has been revalidated, preventing stale data from being returned. (`packages/next/src/server/lib/incremental-cache/index.ts`, [packages/next/src/server/lib/incremental-cache/index.tsR599-R627](diffhunk://#diff-c990316f5df4319261936cd61b07566c5e12cd7e68c9e92f6da38a190a639154R599-R627)) * Refactored logic to store prerender resume data in the cache for better performance and reliability. (`packages/next/src/server/lib/incremental-cache/index.ts`, [packages/next/src/server/lib/incremental-cache/index.tsL442-R461](diffhunk://#diff-c990316f5df4319261936cd61b07566c5e12cd7e68c9e92f6da38a190a639154L442-R461)) ### Testing Updates * Updated E2E tests in `app-action.test.ts` to use modern `fs/promises` and `node:path` modules, improving readability and consistency. (`test/e2e/app-dir/actions/app-action.test.ts`, [test/e2e/app-dir/actions/app-action.test.tsL11-R14](diffhunk://#diff-b3bc78ed83df32c7d5afa3d352038f8afd7eb37027be87ca22bac3d3cb33657aL11-R14)) * Refactored test assertions to ensure dynamic RSC behavior and revalidation logic are correctly validated. (`test/e2e/app-dir/actions/app-action.test.ts`, [[1]](diffhunk://#diff-b3bc78ed83df32c7d5afa3d352038f8afd7eb37027be87ca22bac3d3cb33657aR543-L546) [[2]](diffhunk://#diff-b3bc78ed83df32c7d5afa3d352038f8afd7eb37027be87ca22bac3d3cb33657aL1564-R1589)
-
JJ Kasper authored
This implements the second hook `onBuildComplete` from the adapters RFC https://github.com/vercel/next.js/discussions/77740 which exposes structured routing and build outputs information that can then be used to create finalized outputs depending on differing deployment targets.
-
Luke Sandberg authored
### What? TurboTasks uses numeric ids to reference traits, values and functions, these are used to in serialization routines, dispatching and runtime type checking for traits. This PR adjusts the dispatching codepaths to instead leverage `&'static` references so that these hot codepaths don't have to reference the registry data structures. `dynamic_call` now uses as `&'static NativeFunction` instead of a `FunctionId` `trait_call` now uses a `&'static TraitMethod` instead of a `TraitId` and a `Cow<'static, str>` In principle this will bloat struct sizes since all the `id` types are `u32`, however, in many cases i checked, the reference fit neatly into existing padding `LocalTaskType`, `CachedTaskType`: no change `FunctionAndArg`: 24->32 bytes (afaict this struct is extremely temporary) `TaskStatistics`: I changed the map key here so that map will perhaps get larger as well (though it depends on internals of HashMap, afaict, there is padding already so i think this one is a wash) Call frames will also get bigger to account for the references ### Why? This should remove some small fixed overhead from the codepaths that launch new tasks. Generally registry lookups should be fast but I observed that we often call `registry::get_function` multiple times in the same codepath. The trait_call codepaths had similar problems but with even more indirection. All the generated function stubs have trivial access to the static references since the macro is already what manages the lifetimes. So all in all this mostly simplifies the calling conventions A final small win is that we no longer need to generate `static once_cell` fields for the function ids, which should help a bit with compile time and does reduce binary size. running `cargo bloat --release --bin turbopack-cli` canary: 48.5MiB .text section size, the file size is 153.0MiB func_refs: 48.4MiB .text section size, the file size is 151.5MiB so a tiny reduction in code but 2mb of binary size due to a reduction in `DATA` section entries for all the static variables.
-
Benjamin Woodruff authored
- Follow the naming conventions of other environment variables and prefix `TEST_WASM` with `NEXT_TEST_WASM` so that there's less chance of conflicts with user code - Remove the logic in `setup-wasm.mjs` that modifies the repository (not great for running tests locally) and instead try to match the environment-variable-override behavior used for native (non-wasm) bindings via `NEXT_TEST_WASM_DIR`. - Hard-fail if `NEXT_TEST_WASM` is set and we fail to load wasm bindings instead of silently using fallback logic that loads native bindings instead. - We don't need to install `wasm-pack` with `curl | sh` for tests: `pnpm` already installs it (and pins a specific version). - The whole dance of renaming the directory from `pkg` to `pkg-nextjs` is a hack we use when publishing the package, as we're building both "web" and "nextjs" targets. We don't need to do that for tests. - Fix handling of `undefined` values in SWC options objects. - Remove hacks for Next v12.2
-
vercel-release-bot authored
-
Vercel Release Bot authored
Co-authored-by:Sebastian Sebbie Silbermann <sebastian.silbermann@vercel.com>
-
Tim Neutkens authored
## What? Allow putting `distDir` anywhere in the monorepo (inside the project root), not just inside the app's directory.
-
Jiwon Choi authored
This will be used for sharing the error across the Error Overlay and the DevTools Panel.
-
Vercel Release Bot authored
This auto-generated PR updates the production integration test manifest used when testing Turbopack.
-
Vercel Release Bot authored
This auto-generated PR updates the development integration test manifest used when testing Turbopack.
-
Vercel Release Bot authored
This auto-generated PR updates the production integration test manifest used when testing Rspack.
-
Jiwon Choi authored
Since the Error Overlay call stack had dedicated handlers for animation, it wasn't able to reuse them. Therefore, port the UI part of the call stack and receive handlers as props, so that the call stack component can be shared with the Error Overlay and the DevTools panel.
-
Vercel Release Bot authored
This auto-generated PR updates the development integration test manifest used when testing Rspack.
-
Cong-Cong Pan authored
When import json module in middleware will case error, because codeAnalyzerBySwc should only handle javascript module.
-
Janka Uryga authored
Adds a merge driver that can automatically re-number messages added to `errors.json` if a merge conflict occurs. Now, it would be easier to just run `pnpm update-error-codes`, but that's slow and requires installing deps + building everything, so i'm just manually merging + renumbering instead. To avoid disrupting people's workflows (in case this is buggy, or something), it's currently *not enabled by default*. To enable the merge driver, run: ```shell scripts/merge-errors-json/install ``` which will add it to your `.git/config`. Once it's been confirmed to work well, we can make this command run by default in `postinstall`. ### Testing Other than the test i added (which doesn't run git), i've tested this manually with this script that rebases some stacked branches: <details> <summary>merge-driver-test.sh</summary> ```bash #!/usr/bin/env bash set -eu -o pipefail cd "$1" current_branch="$(git branch --show-current)" ( set -eu -o pipefail git switch lubieowoce/errors-json-merge-driver git switch --force-create 'test/errors-json/base' echo '{ "1": "base message" } ' > packages/next/errors.json git commit -am 'base commit' git switch --force-create 'test/errors-json/one'; echo '{ "1": "base message", "2": "message from branch one" } ' > packages/next/errors.json git commit -am 'commit 1' git switch 'test/errors-json/base' git switch --force-create 'test/errors-json/stacked-1' echo '{ "1": "base message", "2": "message from stacked 1" } ' > packages/next/errors.json git commit -am 'stacked 1' git switch --force-create 'test/errors-json/stacked-2' echo '{ "1": "base message", "2": "message from stacked 1", "3": "message from stacked 2" } ' > packages/next/errors.json git commit -am 'stacked 2' git rebase 'test/errors-json/one' --update-refs || true bat packages/next/errors.json git rebase --abort || true ) git switch "$current_branch" ``` </details> The script does a bunch of git operations, so it's easiest to put it outside of your next.js repo and call `bash merge-driver-test.sh path/to/next.js`. -
vercel-release-bot authored
-
Sebastian "Sebbie" Silbermann authored
-
Jiwon Choi authored
https://github.com/user-attachments/assets/04c936c2-770f-4032-b962-2aad3259404a Closes NEXT-4530
-
Jiwon Choi authored
### Why? Since the DevTools Panel and the DevTools Indicator are decoupled, use the dispatcher to communicate the DevTools scale from the DevTools Panel (Settings tab).
-
Jiwon Choi authored
This is the "router" component for tabs.
-
Sebastian "Sebbie" Silbermann authored
Affected all Node.js versions with `require(esm)` support. We needed https://github.com/storybookjs/addon-webpack5-compiler-swc/commit/70a8e63516bd4f664c2751b9094f38697f39f0ff to fix `pnpm storybook`. Tested with Node.js 20.19.2 which previously failed.
-
Sebastian "Sebbie" Silbermann authored
-
Sebastian "Sebbie" Silbermann authored
The test was implicitly relying on `preloadEntriesOnStart` to load the module in our prod tests. Fixes https://github.com/vercel/next.js/actions/runs/15774186781/job/44464850249?pr=80710#step:34:282 and [other flakes](https://app.datadoghq.com/ci/test/runs?query=test_level%3Atest%20%40test.source.file%3A%22test%2Fe2e%2Fapp-dir%2Finstrumentation-order%2Finstrumentation-order.test.ts%22%20%40test.status%3Afail&agg_m=count&agg_m_source=base&agg_t=count¤tTab=overview&eventStack=&fromUser=true&index=citest&start=1749804083936&end=1750408883936&paused=true) Now we always trigger the page for the first time in the test and wait for the logs to come in instead of hardcoding a timeout.
-
Donny/강동윤 authored
### What? Take `&self` from some trivial methods. ### Why? To prepare `Vc<FileSystemPath>` to `FileSystemPath`.
-
Jiwon Choi authored
https://github.com/user-attachments/assets/309108f3-ecce-4dcb-9f29-3b39ba6a394e Closes NEXT-4529
-
Marc Abramowitz authored
-