@@ -168,9 +168,9 @@ void EvictHttpModulePrefetchCacheUrls(const std::vector<std::string>& urls);
168168// thread until the BFS has fully drained or `timeoutSeconds` elapses.
169169//
170170// Designed to be invoked from JS (via `__nsKickstartHmrPrefetch`)
171- // immediately before the Angular HMR client re-imports the entry —
172- // by the time V8 walks the dep tree, every reachable body is already
173- // in `g_prefetchCache` and the walk runs at memory speed instead of
171+ // immediately before the HMR client re-imports the entry — by the
172+ // time V8 walks the dep tree, every reachable body is already in
173+ // `g_prefetchCache` and the walk runs at memory speed instead of
174174// network speed (turning a ~3s 200-fetch refresh into ~250ms).
175175//
176176// Returns `true` when the BFS drained cleanly. On timeout or seed
@@ -190,14 +190,14 @@ bool KickstartHmrPrefetchSync(const std::string& seedUrl,
190190// variant above, this one fetches ONLY the explicit URL list it was
191191// given (no body scanning, no BFS recursion).
192192//
193- // This is the right shape for HMR: the dev server's
194- // `collectAngularEvictionUrls` already computed the inverse-dep
195- // closure of the changed file ; re-discovering it via in-process
196- // scanning would just duplicate that work and re-fetch modules V8
197- // has already compiled. By feeding the precomputed list directly we
198- // turn N sequential `LoadHttpModuleForUrl` calls (the importer chain
199- // during V8's ResolveModuleCallback walk) into a single parallel
200- // wave that completes before V8 starts walking.
193+ // This is the right shape for HMR: the dev server already computed
194+ // the inverse-dep closure of the changed file (the update payload's
195+ // eviction set) ; re-discovering it via in-process scanning would just
196+ // duplicate that work and re-fetch modules V8 has already compiled.
197+ // By feeding the precomputed list directly we turn N sequential
198+ // `LoadHttpModuleForUrl` calls (the importer chain during V8's
199+ // ResolveModuleCallback walk) into a single parallel wave that
200+ // completes before V8 starts walking.
201201//
202202// Same semantics as `KickstartHmrPrefetchSync` for everything else:
203203// blocks the calling thread until the wave drains or `timeoutSeconds`
@@ -240,10 +240,10 @@ void InitializeHotEventDispatcher(v8::Isolate* isolate, v8::Local<v8::Context> c
240240
241241// Drain and execute `import.meta.hot.dispose(cb)` callbacks for the given module
242242// keys. If `keys` is empty, drains every registered callback across every module
243- // (the right behaviour for whole-app HMR reboots like Angular 's
244- // `__reboot_ng_modules__`, where the entire JS realm's side effects are being
245- // thrown away). Each callback is invoked with that module's `hot.data` object so
246- // users can persist state across the reload (matches Vite spec).
243+ // (the right behaviour for whole-app HMR reboots, where the entire JS realm 's
244+ // side effects are being thrown away). Each callback is invoked with that
245+ // module's `hot.data` object so users can persist state across the reload
246+ // (matches Vite spec).
247247//
248248// Callbacks are removed from the registry after execution so a second drain in
249249// the same cycle is a clean no-op. Per-callback failures are logged (when
@@ -254,10 +254,10 @@ void InitializeHotEventDispatcher(v8::Isolate* isolate, v8::Local<v8::Context> c
254254int RunHotDisposeCallbacks (v8::Isolate* isolate, v8::Local<v8::Context> context,
255255 const std::vector<std::string>& keys);
256256
257- // Initialize the global `__nsRunHmrDispose([keys?])` function so the HMR client
258- // (e.g. @nativescript/vite's Angular HMR client ) can drain dispose callbacks
259- // from JS. Mirrors the `InitializeHotEventDispatcher` pattern. Should be called
260- // once per main isolate during runtime init, gated on dev mode.
257+ // Initialize the global `__nsRunHmrDispose([keys?])` function so HMR clients
258+ // (e.g. @nativescript/vite's) can drain dispose callbacks from JS. Mirrors the
259+ // `InitializeHotEventDispatcher` pattern. Should be called once per main
260+ // isolate during runtime init, gated on dev mode.
261261//
262262// JS signature: `__nsRunHmrDispose(keys?: string[]) => number`
263263// - `keys` omitted / null / undefined / empty array → drain everything.
@@ -276,10 +276,10 @@ int RunHotPruneCallbacks(v8::Isolate* isolate, v8::Local<v8::Context> context,
276276 const std::vector<std::string>& keys);
277277
278278// Initialize the global `__nsRunHmrPrune([keys?])` function. Symmetric with
279- // `__nsRunHmrDispose` but for `prune` callbacks. The Angular HMR client does
280- // NOT call this today (its wholesale `__reboot_ng_modules__` model has no
281- // per-module prune step), but the runner is plumbed end-to-end so future
282- // per-module HMR clients have the entry point ready .
279+ // `__nsRunHmrDispose` but for `prune` callbacks. Clients with per-module
280+ // update models call this when modules leave the import graph;
281+ // wholesale-reboot clients have no prune step. Plumbed end-to-end so the
282+ // entry point is ready for either model .
283283//
284284// JS signature: `__nsRunHmrPrune(keys?: string[]) => number`
285285void InitializeHotPruneRunner (v8::Isolate* isolate, v8::Local<v8::Context> context);
@@ -305,8 +305,9 @@ bool IsAnyModuleDeclined(const std::vector<std::string>& keys);
305305
306306// Initialize the global `__nsHasDeclinedModule([keys?])` function. Returns
307307// `true` if any of the listed keys is declined (or if the declined set is
308- // non-empty AND no keys were passed). The Angular HMR client calls this with
309- // `evictPaths` before reboot; on `true` it falls back to `__nsReloadDevApp()`.
308+ // non-empty AND no keys were passed). HMR clients call this with the update's
309+ // eviction set (the wire payload's `evictPaths`) before applying; on `true`
310+ // they fall back to `__nsReloadDevApp()`.
310311//
311312// JS signature: `__nsHasDeclinedModule(keys?: string[]) => boolean`
312313void InitializeHotDeclinedHelper (v8::Isolate* isolate, v8::Local<v8::Context> context);
0 commit comments