@absolutejs/absolute 0.19.0-beta.884 → 0.19.0-beta.886

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-ttB5kz/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-sgkxwm/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-ttB5kz/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-sgkxwm/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-ttB5kz/src/core/streamingSlotRegistry.ts
51
+ // .angular-partial-tmp-sgkxwm/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,6 +20147,69 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
20147
20147
  });
20148
20148
  const { invalidateFingerprintCache: invalidateFingerprintCache2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
20149
20149
  invalidateFingerprintCache2();
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
+ }
20162
+ const doOne = async () => {
20163
+ if (pageEntries.length === 0)
20164
+ return;
20165
+ await compileAndBundleAngular(state, pageEntries, angularDir);
20166
+ markSsrCacheDirty("angular");
20167
+ };
20168
+ const drive = async () => {
20169
+ try {
20170
+ while (true) {
20171
+ ctx.pending = false;
20172
+ await doOne();
20173
+ if (!ctx.pending)
20174
+ break;
20175
+ }
20176
+ } finally {
20177
+ ctx.inFlight = null;
20178
+ }
20179
+ };
20180
+ const fire = () => {
20181
+ ctx.debounceTimer = null;
20182
+ const resolve36 = ctx.debouncedResolve;
20183
+ ctx.debouncedResolve = null;
20184
+ ctx.debouncedPromise = null;
20185
+ if (ctx.inFlight) {
20186
+ ctx.pending = true;
20187
+ ctx.inFlight.finally(() => resolve36?.());
20188
+ return;
20189
+ }
20190
+ ctx.inFlight = drive();
20191
+ ctx.inFlight.finally(() => resolve36?.());
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
+ };
20150
20213
  }, compileAndBundleAngular = async (state, pageEntries, angularDir) => {
20151
20214
  const { compileAngular: compileAngular2 } = await Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular));
20152
20215
  const { clientPaths, serverPaths } = await compileAngular2(pageEntries, angularDir, true, getStyleTransformConfig(state.config));
@@ -20189,12 +20252,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
20189
20252
  const tierStart = performance.now();
20190
20253
  const verdict = await decideAngularTier(state, angularDir);
20191
20254
  const tierMs = (performance.now() - tierStart).toFixed(0);
20192
- const runBundle = async () => {
20193
- if (pageEntries.length === 0)
20194
- return;
20195
- await compileAndBundleAngular(state, pageEntries, angularDir);
20196
- markSsrCacheDirty("angular");
20197
- };
20255
+ const runBundle = scheduleAngularBundleRebuild(state, pageEntries, angularDir);
20198
20256
  const queueDescription = (queue) => queue.map((e) => e.className).join(", ");
20199
20257
  if (verdict.tier === 0) {
20200
20258
  broadcastSurgical(state, verdict.queue);
@@ -20211,7 +20269,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
20211
20269
  logWarn(`[ng-hmr async bundle] rebuild failed: ${err instanceof Error ? err.message : String(err)}`);
20212
20270
  });
20213
20271
  } else if (verdict.tier === 1 && verdict.kind === "rebootstrap") {
20214
- await runBundle();
20272
+ await runBundle({ immediate: true });
20215
20273
  await broadcastRebootstrap(state, verdict.reason);
20216
20274
  }
20217
20275
  const { manifest } = state;
@@ -21286,6 +21344,7 @@ var init_rebuildTrigger = __esm(() => {
21286
21344
  init_tailwindCompiler();
21287
21345
  init_ssrCache();
21288
21346
  moduleServerPromise = Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
21347
+ angularBundleState = new WeakMap;
21289
21348
  getReactModuleUrl = getModuleUrl;
21290
21349
  EMBER_PAGE_EXTENSIONS = [".gts", ".gjs", ".ts", ".js"];
21291
21350
  HMR_SCRIPT_PATTERN = /<script>window\.__HMR_FRAMEWORK__[\s\S]*?<\/script>\s*<script data-hmr-client>[\s\S]*?<\/script>/;
@@ -21934,5 +21993,5 @@ export {
21934
21993
  build
21935
21994
  };
21936
21995
 
21937
- //# debugId=0E9665625D8067C864756E2164756E21
21996
+ //# debugId=8D490F35E105C28E64756E2164756E21
21938
21997
  //# sourceMappingURL=build.js.map