Skip to content

test(typegen): pack vinext without rebuilding the shared dist - #3496

Merged
james-elicx merged 1 commit into
mainfrom
fix/typegen-pack-no-prepack
Sep 26, 2026
Merged

james-elicx merged 1 commit into
mainfrom
fix/typegen-pack-no-prepack

Conversation

@james-elicx

Copy link
Copy Markdown
Member

Problem

tests/typegen.test.ts ("installs @vinext/types transitively from packed vinext without Next.js") runs pnpm pack in packages/vinext. That fires vinext's prepack, which runs vp pack with clean: true and wipes packages/vinext/dist for several seconds while it rebuilds.

The unit project runs files in parallel (maxWorkers: 3), and other unit files resolve vinext's package exports from that dist. tests/cache-adapters-build.test.ts ("preserves the CDN response entrypoint through Cloudflare's virtual host entry") imports vinext/server/fetch-handler, and when it lands inside the rebuild window it fails with:

Rolldown failed to resolve import "vinext/server/fetch-handler"

Which files overlap depends on the shard schedule, so a change that only resizes unrelated test files can make this fail on every attempt. It does so on #3465 and every PR stacked above it, which pass on the parent #3463 with the same shard contents.

Fix

Pack vinext with --config.ignore-scripts=true, so the test packs the dist the install already built instead of rebuilding the shared one. Without prepack the README copy no longer happens, so the withPreservedFile wrapper that restored packages/vinext/README.md is removed (the rest of the diff is dedent).

Locally the test still passes, and packages/vinext/dist/index.js keeps its modification time across the run.

@james-elicx

Copy link
Copy Markdown
Member Author

/bigbonk review for issues

Please review exact head a863a9bfb04b5265ac715ac6f67ec1bef7ad9fc8 without modifying or pushing the branch. Report all actionable findings within your 8-minute time limit.

@pkg-pr-new

pkg-pr-new Bot commented Sep 26, 2026

Copy link
Copy Markdown

Open in StackBlitz

@vinext/cloudflare

npm i https://pkg.pr.new/@vinext/cloudflare@3496

create-vinext-app

npm i https://pkg.pr.new/create-vinext-app@3496

@vinext/types

npm i https://pkg.pr.new/@vinext/types@3496

vinext

npm i https://pkg.pr.new/vinext@3496

@cloudflare/workers-response-store

npm i https://pkg.pr.new/@cloudflare/workers-response-store@3496

commit: a863a9b

@ask-bonk

ask-bonk Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

LGTM!

github run

@github-actions

Copy link
Copy Markdown
Contributor
Example Preview Production Original
app-router-cloudflare preview production
pages-router-cloudflare preview production
app-router-playground preview production original
realworld-api-rest preview production
nextra-docs-template preview production
benchmarks preview production
hackernews preview production original
response-store-demo preview production
workers-cache preview production
kv preview production
static-export preview production
web preview production

@github-actions

Copy link
Copy Markdown
Contributor

Performance benchmarks

Compared a863a9b against base 63baa24 using alternating same-runner rounds. Next.js was unchanged and skipped.

0 improved · 0 regressed · 6 within ±1.5%

Scenario Framework Baseline Current Change
Client bundle size (gzip) vinext 142.4 KB 142.3 KB ⚫ -0.0%
Client entry size (gzip) vinext 130.4 KB 130.4 KB ⚫ -0.0%
Dev server cold start vinext 3.13 s 3.09 s ⚫ -1.3%
Production build time vinext 3.29 s 3.28 s ⚫ -0.3%
RSC entry closure size (gzip) vinext 128.2 KB 128.2 KB ⚫ -0.0%
Server bundle size (gzip) vinext 226.8 KB 226.8 KB ⚫ +0.0%

View detailed results and traces

🟢 improvement · 🔴 regression · ⚫ change below 1.5% · paired base/head

@james-elicx
james-elicx marked this pull request as ready for review September 26, 2026 22:50
@james-elicx
james-elicx merged commit b1eb146 into main Sep 26, 2026
79 checks passed
@james-elicx
james-elicx deleted the fix/typegen-pack-no-prepack branch September 26, 2026 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant