Volt.HMR.ImportGraph (Volt v0.19.2)

Copy Markdown View Source

ETS-backed raw import graph for HMR boundary fallback.

The dev server records resolved module relationships in Volt.HMR.ModuleGraph. This graph keeps parser-extracted import specifiers as a fallback for files that have not been served through the dev module graph yet.

Summary

Functions

Clear the entire graph.

Clear raw import edges for one session.

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

Find all files that import the given specifier.

Find all files that import a specifier matching the given predicate.

Get the imports for a file path.

Remove a file from the graph.

Update the imports for a file path.

Functions

clear()

@spec clear() :: :ok

Clear the entire graph.

clear_session(session)

Clear raw import edges for one session.

create_table()

@spec create_table() :: :ok

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

dependents(specifier, session \\ :default)

Find all files that import the given specifier.

Used by fallback HMR boundary lookup to propagate changes upward through raw imports.

dependents_matching(predicate, session \\ :default)

Find all files that import a specifier matching the given predicate.

The predicate receives each import specifier and should return true if it matches the file being searched for.

imports_of(path, session \\ :default)

Get the imports for a file path.

remove(path, session \\ :default)

Remove a file from the graph.

update(path, imports, session \\ :default)

Update the imports for a file path.

update_from_compiled(path, compiled_code, session \\ :default)

Update imports from compiled code.