@absolutejs/absolute 0.20.0-beta.4 → 0.20.0-beta.41
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/README.md +203 -0
- package/dist/angular/browser.js +15 -1
- package/dist/angular/browser.js.map +3 -3
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +361 -30
- package/dist/angular/index.js.map +9 -6
- package/dist/angular/server.js +361 -30
- package/dist/angular/server.js.map +9 -6
- package/dist/build.js +2097 -1114
- package/dist/build.js.map +20 -16
- package/dist/cli/config/server.js +4 -0
- package/dist/cli/index.js +6986 -1561
- package/dist/dev/client/cssUtils.ts +16 -2
- package/dist/dev/client/handlers/rebuild.ts +11 -1
- package/dist/dev/client/hmrClient.ts +35 -3
- package/dist/dev/client/hmrTiming.ts +20 -7
- package/dist/dev/client/syncDevtools.ts +237 -0
- package/dist/dev/serverBootstrap.js +28 -0
- package/dist/index.js +2947 -1670
- package/dist/index.js.map +37 -31
- package/dist/mobile/browser.js +123 -1
- package/dist/mobile/browser.js.map +6 -4
- package/dist/mobile/index.js +4579 -375
- package/dist/mobile/index.js.map +39 -18
- package/dist/mobile/remoteMacAgentEntry.js +14 -14
- package/dist/mobile/shellAuth.js +36 -0
- package/dist/mobile/shellBootstrap.js +837 -0
- package/dist/mobile/shellExpoDevices.js +99 -0
- package/dist/mobile/shellSync.js +173 -0
- package/dist/react/index.js +5 -1
- package/dist/react/index.js.map +3 -3
- package/dist/react/server.js +5 -1
- package/dist/react/server.js.map +3 -3
- package/dist/src/angular/pageHandler.d.ts +3 -0
- package/dist/src/build/pwa.d.ts +16 -0
- package/dist/src/cli/config/server.d.ts +1 -1
- package/dist/src/cli/instanceStatus.d.ts +1 -0
- package/dist/src/cli/scripts/dev.d.ts +2 -0
- package/dist/src/core/devBuild.d.ts +1 -0
- package/dist/src/core/pageHandlers.d.ts +11 -2
- package/dist/src/core/prepare.d.ts +376 -0
- package/dist/src/dev/clientManager.d.ts +1 -0
- package/dist/src/dev/devCert.d.ts +6 -4
- package/dist/src/dev/serverEntryCopies.d.ts +3 -0
- package/dist/src/mobile/androidEmulatorController.d.ts +14 -2
- package/dist/src/mobile/androidRelease.d.ts +6 -0
- package/dist/src/mobile/androidTestReport.d.ts +14 -0
- package/dist/src/mobile/androidUpgradeConformance.d.ts +47 -0
- package/dist/src/mobile/androidWebView.d.ts +1 -0
- package/dist/src/mobile/browser.d.ts +1 -0
- package/dist/src/mobile/buildPipeline.d.ts +1 -0
- package/dist/src/mobile/capacitorBundle.d.ts +22 -1
- package/dist/src/mobile/ciWorkflow.d.ts +26 -0
- package/dist/src/mobile/client.d.ts +4 -0
- package/dist/src/mobile/config.d.ts +4 -1
- package/dist/src/mobile/devDeviceAdapter.d.ts +3 -0
- package/dist/src/mobile/deviceCapabilities.d.ts +46 -0
- package/dist/src/mobile/expoBridge.d.ts +91 -0
- package/dist/src/mobile/expoDevController.d.ts +49 -0
- package/dist/src/mobile/expoProject.d.ts +16 -0
- package/dist/src/mobile/index.d.ts +14 -0
- package/dist/src/mobile/iosDeviceAcceptance.d.ts +32 -0
- package/dist/src/mobile/iosPhysicalDeviceTransport.d.ts +16 -0
- package/dist/src/mobile/iosRelease.d.ts +4 -1
- package/dist/src/mobile/iosSimulatorController.d.ts +20 -2
- package/dist/src/mobile/iosTestReport.d.ts +24 -0
- package/dist/src/mobile/mobileBundleInspection.d.ts +55 -0
- package/dist/src/mobile/mobileInspect.d.ts +136 -0
- package/dist/src/mobile/mobilePreview.d.ts +174 -0
- package/dist/src/mobile/mobilePreviewClient.d.ts +1 -0
- package/dist/src/mobile/nativeAuth.d.ts +17 -0
- package/dist/src/mobile/nativeBackgroundSync.d.ts +4 -0
- package/dist/src/mobile/nativeDeviceCapabilities.d.ts +6 -0
- package/dist/src/mobile/nativeTestReport.d.ts +91 -0
- package/dist/src/mobile/releaseArtifact.d.ts +2 -0
- package/dist/src/mobile/releaseDoctor.d.ts +23 -1
- package/dist/src/mobile/remoteMacProtocol.d.ts +11 -0
- package/dist/src/mobile/shellAuth.d.ts +15 -0
- package/dist/src/mobile/shellBootstrap.d.ts +23 -1
- package/dist/src/mobile/shellExpoDevices.d.ts +3 -0
- package/dist/src/mobile/shellHttp.d.ts +2 -0
- package/dist/src/mobile/shellPush.d.ts +11 -0
- package/dist/src/mobile/shellSync.d.ts +47 -0
- package/dist/src/mobile/staticDocument.d.ts +5 -0
- package/dist/src/mobile/syncRemediation.d.ts +10 -0
- package/dist/src/mobile/syncSchema.d.ts +9 -0
- package/dist/src/mobile/transport.d.ts +16 -1
- package/dist/src/plugins/hmr.d.ts +3 -0
- package/dist/src/plugins/imageOptimizer.d.ts +1 -1
- package/dist/src/react/hooks/useMediaQuery.d.ts +1 -1
- package/dist/src/svelte/pageHandler.d.ts +3 -0
- package/dist/src/utils/imageProcessing.d.ts +3 -0
- package/dist/src/utils/loadConfig.d.ts +1 -0
- package/dist/src/utils/logger.d.ts +1 -0
- package/dist/src/utils/startupBanner.d.ts +1 -0
- package/dist/src/utils/userAgentFunctions.d.ts +1 -1
- package/dist/src/vue/pageHandler.d.ts +3 -0
- package/dist/svelte/index.js +316 -23
- package/dist/svelte/index.js.map +8 -5
- package/dist/svelte/server.js +311 -18
- package/dist/svelte/server.js.map +8 -5
- package/dist/types/build.d.ts +50 -3
- package/dist/types/cli.d.ts +1 -0
- package/dist/types/messages.d.ts +1 -1
- package/dist/vue/index.js +316 -23
- package/dist/vue/index.js.map +8 -5
- package/dist/vue/server.js +311 -18
- package/dist/vue/server.js.map +8 -5
- package/package.json +41 -11
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
var __require = import.meta.require;
|
|
3
3
|
|
|
4
|
-
// .angular-partial-tmp-
|
|
4
|
+
// .angular-partial-tmp-DRGeXr/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-
|
|
4
|
+
// .angular-partial-tmp-DRGeXr/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-
|
|
51
|
+
// .angular-partial-tmp-DRGeXr/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/angular/index.js
CHANGED
|
@@ -3281,7 +3281,7 @@ var SLOT_ID_PREFIX = "abs-slot-", CLOSING_BODY_TAG = "</body>", CLOSING_HEAD_TAG
|
|
|
3281
3281
|
getStreamingSlotsRuntimeScript()
|
|
3282
3282
|
].filter(Boolean).join(";");
|
|
3283
3283
|
return `<script${createNonceAttr(nonce)}>${escapeScriptContent(runtimeBody)}</script>`;
|
|
3284
|
-
}, toUint8 = (value, encoder) => encoder.encode(value),
|
|
3284
|
+
}, toUint8 = (value, encoder) => encoder.encode(value), isRecord5 = (value) => Boolean(value) && typeof value === "object", isSafeHtmlLike = (value) => isRecord5(value) && typeof value.changingThisBreaksApplicationSecurity === "string", normalizeSafeHtml = (value) => {
|
|
3285
3285
|
if (isSafeHtmlLike(value)) {
|
|
3286
3286
|
return value.changingThisBreaksApplicationSecurity;
|
|
3287
3287
|
}
|
|
@@ -3342,7 +3342,7 @@ var SLOT_ID_PREFIX = "abs-slot-", CLOSING_BODY_TAG = "</body>", CLOSING_HEAD_TAG
|
|
|
3342
3342
|
}, createTimeoutError = (slot, timeoutMs) => {
|
|
3343
3343
|
const error = Object.assign(new Error(`Streaming slot "${slot.id}" timed out after ${timeoutMs}ms`), { __absTimeout: true });
|
|
3344
3344
|
return error;
|
|
3345
|
-
}, isSlotPatchPayloadObject = (value) =>
|
|
3345
|
+
}, isSlotPatchPayloadObject = (value) => isRecord5(value) && ("html" in value), isTimeoutError = (error) => isRecord5(error) && error.__absTimeout === true, toStreamingSlot = (slot, policy) => ({
|
|
3346
3346
|
errorHtml: slot.errorHtml === undefined ? policy.errorHtml : slot.errorHtml,
|
|
3347
3347
|
fallbackHtml: normalizeSlotText(slot.fallbackHtml, policy.fallbackHtml),
|
|
3348
3348
|
id: slot.id ?? createStreamingSlotId(),
|
|
@@ -3854,6 +3854,7 @@ var colors, MONTHS, formatTimestamp = () => {
|
|
|
3854
3854
|
port,
|
|
3855
3855
|
host,
|
|
3856
3856
|
networkUrl,
|
|
3857
|
+
mobilePreviewUrl,
|
|
3857
3858
|
protocol = "http"
|
|
3858
3859
|
} = options;
|
|
3859
3860
|
const name = `${colors.cyan}${colors.bold}ABSOLUTEJS${colors.reset}`;
|
|
@@ -3867,6 +3868,9 @@ var colors, MONTHS, formatTimestamp = () => {
|
|
|
3867
3868
|
if (networkUrl) {
|
|
3868
3869
|
console.log(` ${colors.green}\u279C${colors.reset} ${colors.bold}Network:${colors.reset} ${networkUrl}`);
|
|
3869
3870
|
}
|
|
3871
|
+
if (mobilePreviewUrl) {
|
|
3872
|
+
console.log(` ${colors.green}\u279C${colors.reset} ${colors.bold}Mobile:${colors.reset} ${mobilePreviewUrl}`);
|
|
3873
|
+
}
|
|
3870
3874
|
console.log("");
|
|
3871
3875
|
};
|
|
3872
3876
|
var init_startupBanner = __esm(() => {
|
|
@@ -4537,7 +4541,15 @@ import { existsSync as existsSync5, readFileSync as readFileSync5, promises as f
|
|
|
4537
4541
|
import { join as join9, basename as basename4, sep, dirname as dirname5, resolve as resolve7, relative as relative5 } from "path";
|
|
4538
4542
|
var {Glob } = globalThis.Bun;
|
|
4539
4543
|
import ts from "typescript";
|
|
4540
|
-
var
|
|
4544
|
+
var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) => {
|
|
4545
|
+
const temporaryPath = `${path}.tmp.${process.pid}.${atomicWriteSequence++}`;
|
|
4546
|
+
try {
|
|
4547
|
+
await fs.writeFile(temporaryPath, content, "utf-8");
|
|
4548
|
+
await fs.rename(temporaryPath, path);
|
|
4549
|
+
} finally {
|
|
4550
|
+
await fs.rm(temporaryPath, { force: true });
|
|
4551
|
+
}
|
|
4552
|
+
}, traceAngularPhase = async (name, fn, metadata) => {
|
|
4541
4553
|
const tracePhase = globalThis.__absoluteBuildTracePhase;
|
|
4542
4554
|
return tracePhase ? tracePhase(`compile/angular/${name}`, fn, metadata) : await fn();
|
|
4543
4555
|
}, readTsconfigPathAliases = () => {
|
|
@@ -4803,10 +4815,10 @@ var traceAngularPhase = async (name, fn, metadata) => {
|
|
|
4803
4815
|
}
|
|
4804
4816
|
}, writeResourceCacheFile = async (cachePath, source) => {
|
|
4805
4817
|
await fs.mkdir(dirname5(cachePath), { recursive: true });
|
|
4806
|
-
await
|
|
4818
|
+
await writeTextFileAtomically(cachePath, JSON.stringify({
|
|
4807
4819
|
source,
|
|
4808
4820
|
version: 1
|
|
4809
|
-
})
|
|
4821
|
+
}));
|
|
4810
4822
|
}, resolveResourceTransformCachePath = async (filePath, source, stylePreprocessors) => {
|
|
4811
4823
|
const resourcePaths = collectAngularResourcePaths(source, dirname5(filePath));
|
|
4812
4824
|
const resourceContents = await Promise.all(resourcePaths.map(async (resourcePath) => {
|
|
@@ -4992,7 +5004,7 @@ var traceAngularPhase = async (name, fn, metadata) => {
|
|
|
4992
5004
|
});
|
|
4993
5005
|
await traceAngularPhase("aot/write-output", () => Promise.all(entries.map(async ({ target, content }) => {
|
|
4994
5006
|
await fs.mkdir(dirname5(target), { recursive: true });
|
|
4995
|
-
await
|
|
5007
|
+
await writeTextFileAtomically(target, content);
|
|
4996
5008
|
})), { outputs: entries.length });
|
|
4997
5009
|
return await traceAngularPhase("aot/collect-output-paths", () => entries.map(({ target }) => target), { outputs: entries.length });
|
|
4998
5010
|
}, compileAngularFile = async (inputPath, outDir, stylePreprocessors) => compileAngularFiles([inputPath], outDir, stylePreprocessors), jitContentCache, invalidateAngularJitCache = (filePath) => {
|
|
@@ -5457,7 +5469,7 @@ ${fields}
|
|
|
5457
5469
|
const processedContent = transpileAndRewrite(sourceCode, relativeDir, actualPath, importRewrites);
|
|
5458
5470
|
const preservedInjection = await readPreservedInjection(targetPath);
|
|
5459
5471
|
await fs.mkdir(targetDir, { recursive: true });
|
|
5460
|
-
await
|
|
5472
|
+
await writeTextFileAtomically(targetPath, processedContent + preservedInjection);
|
|
5461
5473
|
jitContentCache.set(cacheKey, contentHash);
|
|
5462
5474
|
}
|
|
5463
5475
|
allOutputs.push(targetPath);
|
|
@@ -5473,7 +5485,7 @@ ${fields}
|
|
|
5473
5485
|
export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
5474
5486
|
` : withoutLegacyFlag;
|
|
5475
5487
|
if (nextEntryOutput !== entryOutput) {
|
|
5476
|
-
await
|
|
5488
|
+
await writeTextFileAtomically(entryOutputPath, nextEntryOutput);
|
|
5477
5489
|
}
|
|
5478
5490
|
}
|
|
5479
5491
|
return allOutputs;
|
|
@@ -5643,7 +5655,7 @@ export const providers = [${fragments.join(", ")}];
|
|
|
5643
5655
|
`;
|
|
5644
5656
|
}
|
|
5645
5657
|
}
|
|
5646
|
-
await traceAngularPhase("wrapper/write-server-output", () =>
|
|
5658
|
+
await traceAngularPhase("wrapper/write-server-output", () => writeTextFileAtomically(rawServerFile, rewritten), { entry: resolvedEntry });
|
|
5647
5659
|
const relativePath = relative5(indexesDir, rawServerFile).replace(/\\/g, "/");
|
|
5648
5660
|
const normalizedImportPath = relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
|
|
5649
5661
|
const hmrPreamble = hmr ? `window.__HMR_FRAMEWORK__ = "angular";
|
|
@@ -5667,6 +5679,7 @@ var requestContext = Object.prototype.hasOwnProperty.call(window, '__ABS_ANGULAR
|
|
|
5667
5679
|
var pageHasIslands = Boolean(pageModule.__ABSOLUTE_PAGE_HAS_ISLANDS__) || Boolean(document.querySelector('[data-island="true"]'));
|
|
5668
5680
|
var pageHasRawStreamingSlots = Boolean(document.querySelector('[data-absolute-raw-slot="true"]'));
|
|
5669
5681
|
var pageHasStreamingSlots = Boolean(document.querySelector('[data-absolute-slot="true"]'));
|
|
5682
|
+
var isClientRender = window.__ABSOLUTE_PAGE_RENDER_MODE__ === 'client';
|
|
5670
5683
|
var contextProviders = [{ provide: REQUEST_CONTEXT, useValue: requestContext }];
|
|
5671
5684
|
// Page-level providers are injected directly into the page module's
|
|
5672
5685
|
// server output by \`compileAngular\`'s providers-injection step
|
|
@@ -5717,13 +5730,14 @@ if (!document.querySelector(_sel)) {
|
|
|
5717
5730
|
}
|
|
5718
5731
|
|
|
5719
5732
|
var providers = [provideZonelessChangeDetection()];
|
|
5720
|
-
if (!window.__HMR_SKIP_HYDRATION__ && !pageHasIslands) {
|
|
5733
|
+
if (!isClientRender && !window.__HMR_SKIP_HYDRATION__ && !pageHasIslands) {
|
|
5721
5734
|
providers.push(provideClientHydration(withHttpTransferCacheOptions(absoluteHttpTransferCacheOptions)));
|
|
5722
5735
|
}
|
|
5723
5736
|
delete window.__HMR_SKIP_HYDRATION__;
|
|
5724
5737
|
providers.push.apply(providers, pageProviders);
|
|
5725
5738
|
providers.push.apply(providers, contextProviders);
|
|
5726
5739
|
window.__ABS_SLOT_HYDRATION_PENDING__ = pageHasRawStreamingSlots;
|
|
5740
|
+
var absolutePageReady = Promise.resolve();
|
|
5727
5741
|
|
|
5728
5742
|
if (pageHasRawStreamingSlots) {
|
|
5729
5743
|
window.__ABS_SLOT_HYDRATION_PENDING__ = false;
|
|
@@ -5733,7 +5747,7 @@ if (pageHasRawStreamingSlots) {
|
|
|
5733
5747
|
});
|
|
5734
5748
|
}
|
|
5735
5749
|
} else {
|
|
5736
|
-
bootstrapApplication(${componentClassName}, {
|
|
5750
|
+
absolutePageReady = bootstrapApplication(${componentClassName}, {
|
|
5737
5751
|
providers: providers
|
|
5738
5752
|
}).then(function (appRef) {
|
|
5739
5753
|
window.__ANGULAR_APP__ = appRef;
|
|
@@ -5743,8 +5757,17 @@ if (pageHasRawStreamingSlots) {
|
|
|
5743
5757
|
window.__ABS_SLOT_FLUSH__();
|
|
5744
5758
|
});
|
|
5745
5759
|
}
|
|
5760
|
+
return appRef;
|
|
5746
5761
|
});
|
|
5747
5762
|
}
|
|
5763
|
+
window.__ABSOLUTE_PAGE_READY__ = absolutePageReady;
|
|
5764
|
+
window.__ABSOLUTE_PAGE_DISPOSE__ = async function() {
|
|
5765
|
+
await absolutePageReady;
|
|
5766
|
+
if (window.__ANGULAR_APP__) {
|
|
5767
|
+
window.__ANGULAR_APP__.destroy();
|
|
5768
|
+
window.__ANGULAR_APP__ = null;
|
|
5769
|
+
}
|
|
5770
|
+
};
|
|
5748
5771
|
`.trim() : `
|
|
5749
5772
|
import '@angular/compiler';
|
|
5750
5773
|
import { bootstrapApplication } from '@angular/platform-browser';
|
|
@@ -5763,6 +5786,7 @@ var requestContext = Object.prototype.hasOwnProperty.call(window, '__ABS_ANGULAR
|
|
|
5763
5786
|
var pageHasIslands = Boolean(pageModule.__ABSOLUTE_PAGE_HAS_ISLANDS__) || Boolean(document.querySelector('[data-island="true"]'));
|
|
5764
5787
|
var pageHasRawStreamingSlots = Boolean(document.querySelector('[data-absolute-raw-slot="true"]'));
|
|
5765
5788
|
var pageHasStreamingSlots = Boolean(document.querySelector('[data-absolute-slot="true"]'));
|
|
5789
|
+
var isClientRender = window.__ABSOLUTE_PAGE_RENDER_MODE__ === 'client';
|
|
5766
5790
|
var contextProviders = [{ provide: REQUEST_CONTEXT, useValue: requestContext }];
|
|
5767
5791
|
// Page-level providers are injected directly into the page module's
|
|
5768
5792
|
// server output by \`compileAngular\`'s providers-injection step
|
|
@@ -5782,11 +5806,21 @@ var absoluteHttpTransferCacheOptions = {
|
|
|
5782
5806
|
|
|
5783
5807
|
enableProdMode();
|
|
5784
5808
|
|
|
5809
|
+
// Production mobile/client-only activation starts from AbsoluteJS's empty
|
|
5810
|
+
// #root shell rather than server-rendered Angular markup. Create the page's
|
|
5811
|
+
// actual Angular host from its compiled selector so application authors do
|
|
5812
|
+
// not need framework-specific mobile configuration.
|
|
5813
|
+
var _sel = ${componentClassName}.\u0275cmp?.selectors?.[0]?.[0] || 'ng-app';
|
|
5814
|
+
if (!document.querySelector(_sel)) {
|
|
5815
|
+
(document.getElementById('root') || document.body).appendChild(document.createElement(_sel));
|
|
5816
|
+
}
|
|
5817
|
+
|
|
5785
5818
|
var providers = [provideZonelessChangeDetection()].concat(pageProviders).concat(contextProviders);
|
|
5786
|
-
if (!pageHasIslands) {
|
|
5819
|
+
if (!isClientRender && !pageHasIslands) {
|
|
5787
5820
|
providers.unshift(provideClientHydration(withHttpTransferCacheOptions(absoluteHttpTransferCacheOptions)));
|
|
5788
5821
|
}
|
|
5789
5822
|
window.__ABS_SLOT_HYDRATION_PENDING__ = pageHasRawStreamingSlots;
|
|
5823
|
+
var absolutePageReady = Promise.resolve();
|
|
5790
5824
|
|
|
5791
5825
|
if (pageHasRawStreamingSlots) {
|
|
5792
5826
|
window.__ABS_SLOT_HYDRATION_PENDING__ = false;
|
|
@@ -5796,7 +5830,7 @@ if (pageHasRawStreamingSlots) {
|
|
|
5796
5830
|
});
|
|
5797
5831
|
}
|
|
5798
5832
|
} else {
|
|
5799
|
-
bootstrapApplication(${componentClassName}, {
|
|
5833
|
+
absolutePageReady = bootstrapApplication(${componentClassName}, {
|
|
5800
5834
|
providers: providers
|
|
5801
5835
|
}).then(function (appRef) {
|
|
5802
5836
|
window.__ANGULAR_APP__ = appRef;
|
|
@@ -5806,12 +5840,21 @@ if (pageHasRawStreamingSlots) {
|
|
|
5806
5840
|
window.__ABS_SLOT_FLUSH__();
|
|
5807
5841
|
});
|
|
5808
5842
|
}
|
|
5843
|
+
return appRef;
|
|
5809
5844
|
});
|
|
5810
5845
|
}
|
|
5846
|
+
window.__ABSOLUTE_PAGE_READY__ = absolutePageReady;
|
|
5847
|
+
window.__ABSOLUTE_PAGE_DISPOSE__ = async function() {
|
|
5848
|
+
await absolutePageReady;
|
|
5849
|
+
if (window.__ANGULAR_APP__) {
|
|
5850
|
+
window.__ANGULAR_APP__.destroy();
|
|
5851
|
+
window.__ANGULAR_APP__ = null;
|
|
5852
|
+
}
|
|
5853
|
+
};
|
|
5811
5854
|
`.trim();
|
|
5812
5855
|
const indexHash = Bun.hash(hydration).toString(BASE_36_RADIX);
|
|
5813
5856
|
const indexUnchanged = cachedWrapper?.indexHash === indexHash;
|
|
5814
|
-
await traceAngularPhase("wrapper/write-client-index", () =>
|
|
5857
|
+
await traceAngularPhase("wrapper/write-client-index", () => writeTextFileAtomically(clientFile, hydration), { entry: resolvedEntry });
|
|
5815
5858
|
wrapperOutputCache.set(resolvedEntry, {
|
|
5816
5859
|
indexHash,
|
|
5817
5860
|
serverHash: serverContentHash
|
|
@@ -14949,7 +14992,7 @@ var provideDeterministicEnv = (options = {}) => {
|
|
|
14949
14992
|
};
|
|
14950
14993
|
// src/angular/pageHandler.ts
|
|
14951
14994
|
init_constants();
|
|
14952
|
-
import { AsyncLocalStorage as
|
|
14995
|
+
import { AsyncLocalStorage as AsyncLocalStorage4 } from "async_hooks";
|
|
14953
14996
|
import { lstat, mkdir as mkdir4, readlink, symlink } from "fs/promises";
|
|
14954
14997
|
import { basename as basename5, dirname as dirname6, join as join10, resolve as resolve8 } from "path";
|
|
14955
14998
|
import { pathToFileURL as pathToFileURL2 } from "url";
|
|
@@ -15342,6 +15385,276 @@ var lowerAngularServerIslands = async (html) => {
|
|
|
15342
15385
|
// src/angular/pageHandler.ts
|
|
15343
15386
|
init_devRouteRegistrationCallsite();
|
|
15344
15387
|
|
|
15388
|
+
// src/core/requestContext.ts
|
|
15389
|
+
import { AsyncLocalStorage as AsyncLocalStorage2 } from "async_hooks";
|
|
15390
|
+
import { Elysia as Elysia2 } from "elysia";
|
|
15391
|
+
var REQUEST_STORAGE_KEY = Symbol.for("absolutejs.requestAsyncLocalStorage");
|
|
15392
|
+
var isAbsoluteRequestStorage = (value) => typeof value === "object" && value !== null && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function";
|
|
15393
|
+
var getRequestStorage = () => {
|
|
15394
|
+
const value = Reflect.get(globalThis, REQUEST_STORAGE_KEY);
|
|
15395
|
+
return isAbsoluteRequestStorage(value) ? value : undefined;
|
|
15396
|
+
};
|
|
15397
|
+
var ensureRequestStorage = () => {
|
|
15398
|
+
const existing = getRequestStorage();
|
|
15399
|
+
if (existing)
|
|
15400
|
+
return existing;
|
|
15401
|
+
const storage = new AsyncLocalStorage2;
|
|
15402
|
+
Reflect.set(globalThis, REQUEST_STORAGE_KEY, storage);
|
|
15403
|
+
return storage;
|
|
15404
|
+
};
|
|
15405
|
+
var absoluteRequestContext = new Elysia2({
|
|
15406
|
+
name: "absolutejs-request-context"
|
|
15407
|
+
}).request(({ request }) => {
|
|
15408
|
+
ensureRequestStorage().enterWith({ request });
|
|
15409
|
+
}).as("global");
|
|
15410
|
+
var getCurrentAbsoluteRequest = () => getRequestStorage()?.getStore()?.request;
|
|
15411
|
+
var runWithAbsoluteRequest = (request, callback) => ensureRequestStorage().run({ request }, callback);
|
|
15412
|
+
|
|
15413
|
+
// src/mobile/producerContextState.ts
|
|
15414
|
+
var ABSOLUTE_MOBILE_PRODUCER_STORAGE_KEY = Symbol.for("absolutejs.mobileProducerAsyncLocalStorage");
|
|
15415
|
+
var frameworks = new Set([
|
|
15416
|
+
"angular",
|
|
15417
|
+
"ember",
|
|
15418
|
+
"html",
|
|
15419
|
+
"htmx",
|
|
15420
|
+
"react",
|
|
15421
|
+
"svelte",
|
|
15422
|
+
"vue"
|
|
15423
|
+
]);
|
|
15424
|
+
var isCompatibilityPage = (value) => typeof value === "object" && value !== null && ("bundleHash" in value) && typeof value.bundleHash === "string" && ("contract" in value) && typeof value.contract === "string" && ("framework" in value) && typeof value.framework === "string" && frameworks.has(value.framework) && ("pageId" in value) && typeof value.pageId === "string" && ("propsSchemaHash" in value) && typeof value.propsSchemaHash === "string";
|
|
15425
|
+
var getCurrentAbsoluteMobileProducerContext = () => {
|
|
15426
|
+
const value = Reflect.get(globalThis, ABSOLUTE_MOBILE_PRODUCER_STORAGE_KEY);
|
|
15427
|
+
if (typeof value !== "object" || value === null || !("getStore" in value) || typeof value.getStore !== "function") {
|
|
15428
|
+
return;
|
|
15429
|
+
}
|
|
15430
|
+
const context = value.getStore();
|
|
15431
|
+
if (typeof context !== "object" || context === null || !("page" in context) || !isCompatibilityPage(context.page) || !("releaseId" in context) || typeof context.releaseId !== "string") {
|
|
15432
|
+
return;
|
|
15433
|
+
}
|
|
15434
|
+
return { page: context.page, releaseId: context.releaseId };
|
|
15435
|
+
};
|
|
15436
|
+
|
|
15437
|
+
// src/mobile/pageProtocol.ts
|
|
15438
|
+
var ABSOLUTE_MOBILE_PAGE_MEDIA_TYPE = "application/vnd.absolute.page+json";
|
|
15439
|
+
var ABSOLUTE_MOBILE_PAGE_PROTOCOL_VERSION = 1;
|
|
15440
|
+
var BAD_REQUEST_STATUS = 400;
|
|
15441
|
+
var OK_STATUS = 200;
|
|
15442
|
+
var SERVER_ERROR_STATUS = 500;
|
|
15443
|
+
var UPGRADE_REQUIRED_STATUS = 426;
|
|
15444
|
+
var MOBILE_PAGE_REQUEST_HEADERS = {
|
|
15445
|
+
appBuild: "x-absolute-mobile-app-build",
|
|
15446
|
+
pageBundle: "x-absolute-mobile-page-bundle",
|
|
15447
|
+
pageContracts: "x-absolute-mobile-page-contracts",
|
|
15448
|
+
pageId: "x-absolute-mobile-page-id",
|
|
15449
|
+
protocol: "x-absolute-mobile-protocol",
|
|
15450
|
+
runtime: "x-absolute-mobile-runtime"
|
|
15451
|
+
};
|
|
15452
|
+
var parseMediaType = (value) => value.split(";", 1)[0]?.trim().toLowerCase();
|
|
15453
|
+
var acceptsAbsoluteMobilePage = (request) => {
|
|
15454
|
+
if (!request)
|
|
15455
|
+
return false;
|
|
15456
|
+
return (request.headers.get("accept") ?? "").split(",").some((value) => parseMediaType(value) === ABSOLUTE_MOBILE_PAGE_MEDIA_TYPE);
|
|
15457
|
+
};
|
|
15458
|
+
var readRequiredHeader = (request, name) => {
|
|
15459
|
+
const value = request.headers.get(name)?.trim();
|
|
15460
|
+
return value ? value : undefined;
|
|
15461
|
+
};
|
|
15462
|
+
var parseAbsoluteMobilePageRequest = (request) => {
|
|
15463
|
+
if (!request || !acceptsAbsoluteMobilePage(request)) {
|
|
15464
|
+
return { kind: "not-mobile" };
|
|
15465
|
+
}
|
|
15466
|
+
const protocolValue = readRequiredHeader(request, MOBILE_PAGE_REQUEST_HEADERS.protocol);
|
|
15467
|
+
const runtime = readRequiredHeader(request, MOBILE_PAGE_REQUEST_HEADERS.runtime);
|
|
15468
|
+
const appBuild = readRequiredHeader(request, MOBILE_PAGE_REQUEST_HEADERS.appBuild);
|
|
15469
|
+
const pageBundle = readRequiredHeader(request, MOBILE_PAGE_REQUEST_HEADERS.pageBundle);
|
|
15470
|
+
const pageContractsValue = readRequiredHeader(request, MOBILE_PAGE_REQUEST_HEADERS.pageContracts);
|
|
15471
|
+
const pageId = readRequiredHeader(request, MOBILE_PAGE_REQUEST_HEADERS.pageId);
|
|
15472
|
+
if (!protocolValue || !/^\d+$/.test(protocolValue)) {
|
|
15473
|
+
return {
|
|
15474
|
+
kind: "invalid",
|
|
15475
|
+
message: `Missing or invalid ${MOBILE_PAGE_REQUEST_HEADERS.protocol} header.`
|
|
15476
|
+
};
|
|
15477
|
+
}
|
|
15478
|
+
if (!runtime) {
|
|
15479
|
+
return {
|
|
15480
|
+
kind: "invalid",
|
|
15481
|
+
message: `Missing ${MOBILE_PAGE_REQUEST_HEADERS.runtime} header.`
|
|
15482
|
+
};
|
|
15483
|
+
}
|
|
15484
|
+
if (!appBuild) {
|
|
15485
|
+
return {
|
|
15486
|
+
kind: "invalid",
|
|
15487
|
+
message: `Missing ${MOBILE_PAGE_REQUEST_HEADERS.appBuild} header.`
|
|
15488
|
+
};
|
|
15489
|
+
}
|
|
15490
|
+
if (!pageBundle) {
|
|
15491
|
+
return {
|
|
15492
|
+
kind: "invalid",
|
|
15493
|
+
message: `Missing ${MOBILE_PAGE_REQUEST_HEADERS.pageBundle} header.`
|
|
15494
|
+
};
|
|
15495
|
+
}
|
|
15496
|
+
if (!pageContractsValue) {
|
|
15497
|
+
return {
|
|
15498
|
+
kind: "invalid",
|
|
15499
|
+
message: `Missing ${MOBILE_PAGE_REQUEST_HEADERS.pageContracts} header.`
|
|
15500
|
+
};
|
|
15501
|
+
}
|
|
15502
|
+
if (!pageId) {
|
|
15503
|
+
return {
|
|
15504
|
+
kind: "invalid",
|
|
15505
|
+
message: `Missing ${MOBILE_PAGE_REQUEST_HEADERS.pageId} header.`
|
|
15506
|
+
};
|
|
15507
|
+
}
|
|
15508
|
+
const pageContracts = [
|
|
15509
|
+
...new Set(pageContractsValue.split(",").map((value) => value.trim()).filter(Boolean))
|
|
15510
|
+
];
|
|
15511
|
+
if (pageContracts.length === 0) {
|
|
15512
|
+
return {
|
|
15513
|
+
kind: "invalid",
|
|
15514
|
+
message: `${MOBILE_PAGE_REQUEST_HEADERS.pageContracts} must contain at least one contract.`
|
|
15515
|
+
};
|
|
15516
|
+
}
|
|
15517
|
+
return {
|
|
15518
|
+
client: {
|
|
15519
|
+
appBuild,
|
|
15520
|
+
pageBundle,
|
|
15521
|
+
pageContracts,
|
|
15522
|
+
pageId,
|
|
15523
|
+
protocol: Number(protocolValue),
|
|
15524
|
+
runtime
|
|
15525
|
+
},
|
|
15526
|
+
kind: "mobile"
|
|
15527
|
+
};
|
|
15528
|
+
};
|
|
15529
|
+
var responseHeaders = () => {
|
|
15530
|
+
const headers = new Headers({
|
|
15531
|
+
"cache-control": "no-store",
|
|
15532
|
+
"content-type": `${ABSOLUTE_MOBILE_PAGE_MEDIA_TYPE}; version=${ABSOLUTE_MOBILE_PAGE_PROTOCOL_VERSION}`
|
|
15533
|
+
});
|
|
15534
|
+
headerVaryValues.forEach((value) => headers.append("vary", value));
|
|
15535
|
+
return headers;
|
|
15536
|
+
};
|
|
15537
|
+
var headerVaryValues = [
|
|
15538
|
+
"Accept",
|
|
15539
|
+
MOBILE_PAGE_REQUEST_HEADERS.protocol,
|
|
15540
|
+
MOBILE_PAGE_REQUEST_HEADERS.runtime,
|
|
15541
|
+
MOBILE_PAGE_REQUEST_HEADERS.appBuild,
|
|
15542
|
+
MOBILE_PAGE_REQUEST_HEADERS.pageBundle,
|
|
15543
|
+
MOBILE_PAGE_REQUEST_HEADERS.pageContracts,
|
|
15544
|
+
MOBILE_PAGE_REQUEST_HEADERS.pageId
|
|
15545
|
+
];
|
|
15546
|
+
var envelopeResponse = (response, status) => new Response(JSON.stringify({
|
|
15547
|
+
protocol: ABSOLUTE_MOBILE_PAGE_PROTOCOL_VERSION,
|
|
15548
|
+
response
|
|
15549
|
+
}), { headers: responseHeaders(), status });
|
|
15550
|
+
var isRecord4 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
15551
|
+
var normalizeJsonValue = (value) => {
|
|
15552
|
+
const serialized = JSON.stringify(value);
|
|
15553
|
+
if (serialized === undefined) {
|
|
15554
|
+
throw new TypeError("Mobile page props must be JSON-serializable.");
|
|
15555
|
+
}
|
|
15556
|
+
const parsed = JSON.parse(serialized);
|
|
15557
|
+
if (!isRecord4(parsed)) {
|
|
15558
|
+
throw new TypeError("Mobile page props must serialize to an object.");
|
|
15559
|
+
}
|
|
15560
|
+
return parsed;
|
|
15561
|
+
};
|
|
15562
|
+
var finalizeArchivedMobilePage = (context, input) => {
|
|
15563
|
+
const { page } = context;
|
|
15564
|
+
if (page.pageId !== input.compatibility.pageId || page.framework !== input.compatibility.framework) {
|
|
15565
|
+
return envelopeResponse({
|
|
15566
|
+
kind: "invalid-request",
|
|
15567
|
+
message: "Archived producer page identity does not match its release artifact."
|
|
15568
|
+
}, BAD_REQUEST_STATUS);
|
|
15569
|
+
}
|
|
15570
|
+
try {
|
|
15571
|
+
const [currentRepresentation] = input.compatibility.representations;
|
|
15572
|
+
if (!currentRepresentation) {
|
|
15573
|
+
throw new TypeError("Mobile page has no current representation.");
|
|
15574
|
+
}
|
|
15575
|
+
return envelopeResponse({
|
|
15576
|
+
contract: page.contract,
|
|
15577
|
+
framework: page.framework,
|
|
15578
|
+
kind: "page",
|
|
15579
|
+
pageId: page.pageId,
|
|
15580
|
+
props: normalizeJsonValue(currentRepresentation.mapProps(input.props)),
|
|
15581
|
+
status: input.status ?? OK_STATUS
|
|
15582
|
+
}, input.status ?? OK_STATUS);
|
|
15583
|
+
} catch (error) {
|
|
15584
|
+
console.error(`[Mobile] Archived producer ${context.releaseId} failed for ${page.pageId}:`, error);
|
|
15585
|
+
return createAbsoluteMobilePageErrorResponse(page.pageId);
|
|
15586
|
+
}
|
|
15587
|
+
};
|
|
15588
|
+
var createAbsoluteMobileInvalidRequestResponse = (message) => envelopeResponse({ kind: "invalid-request", message }, BAD_REQUEST_STATUS);
|
|
15589
|
+
var createAbsoluteMobilePageErrorResponse = (pageId) => envelopeResponse({
|
|
15590
|
+
code: "representation-failed",
|
|
15591
|
+
kind: "error",
|
|
15592
|
+
pageId,
|
|
15593
|
+
status: SERVER_ERROR_STATUS
|
|
15594
|
+
}, SERVER_ERROR_STATUS);
|
|
15595
|
+
var createAbsoluteMobileUpgradeResponse = (result) => envelopeResponse(result, UPGRADE_REQUIRED_STATUS);
|
|
15596
|
+
var finalizeAbsoluteMobilePage = (input) => {
|
|
15597
|
+
const parsed = parseAbsoluteMobilePageRequest(input.request);
|
|
15598
|
+
if (parsed.kind === "not-mobile")
|
|
15599
|
+
return;
|
|
15600
|
+
if (parsed.kind === "invalid") {
|
|
15601
|
+
return envelopeResponse({ kind: "invalid-request", message: parsed.message }, BAD_REQUEST_STATUS);
|
|
15602
|
+
}
|
|
15603
|
+
const { client } = parsed;
|
|
15604
|
+
if (client.pageId !== input.compatibility.pageId) {
|
|
15605
|
+
return envelopeResponse({
|
|
15606
|
+
kind: "invalid-request",
|
|
15607
|
+
message: `Requested mobile page ${client.pageId} does not match ${input.compatibility.pageId}.`
|
|
15608
|
+
}, BAD_REQUEST_STATUS);
|
|
15609
|
+
}
|
|
15610
|
+
const producerContext = getCurrentAbsoluteMobileProducerContext();
|
|
15611
|
+
if (producerContext)
|
|
15612
|
+
return finalizeArchivedMobilePage(producerContext, input);
|
|
15613
|
+
if (client.protocol !== ABSOLUTE_MOBILE_PAGE_PROTOCOL_VERSION) {
|
|
15614
|
+
return envelopeResponse({
|
|
15615
|
+
kind: "upgrade-required",
|
|
15616
|
+
pageId: input.compatibility.pageId,
|
|
15617
|
+
reason: "protocol"
|
|
15618
|
+
}, UPGRADE_REQUIRED_STATUS);
|
|
15619
|
+
}
|
|
15620
|
+
if (!input.compatibility.runtimes.includes(client.runtime)) {
|
|
15621
|
+
return envelopeResponse({
|
|
15622
|
+
kind: "upgrade-required",
|
|
15623
|
+
pageId: input.compatibility.pageId,
|
|
15624
|
+
reason: "runtime",
|
|
15625
|
+
supportedRuntimes: [...input.compatibility.runtimes]
|
|
15626
|
+
}, UPGRADE_REQUIRED_STATUS);
|
|
15627
|
+
}
|
|
15628
|
+
const clientContracts = new Set(client.pageContracts);
|
|
15629
|
+
const representation = input.compatibility.representations.find(({ contract }) => clientContracts.has(contract));
|
|
15630
|
+
if (!representation) {
|
|
15631
|
+
return envelopeResponse({
|
|
15632
|
+
kind: "upgrade-required",
|
|
15633
|
+
pageId: input.compatibility.pageId,
|
|
15634
|
+
reason: "page-contract",
|
|
15635
|
+
supportedContracts: input.compatibility.representations.map(({ contract }) => contract)
|
|
15636
|
+
}, UPGRADE_REQUIRED_STATUS);
|
|
15637
|
+
}
|
|
15638
|
+
try {
|
|
15639
|
+
return envelopeResponse({
|
|
15640
|
+
contract: representation.contract,
|
|
15641
|
+
framework: input.compatibility.framework,
|
|
15642
|
+
kind: "page",
|
|
15643
|
+
pageId: input.compatibility.pageId,
|
|
15644
|
+
props: normalizeJsonValue(representation.mapProps(input.props)),
|
|
15645
|
+
status: input.status ?? OK_STATUS
|
|
15646
|
+
}, input.status ?? OK_STATUS);
|
|
15647
|
+
} catch (error) {
|
|
15648
|
+
console.error(`[Mobile] Failed to produce ${input.compatibility.pageId} representation ${representation.contract}:`, error);
|
|
15649
|
+
return envelopeResponse({
|
|
15650
|
+
code: "representation-failed",
|
|
15651
|
+
kind: "error",
|
|
15652
|
+
pageId: input.compatibility.pageId,
|
|
15653
|
+
status: SERVER_ERROR_STATUS
|
|
15654
|
+
}, SERVER_ERROR_STATUS);
|
|
15655
|
+
}
|
|
15656
|
+
};
|
|
15657
|
+
|
|
15345
15658
|
// src/angular/ssrSanitizer.ts
|
|
15346
15659
|
var escapeHtml2 = (str) => String(str).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
15347
15660
|
var bypassValue = (value) => ({
|
|
@@ -15453,7 +15766,7 @@ var withRegisteredStreamingSlots = async (renderResponse, options = {}) => {
|
|
|
15453
15766
|
|
|
15454
15767
|
// src/core/streamingSlotWarningScope.ts
|
|
15455
15768
|
init_logger();
|
|
15456
|
-
import { AsyncLocalStorage as
|
|
15769
|
+
import { AsyncLocalStorage as AsyncLocalStorage3 } from "async_hooks";
|
|
15457
15770
|
var STREAMING_SLOT_WARNING_STORAGE_KEY2 = Symbol.for("absolutejs.streamingSlotWarningAsyncLocalStorage");
|
|
15458
15771
|
var isObjectRecord4 = (value) => Boolean(value) && typeof value === "object";
|
|
15459
15772
|
var isAsyncLocalStorage3 = (value) => isObjectRecord4(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function";
|
|
@@ -15469,7 +15782,7 @@ var ensureWarningStorage = () => {
|
|
|
15469
15782
|
if (existing) {
|
|
15470
15783
|
return existing;
|
|
15471
15784
|
}
|
|
15472
|
-
const storage = new
|
|
15785
|
+
const storage = new AsyncLocalStorage3;
|
|
15473
15786
|
Reflect.set(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY2, storage);
|
|
15474
15787
|
return storage;
|
|
15475
15788
|
};
|
|
@@ -15511,11 +15824,11 @@ var runWithStreamingSlotWarningScope = (task, metadata) => ensureWarningStorage(
|
|
|
15511
15824
|
|
|
15512
15825
|
// src/angular/pageHandler.ts
|
|
15513
15826
|
init_ssrRender();
|
|
15514
|
-
var
|
|
15827
|
+
var isRecord6 = (value) => typeof value === "object" && value !== null;
|
|
15515
15828
|
var isAngularComponent2 = (value) => typeof value === "function";
|
|
15516
15829
|
var componentHostsRouterOutlet = (component) => {
|
|
15517
15830
|
const componentDef = Reflect.get(component, "\u0275cmp");
|
|
15518
|
-
if (!
|
|
15831
|
+
if (!isRecord6(componentDef))
|
|
15519
15832
|
return false;
|
|
15520
15833
|
const rawDependencies = componentDef.dependencies;
|
|
15521
15834
|
const dependencies = typeof rawDependencies === "function" ? Reflect.apply(rawDependencies, undefined, []) : rawDependencies;
|
|
@@ -15525,7 +15838,7 @@ var componentHostsRouterOutlet = (component) => {
|
|
|
15525
15838
|
if (dependency === null || typeof dependency !== "object" && typeof dependency !== "function")
|
|
15526
15839
|
return false;
|
|
15527
15840
|
const directiveDef = Reflect.get(dependency, "\u0275dir") ?? dependency;
|
|
15528
|
-
if (!
|
|
15841
|
+
if (!isRecord6(directiveDef))
|
|
15529
15842
|
return false;
|
|
15530
15843
|
const { selectors } = directiveDef;
|
|
15531
15844
|
return Array.isArray(selectors) && JSON.stringify(selectors).includes("router-outlet");
|
|
@@ -15555,7 +15868,7 @@ var ensureAngularCompiler = () => {
|
|
|
15555
15868
|
}
|
|
15556
15869
|
return compilerImportPromise;
|
|
15557
15870
|
};
|
|
15558
|
-
var readAngularPageModule = (value) =>
|
|
15871
|
+
var readAngularPageModule = (value) => isRecord6(value) ? value : null;
|
|
15559
15872
|
var resolveAngularSsrOutDir = (projectRoot = process.cwd(), configuredOutDir = process.env.ABSOLUTE_ANGULAR_SSR_OUTDIR) => configuredOutDir ?? join10(projectRoot, ".absolutejs", "runtime", "angular-ssr");
|
|
15560
15873
|
var createAngularRuntimeCacheBuster = () => `${Date.now().toString(BASE_36_RADIX)}.${Math.random().toString(BASE_36_RADIX).substring(2, RANDOM_ID_END_INDEX)}`;
|
|
15561
15874
|
var existingNodeModulesLinkMatches = async (nodeModulesLink, expectedTarget) => {
|
|
@@ -15656,14 +15969,32 @@ var resolveRequestRenderUrl = (request) => {
|
|
|
15656
15969
|
return "/";
|
|
15657
15970
|
}
|
|
15658
15971
|
};
|
|
15659
|
-
var angularSsrContext = new
|
|
15972
|
+
var angularSsrContext = new AsyncLocalStorage4;
|
|
15660
15973
|
setSsrContextGetter(() => angularSsrContext.getStore());
|
|
15661
15974
|
var handleAngularPageRequest = async (input) => {
|
|
15662
15975
|
const requestId = `angular_${Date.now()}_${Math.random().toString(BASE_36_RADIX).substring(2, RANDOM_ID_END_INDEX)}`;
|
|
15976
|
+
const request = input.request ?? getCurrentAbsoluteRequest();
|
|
15977
|
+
const pageId = input.__absoluteMobile?.pageId ?? derivePageName(input.pagePath);
|
|
15978
|
+
const currentContract = input.__absoluteMobile?.contract ?? `angular:${pageId}:${ABSOLUTE_MOBILE_PAGE_PROTOCOL_VERSION}`;
|
|
15979
|
+
const mobileResponse = finalizeAbsoluteMobilePage({
|
|
15980
|
+
compatibility: {
|
|
15981
|
+
framework: "angular",
|
|
15982
|
+
pageId,
|
|
15983
|
+
representations: [
|
|
15984
|
+
{ contract: currentContract, mapProps: (props) => props }
|
|
15985
|
+
],
|
|
15986
|
+
runtimes: [String(ABSOLUTE_MOBILE_PAGE_PROTOCOL_VERSION)]
|
|
15987
|
+
},
|
|
15988
|
+
props: isRecord6(input.requestContext) ? input.requestContext : Object.create(null),
|
|
15989
|
+
request,
|
|
15990
|
+
status: input.responseInit?.status
|
|
15991
|
+
});
|
|
15992
|
+
if (mobileResponse)
|
|
15993
|
+
return mobileResponse;
|
|
15663
15994
|
return angularSsrContext.run(requestId, async () => {
|
|
15664
|
-
const spaNotFound = await renderSpaNotFound("angular", derivePageName(input.pagePath),
|
|
15995
|
+
const spaNotFound = await renderSpaNotFound("angular", derivePageName(input.pagePath), request);
|
|
15665
15996
|
if (spaNotFound)
|
|
15666
|
-
return withPageCacheHeaders(spaNotFound,
|
|
15997
|
+
return withPageCacheHeaders(spaNotFound, request);
|
|
15667
15998
|
await ensureAngularCompiler();
|
|
15668
15999
|
const userHeadTag = input.headTag ?? "<head></head>";
|
|
15669
16000
|
const resolvedIndexPath = input.indexPath;
|
|
@@ -15671,7 +16002,7 @@ var handleAngularPageRequest = async (input) => {
|
|
|
15671
16002
|
const resolvedPagePath = input.pagePath;
|
|
15672
16003
|
const maybeRequestContext = input.requestContext;
|
|
15673
16004
|
const responseInit = input.responseInit ?? {};
|
|
15674
|
-
const resolvedUrl = resolveRequestRenderUrl(
|
|
16005
|
+
const resolvedUrl = resolveRequestRenderUrl(request);
|
|
15675
16006
|
const siblingCss = await readSiblingCss(resolvedPagePath);
|
|
15676
16007
|
const resolvedHeadTag = injectInlineCss(userHeadTag, siblingCss);
|
|
15677
16008
|
cacheRouteData(resolvedPagePath, {
|
|
@@ -15708,7 +16039,7 @@ var handleAngularPageRequest = async (input) => {
|
|
|
15708
16039
|
...handlerCallProviders,
|
|
15709
16040
|
...await buildServerAnimationProviders(usesLegacyAnimations)
|
|
15710
16041
|
];
|
|
15711
|
-
const providers = buildProviders(deps, sanitizer,
|
|
16042
|
+
const providers = buildProviders(deps, sanitizer, request, maybeRequestContext, responseInit, combinedProviders);
|
|
15712
16043
|
const rawHtml = await renderAngularApp(deps, PageComponent, providers, htmlString, resolvedUrl);
|
|
15713
16044
|
const shouldProcessIslands = hasIslands || rawHtml.includes("<absolute-island");
|
|
15714
16045
|
const htmlWithLoweredIslands = shouldProcessIslands ? await lowerAngularServerIslands(rawHtml) : rawHtml;
|
|
@@ -15716,18 +16047,18 @@ var handleAngularPageRequest = async (input) => {
|
|
|
15716
16047
|
return new Response(html, withHtmlContentType(responseInit));
|
|
15717
16048
|
};
|
|
15718
16049
|
const pageResponse = await runWithStreamingSlotWarningScope(() => options?.collectStreamingSlots === true ? withRegisteredStreamingSlots(renderPageResponse, options) : renderPageResponse(), { handlerCallsite });
|
|
15719
|
-
return withPageCacheHeaders(pageResponse,
|
|
16050
|
+
return withPageCacheHeaders(pageResponse, request);
|
|
15720
16051
|
} catch (error) {
|
|
15721
16052
|
console.error("[SSR] Angular render error:", error);
|
|
15722
16053
|
const pageName = derivePageName(resolvedPagePath);
|
|
15723
16054
|
const conventionResponse = await renderConventionError("angular", pageName, error);
|
|
15724
16055
|
if (conventionResponse) {
|
|
15725
|
-
return withPageCacheHeaders(conventionResponse,
|
|
16056
|
+
return withPageCacheHeaders(conventionResponse, request);
|
|
15726
16057
|
}
|
|
15727
16058
|
return withPageCacheHeaders(new Response(ssrErrorPage("angular", error), {
|
|
15728
16059
|
headers: { "Content-Type": "text/html" },
|
|
15729
16060
|
status: 500
|
|
15730
|
-
}),
|
|
16061
|
+
}), request);
|
|
15731
16062
|
}
|
|
15732
16063
|
});
|
|
15733
16064
|
};
|
|
@@ -16271,5 +16602,5 @@ export {
|
|
|
16271
16602
|
ABSOLUTE_HTTP_TRANSFER_CACHE_SKIP_HEADER
|
|
16272
16603
|
};
|
|
16273
16604
|
|
|
16274
|
-
//# debugId=
|
|
16605
|
+
//# debugId=1C61B9B930534F7864756E2164756E21
|
|
16275
16606
|
//# sourceMappingURL=index.js.map
|