Skip to content

Conversation

@avivkeller
Copy link
Member

@avivkeller avivkeller commented Oct 19, 2025

Adds a new workflow_run workflow which compares the bundle size of the current PR and the base branch.

See #8245 (comment), which shows the diff between a previous commit of this PR and the current commit (which, since no Next.js code changed, is nothing).

Note

If this workflow fails, it will not display 🔴 on the PR. If it succeeds, it won't display 🟢 either.

Note

This workflow will fail for PRs open up unto this point, but should succeed for PRs opened after this is merged.

@vercel
Copy link

vercel bot commented Oct 19, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
nodejs-org Ready Ready Preview Oct 28, 2025 0:40am

@codecov
Copy link

codecov bot commented Oct 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.53%. Comparing base (7015095) to head (1117c2c).
⚠️ Report is 13 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8245      +/-   ##
==========================================
+ Coverage   76.45%   76.53%   +0.07%     
==========================================
  Files         115      117       +2     
  Lines        9643     9733      +90     
  Branches      317      329      +12     
==========================================
+ Hits         7373     7449      +76     
- Misses       2269     2282      +13     
- Partials        1        2       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AugustinMauroy
Copy link
Member

WOW look soo cool ! I'm surprised there are any tool like that on Vercel

@github-actions
Copy link
Contributor

github-actions bot commented Oct 19, 2025

Bundle Stats

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
27 2.66 MB 0%

Changeset

No files were changed

View detailed bundle breakdown

Added

Asset File Size % Changed
.next/static/chunks/8c72443efb8ad7a4.js 0 B → 202.62 kB (+202.62 kB) -

Removed

Asset File Size % Changed
.next/static/chunks/4eb86f5ac65905ca.js 202.62 kB → 0 B (-202.62 kB) -100%

Bigger

No assets were bigger

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
.next/static/chunks/3702f33810660bc3.js 13.58 kB 0%
.next/static/chunks/a6afeba20fdcf503.js 38.48 kB 0%
.next/static/chunks/a9d028b25a130731.js 184.12 kB 0%
.next/static/chunks/73b8b852d483aaf0.js 64.45 kB 0%
.next/static/chunks/b87b961db7376771.js 45.32 kB 0%
.next/static/chunks/191843c6caa55163.js 282 B 0%
.next/static/chunks/08d5f3e0b2432594.js 31.78 kB 0%
.next/static/chunks/762ea4acf7e6dd1c.js 19.03 kB 0%
.next/static/chunks/339ca6a45c4a307a.js 47.36 kB 0%
.next/static/chunks/2bd90456d58968bb.js 57.96 kB 0%
.next/static/chunks/42bb4a8225e5faa9.js 51.05 kB 0%
.next/static/chunks/5e109b7e2c8df7e0.js 37.92 kB 0%
.next/static/chunks/20898c0f779df313.js 40.37 kB 0%
.next/static/chunks/3b0957af0d090e8f.js 40.53 kB 0%
.next/static/chunks/9372c22956f6b20c.js 24.39 kB 0%
.next/static/chunks/f70aec01fd5212d8.js 19.03 kB 0%
.next/static/chunks/8df2bb083f40bc43.js 24 kB 0%
.next/static/chunks/50ac5d9bf38d35e2.js 1.63 kB 0%
.next/static/chunks/0d94628576cc16d2.js 37.92 kB 0%
.next/static/chunks/4b277843bfd11ca3.js 26.89 kB 0%
.next/static/chunks/35d02731dea7af85.js 799.66 kB 0%
.next/static/chunks/eb22c915029abd12.js 51.05 kB 0%
.next/static/chunks/45b092695b5d4f15.js 29.33 kB 0%
.next/static/chunks/02e322153f39cbe9.js 6.16 kB 0%
.next/static/chunks/cb63ecead6a66f96.js 26.89 kB 0%
.next/static/chunks/6ddba08174513224.js 799.66 kB 0%

@avivkeller avivkeller changed the title [wip] bundle stats feat(cicd): add bundle stats comparison Oct 19, 2025
@avivkeller avivkeller linked an issue Oct 19, 2025 that may be closed by this pull request
@avivkeller avivkeller marked this pull request as ready for review October 19, 2025 21:05
@avivkeller avivkeller requested a review from a team as a code owner October 19, 2025 21:05
Copilot AI review requested due to automatic review settings October 19, 2025 21:05
@avivkeller avivkeller requested a review from a team as a code owner October 19, 2025 21:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds a workflow to compare bundle sizes between a PR and the base branch using build artifacts, and updates the build pipeline to emit and upload stats.

  • Introduces a workflow_run-triggered job that pulls artifacts from the PR’s Build run and the latest main run, then compares stats.
  • Updates the Build workflow to generate webpack stats (via TURBOPACK_STATS) and upload them as an artifact on ubuntu-latest.
  • Plumbs TURBOPACK_STATS through Turbo tasks in apps/site.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
apps/site/turbo.json Allows TURBOPACK_STATS to pass through for dev/build/start/deploy tasks so stats can be generated in CI.
.github/workflows/build.yml Exposes TURBOPACK_STATS on ubuntu-latest and uploads webpack-stats.json as an artifact.
.github/workflows/bundle-compare.yml New workflow to fetch artifacts from the PR run and latest main run and compare bundle stats, posting results to the PR.

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@avivkeller
Copy link
Member Author

You can also download the stats file, as it's an artifact.

image

@bmuenzenmeyer
Copy link
Contributor

This is cool. I am probably naive to some inner working here - but surprised it works with the chunks being generated hash filenames

@avivkeller
Copy link
Member Author

Bump @nodejs/web-infra

@avivkeller
Copy link
Member Author

avivkeller commented Oct 28, 2025

So apparently the action doesn't support workflow_run internally (it's a needless check, as the action would support the trigger).

So, I need to write a little custom action to do all of our special logic

@MattIPv4
Copy link
Member

Can we not just open a PR upstream to add support, rather than rolling our own?

@avivkeller
Copy link
Member Author

Can we not just open a PR upstream to add support, rather than rolling our own?

I'm planning to do both. I'll open a Pr upstream, and in the meantime, have a simple script here, unless we'd rather wait for the upstream PR to land?

@MattIPv4
Copy link
Member

I'm personally fine with waiting until upstream support is landed, unless others have a strong need for this urgently.

@ovflowd
Copy link
Member

ovflowd commented Oct 30, 2025

I'm fine merging this without workflow_run for now. @avivkeller can you mark the PR as ready and open a follow-up issue?

@avivkeller
Copy link
Member Author

@ovflowd we need workflow_run for this, otherwise, it's useless to have as an extra file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build Size Difference

6 participants