Repository navigation
Commit 189972f
perf(coil): halve the desktop release bundle (#53)
app.asar 189.66 MiB / 14,765 files -> 99.02 MiB / 3,429 files (-47.8%, -76.8%
files). The updater's .zip drops 20.1 MB; the electron-builder phase drops 62%.
Three cuts, each measured from the packed asar rather than the install tree:
- Web renderer source maps (37.4 MiB) via T3CODE_WEB_SOURCEMAP=0, an existing
upstream variable. All 385 renderer chunks are byte-identical afterwards apart
from the trailing sourceMappingURL comment.
- Third-party source maps (18.2 MiB). First-party maps are kept, so
NODE_OPTIONS=--enable-source-maps still gives readable frames for our code.
- Two renderer-only dependency trees: Clerk's browser SDK (23.2 MiB, 16
packages) and @pierre/diffs' shiki tree (21.0 MiB, 50 packages). Both are
bundled by a client build before staging, and the renderer runs sandboxed with
nodeIntegration off, so neither is resolvable at runtime.
Sync cost is one upstream file, +21/-0. The seam is an env hook on
scripts/build-desktop-artifact.ts rather than an edited literal: upstream's test
asserts DESKTOP_FILE_EXCLUSIONS deep-equals exactly its one entry, and the fork's
list is 67 globs and grows, so an inline list would make every future size fix an
edit to an upstream test assertion. An unset environment packages exactly what
upstream packages. No new seam rows, no new deletions.
Two new fork-owned tools:
- desktop-bundle-reachability.mjs analyses a staged build. It follows literal
import edges AND string-mention edges, because PlaywrightInjectedRuntime.ts
resolves playwright-core through a const and an import-only scan calls 10.2 MiB
of live code dead.
- verify-desktop-bundle.mjs gates every release on both platforms, failing any
packaged import that is not loadable. Found two bugs in itself under test: it
would have failed every Windows release by ignoring app.asar.unpacked, and an
earlier severity split passed a deliberately-broken build.
Re-measured on 136b351, after the #71 Coil rename, #58's dependency
re-resolution and #92 retiring the local autobuild. The packed asar is the same
size on both sides of the rename, and all 66 non-wildcard globs still match a
shipped package.
Corrects issue #53 on five points, recorded in docs/coil/desktop-bundle-size.md —
its size table measured `du` block allocation (core-js "15 MB" is 1.25 MiB of
content), it misses source maps entirely, DESKTOP_FILE_EXCLUSIONS is not
fork-owned, the mac leg is not the release critical path, and the pnpm store is
already cached.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>1 parent eea4d1f commit 189972f
11 files changed
Lines changed: 2313 additions & 2 deletions
File tree
- .github/workflows
- docs/coil
- scripts
- coil
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
389 | 389 | | |
390 | 390 | | |
391 | 391 | | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
392 | 405 | | |
393 | 406 | | |
394 | 407 | | |
| |||
438 | 451 | | |
439 | 452 | | |
440 | 453 | | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
441 | 477 | | |
442 | 478 | | |
443 | 479 | | |
| |||
468 | 504 | | |
469 | 505 | | |
470 | 506 | | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
471 | 510 | | |
472 | 511 | | |
473 | 512 | | |
| |||
492 | 531 | | |
493 | 532 | | |
494 | 533 | | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
495 | 558 | | |
496 | 559 | | |
497 | 560 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
287 | | - | |
| 287 | + | |
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
| |||
0 commit comments