Commit 9b2b650
committed
size: dedupe width/height spelling and extend the name-table pack to dictionary keys
Source (both help every build):
- save() no longer re-spells x/y/width/height/mipLevel when forwarding to
readTexture — readTexture derives the identical defaults from opts itself;
only the forced Ctor override remains ({ ...opts, Ctor: U8 }).
- resizeCanvas builds its return value through sz(), so the width/height keys
outside sz are spelled one less time ({ ...sz(width, height), changed }).
Build (pack-gated, so gzip-delivered builds are untouched):
- The name-table pack gains a second candidate class, KEY_CANDIDATES:
dictionary keys (width, height, format, usage, …) that the member-only pass
must refuse. They are aliased in both positions — .name → [$x] and name: →
[$x]: — because a computed key evaluates to the identical string, so the
descriptor the browser sees never changes. A string mask (new maskStrings,
sharing mapTemplateText's walk) proves no rewrite can land inside a string
or template literal, and any occurrence that is neither shape disqualifies
the name for that build.
- Pack selection is now price-then-apply: every candidate is priced against
its own table-slot cost, and the set as a whole must clear the fixed
let[]="".split(",") skeleton — previously uncharged, which let a lone
marginal name pack at a net code loss. The legend comment's size is now
logged where it is appended (it is documentation on its own line, not code).
Code line: bare tiny -20B, full-featured tiny -102B, min -46B. Files with
packComment on grow ~1-2B from the longer legend; packComment: false keeps
the whole saving.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FrkUU5GGyzvhujesWXZt1k1 parent 3146270 commit 9b2b650
4 files changed
Lines changed: 136 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
706 | 706 | | |
707 | 707 | | |
708 | 708 | | |
709 | | - | |
| 709 | + | |
| 710 | + | |
710 | 711 | | |
711 | 712 | | |
712 | 713 | | |
| |||
760 | 761 | | |
761 | 762 | | |
762 | 763 | | |
763 | | - | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
764 | 768 | | |
765 | 769 | | |
766 | 770 | | |
| |||
0 commit comments