Conversation
|
✅ All CI checks and tests passed. 🎉 All green!🧪 All tests passed 🔗 Commit SHA: 63bb070 | Docs | View more details | Give us feedback! |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The behavior is well-scoped and covered by targeted tests, with only minor non-blocking convention feedback.
Review effort: Balanced
Findings: 2
Open (2)
What changed in this PR
Minifies production backend bundles while adding archive-size reporting and warnings near the upload limit.
Changes:
- Enables esbuild minification while preserving function and class names.
- Tracks and logs compressed/decompressed package sizes.
- Warns when decompressed size reaches 90% of 52 MB and adds regression coverage.
| File | Description |
|---|---|
packages/plugins/apps/src/archive.ts |
Calculates decompressed archive size. |
packages/plugins/apps/src/constants.ts |
Defines size limit and warning ratio. |
packages/plugins/apps/src/vite/build-package.ts |
Logs package sizes and emits warnings. |
packages/plugins/apps/src/vite/build-backend-functions.ts |
Minifies production backend bundles. |
packages/plugins/apps/src/vite/build-backend-functions.test.ts |
Tests minification and preserved names. |
packages/plugins/apps/src/index.test.ts |
Tests size reporting and warning boundaries. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
ksun154
marked this pull request as ready for review
October 1, 2026 20:55
ksun154
force-pushed
the
kelly.sun/apps-backend-minify
branch
from
October 1, 2026 21:03
5bda49b to
2309783
Compare
Minify production backend bundles with esbuild and keepNames, so function and class names survive in function-log stack traces. Dev-server bundles stay unminified. Every package build now logs its file count, compressed size and decompressed size.
ksun154
force-pushed
the
kelly.sun/apps-backend-minify
branch
from
October 1, 2026 21:08
2309783 to
63bb070
Compare
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.

What and why?
Follow-up to the pitchGPT HTTP 413 ("bundle exceeds the maximum decompressed size of 52 MB"). The server's limit is
maxBundleSize = 50 * 1024 * 1024(50 MiB) in app-builder-code'sinternal/uploader/bundle_storage.go; "52 MB" is that value printed in decimal units byhumanize.Bytes. It complements #538, which enables tree-shaking. The two are independent and can merge in either order.keepNames: true. Minification is always on; there's no public option.This takes the minification and the size reporting from #533. It leaves out #533's
apps.backend.minifyopt-out and its near-limit warning: the warning would hardcode a client-side copy of the server's limit, which drifts (#533's 52 MB was already the server's 50 MiBmaxBundleSizeprinted in decimal units).How?
vite/build-backend-functions.ts: setsminify: 'esbuild'andesbuild: { keepNames: true }only in the productionvite.build()call. The sharedgetBaseBackendBuildConfigis unchanged, so the dev-server bundles sent topreview-asyncstay unminified.archive.ts:ArchivegainsdecompressedSize, the sum of the packaged files' sizes. The server's 50 MiB limit counts this total (frontend/,backend/*.jsandmanifest.json), not the zip size.vite/build-package.ts: logsApp package size: N files, X MB compressed, Y MB decompressed.Measurements
Total backend JS on master's config (no tree-shaking), minification toggled:
minify: falseCombined with #538's tree-shaking, measured on the same app (minify with
keepNames, against tree-shaking alone):keepNameskeepNamesapps_backend_project, 7 functions)The synthetic app is not pitchGPT. Code-heavy dependencies minify well; data- or string-heavy ones (locale tables, JSON) much less. pitchGPT has not been measured yet.
Follow-ups
@datadog/apps-cliwith the limit read from the API instead of hardcoded. The CLI would also cover uploading an existing zip, which the plugin never sees.