ci: report minified bundle size changes on PRs#8922
Merged
Conversation
Adds a Build Size workflow that, on each PR, builds only the minified UMD + ESM bundles for both the PR head and its base commit (no stored baseline — the base is rebuilt in the same run), measures their raw, gzip and brotli sizes, and posts/updates a single sticky PR comment with the deltas. Informative only; never fails the build, and tolerates the read-only token on fork PRs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Build size reportThis PR does not change the size of the minified bundles.
|
The minified bundles embed the git short-hash (via _CURRENT_SDK_REVISION and the license banner), which differs between the base and PR commits and showed up as a phantom compressed-size delta even when no code changed. Let utils/rollup-version-revision.mjs honour an ENGINE_BUILD_REVISION env var and pin it to a constant for both builds, so the report reflects only real code-size changes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Fold the table explanation into the headline as a single line above the table and drop the "never fails the build" note. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
Adds a Build Size GitHub Actions workflow (
.github/workflows/build-size.yml) that reports how a PR affects the size of the minified engine bundles. It mirrors the existing API Report workflow's mechanism — same trigger, same sticky-comment pattern — but for bundle size.How it works
pull_requesttomain(opened,synchronize,reopened), so it refreshes on every commit.pull_request.base.sha, builds each, and compares them in the same run — so the report is always "this PR vs themainit targets".build:min:umd+build:min:esm), not the rel/dbg/prf/types variants, to keep the run fast.utils/build-size.mjs) records raw, gzip and brotli sizes ofplaycanvas.min.js(UMD) andplaycanvas.min.mjs(ESM) using Node's built-inzlib.<!-- build-size-bot -->marker —listComments→ find → create/update), showing each bundle's PR size and its delta vsmain.continue-on-errorso fork PRs (read-only token) stay green.Notes / things to decide in review
npm ci+ four minified esbuild builds; well within the 20-min timeout.🤖 Generated with Claude Code