@absolutejs/absolute 0.19.0-beta.747 → 0.19.0-beta.749

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4123,6 +4123,17 @@ var absoluteHttpTransferCacheOptions = {
4123
4123
  // classes without needing a separate build artifact.
4124
4124
  export * from '${normalizedImportPath}';
4125
4125
 
4126
+ // Record this evaluation's \`routes\` and \`providers\` exports for the
4127
+ // HMR fast-patch to compare against on the next reload. If they change
4128
+ // (a new route was added, a provider was edited), fast-patch falls back
4129
+ // to a full re-bootstrap because those values are consumed once at
4130
+ // bootstrap and won't propagate to the running router/injector via an
4131
+ // in-place component patch.
4132
+ if (typeof window !== 'undefined' && window.__ANGULAR_HMR__ && typeof window.__ANGULAR_HMR__.recordPageExports === 'function') {
4133
+ var __abs_hmr_routes = Reflect.get(pageModule, 'routes');
4134
+ window.__ANGULAR_HMR__.recordPageExports('${resolvedEntry}', __abs_hmr_routes, maybePageProviders);
4135
+ }
4136
+
4126
4137
  // Re-Bootstrap HMR with View Transitions API.
4127
4138
  // Skipped during fast-patch: the HMR client sets
4128
4139
  // window.__ANGULAR_HMR_FAST_PATCH__ = true before \`import()\`-ing this
@@ -14350,6 +14361,39 @@ var handleAngularPageRequest = async (input) => {
14350
14361
  };
14351
14362
  // src/angular/page.ts
14352
14363
  var defineAngularPage = (definition) => definition;
14364
+ // src/angular/preserveAcrossHmr.ts
14365
+ var isDev2 = () => {
14366
+ const scope = globalThis;
14367
+ return Boolean(scope.__DEV__) || Boolean(scope.ngDevMode);
14368
+ };
14369
+ var getCache = () => {
14370
+ const scope = globalThis;
14371
+ return scope.__ABS_HMR_INSTANCE_STATE__ ??= new Map;
14372
+ };
14373
+ var getTracker = () => {
14374
+ const scope = globalThis;
14375
+ return scope.__ABS_HMR_TRACKED_INSTANCES__ ??= new Set;
14376
+ };
14377
+ var restoreFromCache = (instance, key) => {
14378
+ const cache = getCache();
14379
+ const stored = cache.get(key);
14380
+ if (!stored)
14381
+ return;
14382
+ for (const [prop, value] of Object.entries(stored)) {
14383
+ try {
14384
+ instance[prop] = value;
14385
+ } catch {}
14386
+ }
14387
+ };
14388
+ var preserveAcrossHmr = (instance) => {
14389
+ if (!isDev2())
14390
+ return;
14391
+ const key = instance.constructor?.name;
14392
+ if (!key || key === "Object")
14393
+ return;
14394
+ restoreFromCache(instance, key);
14395
+ getTracker().add(new WeakRef(instance));
14396
+ };
14353
14397
  // src/angular/pendingTask.ts
14354
14398
  import { inject, PendingTasks } from "@angular/core";
14355
14399
  var withPendingTask = async (work) => {
@@ -14666,6 +14710,7 @@ export {
14666
14710
  withPendingTask,
14667
14711
  renderIsland,
14668
14712
  provideDeterministicEnv,
14713
+ preserveAcrossHmr,
14669
14714
  handleAngularPageRequest,
14670
14715
  getCachedRouteData,
14671
14716
  defineAngularPage,
@@ -14684,5 +14729,5 @@ export {
14684
14729
  ABSOLUTE_HTTP_TRANSFER_CACHE_SKIP_HEADER
14685
14730
  };
14686
14731
 
14687
- //# debugId=2115AC9F35549B7264756E2164756E21
14732
+ //# debugId=23B9411230D851E064756E2164756E21
14688
14733
  //# sourceMappingURL=index.js.map