297 add size limit for small libraries with GitHub actions#298
Conversation
- Added `@size-limit/esbuild-why`, `@size-limit/preset-small-lib`, and `size-limit` to `devDependencies` in `package.json`. - Configured size limits for the project in `package.json`. - Updated `pnpm-lock.yaml` to include new versions for size-limit related packages and other dependencies. This update enhances the project's build process by integrating size-limit for monitoring bundle sizes.
- Constrained the inner container of the video section to a maximum width of 1024px to prevent stretching. - Removed extra horizontal padding on small screens for a more consistent appearance. - Updated component tests to align with the revised layout. This change enhances the visual consistency of the video demo across different screen sizes.
- Adjusted the video section layout by constraining the inner container to a maximum width of 1024px and removing unnecessary horizontal padding on smaller screens. - Updated component tests to reflect the changes in layout and ensure consistency across different screen sizes. This enhancement improves the visual presentation of the video section.
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📦 Bundle Size Report✅ All size limits passed! |
commit: |
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (9)
.github/actions/size-limit/action.yml(1 hunks).github/actions/size-limit/package.json(1 hunks).github/actions/size-limit/run-size-check.ts(1 hunks).github/actions/size-limit/tsconfig.json(1 hunks).github/workflows/size-limit.yml(1 hunks)biome.jsonc(1 hunks)packages/arkenv/.gitignore(1 hunks)packages/arkenv/package.json(2 hunks)turbo.json(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
packages/arkenv/package.json (1)
examples/with-bun-react/build.ts (1)
output(153-157)
.github/actions/size-limit/action.yml (1)
examples/with-bun-react/build.ts (1)
output(153-157)
🪛 GitHub Actions: autofix.ci
.github/actions/size-limit/run-size-check.ts
[error] 90-90: lint/style/noNonNullAssertion: Forbidden non-null assertion. (pkgName.split("/")[1]!)
[error] 135-135: lint/style/noNonNullAssertion: Forbidden non-null assertion. (colonMatch[1]!)
[warning] 105-105: lint/complexity/useOptionalChain: FIXABLE - Change to an optional chain (fileMatch?.[1]).
[warning] 110-110: lint/complexity/useOptionalChain: FIXABLE - Change to an optional chain (limitMatch?.[1]).
[warning] 115-115: lint/complexity/useOptionalChain: FIXABLE - Change to an optional chain (sizeMatch?.[1]).
[warning] 144-144: lint/complexity/useOptionalChain: FIXABLE - Change to an optional chain (hashMatch?.[1]).
[warning] 95-95: lint/suspicious/noControlCharactersInRegex: Unexpected control character in a regular expression.
[warning] 97-97: lint/suspicious/noControlCharactersInRegex: Unexpected control character in a regular expression.
[warning] 97-97: lint/suspicious/noControlCharactersInRegex: Unexpected control character in a regular expression.
🔇 Additional comments (9)
packages/arkenv/.gitignore (1)
1-2: Appropriate ignores for size-limit tooling.The entries properly suppress generated artifacts from size-limit and esbuild analysis.
biome.jsonc (1)
108-117: Appropriate linter override for GitHub Action scripts.Console output in GitHub Action scripts is legitimate and necessary. The override correctly mirrors the pattern used for bin scripts.
.github/actions/size-limit/tsconfig.json (1)
1-29: TypeScript config is appropriately configured for action scripts.The strict settings are suitable for infrastructure code, and allowing unused locals/parameters provides flexibility for conditional logic in action scripts.
.github/actions/size-limit/package.json (1)
1-15: Action package metadata is well-structured.The private package correctly isolates the action's dependencies. Using
@types/bunversion "latest" for dev-only tooling is acceptable, as it's not shipped to users.turbo.json (1)
65-69: Size task correctly configured for always-running checks.Disabling cache and depending on build is the right approach—size checks must always execute to catch regressions, and the bundles must be built first.
.github/actions/size-limit/action.yml (2)
34-75: PR comment logic is well-designed.The comment script correctly handles finding and updating existing bot comments, with appropriate pass/fail messaging. Using
actions/github-script@v7is the standard approach for GitHub API operations in workflows.
20-33: Review comment is factually incorrect and should be disregarded.The
run-size-check.tsscript exists at.github/actions/size-limit/run-size-check.tsand is properly implemented. The script:
- Correctly reads all environment inputs (TURBO_TOKEN, TURBO_TEAM, FILTER)
- Properly writes outputs to GITHUB_OUTPUT as
result(markdown table) andhas_errors(boolean)- Includes robust error handling (try-catch, exit code checking)
- Correctly integrates with pnpm, Turbo, and size-limit via output parsing
- Exits with code 1 on failure and 0 on success
No changes are required. The file was included in the PR.
Likely an incorrect or invalid review comment.
.github/workflows/size-limit.yml (1)
1-49: Workflow structure is sound with proper conditionals and caching.The use of path filtering and conditional job execution is efficient. However, verify whether
.github/actions/size-limit/run-size-check.tsinvokes Turbo again—if so, the build step at line 42 may be redundant.Confirm that line 42 (
pnpm turbo run build --filter='./packages/*') doesn't duplicate build invocations if the run-size-check.ts script also runs Turbo tasks.packages/arkenv/package.json (1)
56-62: CJS monitoring gap confirmed; limit values require verification against PR description.The build produces both ESM and CJS formats (tsdown.config.ts:
format: ["esm", "cjs"]), and both are exported in package.json, but size-limit only monitorsdist/index.js(ESM). The CJS entry should be added.However, the stated limits (3.0 kB for ESM, 3.4 kB for CJS) could not be verified in the codebase documentation. These must be confirmed against the actual PR description or requirements before updating.
Required action:
- Verify the target bundle size limits from the PR objectives
- Add monitoring for
dist/index.cjswith the appropriate CJS limit- Update the ESM limit if the PR objectives differ from the current 2 kB setting
- Added "packageManager": "bun@1.2.2" to package.json for better dependency management. - Refactored regex checks in run-size-check.ts to use optional chaining for improved safety and readability.
… action - Introduced arkregex as a dependency in package.json and bun.lock for enhanced regex functionality. - Updated regex definitions in run-size-check.ts to utilize arkregex for improved performance and clarity.
- Updated the regex matching logic in run-size-check.ts to ensure proper handling of package names. - Improved code readability by removing unnecessary non-null assertions.
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
.github/actions/size-limit/bun.lockis excluded by!**/*.lock
📒 Files selected for processing (4)
.github/actions/size-limit/package.json(1 hunks).github/actions/size-limit/run-size-check.ts(1 hunks).github/actions/size-limit/tsconfig.json(1 hunks).github/dependabot.yml(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- .github/actions/size-limit/package.json
🧰 Additional context used
🪛 GitHub Actions: size-limit
.github/actions/size-limit/run-size-check.ts
[error] 1-1: Cannot find package 'arkregex' from '/home/runner/work/arkenv/arkenv/.github/actions/size-limit/run-size-check.ts'.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: test-e2e (a11y)
…ll dependencies - Changed Bun version to 1.2.22 for consistency. - Added step to install dependencies using Bun in the size-limit action workflow.
- Added 'bash' as the shell for the dependency installation step in the size-limit action workflow.
…tput handling - Updated the size-limit action to utilize environment variables for accessing the size check results and error status. - Removed the build step from the size-limit workflow to streamline the process.
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
.github/actions/size-limit/action.yml (2)
61-63: Bot detection logic is correct but can be more explicit.GitHub Actions comments have
comment.user.typeset to'Bot', so the current filter is reliable. However, the existing code already mitigates specificity concerns through the dual check withcomment.body.includes('Bundle Size Report').For better clarity and explicitness, consider the suggested refactor:
const botComment = comments.find(comment => - comment.user.type === 'Bot' && comment.body.includes('Bundle Size Report') + comment.user.login === 'github-actions[bot]' && comment.body.includes('Bundle Size Report') );This makes the intent more explicit and directly targets the GitHub Actions bot identity.
23-23: Update Bun version to the latest stable release.Bun v1.2.22 was released Sept 14, 2025, but the latest release is v1.2.23 (Sept 28, 2025). Update the pinned version to 1.2.23 to use the most recent stable release. If pinning to a specific patch version is intentional for stability reasons, document the rationale; otherwise, consider using a minor version constraint (
1.2.x) for better maintainability.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/actions/size-limit/action.yml(1 hunks).github/actions/size-limit/package.json(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- .github/actions/size-limit/package.json
- Wrapped the comment posting logic in a try-catch block to handle potential errors gracefully. - Improved error logging to provide more context in case of failures when posting comments on PRs.
- Added a new "size" script to package.json for running size checks. - Modified the size-check action to use the updated command for consistency in execution.
|
Warning Rate limit exceeded@yamcodes has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 8 minutes and 38 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (11)
✨ Finishing touches
🧪 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 |
Closes #297
Summary by CodeRabbit
New Features
Chores
sizescript (2 kB target for arkenv)