Releases
v0.21.0
- Add
Live::Element#selectorfor safely targeting an element by its exact HTML identifier from CSS selector APIs.
v0.20.0
Web Packages
Live now uses web-packages to install and project the JavaScript packages used by its browser integration tests. The generated static package manifest supplies the test page import map, while node_modules is treated as a disposable package-manager projection.
v0.19.0
Explicit Element Construction
Element construction now separates serialized element data from Ruby constructor options and makes the intended construction path explicit.
Live::Element#initializenow requires bothidanddata. ReplaceMyView.newwithMyView.root, and replaceMyView.new("custom-id")withMyView.root("custom-id"). Internal callers usingnewdirectly must pass the data hash explicitly, even when empty.Live::Element.root,.child, and.mountnow accept serialized attributes throughdata:. Other keyword arguments are forwarded toinitialize. For example, changeMyView.root(mode: "presenter")toMyView.root(data: {mode: "presenter"}); constructor dependencies such ascontroller:can remain ordinary keyword arguments.- Calls passing a positional data hash to
.mountmust use thedata:keyword. ChangeChildView.mount(parent, "child", {mode: "compact"})toChildView.mount(parent, "child", data: {mode: "compact"}). Live::Resolver#root(view_class, id = view_class.unique_id, data: {}, **options)constructs an allowed root using the same internal path as browser-resolved elements. Custom resolvers that inject dependencies can override the privatemake(view_class, id, data, **options)method instead of overridingcall.
v0.18.0
- Breaking Change: Live now uses Web Components for managing life-cycle events instead of observers. You will need to use
live-jsv0.16.0 or later with this version oflive, which emits<live-view>elements (instead of<div>elements).- Using older versions of
live-jswith this version oflivemay result in unexpected behavior or errors. - Using older versions of
livewithlive-jsv0.16.0 or later may also result in unexpected behavior or errors.
- Using older versions of
- Updating both
liveandlive-jsto their latest versions is recommended to ensure compatibility, and requires no changes to application code.