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