Repository navigation
v3.5.0 - Syntax aware templates
v3.5.0
Highlights
- Syntax-aware template injection. CSS/HTML/link markup is now injected into the
component's JavaScript via an acorn parse + quote-context-aware splice
(lib/replace.js) instead of brittle text replacement with a per-line backslash hack.
Injected markup may now safely contain',",`,${, and backslashes without
corrupting the surrounding JS. - Multiple templates. A component can now define several HTML templates (e.g. default /
error / empty states), each with its own token, via the newtemplatesoption. Shared
cssPath/cssLinkHrefare applied to every template; a template may override its own
cssLinkHref. - Result exposes
htmls. An ordered array of{ name, path, getHtml }, one per
template. The existinggetHtml()/htmlPathshorthands now resolve to the first
html output and remain for backward compatibility. - Output-collision fix. Duplicate resolved html output names now throw instead of
silently overwriting each other (previously all templates shared<basename>.html).
Backward compatibility
Non-breaking. The flat htmlPath + jsReplacement options continue to work and are
synthesized into a single template internally. All existing fixtures pass unmodified.
New dependency
acorn— JavaScript parser used for token location and safe injection.
Migration notes
None required for v3.4.x callers. To adopt multi-template, pass a templates array; see
docs/v3.5.0.md.
What's Changed
- @3.5.0 - syntax aware templates, multiple outputs by @localnerve in #77
Full Changelog: v3.4.2...v3.5.0