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

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-RnaB85/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-ZHuUgW/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-RnaB85/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-ZHuUgW/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-RnaB85/src/core/streamingSlotRegistry.ts
51
+ // .angular-partial-tmp-ZHuUgW/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
@@ -20147,12 +20147,18 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
20147
20147
  });
20148
20148
  const { invalidateFingerprintCache: invalidateFingerprintCache2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
20149
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);
20150
+ }, ANGULAR_BUNDLE_DEBOUNCE_MS = 2000, angularBundleState, scheduleAngularBundleRebuild = (state, pageEntries, angularDir) => {
20151
+ let ctx = angularBundleState.get(state);
20152
+ if (!ctx) {
20153
+ ctx = {
20154
+ debouncedPromise: null,
20155
+ debouncedResolve: null,
20156
+ debounceTimer: null,
20157
+ inFlight: null,
20158
+ pending: false
20159
+ };
20160
+ angularBundleState.set(state, ctx);
20161
+ }
20156
20162
  const doOne = async () => {
20157
20163
  if (pageEntries.length === 0)
20158
20164
  return;
@@ -20171,14 +20177,46 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
20171
20177
  ctx.inFlight = null;
20172
20178
  }
20173
20179
  };
20174
- return () => {
20180
+ const fire = () => {
20181
+ ctx.debounceTimer = null;
20182
+ const resolve36 = ctx.debouncedResolve;
20183
+ ctx.debouncedResolve = null;
20184
+ ctx.debouncedPromise = null;
20175
20185
  if (ctx.inFlight) {
20176
20186
  ctx.pending = true;
20177
- return ctx.inFlight;
20187
+ ctx.inFlight.finally(() => resolve36?.());
20188
+ return;
20178
20189
  }
20179
20190
  ctx.inFlight = drive();
20180
- return ctx.inFlight;
20191
+ ctx.inFlight.finally(() => resolve36?.());
20181
20192
  };
20193
+ return ({ immediate = false } = {}) => {
20194
+ if (!ctx.debouncedPromise) {
20195
+ ctx.debouncedPromise = new Promise((res) => {
20196
+ ctx.debouncedResolve = res;
20197
+ });
20198
+ }
20199
+ if (immediate) {
20200
+ if (ctx.debounceTimer) {
20201
+ clearTimeout(ctx.debounceTimer);
20202
+ ctx.debounceTimer = null;
20203
+ }
20204
+ fire();
20205
+ } else if (!ctx.debounceTimer) {
20206
+ ctx.debounceTimer = setTimeout(fire, ANGULAR_BUNDLE_DEBOUNCE_MS);
20207
+ } else {
20208
+ clearTimeout(ctx.debounceTimer);
20209
+ ctx.debounceTimer = setTimeout(fire, ANGULAR_BUNDLE_DEBOUNCE_MS);
20210
+ }
20211
+ return ctx.debouncedPromise;
20212
+ };
20213
+ }, runAngularHmrIncremental = async (state) => {
20214
+ try {
20215
+ const { compileAngularForHmr: compileAngularForHmr2 } = await Promise.resolve().then(() => (init_hmrCompiler(), exports_hmrCompiler));
20216
+ await compileAngularForHmr2([], state.resolvedPaths.buildDir, state.lastUserEditedFiles ?? null);
20217
+ } catch (err) {
20218
+ logWarn(`[hmr] surgical-HMR shadow compile skipped: ${err instanceof Error ? err.message : String(err)}`);
20219
+ }
20182
20220
  }, compileAndBundleAngular = async (state, pageEntries, angularDir) => {
20183
20221
  const { compileAngular: compileAngular2 } = await Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular));
20184
20222
  const { clientPaths, serverPaths } = await compileAngular2(pageEntries, angularDir, true, getStyleTransformConfig(state.config));
@@ -20224,21 +20262,17 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
20224
20262
  const runBundle = scheduleAngularBundleRebuild(state, pageEntries, angularDir);
20225
20263
  const queueDescription = (queue) => queue.map((e) => e.className).join(", ");
20226
20264
  if (verdict.tier === 0) {
20265
+ await runAngularHmrIncremental(state);
20227
20266
  broadcastSurgical(state, verdict.queue);
20228
20267
  const b2 = verdict.breakdown;
20229
20268
  logInfo(`[ng-hmr] tier-0 ${queueDescription(verdict.queue)} (server ${tierMs}ms: imports ${b2.importsMs}/resolve ${b2.resolveMs}/compile ${b2.compileMs}; awaiting client apply)`);
20230
- runBundle().catch((err) => {
20231
- logWarn(`[ng-hmr async bundle] rebuild failed: ${err instanceof Error ? err.message : String(err)}`);
20232
- });
20233
20269
  } else if (verdict.tier === 1 && verdict.kind === "remount") {
20270
+ await runAngularHmrIncremental(state);
20234
20271
  broadcastRemount(state, verdict.queue);
20235
20272
  const b2 = verdict.breakdown;
20236
20273
  logInfo(`[ng-hmr] tier-1a remount ${queueDescription(verdict.queue)} (server ${tierMs}ms: imports ${b2.importsMs}/resolve ${b2.resolveMs}/compile ${b2.compileMs}; awaiting client apply)`);
20237
- runBundle().catch((err) => {
20238
- logWarn(`[ng-hmr async bundle] rebuild failed: ${err instanceof Error ? err.message : String(err)}`);
20239
- });
20240
20274
  } else if (verdict.tier === 1 && verdict.kind === "rebootstrap") {
20241
- await runBundle();
20275
+ await runBundle({ immediate: true });
20242
20276
  await broadcastRebootstrap(state, verdict.reason);
20243
20277
  }
20244
20278
  const { manifest } = state;
@@ -21962,5 +21996,5 @@ export {
21962
21996
  build
21963
21997
  };
21964
21998
 
21965
- //# debugId=EBF9D862F6C2580C64756E2164756E21
21999
+ //# debugId=7731A463849A677764756E2164756E21
21966
22000
  //# sourceMappingURL=build.js.map