FormState.modules is a Map<string, unknown> described as a cache "for per-state modules, chiefly history". In practice it holds exactly one key, 'history', written at use-abstract-form.ts:249 and read at use-abstract-form.ts:292 and use-form-context.ts:118. Nothing else has ever registered a module.
Collapsing it to a dedicated optional field on the state measures 38 B gz eager, with undo/redo fully intact.
Small, self-contained, and it makes the shape honest: a one-key generic registry reads as an extension point that does not exist.
Not included here, deliberately. Making form.history undefined on an unconfigured form measures a further 58 B, and it is a worse trade. build-form-api.ts:89-96 argues the current shape correctly: one instance serves every such form, and a template reads form.history.canUndo unconditionally. Turning a total API into a partial one means a template that forgets ?. throws during SSR render, which is a 500 rather than a console warning. 58 B does not buy that failure mode.
Found in the 2026-09-18 feature audit (main@b4a64ef9, eager baseline 33,204 B gz). Every byte figure is a measured ablation, not an estimate.
🤖 Generated with Claude Code
https://claude.ai/code/session_01PnAVwFjpvKQNppAMkSvoiH
FormState.modulesis aMap<string, unknown>described as a cache "for per-state modules, chiefly history". In practice it holds exactly one key,'history', written atuse-abstract-form.ts:249and read atuse-abstract-form.ts:292anduse-form-context.ts:118. Nothing else has ever registered a module.Collapsing it to a dedicated optional field on the state measures 38 B gz eager, with undo/redo fully intact.
Small, self-contained, and it makes the shape honest: a one-key generic registry reads as an extension point that does not exist.
Not included here, deliberately. Making
form.historyundefinedon an unconfigured form measures a further 58 B, and it is a worse trade.build-form-api.ts:89-96argues the current shape correctly: one instance serves every such form, and a template readsform.history.canUndounconditionally. Turning a total API into a partial one means a template that forgets?.throws during SSR render, which is a 500 rather than a console warning. 58 B does not buy that failure mode.Found in the 2026-09-18 feature audit (
main@b4a64ef9, eager baseline 33,204 B gz). Every byte figure is a measured ablation, not an estimate.🤖 Generated with Claude Code
https://claude.ai/code/session_01PnAVwFjpvKQNppAMkSvoiH