@absolutejs/absolute 0.19.0-beta.883 → 0.19.0-beta.885

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-3wcO1H/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-RnaB85/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-3wcO1H/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-RnaB85/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-3wcO1H/src/core/streamingSlotRegistry.ts
51
+ // .angular-partial-tmp-RnaB85/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";
package/dist/build.js CHANGED
@@ -9611,6 +9611,15 @@ var ENTITY_DECORATOR_RE, IMPORT_RE, TOP_LEVEL_DECL_RE, extractAllTopLevelNames =
9611
9611
  // patch the prototype, no view recreation needed).
9612
9612
  {
9613
9613
  const __ng_hmr_id = ${encodedIdLiteral};
9614
+ // Per-class sequence counter. Each \`__ng_hmr_load\` /
9615
+ // \`__ng_hmr_remount\` invocation captures \`seq\` at start, then
9616
+ // checks after the async fetch + before the apply. If a NEWER
9617
+ // event has bumped the counter while we were awaiting (rapid
9618
+ // edits), this older invocation aborts so the latest payload
9619
+ // is the one that lands. Without this guard, racing
9620
+ // \`\u0275\u0275replaceMetadata\` calls can complete out of order and an
9621
+ // older edit's def stomps a newer one's.
9622
+ let __ng_hmr_seq = 0;
9614
9623
  // Send a server-side ack so the dev terminal can log the
9615
9624
  // full HMR latency (server compile + WS hop + client apply +
9616
9625
  // CD pulse) rather than just the server-side compile time.
@@ -9630,11 +9639,13 @@ var ENTITY_DECORATOR_RE, IMPORT_RE, TOP_LEVEL_DECL_RE, extractAllTopLevelNames =
9630
9639
  } catch {}
9631
9640
  };
9632
9641
  const __ng_hmr_load = async (t) => {
9642
+ const mySeq = ++__ng_hmr_seq;
9633
9643
  const t0 = performance.now();
9634
9644
  const [u, core] = await Promise.all([
9635
9645
  import('/@ng/component?c=' + encodeURIComponent(__ng_hmr_id) + '&t=' + t),
9636
9646
  import('@angular/core')
9637
9647
  ]);
9648
+ if (mySeq !== __ng_hmr_seq) return; // superseded by a newer event
9638
9649
  if (!u || typeof u.default !== 'function') return;
9639
9650
  if (${className}.\u0275cmp && typeof core.\u0275\u0275replaceMetadata === 'function') {
9640
9651
  try {
@@ -9668,11 +9679,13 @@ var ENTITY_DECORATOR_RE, IMPORT_RE, TOP_LEVEL_DECL_RE, extractAllTopLevelNames =
9668
9679
  // shared implementation is on \`globalThis.__absAngularRemount\` \u2014
9669
9680
  // installed by hmrClient.ts's import-time wiring.
9670
9681
  const __ng_hmr_remount = async (t) => {
9682
+ const mySeq = ++__ng_hmr_seq;
9671
9683
  const t0 = performance.now();
9672
9684
  const [u, core] = await Promise.all([
9673
9685
  import('/@ng/component?c=' + encodeURIComponent(__ng_hmr_id) + '&t=' + t),
9674
9686
  import('@angular/core')
9675
9687
  ]);
9688
+ if (mySeq !== __ng_hmr_seq) return; // superseded by a newer event
9676
9689
  if (!u || typeof u.default !== 'function') return;
9677
9690
  if (typeof globalThis.__absAngularRemount === 'function' && ${className}.\u0275cmp) {
9678
9691
  try {
@@ -9684,6 +9697,7 @@ var ENTITY_DECORATOR_RE, IMPORT_RE, TOP_LEVEL_DECL_RE, extractAllTopLevelNames =
9684
9697
  core,
9685
9698
  ${JSON.stringify(className)}
9686
9699
  );
9700
+ if (mySeq !== __ng_hmr_seq) return; // newer event arrived during remount
9687
9701
  __ng_hmr_ack('tier-1a', performance.now() - t0);
9688
9702
  } catch (err) {
9689
9703
  console.error('[abs-hmr] remount threw for ${className}:', err);
@@ -20133,6 +20147,38 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
20133
20147
  });
20134
20148
  const { invalidateFingerprintCache: invalidateFingerprintCache2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
20135
20149
  invalidateFingerprintCache2();
20150
+ }, angularBundleState, scheduleAngularBundleRebuild = (state, pageEntries, angularDir) => {
20151
+ const ctx = angularBundleState.get(state) ?? {
20152
+ inFlight: null,
20153
+ pending: false
20154
+ };
20155
+ angularBundleState.set(state, ctx);
20156
+ const doOne = async () => {
20157
+ if (pageEntries.length === 0)
20158
+ return;
20159
+ await compileAndBundleAngular(state, pageEntries, angularDir);
20160
+ markSsrCacheDirty("angular");
20161
+ };
20162
+ const drive = async () => {
20163
+ try {
20164
+ while (true) {
20165
+ ctx.pending = false;
20166
+ await doOne();
20167
+ if (!ctx.pending)
20168
+ break;
20169
+ }
20170
+ } finally {
20171
+ ctx.inFlight = null;
20172
+ }
20173
+ };
20174
+ return () => {
20175
+ if (ctx.inFlight) {
20176
+ ctx.pending = true;
20177
+ return ctx.inFlight;
20178
+ }
20179
+ ctx.inFlight = drive();
20180
+ return ctx.inFlight;
20181
+ };
20136
20182
  }, compileAndBundleAngular = async (state, pageEntries, angularDir) => {
20137
20183
  const { compileAngular: compileAngular2 } = await Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular));
20138
20184
  const { clientPaths, serverPaths } = await compileAngular2(pageEntries, angularDir, true, getStyleTransformConfig(state.config));
@@ -20175,12 +20221,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
20175
20221
  const tierStart = performance.now();
20176
20222
  const verdict = await decideAngularTier(state, angularDir);
20177
20223
  const tierMs = (performance.now() - tierStart).toFixed(0);
20178
- const runBundle = async () => {
20179
- if (pageEntries.length === 0)
20180
- return;
20181
- await compileAndBundleAngular(state, pageEntries, angularDir);
20182
- markSsrCacheDirty("angular");
20183
- };
20224
+ const runBundle = scheduleAngularBundleRebuild(state, pageEntries, angularDir);
20184
20225
  const queueDescription = (queue) => queue.map((e) => e.className).join(", ");
20185
20226
  if (verdict.tier === 0) {
20186
20227
  broadcastSurgical(state, verdict.queue);
@@ -21272,6 +21313,7 @@ var init_rebuildTrigger = __esm(() => {
21272
21313
  init_tailwindCompiler();
21273
21314
  init_ssrCache();
21274
21315
  moduleServerPromise = Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
21316
+ angularBundleState = new WeakMap;
21275
21317
  getReactModuleUrl = getModuleUrl;
21276
21318
  EMBER_PAGE_EXTENSIONS = [".gts", ".gjs", ".ts", ".js"];
21277
21319
  HMR_SCRIPT_PATTERN = /<script>window\.__HMR_FRAMEWORK__[\s\S]*?<\/script>\s*<script data-hmr-client>[\s\S]*?<\/script>/;
@@ -21920,5 +21962,5 @@ export {
21920
21962
  build
21921
21963
  };
21922
21964
 
21923
- //# debugId=7F4CD5C3EC21A0D064756E2164756E21
21965
+ //# debugId=EBF9D862F6C2580C64756E2164756E21
21924
21966
  //# sourceMappingURL=build.js.map