@absolutejs/absolute 0.19.0-beta.369 → 0.19.0-beta.370

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.
package/dist/index.js CHANGED
@@ -180412,23 +180412,27 @@ var registerStreamingSlot = (slot) => {
180412
180412
  };
180413
180413
 
180414
180414
  // src/core/streamingSlotRegistry.ts
180415
- var asyncLocalStorage;
180415
+ var STREAMING_SLOT_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotAsyncLocalStorage");
180416
+ var getStorageGlobal = () => globalThis;
180416
180417
  var isServerRuntime = () => typeof process !== "undefined" && typeof process.versions?.node === "string";
180417
180418
  var ensureAsyncLocalStorage = async () => {
180418
- if (typeof asyncLocalStorage !== "undefined")
180419
- return asyncLocalStorage;
180419
+ const storageGlobal = getStorageGlobal();
180420
+ if (typeof storageGlobal[STREAMING_SLOT_STORAGE_KEY] !== "undefined") {
180421
+ return storageGlobal[STREAMING_SLOT_STORAGE_KEY];
180422
+ }
180420
180423
  if (!isServerRuntime()) {
180421
- asyncLocalStorage = null;
180422
- return asyncLocalStorage;
180424
+ storageGlobal[STREAMING_SLOT_STORAGE_KEY] = null;
180425
+ return storageGlobal[STREAMING_SLOT_STORAGE_KEY];
180423
180426
  }
180424
180427
  const mod = await import("async_hooks");
180425
- asyncLocalStorage = new mod.AsyncLocalStorage;
180426
- return asyncLocalStorage;
180428
+ storageGlobal[STREAMING_SLOT_STORAGE_KEY] = new mod.AsyncLocalStorage;
180429
+ return storageGlobal[STREAMING_SLOT_STORAGE_KEY];
180427
180430
  };
180428
180431
  var registerStreamingSlot2 = (slot) => {
180429
- if (!asyncLocalStorage)
180432
+ const storage = getStorageGlobal()[STREAMING_SLOT_STORAGE_KEY];
180433
+ if (!storage)
180430
180434
  return;
180431
- const store = asyncLocalStorage.getStore();
180435
+ const store = storage.getStore();
180432
180436
  if (!store)
180433
180437
  return;
180434
180438
  store.set(slot.id, slot);
@@ -187419,5 +187423,5 @@ export {
187419
187423
  ANGULAR_INIT_TIMEOUT_MS
187420
187424
  };
187421
187425
 
187422
- //# debugId=C88BAB0C6BD3F8AB64756E2164756E21
187426
+ //# debugId=56839D95BBABD60C64756E2164756E21
187423
187427
  //# sourceMappingURL=index.js.map