[wrangler] Add bundle sizes to structured output - #14915
Conversation
🦋 Changeset detectedLatest commit: 18b6ef2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
|
Codeowners approval required for this PR:
Show detailed file reviewers
|
dario-piotrowicz
left a comment
There was a problem hiding this comment.
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)
| }, | ||
| modules: CfModule[] | ||
| ) { | ||
| ): Promise<BundleSize> { |
There was a problem hiding this comment.
I don't tike this change at all 😕
we're taking printBundleSize and have it return a value, this doesn't seem right at all to me
also I don't understand the motivation here, instead of augmenting printBundleSize to return a value, why don't you just call getSize(...) when you need these values instead?
There was a problem hiding this comment.
PS: if you want to avoid computing the sizes more than once, what I'd suggest you to do is to, instead of modifying this function to return values, modify this function to accept the size and gzipSize and print those instead of calling getSize (or have an override that does that).
|
yup makes sense, I did another pass lmk if this looks better |
wrangler deploy --dry-runcurrently 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
deployandversion-uploadoutput 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.
Note
This is a contribution from an AI agent: Codex, GPT-5.