-
-
Notifications
You must be signed in to change notification settings - Fork 637
Closed
Description
Overview
Add CI check that monitors bundle sizes of the npm packages and fails if they have a significant increase in size compared to the base branch.
Implementation
Implemented in PR #2149 with the following features:
CI Workflow (.github/workflows/bundle-size.yml)
- Triggers on PRs that modify
packages/**,package.json,pnpm-lock.yaml, or.size-limit.json - Compares PR bundle sizes against the base branch
- Fails if any package increases by more than 0.5KB (configurable threshold)
- Posts a size report comment on the PR via size-limit-action
What Gets Measured
- react-on-rails: Raw, gzip, and brotli compressed sizes
- react-on-rails-pro: Raw, gzip, and brotli compressed sizes
- react-on-rails-pro-node-renderer: Raw, gzip, and brotli compressed sizes
- Webpack bundled imports: Client-side bundle sizes when importing packages via webpack
Local Tools
pnpm run size- Check current bundle sizesbin/compare-bundle-sizes- Compare your branch against master locallybin/skip-bundle-size-check- Bypass the CI check for intentional size increases
Configuration Files
.size-limit.json- size-limit configuration defining what to measure.bundle-size-skip-branch- Contains branch name to skip the size checkscripts/bundle-size.mjs- Utility script for setting dynamic limits and comparing sizes
Documentation
- Added "Bundle Size Checks" section to CONTRIBUTING.md
- Added CHANGELOG entry
Related PRs
- Add bundle size CI check using size-limit #2149 - Main implementation
- Add size-limit packages for bundle size tracking #2150 - Added size-limit packages to master
- Add size-limit configuration for bundle size tracking #2152 - Added .size-limit.json config to master
Metadata
Metadata
Assignees
Labels
No labels