Repository navigation
Conversation
Move the chunk rules to `codeSplitting.groups` and give `tslib` its own group. `rxjs` pulled `tslib` into `vendor-ledger`, and `vendor-libs` needs `tslib` at startup, so the entry preloaded the Ledger chunk. Add `check:startup-budget`. It sums the gzip size of the startup JS from `dist/index.html` and fails above the budget, or if `vendor-ledger` is in the startup list. The Build Stats job runs it and adds the result to the build stats comment.
|
✅ No security or compliance issues detected. Reviewed everything up to a51f745. Security OverviewDetected Code Changes
|
📊 Build Bundle StatsThe latest build generated the following assets: 🚦 Startup JS budget✅ The startup JS is 467,817 bytes gzip. The budget is 480,000. 25 startup files
|
Contributor
There was a problem hiding this comment.
🟢 Approved
No active review issues block approval of the startup-bundle isolation and CI budget-check changes.
No open issues 🎉
What changed in this PR
Keeps Ledger dependencies out of the frontend’s startup JavaScript and adds a CI check to guard against startup-size regressions.
Changes:
- Replaces manual chunk rules with code-splitting groups and isolates shared
tslibdependencies. - Adds a startup check enforcing a 480,000-byte gzip budget and rejecting
vendor-ledgerin the startup list. - Runs the check in CI and includes its report in build-stat comments, even when the budget check fails.
| File | Description |
|---|---|
src/governance-app-frontend/vite.config.js |
Defines chunk groups with a higher-priority vendor-tslib group. |
src/governance-app-frontend/scripts/check-startup-budget.ts |
Checks startup assets and prints a Markdown budget report. |
src/governance-app-frontend/package.json |
Exposes the frontend startup-budget command. |
package.json |
Exposes the startup-budget command at the workspace root. |
.github/workflows/check.yaml |
Enforces the budget and publishes the result in build-stat comments. |
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.
Motivation
index.htmlpreloadedvendor-ledgeralthough the Ledger code loads through a dynamicimport().react-remove-scrollinvendor-libsneedstslib, andrxjspulledtslibintovendor-ledger. Nothing paints until the startup JS arrives, and CI posted build stats, but no check could fail.vendor-ledgerinindex.htmlChanges
manualChunkstocodeSplitting.groups, with avendor-tslibgroup above them.check:startup-budget, which fails above 480,000 bytes gzip or ifvendor-ledgeris in the startup list.vendor-buffer, thenvendor-ledger, andBufferexists whenvendor-ledgerevaluates.