Repository navigation
Commit e2846eb
fix(registry): encapsulate caption template runtimes in IIFEs
caption-highlight was already IIFE-wrapped; the other four leaked their
runtime (hfAttach/hfBuild/...) as script-scope globals. Harmless when boot
was synchronous, but the data-driven retrofit defers attach behind
fonts.ready + the sibling fetch — with two caption components pasted into
one composition document, every script finishes before any deferred boot
runs, the last script's definitions win the shared scope, and the first
component never registers its timeline (a renderer waiting on it hangs to
timeout). Wrapping each template's script keeps its internals private so
each boot attaches its own component. window.__HF_CAPTION_ATTACH__ remains
intentionally window-scoped (last-defined-wins).
Co-Authored-By: Claude Fable 5 <[email protected]>1 parent 4f69947 commit e2846eb
4 files changed
Lines changed: 2087 additions & 2029 deletions
File tree
- registry/components
- caption-editorial-emphasis
- caption-emoji-pop
- caption-pill-karaoke
- caption-weight-shift
0 commit comments