feat(template): disable adapter-node precompress to shrink tarball#125
Merged
Conversation
Pass precompress: false to adapter() so the build no longer emits .br/.gz siblings under client/. Each shipped image (dist/, dist-nightly/) drops from 2.0M → 1.5M — a ~520K saving per image, ~1.04 MB total. Trade-off (accepted): sirv serves assets uncompressed when no precompressed sibling exists (verified via Accept-Encoding probe); no Content-Encoding header is set. For the canonical npx start on 127.0.0.1 deployment this is negligible. Closes #120. Refs: PRD-031, EVID-036. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4 tasks
fedorovvvv
added a commit
that referenced
this pull request
May 9, 2026
Sweep stale numbers to match post-PRD-030 / post-PR-125 reality: - "~1.8 MB single-file bundle" → "~1.4 MB" (matches `[build] dist/ ready (1.40M)` after #125 drops precompressed siblings). - Dogfood card row reframed: · drop "~200 LOC" (entry shim is now 5 lines after ADR-003 split, real work spans ~1.3K across `bin/{cli,commands,lib}/*`) · drop "0 runtime deps" (ADR-003 amended to a named-allowlist — `citty` is the one allowed runtime dep, with 0 transitives) · drop "~6 MB tarball with bundled node_modules" (PRD-030 graduated the legacy SvelteKit-with-`node_modules/` shape; current local pack is ~870 kB / ~3 MB unpacked) · lead with what users actually care about (per-image size + tarball weight) instead of LOC bragging - "(~11 artifacts)" in `npm run dev` comment → "100+" (avoids drift; current `forgeplan health` reports 99 artifacts on develop). Mirrors apply to both README.md and README.ru.md. Refs: PRD-030, PR #125, ADR-003. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
fedorovvvv
added a commit
that referenced
this pull request
May 9, 2026
## Summary Sweep stale numeric claims in both READMEs to match the current post-PRD-030 / post-PR #125 reality. ## What changed (verbatim numbers) | Claim | Before | After | Source of truth | |---|---|---|---| | Per-image bundle size | ~1.8 MB | **~1.4 MB** | \`scripts/build.mjs\` post-build report (\`[build] dist/ ready (1.40M)\`) after PR #125 | | Dogfood — bin LOC | ~200 LOC | _removed_ — ADR-003 split bin/ across \`cli.mjs\` + \`commands/\` + \`lib/\`; entry shim is 5 lines, real total ~1.3K across 11 files | \`wc -l bin/**/*.mjs\` | | Dogfood — runtime deps in \`bin/\` | 0 | **1** (\`citty\`, 0 transitive) | ADR-003 (amended named-allowlist), \`package.json#dependencies\` | | Dogfood — tarball | ~6 MB with bundled \`node_modules\` | **~870 kB packed / ~3 MB unpacked** | \`npm pack --dry-run\` (post-PRD-030 single-file bundle, no \`node_modules/\` in tarball) | | Dogfood — CI matrix | \`3 OS in CI\` | **\`3 OS × Node 22\` green smoke matrix** | \`.github/workflows/*\` | | \`npm run dev\` artifact count comment | (~11 artifacts) | **(100+ artifacts)** | \`forgeplan health\` — 99 on develop, anti-drift framing | ## Why The previous numbers were accurate at the time they were written but drifted as PRD-030 graduated the bundle approach, ADR-003 amended the zero-dep rule to allow \`citty\`, and PR #125 dropped the precompressed siblings. Anyone reading the README today would have a wrong mental model of size, deps, and dogfood scale. ## Test plan - [x] \`grep -nE "1\\.8 MB |6 МБ|~200|~11" README.md README.ru.md\` returns no hits. - [x] Both READMEs render in GitHub markdown preview (table cells, no broken refs). - [x] No content-equivalent claims out of sync between EN and RU. - [x] Numbers match current local measurements (\`du -sh dist*\`, \`npm pack --dry-run\`, \`forgeplan health\`). Refs: PRD-030, PR #125, ADR-003.
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
adapter()→adapter({ precompress: false })intemplate/svelte.config.js.*.br+*.gz) from both shipped images.dist*/artifact: 2.0M → 1.5M (–25%, ~520K saving per image, ~1.04 MB total).Why
Per issue #120, the precompressed siblings cost ~520K per image but buy negligible runtime CPU savings for the canonical local-first deployment (
npx @forgeplan/web starton127.0.0.1, single user, no CDN). After PR #117 minified the server bundle, precompressed client assets were the largest fixed cost left in the experimental tarball.Decision (PRD-031 + EVID-036): chose Option A from #120 (disable at adapter level) over B (build.mjs strip — strictly more code for same runtime behaviour) and C (keep
.br, drop.gz— half the win for ~zero additional safety).Trade-off (R-1, documented in PRD-031)
Sirv serves assets uncompressed when no precompressed sibling exists. Verified via direct
Accept-Encoding: br, gzipprobe against a livenpx ... startserver in a scratch dir:(Same response with and without
Accept-Encoding. NoContent-Encodingheader in either case.) For loopback127.0.0.1deployments the cost is negligible. Mitigation paths if a real complaint surfaces: revert this flag, or wire on-the-fly compression intemplate/src/hooks.server.ts.Test plan
npm run build— both images emit (dist/ ready (1.40M),dist-nightly/ ready (1.40M)).find dist dist-nightly -name '*.br' -o -name '*.gz' | wc -l→ 0 (was 84).du -sh dist dist-nightly→ 1.5M each (was 2.0M each, well under PRD-014 SC-1 3M cap).npm run smoke→ALL IMAGES PASS.init --image nightly→start→GET /returns HTTP 200;GET /_app/immutable/entry/app.*.jsreturns HTTP 200 with correct Content-Length.Refs: PRD-031, EVID-036, PRD-014, PRD-030, #117.