@absolutejs/absolute 0.19.0-beta.850 → 0.19.0-beta.851

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.
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  var __require = import.meta.require;
3
3
 
4
- // .angular-partial-tmp-ZJL7JH/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-64JFeG/src/core/streamingSlotRegistrar.ts
5
5
  var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
6
6
  var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
7
7
  var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  var __require = import.meta.require;
3
3
 
4
- // .angular-partial-tmp-ZJL7JH/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-64JFeG/src/core/streamingSlotRegistrar.ts
5
5
  var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
6
6
  var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
7
7
  var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
@@ -48,7 +48,7 @@ var warnMissingStreamingSlotCollector = (primitiveName) => {
48
48
  getWarningController()?.maybeWarn(primitiveName);
49
49
  };
50
50
 
51
- // .angular-partial-tmp-ZJL7JH/src/core/streamingSlotRegistry.ts
51
+ // .angular-partial-tmp-64JFeG/src/core/streamingSlotRegistry.ts
52
52
  var STREAMING_SLOT_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotAsyncLocalStorage");
53
53
  var isObjectRecord2 = (value) => Boolean(value) && typeof value === "object";
54
54
  var isAsyncLocalStorage = (value) => isObjectRecord2(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function";
@@ -402,7 +402,13 @@ const handleTemplateUpdate = async (message: HMRMessage): Promise<boolean> => {
402
402
  }
403
403
 
404
404
  const results = hmr.endTemplateUpdateBatch();
405
- if (results.length === 0) return false;
405
+ // Empty batch = the chunk's components weren't already in the
406
+ // registry (off-page broadcast). No-op success — see the
407
+ // matching comment in `handleComponentStyleUpdate`.
408
+ if (results.length === 0) {
409
+ console.warn = origWarn;
410
+ return true;
411
+ }
406
412
  if (!results.every((r) => r.ok)) return false;
407
413
 
408
414
  console.warn = origWarn;
@@ -481,12 +487,18 @@ const handleComponentStyleUpdate = async (
481
487
  }
482
488
 
483
489
  const results = hmr.endStyleUpdateBatch();
484
- if (results.length === 0) {
485
- // Chunk re-evaluated but no component re-registered likely
486
- // the edited file isn't actually used by this page, or the
487
- // chunk skipped its registration block. Fall back to reboot.
488
- return false;
489
- }
490
+ // Empty batch is a no-op success: the chunk re-evaluated but
491
+ // none of its components were already in the registry, so they
492
+ // couldn't be live on the page right now. Common when a CSS
493
+ // edit affects multiple page bundles (the server broadcasts
494
+ // once per page) and the user is only looking at one of them —
495
+ // the off-page broadcasts add fresh entries to the registry but
496
+ // produce no batch updates. Treating that as a failure forced
497
+ // fallthrough to reboot for every off-page broadcast, which
498
+ // fired `startViewTransition` repeatedly and produced the
499
+ // "Transition was skipped" abort when the second reboot
500
+ // superseded the first mid-flight.
501
+ if (results.length === 0) return true;
490
502
  return results.every((r) => r.ok);
491
503
  } catch (err) {
492
504
  console.warn('[HMR] Angular style update failed, falling back:', err);
@@ -547,7 +559,9 @@ const handleServiceMethodSwap = async (
547
559
  }
548
560
 
549
561
  const results = hmr.endServiceUpdateBatch();
550
- if (results.length === 0) return false;
562
+ // Empty batch = off-page broadcast, see comment in
563
+ // `handleComponentStyleUpdate`.
564
+ if (results.length === 0) return true;
551
565
  if (!results.every((r) => r.ok)) return false;
552
566
 
553
567
  // New method bodies might compute new values for observable-fed
@@ -453,9 +453,23 @@ const applyStyleUpdate = (id: string, newCtor: unknown) => {
453
453
  return true;
454
454
  }
455
455
 
456
+ // Always update `ɵcmp.styles` first so future mounts of this
457
+ // component pick up the new content. The DOM `<style>` swap below
458
+ // handles currently-mounted instances; any component that isn't on
459
+ // the page right now (an unopened modal, a route view that hasn't
460
+ // been visited yet) simply has no `<style>` tag to find — and
461
+ // that's fine. The next time it mounts, Angular reads from
462
+ // `ɵcmp.styles` and injects the new content. Treating that case
463
+ // as a failure was the source of the "Transition was skipped"
464
+ // bug: the SPA at /portal/dashboard registered dozens of
465
+ // components whose styles weren't injected (modals, sibling tabs,
466
+ // etc.), and each missing live `<style>` tag forced fallthrough
467
+ // to the reboot path, firing `startViewTransition` while the
468
+ // previous one was still finishing.
469
+ liveCmp.styles = nextStyles;
470
+
456
471
  const hosts = collectStyleHosts();
457
472
  const consumed = new Set<HTMLStyleElement>();
458
- const matches: { tag: HTMLStyleElement; nextContent: string }[] = [];
459
473
 
460
474
  for (let i = 0; i < oldStyles.length; i++) {
461
475
  const oldContent = oldStyles[i] ?? '';
@@ -463,20 +477,14 @@ const applyStyleUpdate = (id: string, newCtor: unknown) => {
463
477
  if (oldContent === nextContent) continue;
464
478
  const tag = findStyleTagByContent(hosts, oldContent, consumed);
465
479
  if (!tag) {
466
- // Couldn't locate one of the live <style> tags — fall through
467
- // to reboot rather than leaving the page in a half-updated
468
- // state.
469
- return false;
480
+ // Component not currently mounted (or already-swapped style).
481
+ // Skip the DOM swap; `ɵcmp.styles` is already updated above
482
+ // so the next mount picks up the new content.
483
+ continue;
470
484
  }
471
485
  consumed.add(tag);
472
- matches.push({ tag, nextContent });
473
- }
474
-
475
- // Only mutate after we've verified we can update every diffed style.
476
- for (const { tag, nextContent } of matches) {
477
486
  tag.textContent = nextContent;
478
487
  }
479
- liveCmp.styles = nextStyles;
480
488
 
481
489
  updateCounter.value++;
482
490
  entry.updateCount++;
package/package.json CHANGED
@@ -384,5 +384,5 @@
384
384
  ]
385
385
  }
386
386
  },
387
- "version": "0.19.0-beta.850"
387
+ "version": "0.19.0-beta.851"
388
388
  }