Version 3.0.0-rc3
Pre-release
Pre-release
Added
- First-party pagination support for
inertia_scroll/2. Pass aScrivener.Pagestruct or a Flop{records, %Flop.Meta{}}tuple directly and the entries are placed under the:wrapperkey (default"data") with pagination metadata extracted automatically. Extensible to other libraries via theInertia.Paginatedprotocol, whoseto_scroll/1returns a metadata map that optionally carries the page's:entries. Also adds a:transformoption for serializing each entry before it is rendered, and a:metaoption (a function whose returned map is placed under a"meta"key in the prop, alongside the entries) for surfacing extra pagination data to the page. - Add a
:csp_nonce_assign_keyconfig option. When set, the library reads a Content-Security-Policy nonce from the given connection assign and applies it to the<script>tag used to bootstrap the page data. - The
:match_onoption oninertia_merge/2,inertia_prepend/2, andinertia_deep_merge/2now accepts a list of keys (in addition to a single key) for matching on multiple fields, producing onematchPropsOnentry per key. - Add an
on_error: :ignoreoption toinertia_defer/2,3for graceful failure of deferred props. When a rescued deferred prop's resolver fails during a partial reload, the prop is omitted, its path is reported in therescuedPropspage metadata, and the failure is logged and emitted as a[:inertia, :deferred_prop, :rescue]telemetry event (#75).
Changed
- (Breaking)
inertia_scroll/2now always shapes the prop value as%{<wrapper> => entries}. Previously a%{data:, meta:}map was passed through verbatim; now only the entries under the wrapper key are kept, and any other top-level keys (includingmetaand any sibling fields liketotal_count) are dropped from the prop. Pagination metadata is surfaced viascrollPropsinstead — read pagination state from there. - (Breaking) Renamed the
inertia_scroll/2:metadataoption (added in 2.6.0) to:scroll_metadata, to distinguish it from the new:metaoption (which adds display data to the prop value).:scroll_metadatastill produces thescrollPropsthe client component uses. - (Breaking)
ectois now an optional dependency. TheEcto.Changeseterror serializer is only available when Ecto is present. Apps that pass changesets toassign_errorsand don't already depend on Ecto should add{:ecto, "~> 3.10"}(most Phoenix apps already do). Bare error maps work without Ecto. - (Breaking)
nodejsis now an optional dependency. It's only needed by the default Node.js SSR adapter, so apps using SSR with the default adapter should add{:nodejs, "~> 3.0"}. Apps that don't use SSR (or use a custom:ssr_adapter) no longer pull it in. - (Breaking) Raised minimum versions: Elixir
>= 1.15.0andphoenix_html ~> 4.0.
Removed
- (Breaking) Removed the
Inertia.ScrollMetadataprotocol (added in 2.6.0). Pagination extensibility is now provided by the singleInertia.Paginatedprotocol — implementto_scroll/1(which returns a metadata map, optionally carrying:entries) instead ofto_scroll_metadata/1.
Fixed
- Emit
matchPropsOnas a list of"path.field"strings (e.g.["users.id"]) instead of a%{path => field}map. The Inertia.js client expects an array and callsArray.prototype.findon it, so the previous map shape caused a client-side error when merging props with amatch_onkey.