- 19 May, 2025 31 commits
-
-
vercel-release-bot authored
-
Vercel Release Bot authored
-
Luke Sandberg authored
Unroll recursion in `RuleCondition::matches` This trades allocations due to `Box::pin` calls during recursion for an explicit stack and a tiny interpreter loop. (#79310) ### What? Replace recursion with an explicit stack to reduce allocations. Also, add tests! This trims peak heap in a build of `vercel-site` by 100-300m, see https://vercel.slack.com/archives/C06PPGZ0FD3/p1747438469043789?thread_ts=1746823119.596949&cid=C06PPGZ0FD3 ### Why? This replaces a lot of `Box::pin` calls during evaluation, instead we can amortize the heap allocation cost by pushing items onto explicit stack. This is managed as a SmallVec so in many cases we should be able to avoid allocations. ### How? Tediously introduce a small bytecode machine... sigh. The main alternatives considered were: * pulling all `awaits` up to the top level and using a normal recursive function. This works, but would be limiting when we inevitably add another async dependency on the `Source::content` * eliminating asynchrony from `Source::ident`. This turned out to be controversial (see discussion in linear) and incredibly complex to implement so it is deferred. Closes PACK-4560
-
vercel-release-bot authored
-
Joshua Hannaford authored
## Add logging for entrypoint writing in Turbopack build ### What? This PR adds diagnostic event logging for the entrypoint writing process during Turbopack builds, showing when the process starts and finishes along with timing information. ### Why? This allows us to better track if we are bound by file IO in terms of performance as the number of cores increases. ### How? - Added diagnostic events at the start and end of the `project_write_all_entrypoints_to_disk` function - Added an `Event` severity level to the `Severity` enum to match the `Log` types in Next.js - Implemented event subscription in the build process to capture and display these events
-
JJ Kasper authored
We previously weren't showing any indication when we weren't setting to the runtime cache in production due to the size limit being hit which can make debugging cache misses very tricky so this ensures we always show the warning not just in dev mode. x-ref: [slack thread](https://vercel.slack.com/archives/C02K2HCH5V4/p1747675632042719?thread_ts=1746633220.634939&cid=C02K2HCH5V4)
-
Will Binns-Smith authored
Like `compiler.define`, this allows users to create compile-time constants both Turbopack and webpack from a single API. `compiler.defineServer` instead only makes these constants available for server or edge environments, not the client environment.
-
Jiwon Choi authored
See https://github.com/changesets/changesets/blob/main/packages/changelog-github/CHANGELOG.md for the format.
-
Jiwon Choi authored
### Why? When there are no changesets for `next`, the canary release won't be published even if there are new commits. If this is the case, add an empty changeset for `next` to let the canary release proceed. Note that this will result in an empty Changelog and GitHub Release, but this PR does not cover handling that part. ### Testing Plan Set env `RELEASE_TYPE=canary` and run `ci:version` locally to see the result. --------- Co-authored-by:
JJ Kasper <jj@jjsweb.site> Co-authored-by:
Sebastian "Sebbie" Silbermann <sebastian.silbermann@vercel.com>
-
Jiwon Choi authored
This PR uses `changesets/action` to handle the canary release. Since the action creates a Version Packages PR by default, I added a GH Action that checks if the PR is released from the correct release workflow. It triple-verifies via the user login (`vercel-release-bot`), PR title (`Version Packages (canary)`), and a label (`created-by: CI`) to ensure the opened PR is not trying to spoof. After the validation, the PR bypasses required checks, is merged into the canary branch, and proceeds with the rest of the release process. ### Testing Plan Try running `ci:version` and `ci:publish` locally, and handle the release type via env `RELEASE_TYPE`. Confirmed the CI force merge on https://github.com/devjiwonchoi/lab-releases/pull/13 --------- Co-authored-by:
Sebastian "Sebbie" Silbermann <sebastian.silbermann@vercel.com>
-
Jiwon Choi authored
### Why? Since Next.js emits a debug warning to help catch when a stale `@next/swc` version is being used, couple their versions to be published together. https://github.com/vercel/next.js/blob/3f2a3647ee619c92f2d576b83dfde748003a7f31/packages/next/src/build/swc/index.ts#L131-L139
-
vercel-release-bot authored
-
Genhao Li authored
<!-- 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 # --> ``croppint`` is a typo for ``cropping``, could be misleading Co-authored-by:
JJ Kasper <jj@jjsweb.site>
-
Sebastian "Sebbie" Silbermann authored
[build-sourcemaps] Sourcemap errors during prerender if `experimental.enablePrerenderSourceMaps` is enabled (#79109)
-
Jiwon Choi authored
> [!NOTE] > - Introduced in [PR #67400](https://github.com/vercel/next.js/pull/67400) and released in [v15.0.0-canary.54](https://github.com/vercel/next.js/releases/tag/v15.0.0-canary.54) > - See failed test in deployment [GitHub Actions Run](https://github.com/vercel/next.js/actions/runs/15083957601/job/42405327124?pr=79204#step:34:92) ### Summary This PR resolves two issues related to interception routes and rewrite behavior in Vercel deployments: 1. Rewrite params not parsed correctly from the `NEXT_ROUTER_STATE_TREE_HEADER`, resulting in server crashes due to missing dynamic params. 2. Malformed search query from Vercel deployment, where unresolved dynamic params like `:foo_id` were passed instead of actual values like `1`. These issues caused runtime errors and incorrect component behavior during navigation in deployed environments. This PR ensures consistent param resolution across local and deployed environments. ### Issue 1: Missing Rewrite Params in Vercel The `NEXT_ROUTER_STATE_TREE_HEADER` header, introduced in PR [#67400](https://github.com/vercel/next.js/pull/67400), wasn't parsed correctly during Vercel deployment. This was fine locally with `next start`, which uses [`getResolveRoutes`](https://github.com/vercel/next.js/blob/42b1c400c977cbe43147c083714e7f6bd38cff80/packages/next/src/shared/lib/router/utils/resolve-rewrites.ts#L14), but broke in Vercel which used [`handleRewrites`](https://github.com/vercel/next.js/blob/42b1c400c977cbe43147c083714e7f6bd38cff80/packages/next/src/server/server-utils.ts#L208). ``` TypeError: Expected "<a_dynamic_route_slug>" to be a string at async Object.handler (___next_launcher.cjs:58:5) at async Server.r (../../opt/rust/nodejs.js:2:14674) at async Server.<anonymous> (../../opt/rust/nodejs.js:16:6262) ``` This occurred because the expected dynamic route params were undefined, causing `path-to-regexp` to throw when trying to compile the destination path. ### Solution We ported the interception route rewrite logic from PR #67400, allowing consistent resolution of route params from the `NEXT_ROUTER_STATE_TREE_HEADER`. ### Issue 2: Malformed Query from Vercel Even after correct interception routing, the query string received from Vercel contained unresolved params such as `:foo_id`, resulting in: ```ts { rsc: 'aaaaa', nxtPfoo_id: ':foo_id', nxtPbar_id: ':bar_id', nxtPbaz: '1', } ``` Instead of the expected: ```ts { rsc: 'aaaaa', nxtPfoo_id: '1', nxtPbar_id: '1', nxtPbaz: '1', } ``` This happened because the rewrite rule: ```json { "source": "/:baz_id", "destination": "/:foo_id/:bar_id/(...)baz/:baz_id", ... } ``` Did not include `:foo_id` or `:bar_id` in the `source`, so they were never correctly mapped by Vercel CLI's [`convertRewrites`](https://github.com/vercel/vercel/blob/53e3609f144d08ad92d42291bcbf483ae592ff1b/packages/routing-utils/src/superstatic.ts#L165). ### Solution Since we already parse rewrite params from the `NEXT_ROUTER_STATE_TREE_HEADER`, we now inject those resolved values into `parsedUrl.query`. If any query value still starts with `:`, it's treated as unexpected and replaced with the rewrite params accordingly.
-
Jiwon Choi authored
This PR added `.github/workflows/trigger_release_new.yml`, which is a port of `.github/workflows/trigger_release.yml` and modified [publishRelease](https://github.com/vercel/next.js/blob/8223eb86925e575cd641b55626b4bbc4a4d788c6/.github/workflows/build_and_deploy.yml#L529) to use the `changesets/action` to publish to NPM and GitHub Release. This workflow uses [changesets/action](https://github.com/changesets/action) to publish NPM and GitHub Release. The main difference is that the GitHub Release will be published per package. ### Testing Plan Try running `ci:version` and `ci:publish` locally.
-
Donny/강동윤 authored
### What? Replace `retry_future` call with `retry_blocking`. ### Why? `tokio::fs` is a trap for this kind of usage. Each function call will spawn one thread until it reaches the thread pool limit. Our previous code could spawn at most eight threads to handle one `write file` effect. The numbers at x-ref: https://vercel.slack.com/archives/C06PPGZ0FD3/p1747437041264999
-
Niklas Mischkulnig authored
This additional block was originally added to support cases like ```js var {exports} = __turbopack_context; { // user code var exports = 1234; } ``` so we only need it if Turbopack actually inserts a variable declaration. -
Hendrik Liebau authored
Now that `ppr` is enabled by default when `dynamicIO` is enabled, we can remove the obsolete `ppr: true` configs from the Dynamic IO tests.
-
Janka Uryga authored
Follow-up to #79254, there's one more test flaking with the same issue. I pulled the label-ignoring logic out into ```ts expect(browser).toDisplayRedbox('...', { label: false }) ``` so that it's easy to find these later when we fix the underlying issue. -
Joseph authored
Closes: https://linear.app/vercel/issue/DOC-4668/document-the-experimentaltaint-option-in-nextconfigts Flag value was incorrect.
-
Hendrik Liebau authored
The prospective fallback prerenders, which ensured that a fallback shell could be prerendered without errors, were only needed when Dynamic IO was enabled and PPR was disabled. This scenario is no longer supported.
-
Vercel Release Bot authored
-
Joseph authored
Closes: https://linear.app/vercel/issue/DOC-4677/remove-reference-to-next-dev-verbose Fixes: https://github.com/vercel/next.js/issues/79337 For now, `--verbose` is not supported for `next dev`. --------- Co-authored-by:
Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
-
Hendrik Liebau authored
Now that `ppr` is automatically enabled when `dynamicIO` is enabled, we can remove the code branch that handled prerendering with Dynamic IO enabled, and PPR disabled. > [!NOTE] > This PR is best reviewed with hidden whitespace changes.
-
Janka Uryga authored
missed this one in #78916. Weirdly enough the replacement seems to be working fine -- i guess something in recast was parsing the string (i.e. `path.replace("__turbopack_load_by_url__")` worked somehow). but that's not allowed according to recast's types, so we shouldn't rely on that. -
Joseph authored
Closes: https://linear.app/vercel/issue/DOC-4668/document-the-experimentaltaint-option-in-nextconfigts - Documents activation of taint APIs within Next.js - Documents basic usage of the taint APIs --------- Co-authored-by:
Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
-
Vercel Release Bot authored
-
Vercel Release Bot authored
-
zoomdong authored
-
Sebastian "Sebbie" Silbermann authored
Allows unambigious assertions on CLI output. Not that interesting for dev but `next build` will have the logs for all pages in all tests. I also made the pages static where possible so that we'll be able to assert on the logged errors during `next build`.
-
- 18 May, 2025 3 commits
-
-
vercel-release-bot authored
-
Tim Neutkens authored
-
Tim Neutkens authored
## What? This test was already skipped for dev, seems I missed skipping it for build, added that here.
-
- 17 May, 2025 6 commits
-
-
vercel-release-bot authored
-
Hendrik Liebau authored
With this PR, we're automatically enabling `ppr` when `dynamicIO` is enabled, and forbid using `ppr: 'incremental'` or `ppr: false` together with `dynamicIO: true`. While implementing the config validation, I noticed that the `userConfig`, `config`, and `result` objects in `assignDefaults` were untyped. This is fixed now.
-
Hendrik Liebau authored
To prepare for an upcoming change where `ppr` will be enabled automatically when `dynamicIO` is enabled, we're hard coding `ppr: true` in the Dynamic IO tests with this PR. The non-PPR assertions are subsequently removed, which makes up most of the changed lines. We can now also exclude the tests in the PPR tests manifest, so that they're not run twice in CI. > [!NOTE] > This PR is best reviewed with hidden whitespace changes.
-
Hendrik Liebau authored
To prepare for an upcoming change where `ppr` will be enabled automatically when `dynamicIO` is enabled, we're disabling `dynamicIO` in the global default cache handler test, and using the `useCache` config instead, because `output: 'standalone'` is currently not compatible with PPR.
-
Hendrik Liebau authored
When dynamicIO is enabled, missing data is encoded to an infinitely hanging promise, the absence of which we use to determine if a segment is fully static or partially static. However, when dynamicIO is not enabled, this trick doesn't work. Previously, if PPR is enabled, and dynamicIO is not, we were conservative and assumed that all segments are partial. That doesn't need to be the case, though. We can use the `onPostpone` callback of the `prerender` function to determine if a given RSC node is partial. To make sure that this works as expected, we're disabling `dynamicIO` in `test/e2e/app-dir/segment-cache/incremental-opt-in`. Without this change, the following tests would fail because additional requests for the PPR-enabled routes are triggered when `dynamicIO` is disabled: - `when a link is prefetched with <Link prefetch=true>, no dynamic request is made on navigation` - `when prefetching with prefetch=true, refetches cache entries that only contain partial data` - `when prefetching with prefetch=true, refetches partial cache entries even if there's already a pending PPR request` In addition, we're also disabling `dynamicIO` in `test/e2e/app-dir/segment-cache/client-only-opt-in` as well as `test/e2e/app-dir/segment-cache/export`, to prepare for an upcoming change where `ppr` will be enabled automatically when `dynamicIO` is enabled. Those three tests are then not compatible with `dynamicIO` because they either rely on the `'incremental'` PPR config, or on `output: 'export'`.
-
Jiwon Choi authored
[TypeScript Plugin] Moved the diagnostics' positions to the prop's type instead of the value for client-boundary warnings (#79193) Best be reviewed with "Hide whitespace". ### Why? Since it was matching `ts.isObjectBindingPattern`, which checks only the destructured props:  It didn't handle non-destructured:  Therefore, I think it's more natural to target the types, not the props value, as the cause of this warning is actually the types:   x-ref: https://github.com/vercel/next.js/pull/79144#discussion_r2086941435 --------- Co-authored-by:
Janka Uryga <lolzatu2@gmail.com>
-