Repository navigation
test(scripts): guard dashboard chunk size regression - #525
Conversation
|
@Fhatu12 is attempting to deploy a commit to the jo-duchan's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe dashboard first-load budget test now checks that emitted JavaScript chunks stay below 500,000 raw bytes. It validates the assets directory and reports oversized chunks with their names and sizes. ChangesDashboard budget validation
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Ran all three acceptance criteria from #524 against your branch instead of reading them off the diff:
The middle row is really the point of this PR, and it behaves exactly as intended. First-load drops to 145,320 B and comfortably clears the budget, while a 541.99 kB chunk comes back. Neither guard would have caught that on its own, and the third row shows that isn't just an accident of ordering—each one is blind to exactly what the other catches. That's what makes keeping both necessary rather than redundant. My negative-case numbers match yours to the byte on the removal case and are within 19 B on the eager-split case, which looks like normal source drift between our checkouts rather than any disagreement. A few things I checked specifically:
CI is green across both Node versions and both build architectures. The only red is the Vercel check, an unrelated authorization issue on this repo. Nothing to change here. Thanks for turning the follow-up around so quickly, and for checking both negative cases yourself before pushing. That made this a one-round review. |
|
Thanks for merging this one! Nice to close the loop from #520 and get both regression cases covered properly. Appreciate it. |
Summary
Closes #524
Extends the dashboard build regression guard added in #520 with a second, independent assertion for emitted JavaScript chunk size.
The existing check protects first-load Brotli bytes, but removing
manualChunkslowers that metric while restoring the 541.99 kB application chunk and Vite warning. This adds a raw-size guard so the two failure modes are covered separately.What changed
packages/dashboard/dist/assets/*.jsfiles dynamicallyValidation
Healthy configuration:
Negative checks:
removing
manualChunksrestoring the rejected eager UI/forms split
Full validation:
pnpm exec vitest run --config scripts/vitest.config.mjs dashboardFirstLoadBudgetpnpm test— 180 files passed / 1 skipped; 2370 tests passed / 1 skippedpnpm typecheckpnpm lintgit diff --checkThe existing unrelated lint warnings remain unchanged.
Scope
Only:
scripts/__tests__/dashboardFirstLoadBudget.test.mjsNo production configuration or dependency changes.
Summary by CodeRabbit