I released v2.0.0.
Almost everything in this release is a port of work that already existed in
live_vue - props diffing, stream support and
the encoder protocol. Claude did the bulk of the porting.
Big thanks to @Valian
Breaking Changes:
data-propsis now encoded through the newLiveReact.Encoderprotocol instead of
Jason.Encoder. Structs passed as props need@derive LiveReact.Encoder(or an
explicit implementation); plain maps are unaffected. See
Upgrading to 2.0.
Features:
- Props are diffed and sent incrementally over
data-props-diffinstead of the full
props being re-sent on every update. On by default
(config :live_react, enable_props_diff: true), opt out globally withfalseor per
component withdiff={false}. Phoenix.LiveView.stream/4assigns are supported: a stream passed as a prop is diffed
and delivered overdata-streams-diff, arriving on the client as an array whose items
carry their__dom_id.LiveReact.Encoderships implementations for the structs you are most likely to pass
as props:Phoenix.HTML.Form(including Ecto changeset values and errors),
Phoenix.LiveView.AsyncResult,Phoenix.LiveView.UploadConfig,
Phoenix.LiveView.UploadEntry, andDate,Time,NaiveDateTimeandDateTime.
New guide: Props Diffing and Streams.
New examples site:
The demo app moved out of the library into its own repository and now lives at
https://live-react.mrdotb.com. Every example has Preview / LiveView / React tabs,
so you can read the server side and the client side of the same page side by side.
The 2.0 features have examples of their own:
- props-diffing — only the changed
prop path travels over the wire, unless a component opts out - streams — insert, replace, edit, delete
- encoder — what
@derive LiveReact.Encoder
sends to the client, and what it keeps on the server - async —
assign_async’sAsyncResult
reaching React as loading, ok and failed


















