Repository navigation
Build every committed bundle with one Node builder - #2460
Merged
Merged
Conversation
`build/vendor.py` shelled out to esbuild once per bundle, copied patched packages into a scratch directory, and handed a `meta.json` to `shipped.mjs`'s CLI; five per-bundle Node scripts sat beside it, and `check:bundles` rebuilt in place and read `git status`. It is replaced by `build/vendor.mjs`, one table with a row per bundle, built in-process and returned as an outputs map that `build/browser/build.mjs` writes and checks with its own, the way it already did for the initial renderers and styles. - `pnpm run build:browser` now rebuilds every bundle, and `pnpm run check:browser` (part of `pnpm run check`) compares them with the committed bytes without writing, so it works on an uncommitted tree. `check:bundles`, its CI step and its `wt merge` block are gone. The full build takes about 2s. - The layer's `vendor/` and every package's `vendor/` are owned whole: a file there that no build writes is stale, replacing the framework-only directory scan and the `git status` read. - Upstream adaptations edit modules as esbuild loads them through one `adapt` plugin and one `seam()` count guard, Lit's three included. The floating-ui `.patch` files apply in memory with jsdiff. An adaptation whose module no longer loads now fails the build too; nothing writes `node_modules` or a scratch copy. - `build/registry.mjs` is the one generator of registry-derived runtime modules: `runtime/syntax-languages.js` (was in vendor.py) and `runtime/composing/drawing-schema.js` (was in build.mjs) are rows of one table. Their first-line banners now name it. - `build/lit.mjs` declares the static-html renaming once, deriving the export list from `lit/static-html.js`; `lit.js` and Web Awesome's binding (`bindToVendoredLit`) read the same table, and the binding checks per importer that the package resolves Leaf's Lit. - `shipped.mjs` loses its CLI, the only caller of which was vendor.py. - `crelt`, `w3c-keyname`, `style-mod`, `@floating-ui/core` and `@floating-ui/utils` leave `package.json`: they were declared only so the scratch copies could resolve their dependencies after the pnpm move; the lock still pins them. Bundle contents are byte-identical. Three chunk file names change (syntax's two shared chunks, Web Awesome's one) with the files that import them: esbuild's chunk hash includes input paths relative to the working directory, which was `.tmp/vendor-*/` and is now the repository root. Web Awesome's chunk also carries a theme comment that named `build/vendor.py`. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 12, 2026
max-sixty
added a commit
that referenced
this pull request
Oct 12, 2026
The site build compiles the runtime through `build/browser/build.mjs`, which since #2460 loads `build/vendor.mjs`, `build/lit.mjs`, `build/registry.mjs` and the bundle entries under `build/`. The `publish-site` trigger listed two of those files by hand, so a change to any other one reached main without republishing the site. The trigger now names the build tree as a whole, so a new build module needs no edit here. Found while landing #2460 (code-quality survey, second wave). > _This was written by Claude Code on behalf of max-sixty_ Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every committed browser bundle is now built by one Node builder.
build/vendor.py(Python shelling out to esbuild per bundle, copying patched packages into a scratch dir, handingmeta.jsontoshipped.mjs's CLI) and its five per-bundle Node scripts becomebuild/vendor.mjs: one table, a row per bundle, built in-process and returned as an outputs map thatbuild/browser/build.mjswrites and checks alongside the framework, initial renderers and styles. Code-quality survey items F127 and F58.What changes for a contributor:
pnpm run build:browserrebuilds everything (about 2s);pnpm run check:browser, already part ofpnpm run check, compares every bundle with the committed bytes without writing, so it works on an uncommitted tree.check:bundles, its CI step and itswt mergeblock are gone.vendor/and every package'svendor/are owned whole: any file there that no build writes is reported stale (this replaces thegit statusread).adaptesbuild plugin and oneseam()count guard (Lit's three included); the floating-ui.patchfiles apply in memory with jsdiff. An adaptation whose module no longer loads now fails the build. Nothing writesnode_modulesor a scratch copy.build/registry.mjsis the single generator of registry-derived runtime modules:runtime/syntax-languages.js(was in vendor.py) andruntime/composing/drawing-schema.js(was in build.mjs) are two rows of one table, so a new registry fact is one row.build/lit.mjs(F58) declares the static-html renaming once and derives the export list fromlit/static-html.js;lit.jsand Web Awesome'sbindToVendoredLitbinding read the same table, and the binding checks per importer that the package resolves Leaf's Lit.crelt,w3c-keyname,style-mod,@floating-ui/coreand@floating-ui/utilsleavepackage.json: they were declared only so the scratch copies could resolve dependencies after the pnpm move. The lock still pins them.Byte identity. All bundle contents are unchanged. Three chunk file names change (syntax's two shared chunks and Web Awesome's one), along with the lines importing them: esbuild's chunk hash includes input paths relative to the working directory, which was
.tmp/vendor-*/and is now the repository root (confirmed by building from a depth-2 directory, which reproduces the old names). Web Awesome's chunk also carries a theme comment that namedbuild/vendor.py, and the two registry modules' first-line banners now namebuild/registry.mjs.Key files:
build/vendor.mjs(the table andadapt/seam),build/browser/build.mjs(aggregation, vendor-directory ownership),build/lit.mjs,build/registry.mjs.Open PRs #2336 and #2249 each touch
build/vendor.py(a copiedscoped-registrybundle; a snapdom.patch); after this lands they port to acopyrow and apatches(...)adaptation respectively.