v0.8.26
Changes
[Unreleased]
Added
lvt-preserveattribute: morphdom escape hatch that skips an element and its subtree entirely during diff (equivalent to Phoenix LiveView'sphx-update="ignore"). Checked ontoElso the server retains authority to remove it.lvt-preserve-attrsattribute: morphdom escape hatch that preserves user-managed attributes (e.g.openon<details>) while still diffing children. Protects attributes the server template does not set. Checked ontoElfor consistent server authority.- In-band
__navigate__SPA navigation: same-pathname link clicks send{action:"__navigate__", data:<params>}over the existing WebSocket instead of fetching new HTML. Requires server-side support (livetemplate/livetemplate#344). - DOMParser fallback in
updateDOM: HTML containing<script>tags is now parsed viaDOMParserto avoid a ChromeinnerHTMLbug that creates phantom duplicate DOM nodes after script tags.
Breaking Changes
- Cross-pathname same-handler navigation now always reconnects. Previously, if two routes shared the same
data-lvt-id, navigating between them would do an in-place DOM swap without reconnecting. This fast path has been removed; all cross-pathname navigations (regardless of handler ID) now trigger a full WebSocket reconnect. This is the correct behavior — same-ID across paths means two distinct routes, andsendNavigatecannot express a path change. If your app shares adata-lvt-idacross routes, expect a reconnect flash where there was none before.
Deployment note
The __navigate__ in-band action is a no-op on server versions before livetemplate/livetemplate#344. Deploy the server update before or simultaneously with this client version to avoid same-pathname link clicks sending an unrecognized WebSocket action.
Installation
npm
npm install @livetemplate/client@0.8.26CDN
<script src="https://cdn.jsdelivr.net/npm/@livetemplate/client@0.8.26/dist/livetemplate-client.browser.js"></script>Related Releases
This release follows the LiveTemplate core library version 0.8.x
- Core Library: https://github.com/livetemplate/livetemplate
- CLI Tool: https://github.com/livetemplate/lvt
- Examples: https://github.com/livetemplate/examples