You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Build the exact main base SHA and the PR merge commit in parallel with the existing CI build command.
Compare all emitted client JavaScript and CSS in raw and per-file gzip bytes.
Compare the gzip size of the JS and CSS listed in the TanStack Start manifest for 15 key pages, including home, library landings, docs, blog, maintainers, showcase, and TanChat. Count shared assets once per page.
Post the total and per-page comparisons in one comment on same-repository PRs and update it on subsequent runs. Fork PRs upload the measurements.
Verification
Both builds completed and the workflow updated the live comparison comment with both tables.
Local checks covered shared asset deduplication, added and removed routes, and updating the existing comment.
Summary by CodeRabbit
Chores
Pull requests targeting the main branch now receive JavaScript and CSS bundle-size reports, including page-level totals, in an automatically updated comment.
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
No actionable comments were generated in the recent review.
Walkthrough
Adds a GitHub Actions workflow that builds the base and pull request commits, measures JavaScript, CSS, and configured page gzip sizes, and posts or updates a pull request comment with the comparison.
Changes: Bundle Size Reporting
Layer / File(s)
Summary
Build and publish size reports .github/workflows/bundle-size.yml
The workflow builds the base and pull request commits, measures JavaScript, CSS, and configured page gzip sizes, then uploads each report as an artifact.
Validate reports and prepare comparison .github/workflows/bundle-size.yml
The comment job downloads both reports, validates their metrics, checks the current pull request state and head SHA, and formats a Markdown comparison.
Create or update the report comment .github/workflows/bundle-size.yml
The workflow updates an eligible marked bundle-size comment when its content differs. If no marked bot comment exists, it creates one.
sequenceDiagram
participant BuildJobs
participant Artifacts
participant CommentJob
participant GitHubPullRequest
BuildJobs->>Artifacts: Upload base and pull request size reports
CommentJob->>Artifacts: Download both reports
CommentJob->>GitHubPullRequest: Fetch current pull request state and head SHA
CommentJob->>CommentJob: Validate reports and format size comparison
CommentJob->>GitHubPullRequest: Create or update bundle-size comment
Loading
Suggested reviewers:tannerlinsley
Merge Risk: Minimal · up to 14435
This PR adds a CI workflow that reports client bundle size changes on pull requests. It does not touch application runtime code. No concrete defect was established, and a misconfiguration would most likely show up as a failed report job.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "ci: report client bundle size changes on pull requests" matches the main change. The PR adds a GitHub Actions workflow that builds the base and PR commits, measures client JavaScript and CS…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check
Explanation
The title "ci: report client bundle size changes on pull requests" matches the main change. The PR adds a GitHub Actions workflow that builds the base and PR commits, measures client JavaScript and CSS sizes, and posts or updates a bundle size comment on same-repository PRs. The title is specific, concise, and follows a conventional commit style.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: 973edf4f-0a6c-4708-9426-12a33a43161e
Commits
Reviewing files that changed from the base of the PR and between c542d3a and 14435d2.
Files selected for processing: 1
.github/workflows/bundle-size.yml
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 0 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Scanning only dist/client/assets excludes client JavaScript copied from public, including the registered service worker, leaving the reported JavaScript totals incomplete.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The bundle-size workflow omits shipped JavaScript outside dist/client/assets and can miss outer-layout assets when traversing the pruned manifest, producing misleading totals.
for (const [id, route] of Object.entries(routes)) {
for (const child of route.children ?? []) parents.set(child, id)
}
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
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.
Summary
mainbase SHA and the PR merge commit in parallel with the existing CI build command.Verification
Summary by CodeRabbit