Skip to content

v2.0.0

@mrdotb mrdotb tagged this 01 Sep 19:25
[v2.0.0](https://github.com/mrdotb/live_react/compare/v1.1.0...v2.0.0) (2026-09-01)
Breaking Changes:
* `data-props` is now encoded via the new `LiveReact.Encoder` protocol instead of `Jason.Encoder`. Struct props must now `@derive LiveReact.Encoder` (or implement it explicitly) — plain maps are unaffected. See [Upgrading to 2.0](guides/upgrading-to-2.0.md) for migration examples.
Features:
* Props are now diffed and sent incrementally over `data-props-diff` instead of being fully re-sent on every update (`config :live_react, enable_props_diff: true` by default; opt out globally with `false` or per-component with `diff={false}`).
* Added support for `Phoenix.LiveView.stream/4` assigns: a stream passed as a prop is now automatically diffed and delivered over `data-streams-diff`, arriving on the client as an array whose items carry their `__dom_id`.
* `LiveReact.Encoder` ships implementations for the structs most likely to be passed as props: `Phoenix.HTML.Form` (including Ecto changeset values and errors), `Phoenix.LiveView.AsyncResult`, `Phoenix.LiveView.UploadConfig`, `Phoenix.LiveView.UploadEntry`, and `Date`, `Time`, `NaiveDateTime` and `DateTime`.
Bug Fixes:
* Props diffing no longer requires the call site to pass `socket`. A render was previously treated as dead whenever `socket` was absent, which forced the full-props branch on every update: `data-props` was resent carrying only the *changed* keys, while `data-props-diff` was never marked as changed. A client in diff mode therefore read a diff attribute that never moved and silently stopped updating. `dead` is now only derived on the initial render, where it is both knowable and the only place it is used.
* Cleared the compiler warnings raised by Elixir 1.20.
Documentation:
* Added the [Props Diffing and Streams](guides/props-diffing.md) and [Upgrading to 2.0](guides/upgrading-to-2.0.md) guides, and documented the reserved assigns of `LiveReact.react/1`.
* The example application moved to its own repository, [mrdotb/live_react_examples](https://github.com/mrdotb/live_react_examples).
Assets 2
Loading