Repository navigation
pilot: weighbridge package-weight gate - #761
Open
garrity-miepub wants to merge 1 commit into
Open
garrity-miepub wants to merge 1 commit into
garrity-miepub wants to merge 1 commit into
Conversation
Weighs pack size, per-entry min+gzip bundle size, and import time on every PR; limits set at ~10% headroom over the 0.11.0 baseline. Build script diagnostics moved to stderr so `npm pack --json` stays parseable. Refs #622
Deploying ui with
|
| Latest commit: |
e1ba04e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ebf89ab4.ui-6d0.pages.dev |
| Branch Preview URL: | https://pilot-weighbridge.ui-6d0.pages.dev |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the package-weight gate changes.
No open issues 🎉
What changed in this PR
This PR pilots Weighbridge as a package-weight gate, making increases beyond configured limits explicit and reviewable.
Changes:
- Adds limits for package size, selected directory sizes, entry-point bundle sizes, and import times.
- Adds a read-only CI workflow to build and weigh the package on non-draft PRs targeting
mainand pushes tomain. - Moves build diagnostics to stderr to avoid corrupting
npm pack --jsonoutput and ignores local Weighbridge reports.
| File | Description |
|---|---|
weighbridge.json |
Defines weight limits and externalizes peer dependencies from bundle measurements. |
scripts/build-esheet.mjs |
Sends the build-skip diagnostic to stderr. |
scripts/build-datavis.mjs |
Sends build-status diagnostics to stderr. |
.gitignore |
Excludes local Weighbridge reports and baseline outputs. |
.github/workflows/weighbridge.yml |
Builds the package and runs the Weighbridge gate in CI. |
Review effort: Balanced
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.
What & why
Pilots mieweb/weighbridge — a CI gate that weighs the npm package on every PR and fails if a limit in
weighbridge.jsonis exceeded. Bloat arrives one "small" dependency at a time; this makes every weight increase a conscious, diffable decision (raise the limit in the same PR) instead of silent drift. Refs #622.What's weighed (limits ≈ measured 0.11.0 baseline + 10% headroom):
dist/agent/.gzip./hooksgzip./utilsgzip./tailwind-presetgzip./hooks/./utils/./tailwind-presetAll
peerDependenciesare externalized, so bundle gzip ≈ the weight this library itself adds to a consumer's app. The main entry has no import-time gate — it's a browser-targeting bundle (HTMLElement is not definedunder plain Node).Changes
weighbridge.json— scale config (new).github/workflows/weighbridge.yml— build +mieweb/weighbridge@v1gate on PRs/pushes to main (new; pilot skips the trending/badges extras, which needcontents: write)scripts/build-datavis.mjs,scripts/build-esheet.mjs— bug found during the pilot: their stdout[build:…]diagnostics corruptnpm pack --jsonoutput (parsed from the first[). Diagnostics now go to stderr, where they belong..gitignore— weighbridge local report/baseline outputsPilot observations for discussion
dist/ships 41 MB unpacked — sourcemaps plus the duplicated ESM+CJS chunk graph are the likely bulk; weighbridge now makes that visible per-PR.Checklist
pnpm typecheck && pnpm lint && pnpm format && pnpm testpasspnpm test:visual) — n/a, no rendering changeRTL — see CONTRIBUTING.md → RTL & direction-agnostic styling
rtl:-scale-x-100— n/aArrowLeft/ArrowRighthandlers are direction-aware — n/a