Astral.Islands.Registry (Astral v0.3.1)

Copy Markdown View Source

Per-render-process registry of client-side islands.

Volt builds discovered island entries before page rendering. This registry assigns document-local identities and collects stylesheet dependencies for those prebuilt entries.

Summary

Functions

Return the islands registered for the current document.

Register an island and return its canonical value.

Return the site currently being rendered.

Start an empty island registry for a site render.

Start document-local island identities and dependency collection.

Clear the current process registry.

Return the completed document's stylesheet dependencies in registration order.

Types

state()

@type state() :: %{
  site: Astral.Site.t(),
  islands: %{required(String.t()) => Astral.Islands.Island.t()},
  ids: %{required(String.t()) => pos_integer()},
  entries: [String.t()]
}

Functions

islands()

@spec islands() :: [Astral.Islands.Island.t()]

Return the islands registered for the current document.

register(opts)

@spec register(keyword()) :: Astral.Islands.Island.t()

Register an island and return its canonical value.

site()

@spec site() :: Astral.Site.t()

Return the site currently being rendered.

start(site)

@spec start(Astral.Site.t()) :: :ok

Start an empty island registry for a site render.

start_document()

Start document-local island identities and dependency collection.

stop()

@spec stop() :: :ok

Clear the current process registry.

stylesheets()

@spec stylesheets() :: [String.t()]

Return the completed document's stylesheet dependencies in registration order.