Skip to content

v0.8.41

Choose a tag to compare

@adnaan adnaan released this 06 May 18:39
· 77 commits to main since this release

Changes

Migration: Phase 1A breaking changes (v0.8.13 / v0.8.14)

If you're upgrading from < 0.8.13, the attribute surface changed substantially. Run
grep -rn 'lvt-' <your-template-dir> (or grep -rn 'lvt-' . from your app root) to
find call-sites that need updating.

Renamed attributes

Old New Phase
lvt-click, lvt-input, lvt-change, lvt-keydown, lvt-submit, ... (16 event-specific attributes) lvt-on:{event} (generic event router) v0.8.13
lvt-{action}-on:{event} (reactive shortcuts) lvt-el:{method}:on:{state} v0.8.13
lvt-data-*, lvt-value-* standard data-* attributes v0.8.13
lvt-disable-with lvt-form:disable-with v0.8.13
lvt-no-intercept (on <a> links) lvt-nav:no-intercept v0.8.14
lvt-no-intercept (on <form>) lvt-form:no-intercept v0.8.14
(form action routing — implicit) lvt-form:action="..." (explicit, highest priority) v0.8.14

Removed (no replacement — use the standard-HTML alternative)

Removed Use instead
ModalManager / lvt-modal-open / lvt-modal-close Native <dialog> element + dialog.showModal() / dialog.close()
lvt-confirm="message" onclick="return confirm('message')" (standard browser API)
lvt-disable-on:{event} / lvt-enable-on:{event} reactive actions lvt-el:{method}:on:{state} (e.g. lvt-el:setAttr:disabled:on:save:pending)

New Tier 2 namespaces

  • lvt-on:{event} — DOM event handlers (Tier 1: standard HTML onclick=... is preferred when no server round-trip is needed)
  • lvt-el:{method}:on:{state} — reactive DOM mutations driven by client state
  • lvt-fx:{directive} — visual effects (lvt-fx:scroll, lvt-fx:highlight, lvt-fx:animate)
  • lvt-form:{behavior} — form-scoped behaviors (preserve, disable-with, action, no-intercept)
  • lvt-nav:{behavior} — navigation-scoped behaviors (no-intercept)
  • lvt-mod:{modifier} — event-handling modifiers (debounce, throttle)

Backward-compat shims

The legacy lvt-no-intercept attribute is recognized on both <a> links and <form>
elements via a shared shim in utils/legacy-attr.ts. Apps that upgrade the client
without renaming all templates in lockstep keep working. The first time a legacy
attribute is encountered the client logs a one-time deprecation warning so app authors
can find call-sites to migrate. The shim will be removed in v0.9.0 — migrate to
lvt-nav:no-intercept (links) and lvt-form:no-intercept (forms) before then.

For the full design rationale, see the attribute-reduction proposal in the server repo.

Installation

npm

npm install @livetemplate/client@0.8.41

CDN

<script src="https://cdn.jsdelivr.net/npm/@livetemplate/client@0.8.41/dist/livetemplate-client.browser.js"></script>

Related Releases

This release follows the LiveTemplate core library version 0.8.x