Volt.HMR.StyleGraph (Volt v0.14.11)

Copy Markdown View Source

ETS-backed stylesheet dependency graph for HMR invalidation.

The graph stores resolved stylesheet dependencies and reverse dependent links. Dependency discovery belongs to Volt.CSS.Dependencies; this module only owns the dev-server state needed to invalidate and hot-update stylesheets when an imported stylesheet or referenced asset changes.

Summary

Functions

Clear the entire graph.

Create the stylesheet graph ETS table. Called once from Application.start/2.

Return direct resolved dependencies for a stylesheet source file.

Return all transitive stylesheets that depend on a source file.

Remove a stylesheet from the graph.

Update resolved dependencies for a stylesheet source file.

Functions

clear()

@spec clear() :: :ok

Clear the entire graph.

create_table()

@spec create_table() :: :ok

Create the stylesheet graph ETS table. Called once from Application.start/2.

dependencies_of(path)

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

Return direct resolved dependencies for a stylesheet source file.

dependents(path)

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

Return all transitive stylesheets that depend on a source file.

remove(path)

@spec remove(String.t()) :: :ok

Remove a stylesheet from the graph.

update(path, dependencies)

@spec update(String.t(), [String.t()]) :: :ok

Update resolved dependencies for a stylesheet source file.