PhoenixReplay.Recording (PhoenixReplay v0.6.2)

Copy Markdown View Source

A recorded LiveView session.

Holds the session metadata and an ordered list of PhoenixReplay.Recording.Events. Use PhoenixReplay.Recording.Timeline to reconstruct state at a point in time.

dropped counts collected events left out once a collector reached its :limit, keyed by collector name, such as "my_app.repo.query" or "log".

client describes the browser and the visit; see PhoenixReplay.Recording.Client.

layout is the layout the view rendered in live, as module and template names: the one mount/3 or an on_mount hook returned with layout:, else the one its use Phoenix.LiveView, layout: ... names, or false for none. It is nil in recordings made before it was kept, which replay in the layout the view names today.

Summary

Types

A layout by module and template name, such as {"MyAppWeb.Layouts", "app"}, or false for none.

t()

The browser's viewport: its size in CSS pixels and pixel ratio, and when the browser reports them, the screen's orientation angle and the media settings the page's CSS could see: the color scheme, reduced motion, contrast and the kind of pointer.

Functions

Generates a URL-safe random recording id.

Brings a recording stored by an earlier version up to date. PhoenixReplay.Storage.Codec calls it on every recording it decodes.

Returns true when id has the shape produced by generate_id/0.

Types

id()

@type id() :: String.t()

layout()

@type layout() :: {String.t(), String.t()} | false

A layout by module and template name, such as {"MyAppWeb.Layouts", "app"}, or false for none.

t()

@type t() :: %PhoenixReplay.Recording{
  client: PhoenixReplay.Recording.Client.t(),
  code: PhoenixReplay.Recording.Code.t() | nil,
  connected_at: integer(),
  dropped: %{required(String.t()) => pos_integer()},
  events: [PhoenixReplay.Recording.Event.t()],
  id: id(),
  layout: layout() | nil,
  params: map(),
  session: map(),
  url: String.t() | nil,
  view: module()
}

viewport()

@type viewport() :: %{
  :width => pos_integer(),
  :height => pos_integer(),
  :dpr => number(),
  optional(:angle) => 0 | 90 | 180 | 270,
  optional(:color_scheme) => :light | :dark,
  optional(:reduced_motion) => boolean(),
  optional(:contrast) => :more | :less | :no_preference,
  optional(:pointer) => :coarse | :fine | :none,
  optional(:hover) => :hover | :none
}

The browser's viewport: its size in CSS pixels and pixel ratio, and when the browser reports them, the screen's orientation angle and the media settings the page's CSS could see: the color scheme, reduced motion, contrast and the kind of pointer.

Functions

generate_id()

@spec generate_id() :: id()

Generates a URL-safe random recording id.

upgrade(recording)

@spec upgrade(t()) :: t()

Brings a recording stored by an earlier version up to date. PhoenixReplay.Storage.Codec calls it on every recording it decodes.

valid_id?(id)

@spec valid_id?(term()) :: boolean()

Returns true when id has the shape produced by generate_id/0.