How your app's recordings are replayed, as a whole. For how one LiveView
renders in a replay, see PhoenixReplay.Replay.View; for assigns that
changed shape since a recording, see PhoenixReplay.Migration.
Replays render today's templates and root layout with the assigns
recorded then, and most need nothing more: an assign a recording lacks
is rendered as nil, and the root layout, rendered again at each moment,
gives the replayed page's <html> and <body> their attributes, such
as a theme. A module of this behaviour, configured as :replay, covers
a layout whose attributes come from something other than its assigns:
config :phoenix_replay, replay: MyAppWeb.Replay
defmodule MyAppWeb.Replay do
@behaviour PhoenixReplay.Replay
@impl true
def root_attributes(_view, assigns), do: %{"data-plan" => assigns[:plan]}
endIts callback is optional.
Summary
Callbacks
Attributes for the replayed page's <html> at a moment, besides those
the root layout renders, for a layout whose attributes come from
something other than its assigns.
Functions
Calls module's root_attributes/2, with names and values as
strings, or returns no attributes without it.