Repository navigation
perf(build): overlap type checking and the AI index with the site build - #974
letstokenize wants to merge 5 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…l-deploy-time-a9f1fa # Conflicts: # .github/workflows/verify.yml # vite.config.ts
…l-deploy-time-a9f1fa # Conflicts: # package.json
…l-deploy-time-a9f1fa # Conflicts: # vite.config.ts
…l-deploy-time-a9f1fa
There was a problem hiding this comment.
I reviewed this PR and didn't find any bugs. The new Vite plugin depends on internals of vocs and plugin-rsc that I couldn't check from this checkout, so a human look would still be worthwhile.
What was reviewed:
- package.json: the regex selector in
pnpm runmatches onlycheck:typesandbuild:site, and it runs after theguard-vocs-config.mjsguard. - vite.config.ts:
isRscScanBuilduseswrite === falseto decide whether a build is a scan. The only otherwrite: falsebuilds in the repo are insrc/test/zyzz-integration.test.ts. They useconfigFile: false, so this plugin doesn't apply to them. - Not verifiable here: the vocs virtual module ID, the
getAiSearchManifestexport name and the claim that the index keeps building in the background. vocs isn't installed in this checkout.
Extended reasoning...
The change is limited to the build: package.json now runs type checking alongside the site build, and vite.config.ts adds a build-only plugin. During plugin-rsc scan passes, that plugin replaces a vocs virtual module with a stub. It touches no security-sensitive code (no auth, input handling or data exposure). I deferred because the plugin relies on vocs internals that aren't in this checkout: the \0virtual:vocs/ai-search-manifest ID, the shape of the getAiSearchManifest export, and where the index build starts. It also assumes that only plugin-rsc's scan builds set write === false. A small change in either dependency could quietly stub the manifest out of the real build, or leave it unstubbed during the scans.
Summary
Docs deploys now take about 2.5–4 minutes. Close to a minute of that is waiting that doesn't need to happen: the type check runs alone before the site build starts, and the first build pass waits on the AI search index. This overlaps both with the build, which brought a preview build down to about 2 minutes.
Changes
pnpm buildrunscheck:typesandbuild:siteconcurrently through pnpm's script selector, and still fails if either one fails. On Vercel the type check currently takes 33–53s before the build starts.llms.txtsources in the background. The scans discard module bodies anyway. The real RSC build still waits for the full manifest. Onmain, scan 1 finishes one second after the index in every recent build.Testing
Vercel, from
pnpm run buildstart to build completion (8-core Enhanced machines):main, last 6 production buildsThis is one preview run against six
mainbuilds, and Vercel build times vary between runs.Local A/B on the same tree (10-core Mac, AI index inactive without
CLOUDFLARE_API_TOKEN): median 89s with type checking in parallel against about 102s sequential. Local machines see less gain because the type check competes with the build for CPU.pnpm build,pnpm check:types, and Biome pass on the merged branch.build.write = falseand on Vocs'virtual:vocs/ai-search-manifestmodule ID. Both hold on the current versions (plugin-rsc 0.5.37, Vocs 2.10.3). If either changes, the plugin stops matching and the build behaves as it does today.