Open History to see the last commit
1# Mobile development lifecycle
2
3The [connection runtime's HMR boundary](../../apps/mobile/src/lib/hot-swappable-atom-runtime.ts)
4keeps a stable atom runtime and replaces its Effect layer through a writable atom.
5It accepts the update only after installing the new layer. Otherwise importers
6retain the old behavior even though Metro reports a successful refresh.
7
8Do not reset the shared atom registry to refresh a connection-runtime edit. Reset
9removes listeners from mounted consumers that Metro has no reason to rerender.
10When the registry or managed-runtime module itself changes, normal Metro propagation
11disposes its old resources. This boundary does not make arbitrary module-level atom
12families safe to hot-swap. Production uses an ordinary atom runtime.
13
14[Environment supervisor scopes](../../packages/client-runtime/src/connection/registry.ts)
15are children of the registry scope. The per-environment map supports targeted
16shutdown, but a supervisor created after its cleanup runs would escape it. A closed
17parent scope also closes late arrivals, preventing interrupted startup or runtime
18replacement from leaving a WebSocket alive outside the new registry.
19
20The [Uniwind patch](../../patches/uniwind@1.11.0.patch) still compiles CSS on Metro
21updates so newly used classes are discovered. It skips global style invalidation
22only when the generated stylesheet and theme list are unchanged. Skipping compilation
23would lose new classes; invalidating every consumer for unchanged output makes an
24ordinary component edit refresh the whole app. The fingerprint is recorded only
25after initialization succeeds.
26
27The native modules under `apps/mobile/modules/` are `file:` dependencies, and pnpm
28copies those into its virtual store instead of linking them. Metro bundles the copy,
29so an edit to a module's TypeScript is invisible to a running dev client until
30`vp i` re-syncs it, while Gradle and CocoaPods compile the worktree directory
31directly. A JavaScript change that "has no effect" on device is usually this.