I drive the hot-reload pipeline: write source to disk, compile, persist beam files, broadcast events, and return a payload that GT-side subscribers can re-render from directly.
See reload/2 for the full sequence and the recompiled payload
shape carried back to the GT side.
Summary
Functions
I return the compile dependency graph as {from, to, label} edges.
I drop mod from the BEAM so a stale loaded copy does not survive
source-file deletion, then broadcast :source_removed. GT-side
caches subscribe to that event and drop their derived state.
I hot-reload a source file and its dependents.
Functions
I return the compile dependency graph as {from, to, label} edges.
Edges represent: changing to forces recompilation of from.
Label is :compile, :export, or :runtime.
@spec purge_module(module()) :: :ok
I drop mod from the BEAM so a stale loaded copy does not survive
source-file deletion, then broadcast :source_removed. GT-side
caches subscribe to that event and drop their derived state.
I hot-reload a source file and its dependents.
- Writes
contenttopathand formats it - Compiles the dep's full source tree via ParallelCompiler (excludes the currently running eval module)
- Persists compiled beams to ebin
- Recompiles the main project via IEx.Helpers.recompile
- Broadcasts a
%GtBridge.Events.ModuleEvent{kind: :recompiled}for each module that was compiled. On parse/compile failure, broadcasts a%ModuleEvent{kind: :compile_failed}and reraises.
Returns %{recompiled: [payload]} where each payload is a map. The
directly-saved module's payload carries mod, source_hash, and
functions (the new Analysis.all_functions/1 result) inline, so
GT-side subscribers re-render from the announcement without a
follow-up bridge call. Sibling modules from ParallelCompiler
propagation arrive bare (%{mod: name, source_hash: nil, functions: nil})
and let any subscribers fall back to refetching on demand.
Returns :ok regardless of success/failure; subscribers learn the
outcome via the broadcast events (:source_written, :recompiled,
:compile_failed). No GT-side caller inspects the response.