Skip to content

[wrangler] Add bundle sizes to structured output - #14915

Merged
dario-piotrowicz merged 1 commit into
cloudflare:mainfrom
perplexityai:codex/wrangler-bundle-size-output
Sep 1, 2026
Merged

[wrangler] Add bundle sizes to structured output#14915
dario-piotrowicz merged 1 commit into
cloudflare:mainfrom
perplexityai:codex/wrangler-bundle-size-output

Conversation

@longlho

@longlho longlho commented Jul 29, 2026

Copy link
Copy Markdown

wrangler deploy --dry-run currently reports bundle size only through human-formatted console output. CI size gates must regex that text, which is brittle.

This adds exact raw and gzip-compressed byte counts to the existing structured deploy and version-upload output records, including dry runs:

{
  "bundle_size": {
    "raw_bytes": 1234,
    "gzip_bytes": 567
  }
}

The bundle reporter now returns the measurements it already calculates, and deploy helpers pass them to Wrangler's output writer.


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: this extends Wrangler's existing machine-readable output without changing CLI usage.

Note

This is a contribution from an AI agent: Codex, GPT-5.

@changeset-bot

changeset-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b51a5d6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
wrangler Minor
@cloudflare/vite-plugin Patch
@cloudflare/vitest-plugin Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@longlho
longlho marked this pull request as ready for review July 29, 2026 16:10
@longlho
longlho requested a review from workers-devprod as a code owner July 29, 2026 16:11
@workers-devprod
workers-devprod requested review from a team and dario-piotrowicz and removed request for a team July 29, 2026 16:11
@workers-devprod

workers-devprod commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • @cloudflare/wrangler
Show detailed file reviewers
  • .changeset/tidy-ravens-report.md: [@cloudflare/wrangler]
  • packages/deploy-helpers/src/deploy/deploy.ts: [@cloudflare/wrangler]
  • packages/deploy-helpers/src/deploy/helpers/bundle-reporter.ts: [@cloudflare/wrangler]
  • packages/deploy-helpers/src/deploy/versions-upload.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/tests/deploy/build.test.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/tests/deploy/core.test.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/deploy/index.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/deployment-bundle/bundle-reporter.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/dev/remote.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/output.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/versions/upload.ts: [@cloudflare/wrangler]

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@dario-piotrowicz dario-piotrowicz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the nice improvement @longlho 🙂

I just left a small comment, please let me know what you think (besides this the PR looks good to me)

Comment thread packages/deploy-helpers/src/deploy/helpers/bundle-reporter.ts Outdated
@longlho

longlho commented Jul 30, 2026

Copy link
Copy Markdown
Author

yup makes sense, I did another pass lmk if this looks better

@dario-piotrowicz

Copy link
Copy Markdown
Member

oh wow the merge conflicts 😓

@longlho could you have a look? 🙏

@longlho
longlho force-pushed the codex/wrangler-bundle-size-output branch from 18b6ef2 to b51a5d6 Compare August 21, 2026 18:01
@github-project-automation github-project-automation Bot moved this to Untriaged in workers-sdk Aug 21, 2026
@workers-devprod

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • @cloudflare/wrangler
Show detailed file reviewers
  • .changeset/tidy-ravens-report.md: [@cloudflare/wrangler]
  • packages/deploy-helpers/src/deploy/deploy.ts: [@cloudflare/wrangler]
  • packages/deploy-helpers/src/deploy/helpers/bundle-reporter.ts: [@cloudflare/wrangler]
  • packages/deploy-helpers/src/deploy/versions-upload.ts: [@cloudflare/wrangler]
  • packages/workers-utils/src/output.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/tests/deploy/build.test.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/tests/deploy/core.test.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/deployment-bundle/bundle-reporter.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/dev/remote.ts: [@cloudflare/wrangler]
@longlho

longlho commented Aug 21, 2026

Copy link
Copy Markdown
Author

yup done :)

@pkg-pr-new

pkg-pr-new Bot commented Aug 21, 2026

Copy link
Copy Markdown
@cloudflare/autoconfig

npm i https://pkg.pr.new/@cloudflare/autoconfig@14915

@cloudflare/build-output-utils

npm i https://pkg.pr.new/@cloudflare/build-output-utils@14915

@cloudflare/codemods

npm i https://pkg.pr.new/@cloudflare/codemods@14915

@cloudflare/config

npm i https://pkg.pr.new/@cloudflare/config@14915

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@14915

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/@cloudflare/deploy-helpers@14915

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@14915

miniflare

npm i https://pkg.pr.new/miniflare@14915

@cloudflare/pages-functions

npm i https://pkg.pr.new/@cloudflare/pages-functions@14915

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@14915

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@14915

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@14915

@cloudflare/vitest-plugin

npm i https://pkg.pr.new/@cloudflare/vitest-plugin@14915

@cloudflare/workers-auth

npm i https://pkg.pr.new/@cloudflare/workers-auth@14915

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@14915

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@14915

wrangler

npm i https://pkg.pr.new/wrangler@14915

commit: b51a5d6

@dario-piotrowicz dario-piotrowicz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me, thanks for the change @longlho 😄

@dario-piotrowicz dario-piotrowicz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM 🙂

Thanks again for the PR @longlho 😄 🥳

@workers-devprod

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@workers-devprod workers-devprod left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Codeowners reviews satisfied

@github-project-automation github-project-automation Bot moved this from Untriaged to Approved in workers-sdk Aug 28, 2026
@longlho

longlho commented Aug 28, 2026

Copy link
Copy Markdown
Author

thanks a lot for the review! im looking forward to the new version and getting rid of our local patch 😄

@dario-piotrowicz
dario-piotrowicz enabled auto-merge (squash) August 28, 2026 16:31
@dario-piotrowicz
dario-piotrowicz merged commit 707cb6f into cloudflare:main Sep 1, 2026
79 of 84 checks passed
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants