@absolutejs/absolute 0.19.0-beta.984 → 0.19.0-beta.986

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-WLpTnM/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-jf8JvA/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-WLpTnM/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-jf8JvA/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-WLpTnM/src/core/streamingSlotRegistry.ts
51
+ // .angular-partial-tmp-jf8JvA/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";
@@ -4488,7 +4488,19 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
4488
4488
  const detectedClassName = await traceAngularPhase("wrapper/detect-component-class", () => detectExportedComponentClass(original), { entry: resolvedEntry });
4489
4489
  const componentClassName = detectedClassName ?? `${toPascal(fileBase)}Component`;
4490
4490
  const usesLegacyAnimations = await traceAngularPhase("wrapper/detect-legacy-animations", () => usesLegacyAngularAnimations(resolvedEntry), { entry: resolvedEntry });
4491
- const serverContentHash = Bun.hash(original).toString(BASE_36_RADIX);
4491
+ const pageInjectionForHash = providersInjection?.pagesByFile.get(resolvedEntry);
4492
+ const providersHashInput = providersInjection ? (() => {
4493
+ let providersSourceContent = "";
4494
+ try {
4495
+ providersSourceContent = readFileSync4(providersInjection.appProvidersSource, "utf-8");
4496
+ } catch {}
4497
+ return JSON.stringify({
4498
+ basePath: pageInjectionForHash?.basePath ?? null,
4499
+ hasRoutes: pageInjectionForHash?.hasRoutes ?? false,
4500
+ source: providersSourceContent
4501
+ });
4502
+ })() : "no-providers";
4503
+ const serverContentHash = `${Bun.hash(original).toString(BASE_36_RADIX)}.${Bun.hash(providersHashInput).toString(BASE_36_RADIX)}`;
4492
4504
  const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
4493
4505
  const clientFile = join7(indexesDir, jsName);
4494
4506
  if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash && existsSync4(clientFile) && (usesLegacyAnimations || !original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__")) && (!usesLegacyAnimations || original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__"))) {
@@ -4516,6 +4528,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
4516
4528
  `;
4517
4529
  }
4518
4530
  const pageInjection = providersInjection?.pagesByFile.get(resolvedEntry);
4531
+ rewritten = rewritten.replace(/\n\/\* __ABS_PROVIDERS_INJECTION_START \*\/[\s\S]*?\/\* __ABS_PROVIDERS_INJECTION_END \*\/\n?/g, "");
4519
4532
  if (providersInjection && pageInjection) {
4520
4533
  const compiledAppProvidersPath = (() => {
4521
4534
  const angularDirAbs = resolve6(outRoot);
@@ -4540,9 +4553,11 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
4540
4553
  fragments.push(`{ provide: __abs_APP_BASE_HREF, useValue: ${JSON.stringify(pageInjection.basePath)} }`);
4541
4554
  }
4542
4555
  rewritten += `
4556
+ /* __ABS_PROVIDERS_INJECTION_START */
4543
4557
  ${importLines.join(`
4544
4558
  `)}
4545
4559
  export const providers = [${fragments.join(", ")}];
4560
+ /* __ABS_PROVIDERS_INJECTION_END */
4546
4561
  `;
4547
4562
  }
4548
4563
  await traceAngularPhase("wrapper/write-server-output", () => fs.writeFile(rawServerFile, rewritten, "utf-8"), { entry: resolvedEntry });
@@ -14830,9 +14845,11 @@ var handleAngularPageRequest = async (input) => {
14830
14845
  const sanitizer = getSsrSanitizer(deps);
14831
14846
  const pageProvidersExport = Reflect.get(pageModule, "providers");
14832
14847
  const pageProviders = Array.isArray(pageProvidersExport) ? pageProvidersExport : [];
14848
+ const handlerCallProviders = Array.isArray(input.providers) ? input.providers : [];
14833
14849
  const combinedProviders = [
14834
14850
  ...await buildRouterRedirectProviders(deps, responseInit),
14835
14851
  ...pageProviders,
14852
+ ...handlerCallProviders,
14836
14853
  ...await buildServerAnimationProviders(usesLegacyAnimations)
14837
14854
  ];
14838
14855
  const providers = buildProviders(deps, sanitizer, input.request, maybeRequestContext, responseInit, combinedProviders);
@@ -14922,23 +14939,9 @@ var useResource = (fetcher, options = {}) => {
14922
14939
  // src/angular/composables/useSubscription.ts
14923
14940
  import { DestroyRef as DestroyRef2, inject as inject3 } from "@angular/core";
14924
14941
  import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
14925
- var warnedOnce = false;
14926
- var tryCaptureDestroyRef = () => {
14927
- try {
14928
- return inject3(DestroyRef2);
14929
- } catch {
14930
- if (!warnedOnce) {
14931
- warnedOnce = true;
14932
- console.warn("[absolute/angular] useSubscription was called outside an Angular injection context (likely from a lifecycle hook). Auto-teardown via takeUntilDestroyed is disabled for that call; the subscription will leak unless the caller manually unsubscribes. Move the call to a field initializer or the constructor, or pass the captured DestroyRef as the third argument.");
14933
- }
14934
- return null;
14935
- }
14936
- };
14937
14942
  function useSubscription(observable, observerOrNext, destroyRef) {
14938
- const captured = destroyRef ?? tryCaptureDestroyRef();
14943
+ const captured = destroyRef ?? inject3(DestroyRef2);
14939
14944
  const observer = typeof observerOrNext === "function" ? { next: observerOrNext } : observerOrNext;
14940
- if (!captured)
14941
- return observable.subscribe(observer);
14942
14945
  return observable.pipe(takeUntilDestroyed(captured)).subscribe(observer);
14943
14946
  }
14944
14947
  // src/angular/composables/useTimers.ts
@@ -15387,5 +15390,5 @@ export {
15387
15390
  ABSOLUTE_HTTP_TRANSFER_CACHE_SKIP_HEADER
15388
15391
  };
15389
15392
 
15390
- //# debugId=9C93C7CD63419DAF64756E2164756E21
15393
+ //# debugId=44A39DBA5FC9C91464756E2164756E21
15391
15394
  //# sourceMappingURL=index.js.map