Repository navigation
Compile UI Tailwind once per verification (#230) - #238
Merged
Merged
Conversation
packages/ui ran verify as typecheck then build, and both of those run styles, so scripts/build-styles.mjs compiled the same minified CSS twice per verification. verify now runs styles once and then the compiler-only typecheck:tsc and build:tsc scripts. typecheck and build keep their old meaning -- each still runs styles first -- so either works alone on a fresh checkout, and every external caller (scripts/pack-sources.mjs, scripts/prepare-extension-release.sh, .github/workflows/ci.yml) still invokes only styles, typecheck, build and verify. No CI workflow changed. No caching and no up-to-date check were added. The single styles run is unconditional, so no stale output can survive a source change. Verified locally on macOS 15 / Node 26, from a state with no packages/ui/dist and no src/styles.generated.ts: - Paired A/B, alternating old and new scripts, 8 pairs each: verify median 2.85s before, 2.63s after; median paired saving 0.21s, mean 0.32s (one outlier pair at 1.74s, one at -0.37s). That is about 7% of a ~2.9s run, and the styles step alone is under a second here. The redundancy is real but the wall-clock saving is small; the issue's own CI timings describe one run, not a benchmark, so no larger claim is made. CI, where the run is cold, was not measured. - Exactly one styles invocation in verify's output, down from two. - src/styles.generated.ts is byte-identical (sha256 2f7e3ad4...) whether produced by typecheck alone, build alone, or verify. - Invalidation: adding an unused utility class to src/components.ts changed the generated hash and emitted the class; reverting restored the original hash. - build alone and typecheck alone each still emit the stylesheet and dist/index.d.ts from a clean state. Gates run: npm run lint, npm run check, npm test (581 pass, 1 skipped), npm run verify:workspaces (ui 59, auth 196, admin 63, integration 1, all pass). A true fresh clone plus npm ci was not run; the ui package was reset to its unbuilt state before every measurement, and the root dist/ that packages/ui/test/scaffold.test.ts requires was built once first, as CI does. Co-Authored-By: Claude Opus 5 <[email protected]>
jimhoyd
force-pushed
the
fix/ui-styles-once-per-verify
branch
from
September 20, 2026 05:19
2e42cf0 to
8ae2033
Compare
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.
Closes #230.
What changed
packages/uiranverifyastypecheckthenbuild, and both of those runstyles, soscripts/build-styles.mjscompiled the same minified Tailwind CSS twice per verification.typecheckandbuildkeep their old meaning — each still runsstylesfirst — so either works alone on a fresh checkout. Every external caller (scripts/pack-sources.mjs,scripts/prepare-extension-release.sh,.github/workflows/ci.yml) invokes onlystyles,typecheck,buildandverify, all of which are preserved. No workflow file changed, so required checks are untouched.No caching and no up-to-date check were added. The single
stylesrun is unconditional; there is no "skip if the file exists" path, so no stale output can survive a source change.Docs updated:
packages/ui/README.md,packages/ui/CONTRIBUTING.md,packages/ui/AGENTS.md, plus a changeset.Measured
macOS 15, Node 26, local. Before each run:
packages/ui/distandpackages/ui/src/styles.generated.tsremoved. Paired A/B alternating the old and new script sets in the same session, 8 pairs:Median paired saving 0.21s, mean 0.32s; per-pair deltas
[0.22, -0.37, 1.74, 0.19, 0.22, 0.13, 0.21, 0.22]— the 1.74s and -0.37s pairs are machine noise.Honest reading: that is roughly 7% of a ~2.9s run. The
stylesstep alone takes under a second on this machine, so the wall-clock saving is small. The issue's own CI timings describe one run rather than a controlled benchmark, and CI (cold cache, slower runners) was not measured, so no larger claim is made here. The change is worth making because the double compilation is a real redundancy that can be removed without adding a cache, not because it is a meaningful speedup.Verified
stylesinvocation inverify's output, down from two.src/styles.generated.tsis byte-identical (sha2562f7e3ad4…) fromtypecheckalone,buildalone, orverify.src/components.tschanged the generated hash and emitted the class in the CSS; reverting restored the original hash.buildalone emits the stylesheet plusdist/index.d.ts, andtypecheckalone passes.npm run lint,npm run check,npm test(581 pass, 1 skipped),npm run verify:workspaces(ui 59, auth 196, admin 63, workspace integration 1 — all pass).Not established
npm ciwas run. Each measurement resetpackages/uito its unbuilt state instead, and the rootdist/thatpackages/ui/test/scaffold.test.tsrequires was built once beforehand, as CI does.packages/uiwas touched.authandadminstill runtypecheckthenbuildin their ownverify, which duplicatestscwork but not style compilation.🤖 Generated with Claude Code