Repository navigation
Conversation
Two generators each bundled Lit: scripts/browser/build.mjs into browser-runtime.js, and vendor.py's Web Awesome build into its shared chunk. Every page therefore evaluated Lit twice (window.litHtmlVersions read ["3.3.3", "3.3.3"]): two LitElement classes, two template caches, and two pins in two files that could drift apart. The browser build now writes vendor/lit.js, every public Lit module in one namespace in the shape of Lit's own lit-all bundle (static-html's tags as staticHtml, staticSvg, staticMathml), and binds the framework's Lit imports to it. The Web Awesome build externalizes every lit specifier to /vendor/lit.js, mapping static-html onto the renamed tags, and no longer bundles or pins Lit; it installs package.json's lit beside Web Awesome and refuses when npm has to nest a different one under it, so the single pin still has to fall inside Web Awesome's declared range. The build gate that refused every import in browser output now admits a static import of a sibling output and nothing else. build.test.mjs checks the framework imports ./lit.js rather than carrying Lit, and that lit.js exports the names Web Awesome reaches for. Served heat-loss preview, same journey: litHtmlVersions ["3.3.3","3.3.3"] -> ["3.3.3"], vendor requests 6 -> 7 (lit.js), boot bytes for browser-runtime + Web Awesome chunk (+ lit.js) 287,141 -> 282,842. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
left a comment
There was a problem hiding this comment.
Removing lit from scripts/vendor.py's PINS leaves its version with no drift watcher. report_pins iterates PINS, so scripts/vendor.py --pins — the weekly step that exists because these versions "drift silently" — no longer prints a lit row, and .github/dependabot.yml declares only the github-actions and uv ecosystems, so nothing reads package.json either. The new refusal in build_webawesome is a different guard: it fires on a bump that lands outside Web Awesome's range, and a Lit that simply never moves produces no signal at all.
The gap is wider than lit. package.json now holds the framework's whole browser payload pin set — lit and @preact/signals-core both reach a page — and no watcher reads it. @preact/signals-core was already sitting there, so this PR isn't what opened the hole, but it moves the page's single most consequential browser dependency into it without saying so.
Both homes for the fix have a cost, so it's a call for you rather than something to just push: an npm entry in .github/dependabot.yml would cover package.json and pick up @preact/signals-core too, but esbuild is pinned in both PINS and devDependencies, so dependabot would move one copy and leave the other disagreeing; a lit row back in PINS would reinstate the two-places-to-drift problem this PR set out to remove. Say which and I'll push it.
Lit left PINS when the Web Awesome bundle stopped carrying it, which took its row out of the weekly drift report; @preact/signals-core, also page payload, never had one. --pins now also reads the package.json pins the browser build's manifest lists as bundled, holds lit to Web Awesome's range as before, and names npm run build:browser (plus webawesome for lit) as the rebuild. The pins stay in package.json alone. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Pushed 7a1e846 for the drift gap without a second pin:
|
|
Confirmed — both rows are back and neither reinstates a second place to drift.
Separately, and not about the diff: For the interim I ran the gate's Python half over the commit's only non-doc file: What I checked and how
|
leaf-agent
left a comment
There was a problem hiding this comment.
scripts/AGENTS.md still says of vendor.py that "Every pinned version sits in one table there", and this PR makes that false: lit's pin moved to package.json, and build_webawesome installs it from there — lit = browser_pins()["lit"], then f"lit@{lit}" in the npm install. That fact has three copies in the tree, and 7a1e846 corrected the other two, the dependabot.yml comment and the weekly step. This is the one a session reads before touching vendor.py, so the reader who comes to bump Lit looks in PINS, doesn't find it, and has nothing pointing at package.json.
The sentence sits outside the diff's hunks, so I can't attach a suggestion. Replacing it with something like:
Every version it pins sits in one table there, except the page payload the browser build bundles —
litand@preact/signals-core, pinned inpackage.jsonand read from the build manifest by--pins.
would close it. Say the word and I'll push it.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # scripts/browser/generated/browser-runtime.js.map # scripts/browser/generated/browser-runtime.manifest.json # skills/leaf/assets/vendor/browser-runtime.js
|
db7bb4b closes the And the mechanism for the missing Same three for Worth naming above this PR: committed generated browser output means any two branches that regenerate it conflict, and the consequence is not just a merge to do — the conflict silently removes the only required check from the head while the PR keeps showing a green
|
… its lock (#1084) JS versions lived in two manifests. `scripts/vendor.py` kept a `PINS` table and installed each bundle's packages into a throwaway npm directory. The browser framework build pinned Lit, Signals and esbuild in `package.json`, and #1011 and #1022 moved rows across one at a time. `plot`, `pierre` and `mcp-app` also took their transitive dependencies from whatever npm resolved on the day, so their bytes weren't reproducible. Now `package.json` pins every package a bundle's own source imports, and `package-lock.json` settles the rest of each closure. `vendor.py` builds every bundle from the root `node_modules` that `npm ci` installs and reads banner versions from there. `PINS`, the throwaway installs, `HELD_BY`, `REBUILDS` and `--pins` are gone. A package that another package depends on is now held by that dependant's range and the lock, which is what `HELD_BY` used to approximate. **Testing the model.** First I added every existing pin to `package.json`, and all of them resolved in one tree without conflict. Nested copies exist (`marked` 11 under Web Awesome, `acorn` under agentic-mermaid, `entities` 6 under parse5), but none of them reaches a bundle differently than it did before. Rebuilding from the root lock reproduced every tracked file byte for byte. The one exception is the Web Awesome shared chunk's name (`chunk-SH2BVOI3.js` → `chunk-DGEFCNBY.js`): esbuild's chunk hash covers input paths, and the content is identical. That new name is stable across runs. Then I trimmed `package.json` to direct imports only, and the lock kept every resolved version. **What moved:** - CI's `test` job runs `uv run scripts/vendor.py` and fails on any diff, now that a rebuild reproduces exactly. Root `AGENTS.md` says `wt merge` doesn't run this check. - Dependabot now watches the root npm manifest, grouped weekly, with esbuild excluded. Its PR stays red until the bundles are rebuilt, and running-tend's weekly section says how. - `browser-runtime.manifest.json` records the lock hash and contributor dependencies, so it was regenerated. - Deleted `test_the_tooling_instructions_place_every_vendored_bundle`, since the reproducible/unreproducible split it enforced no longer exists. The MCP App banner test reads the lock. - Pierre's license walk resolves each package to the copy esbuild actually read, nested or not. **Verification:** `npm ci`; `npm run check:browser && npm run test:browser` (64 pass); `npm run test:runtime` (91 pass); `uv run scripts/vendor.py` twice with a clean tree; `uv run pytest tests` (1353 passed). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Every page evaluated Lit twice.
scripts/browser/build.mjsbundled it intobrowser-runtime.js, andvendor.py's Web Awesome build bundled it again into the shared chunk every page loads throughwebawesome-chrome.js. In a served pagewindow.litHtmlVersionsread["3.3.3", "3.3.3"], and the same forlitElementVersionsandreactiveElementVersions. That meant twoLitElementclasses, two template caches, and a Lit pin in two files (package.json,vendor.pyPINS) that could drift apart.Change
skills/leaf/assets/vendor/lit.js. It holds every public Lit module in one namespace, shaped like Lit's ownlit-allbundle: static-html's tags are exported asstaticHtml,staticSvgandstaticMathml, so they don't shadow the ordinary tags. The list of modules comes from Lit'spackage.jsonexports, so nothing is maintained by hand.browser-runtime.jsimports Lit from./lit.js.litspecifier to/vendor/lit.jsand mapslit/static-html.jsonto the renamed tags. It no longer bundles or pins Lit. It installspackage.json'slitbeside Web Awesome and refuses to build if npm has to nest a different Lit under Web Awesome, so the one pin still has to fall inside Web Awesome's declared range.scripts/vendor.py --pinsalso reads thepackage.jsonpins that the browser build's manifest lists as page payload (litand@preact/signals-core). It still holdslitto Web Awesome's range and namesbrowser(npm run build:browser) as the rebuild, so Lit keeps its weekly drift row without a second pin. Therunning-tendweekly step and thedependabot.ymlcomment describe this.build.test.mjschecks that the framework imports./lit.jsinstead of carrying Lit, and thatlit.jsexports the names Web Awesome uses.Measured
I served the
heat-losspreview from each checkout and ran the same journey on both, readingperformance.getEntriesByType('resource')and the version globals:litHtmlVersions["3.3.3","3.3.3"]["3.3.3"]lit.js)Neither console logged errors.
wa-inputandwa-copy-buttonupgrade.Tests
npm run test:browserandnpm run check:browsernpm run test:runtimepytest --run-nightly tests/test_interact_document.py tests/test_render_export.py tests/test_interact_layer.pytests/test_render_widgets.py -k "webawesome or color or slider or switch or radio or select or number or textarea or comparison or copy"🤖 Generated with Claude Code