doc.js over its size budget on dev #428

Closed
opened 2026-11-08 14:24:16 +00:00 by kayg · 3 comments
Owner

verify fast fails the tracer check doc.js stays small on unmodified dev (J365, #404): 13408 bytes, budget < 12000.

Bisect (doc.js, minified, as docs-build.ts builds it): f8fe487fe = 6723, 5d34c133a = 13408. The merge is fix-removal-confirm (#391): it made packages/ui/src/tooltip.ts import ./glass-bed. The docs page script only needs copyTextInPlace (doc-enhance -> copy-feedback), and the tooltip code used to be tree-shaken out. With the new import, Bun keeps the whole tooltip module (+6.7 KB) and the rest of copy-feedback. Not #409, #367, #416 or mesh DNS.

Proof: replacing the attachGlassBed call with a stub gives 6723 again; "sideEffects": false on packages/ui gives 6723 too.

Plan: declare packages/ui side-effect-free (nothing in it is imported for effect only), so unused exports are dropped again. Budget stays 12000. ~1 h.
Branch fix-docjs-budget, base 7c8bd2221.

`verify fast` fails the tracer check `doc.js stays small` on unmodified dev (J365, #404): 13408 bytes, budget < 12000. Bisect (doc.js, minified, as docs-build.ts builds it): f8fe487fe = 6723, 5d34c133a = 13408. The merge is `fix-removal-confirm` (#391): it made `packages/ui/src/tooltip.ts` import `./glass-bed`. The docs page script only needs `copyTextInPlace` (doc-enhance -> copy-feedback), and the tooltip code used to be tree-shaken out. With the new import, Bun keeps the whole tooltip module (+6.7 KB) and the rest of copy-feedback. Not #409, #367, #416 or mesh DNS. Proof: replacing the `attachGlassBed` call with a stub gives 6723 again; `"sideEffects": false` on packages/ui gives 6723 too. Plan: declare packages/ui side-effect-free (nothing in it is imported for effect only), so unused exports are dropped again. Budget stays 12000. ~1 h. Branch `fix-docjs-budget`, base 7c8bd2221.
Author
Owner

Started: branch fix-docjs-budget, base 7c8bd2221. Cause above (merge 5d34c133a, #391 tooltip -> glass-bed import defeats tree-shaking). Fix pushed; running tracer build + specs on dev-02.

Started: branch fix-docjs-budget, base 7c8bd2221. Cause above (merge 5d34c133a, #391 tooltip -> glass-bed import defeats tree-shaking). Fix pushed; running tracer build + specs on dev-02.
Author
Owner

Finished. Branch fix-docjs-budget, head e97ce91b1 (one commit, base 7c8bd2221): packages/ui/package.json gets "sideEffects": false. Nothing in packages/ui is imported for its effect alone, so Bun drops unused modules again. Budget unchanged (12000).

Sizes (docs-build.ts's own build, minified, dev-02): doc.js 13408 -> 6723 bytes. Whole tracer dist JS 1,645,699 -> 1,637,694 bytes (-8 KB, chunks re-split, 123 -> 119 files); main.js 28860 -> 29239 (+379 B). main.js is the one number that rose; the deferred/entry budgets run in the browser suite, which I did not run in full (see below).

Proof

  • bun test docs-build.test.ts chunk-classes.test.ts browser-build.test.ts precompress.test.ts (dev-02): 25 pass, 0 fail, includes "doc.js stays small" (/tmp/j372-pw2.log on dev-02 has the run).
  • bun run check (tsc) passes; scripts/verify quick on compute01: passed (QUICK_EXIT=0, ~/j372-quick.log).
  • Playwright (dev-02, 59 specs: host-removal-confirm, pending-host-removal, tooltip-fit, docs, docs-reading, clusters-stray-tooltip): 53 pass, 6 fail, all in pending-host-removal.spec.ts (label x offset 0.9-3.3 px vs 0.5 allowed). The same spec fails 5 of 6 on unmodified origin/dev 77b1255cb (/tmp/j372-pw3.log), so it is not from this change. host-removal-confirm (the #391 glass bed) passes.

verify fast on compute01: FAIL, not from this change. Table row test | FAIL (101), everything else PASS (static builds PASS, doc comments PASS, ...). Nine infraternal-plugin-ssh --test install tests fail ("Setup is already running on this host", "Uploading the infraternal binary failed"). Three of them fail the same way alone, on both my branch and unmodified origin/dev (~/j372-t.log, ~/j372-t-dev.log on compute01). Because the Rust gate failed, verify never reached its tracer-browser phase, so I did not run the whole 1,280-spec tracer suite (a single worker would hold dev-02's one slot for hours). Needs: someone to look at the ssh install tests on compute01 and the pending-host-removal alignment spec, both red on dev.

Cause recap: merge 5d34c133a (#391) added import "./glass-bed" to tooltip.ts; Bun then kept the whole tooltip module (+6.7 KB) in doc.js.

Finished. Branch `fix-docjs-budget`, head **e97ce91b1** (one commit, base 7c8bd2221): `packages/ui/package.json` gets `"sideEffects": false`. Nothing in packages/ui is imported for its effect alone, so Bun drops unused modules again. Budget unchanged (12000). **Sizes** (docs-build.ts's own build, minified, dev-02): doc.js 13408 -> **6723** bytes. Whole tracer `dist` JS 1,645,699 -> 1,637,694 bytes (-8 KB, chunks re-split, 123 -> 119 files); `main.js` 28860 -> 29239 (+379 B). main.js is the one number that rose; the deferred/entry budgets run in the browser suite, which I did not run in full (see below). **Proof** - `bun test docs-build.test.ts chunk-classes.test.ts browser-build.test.ts precompress.test.ts` (dev-02): 25 pass, 0 fail, includes "doc.js stays small" (/tmp/j372-pw2.log on dev-02 has the run). - `bun run check` (tsc) passes; `scripts/verify quick` on compute01: passed (QUICK_EXIT=0, ~/j372-quick.log). - Playwright (dev-02, 59 specs: host-removal-confirm, pending-host-removal, tooltip-fit, docs, docs-reading, clusters-stray-tooltip): 53 pass, 6 fail, all in `pending-host-removal.spec.ts` (label x offset 0.9-3.3 px vs 0.5 allowed). The same spec fails 5 of 6 on unmodified origin/dev 77b1255cb (/tmp/j372-pw3.log), so it is not from this change. host-removal-confirm (the #391 glass bed) passes. **`verify fast` on compute01: FAIL, not from this change.** Table row `test | FAIL (101)`, everything else PASS (static builds PASS, doc comments PASS, ...). Nine `infraternal-plugin-ssh --test install` tests fail ("Setup is already running on this host", "Uploading the infraternal binary failed"). Three of them fail the same way alone, on both my branch and unmodified origin/dev (~/j372-t.log, ~/j372-t-dev.log on compute01). Because the Rust gate failed, verify never reached its tracer-browser phase, so I did not run the whole 1,280-spec tracer suite (a single worker would hold dev-02's one slot for hours). Needs: someone to look at the ssh install tests on compute01 and the pending-host-removal alignment spec, both red on dev. Cause recap: merge 5d34c133a (#391) added `import "./glass-bed"` to tooltip.ts; Bun then kept the whole tooltip module (+6.7 KB) in doc.js.
Author
Owner

Closed by the orchestrator during the 2026-11-09 night housekeeping (owner order: "close stale prs/issues"). The work has landed on dev, and the latest note here is a finish or merge note (J387 inventory on #436). Reopen if anything is still missing.

Closed by the orchestrator during the 2026-11-09 night housekeeping (owner order: "close stale prs/issues"). The work has landed on dev, and the latest note here is a finish or merge note (J387 inventory on #436). Reopen if anything is still missing.
kayg closed this issue 2026-11-08 19:04:23 +00:00
Sign in to join this conversation.
No labels
launch-qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/infraternal#428
No description provided.