@absolutejs/absolute 0.19.0-beta.805 → 0.19.0-beta.807
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/angular/index.js +5 -5
- package/dist/angular/server.js +5 -5
- package/dist/build.js +4 -4
- package/dist/{chunk-gxrsf71e.js → chunk-1rfh7hw9.js} +29 -15
- package/dist/chunk-1rfh7hw9.js.map +11 -0
- package/dist/{chunk-f8k0tb5z.js → chunk-1x4fxm57.js} +5 -5
- package/dist/{chunk-n5a5nxnt.js → chunk-3rea1gam.js} +20 -14
- package/dist/chunk-3rea1gam.js.map +28 -0
- package/dist/{chunk-pevt15h0.js → chunk-629x0yh4.js} +5 -5
- package/dist/{chunk-a0x4bf8d.js → chunk-92fsjfpp.js} +2 -14
- package/dist/{chunk-a0x4bf8d.js.map → chunk-92fsjfpp.js.map} +3 -3
- package/dist/{chunk-z6c8qcmw.js → chunk-9j59emg3.js} +2 -2
- package/dist/{chunk-r0w678ve.js → chunk-bgb8k1qs.js} +2 -2
- package/dist/{chunk-by7t1d3r.js → chunk-cm0g4q6w.js} +2 -2
- package/dist/{chunk-hf5fjykx.js → chunk-jpkjdgsk.js} +13 -53
- package/dist/chunk-jpkjdgsk.js.map +11 -0
- package/dist/{chunk-8zz4g25g.js → chunk-kwgh8rmg.js} +14 -17
- package/dist/chunk-kwgh8rmg.js.map +14 -0
- package/dist/{chunk-0r32762k.js → chunk-m97ze5hz.js} +3 -3
- package/dist/{chunk-0r32762k.js.map → chunk-m97ze5hz.js.map} +1 -1
- package/dist/{chunk-ccz4x8vr.js → chunk-p5zgj77m.js} +3 -3
- package/dist/chunk-pnscgw95.js +90 -0
- package/dist/chunk-pnscgw95.js.map +10 -0
- package/dist/{chunk-0fsxp5gc.js → chunk-r6e8pytx.js} +2 -2
- package/dist/client/index.js +4 -4
- package/dist/index.js +5 -6
- package/dist/index.js.map +2 -2
- package/dist/islands/index.js +1 -1
- package/dist/react/index.js +1 -1
- package/dist/src/angular/ssrRender.d.ts +1 -3
- package/dist/src/build/buildAngularVendor.d.ts +2 -2
- package/dist/src/index.d.ts +0 -1
- package/dist/svelte/index.js +1 -1
- package/dist/types/angular.d.ts +0 -6
- package/dist/vue/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-8zz4g25g.js.map +0 -14
- package/dist/chunk-gxrsf71e.js.map +0 -11
- package/dist/chunk-hf5fjykx.js.map +0 -11
- package/dist/chunk-n5a5nxnt.js.map +0 -28
- package/dist/chunk-r8dzkm4s.js +0 -194
- package/dist/chunk-r8dzkm4s.js.map +0 -11
- package/dist/src/angular/injectorPatch.d.ts +0 -1
- /package/dist/{chunk-f8k0tb5z.js.map → chunk-1x4fxm57.js.map} +0 -0
- /package/dist/{chunk-pevt15h0.js.map → chunk-629x0yh4.js.map} +0 -0
- /package/dist/{chunk-z6c8qcmw.js.map → chunk-9j59emg3.js.map} +0 -0
- /package/dist/{chunk-r0w678ve.js.map → chunk-bgb8k1qs.js.map} +0 -0
- /package/dist/{chunk-by7t1d3r.js.map → chunk-cm0g4q6w.js.map} +0 -0
- /package/dist/{chunk-ccz4x8vr.js.map → chunk-p5zgj77m.js.map} +0 -0
- /package/dist/{chunk-0fsxp5gc.js.map → chunk-r6e8pytx.js.map} +0 -0
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
|
|
17
17
|
// src/core/islandSsr.ts
|
|
18
18
|
var renderAngularIslandToHtmlInternal = async (component, props, islandId) => {
|
|
19
|
-
const { renderAngularIslandToHtml } = await import("./chunk-
|
|
19
|
+
const { renderAngularIslandToHtml } = await import("./chunk-629x0yh4.js");
|
|
20
20
|
return renderAngularIslandToHtml(component, props, islandId);
|
|
21
21
|
};
|
|
22
22
|
var renderAngularIslandToHtml = renderAngularIslandToHtmlInternal;
|
|
@@ -181,4 +181,4 @@ var renderIslandResult = async (registry, props) => {
|
|
|
181
181
|
export { renderIslandMarkup, renderIslandResult };
|
|
182
182
|
|
|
183
183
|
//# debugId=422A05E95D6E1A7B64756E2164756E21
|
|
184
|
-
//# sourceMappingURL=chunk-
|
|
184
|
+
//# sourceMappingURL=chunk-9j59emg3.js.map
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
} from "./chunk-gf0ygptk.js";
|
|
20
20
|
import {
|
|
21
21
|
renderIslandMarkup
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-9j59emg3.js";
|
|
23
23
|
import {
|
|
24
24
|
getIslandBuildReference
|
|
25
25
|
} from "./chunk-8kcfffry.js";
|
|
@@ -669,4 +669,4 @@ var setCurrentPageIslandMetadata = (metadata) => {
|
|
|
669
669
|
export { isTailwindCandidate, compileTailwind, compileTailwindConfig, collectIslandFrameworkSources, generateIslandEntryPoints, loadIslandRegistryBuildInfo, extractStaticStreamingTags, transformCurrentStaticPageHtml, transformStaticPagesWithIslands, getPagesUsingIslandSource, loadPageIslandMetadata, setCurrentPageIslandMetadata, logStartupTimingBlock };
|
|
670
670
|
|
|
671
671
|
//# debugId=EA2793B90D7FF16C64756E2164756E21
|
|
672
|
-
//# sourceMappingURL=chunk-
|
|
672
|
+
//# sourceMappingURL=chunk-bgb8k1qs.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
resolveAngularRuntimePath
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-m97ze5hz.js";
|
|
5
5
|
import"./chunk-bmgqm774.js";
|
|
6
6
|
|
|
7
7
|
// src/angular/angularPatch.ts
|
|
@@ -146,4 +146,4 @@ export {
|
|
|
146
146
|
};
|
|
147
147
|
|
|
148
148
|
//# debugId=D59B1B9EA72E3DAF64756E2164756E21
|
|
149
|
-
//# sourceMappingURL=chunk-
|
|
149
|
+
//# sourceMappingURL=chunk-cm0g4q6w.js.map
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import {
|
|
3
|
-
generateClientScriptCode,
|
|
4
|
-
getAndClearClientScripts,
|
|
5
|
-
patchAngularInjectorSingleton
|
|
6
|
-
} from "./chunk-r8dzkm4s.js";
|
|
7
2
|
import {
|
|
8
3
|
resolveAngularRuntimePath
|
|
9
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-m97ze5hz.js";
|
|
5
|
+
import {
|
|
6
|
+
generateClientScriptCode,
|
|
7
|
+
getAndClearClientScripts
|
|
8
|
+
} from "./chunk-pnscgw95.js";
|
|
10
9
|
import {
|
|
11
10
|
toScreamingSnake
|
|
12
11
|
} from "./chunk-p5504p14.js";
|
|
@@ -21,16 +20,16 @@ import {
|
|
|
21
20
|
// src/angular/angularDeps.ts
|
|
22
21
|
var initDominoAdapter = (platformServer) => {
|
|
23
22
|
try {
|
|
24
|
-
|
|
25
|
-
DominoAdapter?.makeCurrent?.();
|
|
23
|
+
platformServer.\u{275}DominoAdapter?.makeCurrent?.();
|
|
26
24
|
} catch (err) {
|
|
27
25
|
console.error("Failed to initialize DominoAdapter:", err);
|
|
28
26
|
}
|
|
29
27
|
};
|
|
30
28
|
var loadAngularDeps = async () => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
if (true) {
|
|
30
|
+
await import(resolveAngularRuntimePath("@angular/compiler"));
|
|
31
|
+
}
|
|
32
|
+
const { applyPatches } = await import("./chunk-cm0g4q6w.js");
|
|
34
33
|
await applyPatches();
|
|
35
34
|
const [platformBrowser, platformServer, common, core] = await Promise.all([
|
|
36
35
|
import(resolveAngularRuntimePath("@angular/platform-browser")),
|
|
@@ -75,30 +74,6 @@ var cacheRouteData = (pagePath, data) => {
|
|
|
75
74
|
};
|
|
76
75
|
var getCachedRouteData = (pagePath) => routePropsCache.get(pagePath);
|
|
77
76
|
var selectorCache = new Map;
|
|
78
|
-
var buildDeps = (ssrResult, baseDeps) => {
|
|
79
|
-
if (!ssrResult?.core) {
|
|
80
|
-
return baseDeps;
|
|
81
|
-
}
|
|
82
|
-
const { common, core, platformBrowser, platformServer } = ssrResult;
|
|
83
|
-
return {
|
|
84
|
-
APP_BASE_HREF: common?.APP_BASE_HREF ?? baseDeps.APP_BASE_HREF,
|
|
85
|
-
bootstrapApplication: platformBrowser?.bootstrapApplication ?? baseDeps.bootstrapApplication,
|
|
86
|
-
DomSanitizer: platformBrowser?.DomSanitizer ?? baseDeps.DomSanitizer,
|
|
87
|
-
ENVIRONMENT_INITIALIZER: core.ENVIRONMENT_INITIALIZER ?? baseDeps.ENVIRONMENT_INITIALIZER,
|
|
88
|
-
inject: core.inject ?? baseDeps.inject,
|
|
89
|
-
provideClientHydration: platformBrowser?.provideClientHydration ?? baseDeps.provideClientHydration,
|
|
90
|
-
provideServerRendering: platformServer?.provideServerRendering ?? baseDeps.provideServerRendering,
|
|
91
|
-
provideZonelessChangeDetection: core.provideZonelessChangeDetection,
|
|
92
|
-
reflectComponentType: core.reflectComponentType,
|
|
93
|
-
renderApplication: platformServer?.renderApplication ?? baseDeps.renderApplication,
|
|
94
|
-
REQUEST: core.REQUEST ?? baseDeps.REQUEST,
|
|
95
|
-
REQUEST_CONTEXT: core.REQUEST_CONTEXT ?? baseDeps.REQUEST_CONTEXT,
|
|
96
|
-
RESPONSE_INIT: core.RESPONSE_INIT ?? baseDeps.RESPONSE_INIT,
|
|
97
|
-
Sanitizer: core.Sanitizer,
|
|
98
|
-
SecurityContext: core.SecurityContext,
|
|
99
|
-
withHttpTransferCacheOptions: platformBrowser?.withHttpTransferCacheOptions ?? baseDeps.withHttpTransferCacheOptions
|
|
100
|
-
};
|
|
101
|
-
};
|
|
102
77
|
var buildProviders = (deps, sanitizer, maybeProps, tokenMap, request, requestContext, responseInit, userProviders = []) => {
|
|
103
78
|
const providers = [
|
|
104
79
|
deps.provideServerRendering(),
|
|
@@ -130,21 +105,6 @@ var isInjectionToken = (value) => {
|
|
|
130
105
|
return "ngMetadataName" in value && value.ngMetadataName === "InjectionToken";
|
|
131
106
|
};
|
|
132
107
|
var discoverTokens = (pageModule) => new Map(Object.entries(pageModule).filter(([, value]) => isInjectionToken(value)));
|
|
133
|
-
var loadSsrDeps = async (pagePath) => {
|
|
134
|
-
const ssrDepsPath = (pagePath.split("?")[0] ?? pagePath).replace(/\.js$/, ".ssr-deps.js");
|
|
135
|
-
try {
|
|
136
|
-
const ssrDeps = await import(ssrDepsPath);
|
|
137
|
-
const result = {
|
|
138
|
-
common: ssrDeps.__angularCommon,
|
|
139
|
-
core: ssrDeps.__angularCore,
|
|
140
|
-
platformBrowser: ssrDeps.__angularPlatformBrowser,
|
|
141
|
-
platformServer: ssrDeps.__angularPlatformServer
|
|
142
|
-
};
|
|
143
|
-
return result;
|
|
144
|
-
} catch {
|
|
145
|
-
return null;
|
|
146
|
-
}
|
|
147
|
-
};
|
|
148
108
|
var resolveSelector = (deps, pagePath, PageComponent) => {
|
|
149
109
|
const cached = selectorCache.get(pagePath);
|
|
150
110
|
if (cached) {
|
|
@@ -201,7 +161,7 @@ var withSuppressedAngularDevLogs = async (render) => {
|
|
|
201
161
|
}
|
|
202
162
|
};
|
|
203
163
|
|
|
204
|
-
export { getAngularDeps, cacheRouteData, getCachedRouteData,
|
|
164
|
+
export { getAngularDeps, cacheRouteData, getCachedRouteData, buildProviders, clearSelectorCache, discoverTokens, resolveSelector, injectSsrScripts, renderAngularApp, withSuppressedAngularDevLogs };
|
|
205
165
|
|
|
206
|
-
//# debugId=
|
|
207
|
-
//# sourceMappingURL=chunk-
|
|
166
|
+
//# debugId=B7A848C26CC37E7664756E2164756E21
|
|
167
|
+
//# sourceMappingURL=chunk-jpkjdgsk.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/angular/angularDeps.ts", "../src/angular/ssrRender.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import type { AngularDeps } from '../../types/angular';\nimport { resolveAngularRuntimePath } from './resolveAngularPackage';\n\nconst initDominoAdapter = (platformServer: {\n\tɵDominoAdapter?: { makeCurrent?: () => void };\n}) => {\n\ttry {\n\t\tplatformServer.ɵDominoAdapter?.makeCurrent?.();\n\t} catch (err) {\n\t\tconsole.error('Failed to initialize DominoAdapter:', err);\n\t}\n};\n\nconst loadAngularDeps = async () => {\n\t// JIT compiler is only needed in development, where user pages are\n\t// runtime-compiled by `compileAngularFileJIT` and emit partial\n\t// declarations that need the compiler facade to link. In production\n\t// the linker has already processed every partial declaration into\n\t// final ɵdir/ɵcmp/ɵfac at vendor build time, so the compiler isn't\n\t// imported and isn't part of the prod vendor bundle.\n\tif (process.env.NODE_ENV !== 'production') {\n\t\tawait import(resolveAngularRuntimePath('@angular/compiler'));\n\t}\n\n\t// angularPatch imports @angular/platform-server internally, so it\n\t// must also run after the compiler is available.\n\tconst { applyPatches } = await import('./angularPatch');\n\tawait applyPatches();\n\n\t// Now safe to load all Angular packages in parallel\n\tconst [platformBrowser, platformServer, common, core] = await Promise.all([\n\t\timport(resolveAngularRuntimePath('@angular/platform-browser')),\n\t\timport(resolveAngularRuntimePath('@angular/platform-server')),\n\t\timport(resolveAngularRuntimePath('@angular/common')),\n\t\timport(resolveAngularRuntimePath('@angular/core'))\n\t]);\n\n\tif (process.env.NODE_ENV !== 'development') {\n\t\tcore.enableProdMode();\n\t}\n\n\tinitDominoAdapter(platformServer);\n\n\treturn {\n\t\tAPP_BASE_HREF: common.APP_BASE_HREF,\n\t\tbootstrapApplication: platformBrowser.bootstrapApplication,\n\t\tDomSanitizer: platformBrowser.DomSanitizer,\n\t\tENVIRONMENT_INITIALIZER: core.ENVIRONMENT_INITIALIZER,\n\t\tinject: core.inject,\n\t\tprovideClientHydration: platformBrowser.provideClientHydration,\n\t\tprovideServerRendering: platformServer.provideServerRendering,\n\t\tprovideZonelessChangeDetection: core.provideZonelessChangeDetection,\n\t\treflectComponentType: core.reflectComponentType,\n\t\trenderApplication: platformServer.renderApplication,\n\t\tREQUEST: core.REQUEST,\n\t\tREQUEST_CONTEXT: core.REQUEST_CONTEXT,\n\t\tRESPONSE_INIT: core.RESPONSE_INIT,\n\t\tSanitizer: core.Sanitizer,\n\t\tSecurityContext: core.SecurityContext,\n\t\twithHttpTransferCacheOptions:\n\t\t\tplatformBrowser.withHttpTransferCacheOptions\n\t};\n};\n\nlet angularDeps: Promise<AngularDeps> | null = null;\n\nexport const getAngularDeps = () => {\n\tif (!angularDeps) {\n\t\tangularDeps = loadAngularDeps();\n\t}\n\n\treturn angularDeps;\n};\n",
|
|
6
|
+
"import type { EnvironmentProviders, Provider, Type } from '@angular/core';\nimport type { BootstrapContext } from '@angular/platform-browser';\nimport type { AngularDeps, CachedRouteData } from '../../types/angular';\nimport { toScreamingSnake } from '../utils/stringModifiers';\nimport {\n\tgetAndClearClientScripts,\n\tgenerateClientScriptCode\n} from '../utils/registerClientScript';\nimport { buildAbsoluteHttpTransferCacheOptions } from './httpTransferCache';\nimport { buildRequestProviders } from './requestProviders';\n\n// --- Last-used props cache for HMR ---\n// Stores { props, headTag } from the most recent real request per route\n// so HMR re-renders with the same data the user last saw (Vite/Next behavior).\n\nconst routePropsCache = new Map<string, CachedRouteData>();\n\nexport const cacheRouteData = (pagePath: string, data: CachedRouteData) => {\n\tconst cacheKey = pagePath.split('?')[0] ?? pagePath;\n\troutePropsCache.set(cacheKey, data);\n};\nexport const getCachedRouteData = (pagePath: string) =>\n\troutePropsCache.get(pagePath);\n\n// --- Selector cache ---\n\nconst selectorCache = new Map<string, string>();\nexport const buildProviders = (\n\tdeps: AngularDeps,\n\tsanitizer: InstanceType<AngularDeps['DomSanitizer']>,\n\tmaybeProps: Record<string, unknown> | undefined,\n\ttokenMap: Map<string, unknown>,\n\trequest: Request | undefined,\n\trequestContext: unknown,\n\tresponseInit: ResponseInit | undefined,\n\tuserProviders: ReadonlyArray<Provider | EnvironmentProviders> = []\n) => {\n\tconst providers: (Provider | EnvironmentProviders)[] = [\n\t\tdeps.provideServerRendering(),\n\t\tdeps.provideClientHydration(\n\t\t\tdeps.withHttpTransferCacheOptions(\n\t\t\t\tbuildAbsoluteHttpTransferCacheOptions()\n\t\t\t)\n\t\t),\n\t\tdeps.provideZonelessChangeDetection(),\n\t\t{ provide: deps.APP_BASE_HREF, useValue: '/' },\n\t\t{\n\t\t\tprovide: deps.DomSanitizer,\n\t\t\tuseValue: sanitizer\n\t\t},\n\t\t{ provide: deps.Sanitizer, useValue: sanitizer },\n\t\t...buildRequestProviders(deps, request, requestContext, responseInit),\n\t\t...userProviders\n\t];\n\n\tif (!maybeProps) {\n\t\treturn providers;\n\t}\n\n\tconst propProviders = Object.entries(maybeProps)\n\t\t.map(([propName, propValue]) => ({\n\t\t\ttoken: tokenMap.get(toScreamingSnake(propName)),\n\t\t\tvalue: propValue\n\t\t}))\n\t\t.filter((entry) => entry.token)\n\t\t.map((entry) => ({ provide: entry.token, useValue: entry.value }));\n\n\treturn [...providers, ...propProviders];\n};\nexport const clearSelectorCache = () => selectorCache.clear();\n\nconst isInjectionToken = (value: unknown) => {\n\tif (!value || typeof value !== 'object') {\n\t\treturn false;\n\t}\n\n\treturn (\n\t\t'ngMetadataName' in value && value.ngMetadataName === 'InjectionToken'\n\t);\n};\n\nexport const discoverTokens = (pageModule: Record<string, unknown>) =>\n\tnew Map(\n\t\tObject.entries(pageModule).filter(([, value]) =>\n\t\t\tisInjectionToken(value)\n\t\t)\n\t);\nexport const resolveSelector = (\n\tdeps: AngularDeps,\n\tpagePath: string,\n\tPageComponent: Type<unknown>\n) => {\n\tconst cached = selectorCache.get(pagePath);\n\tif (cached) {\n\t\treturn cached;\n\t}\n\n\tconst selector =\n\t\tdeps.reflectComponentType(PageComponent)?.selector ?? 'ng-app';\n\tselectorCache.set(pagePath, selector);\n\n\treturn selector;\n};\n\n// --- Inject HTML helper ---\n\nconst injectBeforeClose = (html: string, snippet: string) => {\n\tif (html.includes('</body>')) {\n\t\treturn html.replace('</body>', `${snippet}</body>`);\n\t}\n\tif (html.includes('</html>')) {\n\t\treturn html.replace('</html>', `${snippet}</html>`);\n\t}\n\n\treturn html + snippet;\n};\n\n// --- Post-render HTML injection ---\n\nexport const injectSsrScripts = (\n\thtml: string,\n\trequestId: string,\n\tindexPath: string,\n\tprops?: Record<string, unknown>\n) => {\n\tlet result = html;\n\n\tconst registeredScripts = getAndClearClientScripts(requestId);\n\tif (registeredScripts.length > 0) {\n\t\tresult = injectBeforeClose(\n\t\t\tresult,\n\t\t\tgenerateClientScriptCode(registeredScripts)\n\t\t);\n\t}\n\n\tif (props) {\n\t\tresult = injectBeforeClose(\n\t\t\tresult,\n\t\t\t`<script>window.__ABS_ANGULAR_PAGE_PROPS__ = ${JSON.stringify(props)};</script>`\n\t\t);\n\t}\n\n\tif (indexPath) {\n\t\tconst escapedIndexPath = JSON.stringify(indexPath);\n\t\tresult = injectBeforeClose(\n\t\t\tresult,\n\t\t\t`<script>import(${escapedIndexPath});</script>`\n\t\t);\n\t}\n\n\treturn result;\n};\nexport const renderAngularApp = async (\n\tdeps: AngularDeps,\n\tPageComponent: Type<unknown>,\n\tproviders: (Provider | EnvironmentProviders)[],\n\tdocument: string | Document,\n\turl: string = '/'\n) => {\n\tconst bootstrap = (context: BootstrapContext) =>\n\t\tdeps.bootstrapApplication(PageComponent, { providers }, context);\n\n\treturn withSuppressedAngularDevLogs(() =>\n\t\tdeps.renderApplication(bootstrap, {\n\t\t\tdocument,\n\t\t\tplatformProviders: [],\n\t\t\turl\n\t\t})\n\t);\n};\nexport const withSuppressedAngularDevLogs = async <T>(\n\trender: () => Promise<T>\n) => {\n\tconst origLog = console.log;\n\tconsole.log = (...args: unknown[]) => {\n\t\tif (\n\t\t\ttypeof args[0] === 'string' &&\n\t\t\targs[0].includes('development mode')\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\torigLog.apply(console, args);\n\t};\n\n\ttry {\n\t\treturn await render();\n\t} finally {\n\t\tconsole.log = origLog;\n\t}\n};\n"
|
|
7
|
+
],
|
|
8
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAGA,IAAM,oBAAoB,CAAC,mBAErB;AAAA,EACL,IAA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,OAAO,6BAA6B,MACnC,KAAK,kBAAkB,WAAW;AAAA,IACjC;AAAA,IACA,mBAAmB,CAAC;AAAA,IACpB;AAAA,EACD,CAAC,CACF;AAAA;AAEM,IAAM,+BAA+B,OAC3C,WACI;AAAA,EACJ,MAAM,UAAU,QAAQ;AAAA,EACxB,QAAQ,MAAM,IAAI,SAAoB;AAAA,IACrC,IACC,OAAO,KAAK,OAAO,YACnB,KAAK,GAAG,SAAS,kBAAkB,GAClC;AAAA,MACD;AAAA,IACD;AAAA,IACA,QAAQ,MAAM,SAAS,IAAI;AAAA;AAAA,EAG5B,IAAI;AAAA,IACH,OAAO,MAAM,OAAO;AAAA,YACnB;AAAA,IACD,QAAQ,MAAM;AAAA;AAAA;",
|
|
9
|
+
"debugId": "B7A848C26CC37E7664756E2164756E21",
|
|
10
|
+
"names": []
|
|
11
|
+
}
|
|
@@ -20,27 +20,24 @@ import {
|
|
|
20
20
|
requireCurrentIslandRegistry
|
|
21
21
|
} from "./chunk-5003emhv.js";
|
|
22
22
|
import {
|
|
23
|
-
buildDeps,
|
|
24
23
|
buildProviders,
|
|
25
24
|
cacheRouteData,
|
|
26
25
|
clearSelectorCache,
|
|
27
26
|
discoverTokens,
|
|
28
27
|
getAngularDeps,
|
|
29
28
|
injectSsrScripts,
|
|
30
|
-
loadSsrDeps,
|
|
31
29
|
renderAngularApp,
|
|
32
30
|
resolveSelector
|
|
33
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-jpkjdgsk.js";
|
|
34
32
|
import {
|
|
35
|
-
setSsrContextGetter
|
|
36
|
-
} from "./chunk-r8dzkm4s.js";
|
|
37
|
-
import {
|
|
38
|
-
resolveAngularPackage,
|
|
39
33
|
resolveAngularRuntimePath
|
|
40
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-m97ze5hz.js";
|
|
35
|
+
import {
|
|
36
|
+
setSsrContextGetter
|
|
37
|
+
} from "./chunk-pnscgw95.js";
|
|
41
38
|
import {
|
|
42
39
|
renderIslandMarkup
|
|
43
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-9j59emg3.js";
|
|
44
41
|
import {
|
|
45
42
|
BASE_36_RADIX,
|
|
46
43
|
RANDOM_ID_END_INDEX
|
|
@@ -106,7 +103,7 @@ var buildRedirectEventHandler = (responseInit, routerModule) => {
|
|
|
106
103
|
var buildRouterRedirectProviders = async (deps, responseInit) => {
|
|
107
104
|
let routerModule;
|
|
108
105
|
try {
|
|
109
|
-
routerModule = await import(
|
|
106
|
+
routerModule = await import(resolveAngularRuntimePath("@angular/router"));
|
|
110
107
|
} catch {
|
|
111
108
|
return [];
|
|
112
109
|
}
|
|
@@ -282,6 +279,8 @@ var resolvePageComponent = (pageModule) => {
|
|
|
282
279
|
};
|
|
283
280
|
var compilerImportPromise = null;
|
|
284
281
|
var ensureAngularCompiler = () => {
|
|
282
|
+
if (false)
|
|
283
|
+
;
|
|
285
284
|
if (!compilerImportPromise) {
|
|
286
285
|
compilerImportPromise = import(resolveAngularRuntimePath("@angular/compiler"));
|
|
287
286
|
}
|
|
@@ -316,7 +315,7 @@ var resolveRuntimeAngularModulePath = async (pagePath) => {
|
|
|
316
315
|
}
|
|
317
316
|
const outDir = resolveAngularSsrOutDir();
|
|
318
317
|
await ensureAngularSsrNodeModules(outDir);
|
|
319
|
-
const { compileAngularFileJIT } = await import("./chunk-
|
|
318
|
+
const { compileAngularFileJIT } = await import("./chunk-92fsjfpp.js");
|
|
320
319
|
const outputs = await compileAngularFileJIT(pagePath, outDir, process.cwd());
|
|
321
320
|
const expectedFileName = basename(pagePath).replace(/\.ts$/, ".js");
|
|
322
321
|
return outputs.find((output) => output.endsWith(`/${expectedFileName}`)) ?? outputs.find((output) => output.endsWith(`\\${expectedFileName}`)) ?? outputs[0] ?? pagePath;
|
|
@@ -385,14 +384,12 @@ var handleAngularPageRequest = async (input) => {
|
|
|
385
384
|
}
|
|
386
385
|
const hasIslands = typeof pageModule.__ABSOLUTE_PAGE_HAS_ISLANDS__ === "boolean" ? pageModule.__ABSOLUTE_PAGE_HAS_ISLANDS__ : false;
|
|
387
386
|
const usesLegacyAnimations = pageModule.__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ === true;
|
|
388
|
-
const
|
|
389
|
-
const deps = buildDeps(ssrResult, baseDeps);
|
|
387
|
+
const deps = baseDeps;
|
|
390
388
|
const tokenMap = discoverTokens(pageModule);
|
|
391
389
|
const selector = resolveSelector(deps, resolvedPagePath, PageComponent);
|
|
392
390
|
lastSelector = selector;
|
|
393
391
|
const htmlString = `<!DOCTYPE html><html>${resolvedHeadTag}<body><${selector}></${selector}></body></html>`;
|
|
394
|
-
|
|
395
|
-
resetSsrSanitizer();
|
|
392
|
+
resetSsrSanitizer();
|
|
396
393
|
const sanitizer = getSsrSanitizer(deps);
|
|
397
394
|
const pageProvidersExport = Reflect.get(pageModule, "providers");
|
|
398
395
|
const pageProviders = Array.isArray(pageProvidersExport) ? pageProvidersExport : [];
|
|
@@ -425,5 +422,5 @@ var handleAngularPageRequest = async (input) => {
|
|
|
425
422
|
|
|
426
423
|
export { handleAngularPageRequest };
|
|
427
424
|
|
|
428
|
-
//# debugId=
|
|
429
|
-
//# sourceMappingURL=chunk-
|
|
425
|
+
//# debugId=90BA6F5F775B36CE64756E2164756E21
|
|
426
|
+
//# sourceMappingURL=chunk-kwgh8rmg.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/angular/pageHandler.ts", "../src/angular/animationProviders.ts", "../src/angular/routerRedirectProviders.ts", "../src/angular/lowerServerIslands.ts", "../src/angular/ssrSanitizer.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { AsyncLocalStorage } from 'node:async_hooks';\nimport { mkdir, symlink } from 'node:fs/promises';\nimport { tmpdir } from 'node:os';\nimport { basename, dirname, join, resolve } from 'node:path';\nimport type { EnvironmentProviders, Provider, Type } from '@angular/core';\nimport type {\n\tAngularPageDefinition,\n\tAngularPagePropsOf\n} from '../../types/angular';\nimport { BASE_36_RADIX, RANDOM_ID_END_INDEX } from '../constants';\nimport { injectIslandPageContext } from '../core/islandPageContext';\nimport { ssrErrorPage } from '../utils/ssrErrorPage';\nimport {\n\tderivePageName,\n\trenderConventionError\n} from '../utils/resolveConvention';\nimport { setSsrContextGetter } from '../utils/registerClientScript';\nimport { getAngularDeps } from './angularDeps';\nimport { buildServerAnimationProviders } from './animationProviders';\nimport { buildRouterRedirectProviders } from './routerRedirectProviders';\nimport { lowerAngularServerIslands } from './lowerServerIslands';\nimport { getCurrentRouteRegistrationCallsite } from '../core/devRouteRegistrationCallsite';\nimport { getSsrSanitizer, resetSsrSanitizer } from './ssrSanitizer';\nimport {\n\ttype StreamingSlotEnhancerOptions,\n\twithRegisteredStreamingSlots\n} from '../core/responseEnhancers';\nimport {\n\tcaptureStreamingSlotWarningCallsite,\n\trunWithStreamingSlotWarningScope\n} from '../core/streamingSlotWarningScope';\nimport { isSsrCacheDirty, markSsrCacheDirty } from '../core/ssrCache';\nimport {\n\tbuildProviders,\n\tcacheRouteData,\n\tclearSelectorCache,\n\tdiscoverTokens,\n\tinjectSsrScripts,\n\trenderAngularApp,\n\tresolveSelector\n} from './ssrRender';\nimport { resolveAngularRuntimePath } from './resolveAngularPackage';\n\nlet lastSelector = 'angular-page';\ntype AngularPageRenderOptions = StreamingSlotEnhancerOptions & {\n\tcollectStreamingSlots?: boolean;\n};\ntype IsAny<T> = 0 extends 1 & T ? true : false;\ntype HasNoRequiredAngularProps<Props> =\n\tIsAny<Props> extends true ? true : keyof Props extends never ? true : false;\ntype AngularPageHasOptionalProps<Page> = Page extends {\n\tpage: AngularPageDefinition<infer Props>;\n}\n\t? HasNoRequiredAngularProps<Props>\n\t: Page extends { default: AngularPageDefinition<infer Props> }\n\t\t? HasNoRequiredAngularProps<Props>\n\t\t: HasNoRequiredAngularProps<AngularPagePropsOf<Page>>;\nexport type AngularPageRequestInput<\n\tPage = { page: AngularPageDefinition<Record<never, never>> }\n> = AngularPageRenderOptions & {\n\theadTag?: `<head>${string}</head>`;\n\tindexPath: string;\n\tpagePath: string;\n\t/** The incoming request. When provided, its URL is forwarded to\n\t * Angular's `renderApplication`, so `LocationStrategy.path()` and\n\t * Angular Router both see the real URL instead of `/`. Without it,\n\t * Router-based pages can't match anything but the root route. */\n\trequest?: Request;\n\t/** Per-request context made available through Angular's REQUEST_CONTEXT token. */\n\trequestContext?: unknown;\n\t/** Mutable response init made available through Angular's RESPONSE_INIT token. */\n\tresponseInit?: ResponseInit;\n} & (AngularPageHasOptionalProps<Page> extends true\n\t\t? { props?: NoInfer<AngularPagePropsOf<Page>> }\n\t\t: { props: NoInfer<AngularPagePropsOf<Page>> });\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n\ttypeof value === 'object' && value !== null;\n\nconst isAngularComponent = (value: unknown): value is Type<unknown> =>\n\ttypeof value === 'function';\n\nconst isAngularPageDefinition = (\n\tvalue: unknown\n): value is AngularPageDefinition<Record<string, unknown>> =>\n\tisRecord(value) && isAngularComponent(value.component);\n\nconst resolvePageComponent = (pageModule: Record<string, unknown>) => {\n\tconst page = Reflect.get(pageModule, 'page');\n\tif (isAngularPageDefinition(page)) {\n\t\treturn page.component;\n\t}\n\n\tconst defaultExport = pageModule.default;\n\tif (isAngularPageDefinition(defaultExport)) {\n\t\treturn defaultExport.component;\n\t}\n\n\tif (isAngularComponent(defaultExport)) {\n\t\treturn defaultExport;\n\t}\n\n\treturn Object.values(pageModule).find((value) => isAngularComponent(value));\n};\n\n// `@angular/compiler` is required at request time only in dev, where\n// `compileAngularFileJIT` produces partial declarations that need the\n// compiler facade to link. In production every partial has already been\n// linked at build time by the linker plugin, so the compiler isn't loaded\n// or shipped.\nlet compilerImportPromise: Promise<unknown> | null = null;\nconst ensureAngularCompiler = () => {\n\tif (process.env.NODE_ENV === 'production') return Promise.resolve();\n\tif (!compilerImportPromise) {\n\t\tcompilerImportPromise = import(\n\t\t\tresolveAngularRuntimePath('@angular/compiler')\n\t\t);\n\t}\n\n\treturn compilerImportPromise;\n};\n\nconst readAngularPageModule = (value: unknown) =>\n\tisRecord(value) ? value : null;\n\nconst resolveAngularSsrOutDir = () =>\n\tprocess.env.ABSOLUTE_ANGULAR_SSR_OUTDIR ??\n\tjoin(tmpdir(), 'absolutejs', 'generated', 'angular-ssr');\n\nconst ensureAngularSsrNodeModules = async (outDir: string) => {\n\tconst outRoot = resolve(dirname(dirname(outDir)));\n\tconst nodeModulesLink = join(outRoot, 'node_modules');\n\tif (process.env.ABSOLUTE_ANGULAR_SSR_OUTDIR) {\n\t\treturn;\n\t}\n\tif (nodeModulesLink === resolve(process.cwd(), 'node_modules')) {\n\t\treturn;\n\t}\n\tif (await Bun.file(nodeModulesLink).exists()) {\n\t\treturn;\n\t}\n\n\tawait mkdir(outRoot, { recursive: true });\n\ttry {\n\t\tawait symlink(\n\t\t\tresolve(process.cwd(), 'node_modules'),\n\t\t\tnodeModulesLink,\n\t\t\t'dir'\n\t\t);\n\t} catch (error) {\n\t\tif (\n\t\t\t!(error instanceof Error) ||\n\t\t\t!('code' in error) ||\n\t\t\terror.code !== 'EEXIST'\n\t\t) {\n\t\t\tthrow error;\n\t\t}\n\t}\n};\n\nconst resolveRuntimeAngularModulePath = async (pagePath: string) => {\n\tif (!pagePath.endsWith('.ts')) {\n\t\treturn pagePath;\n\t}\n\n\tconst outDir = resolveAngularSsrOutDir();\n\tawait ensureAngularSsrNodeModules(outDir);\n\tconst { compileAngularFileJIT } = await import('../build/compileAngular');\n\tconst outputs = await compileAngularFileJIT(\n\t\tpagePath,\n\t\toutDir,\n\t\tprocess.cwd()\n\t);\n\tconst expectedFileName = basename(pagePath).replace(/\\.ts$/, '.js');\n\n\treturn (\n\t\toutputs.find((output) => output.endsWith(`/${expectedFileName}`)) ??\n\t\toutputs.find((output) => output.endsWith(`\\\\${expectedFileName}`)) ??\n\t\toutputs[0] ??\n\t\tpagePath\n\t);\n};\n\nconst withHtmlContentType = (responseInit: ResponseInit = {}) => {\n\tconst headers = new Headers(responseInit.headers);\n\tif (!headers.has('Content-Type')) {\n\t\theaders.set('Content-Type', 'text/html');\n\t}\n\n\treturn { ...responseInit, headers };\n};\n\nconst resolveRequestRenderUrl = (request: Request | undefined) => {\n\tif (!request) return '/';\n\n\ttry {\n\t\tconst parsed = new URL(request.url);\n\n\t\treturn `${parsed.pathname}${parsed.search}`;\n\t} catch {\n\t\treturn '/';\n\t}\n};\n\nconst assertNoHandlerProviders = (input: Record<string, unknown>) => {\n\tif (!('providers' in input)) return;\n\n\tthrow new Error(\n\t\t'Angular handler providers are not supported. Export `providers` from the Angular page module, or inject REQUEST / REQUEST_CONTEXT for request-scoped data.'\n\t);\n};\n\nexport const invalidateAngularSsrCache = () => {\n\tmarkSsrCacheDirty('angular');\n\tclearSelectorCache();\n};\n\nconst angularSsrContext = new AsyncLocalStorage<string>();\nsetSsrContextGetter(() => angularSsrContext.getStore());\n\nexport const handleAngularPageRequest = async <\n\tPage = { page: AngularPageDefinition<Record<never, never>> }\n>(\n\tinput: AngularPageRequestInput<Page>\n) => {\n\tconst requestId = `angular_${Date.now()}_${Math.random().toString(BASE_36_RADIX).substring(2, RANDOM_ID_END_INDEX)}`;\n\n\treturn angularSsrContext.run(requestId, async () => {\n\t\tawait ensureAngularCompiler();\n\n\t\tconst resolvedHeadTag = input.headTag ?? '<head></head>';\n\t\tconst resolvedIndexPath = input.indexPath;\n\t\tconst options = input;\n\t\tconst resolvedPagePath = input.pagePath;\n\t\tconst maybeProps = input.props;\n\t\tconst responseInit = input.responseInit ?? {};\n\t\tconst resolvedUrl = resolveRequestRenderUrl(input.request);\n\n\t\t// Cache props + headTag for HMR replay — strip query strings\n\t\t// so cache-busted HMR paths match the original manifest path.\n\t\tcacheRouteData(resolvedPagePath, {\n\t\t\theadTag: resolvedHeadTag,\n\t\t\tprops: maybeProps\n\t\t});\n\n\t\tif (isSsrCacheDirty('angular')) {\n\t\t\tclearSelectorCache();\n\t\t\tconst script = resolvedIndexPath\n\t\t\t\t? `<script>import(${JSON.stringify(resolvedIndexPath)});</script>`\n\t\t\t\t: '';\n\t\t\tconst html = `<!DOCTYPE html><html>${resolvedHeadTag}<body><${lastSelector}></${lastSelector}>${script}</body></html>`;\n\n\t\t\treturn new Response(html, {\n\t\t\t\theaders: { 'Content-Type': 'text/html' }\n\t\t\t});\n\t\t}\n\n\t\ttry {\n\t\t\tassertNoHandlerProviders(input);\n\n\t\t\tconst handlerCallsite =\n\t\t\t\toptions?.collectStreamingSlots === true\n\t\t\t\t\t? undefined\n\t\t\t\t\t: (getCurrentRouteRegistrationCallsite() ??\n\t\t\t\t\t\tcaptureStreamingSlotWarningCallsite());\n\t\t\tconst renderPageResponse = async () => {\n\t\t\t\tconst baseDeps = await getAngularDeps();\n\t\t\t\tconst runtimePagePath =\n\t\t\t\t\tawait resolveRuntimeAngularModulePath(resolvedPagePath);\n\t\t\t\tconst importedPageModule: unknown = await import(\n\t\t\t\t\truntimePagePath\n\t\t\t\t);\n\t\t\t\tconst pageModule = readAngularPageModule(importedPageModule);\n\t\t\t\tif (!pageModule) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Invalid Angular page module: ${resolvedPagePath}`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tconst PageComponent = resolvePageComponent(pageModule);\n\t\t\t\tif (!isAngularComponent(PageComponent)) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Angular page module must export an Angular component: ${resolvedPagePath}`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tconst hasIslands =\n\t\t\t\t\ttypeof pageModule.__ABSOLUTE_PAGE_HAS_ISLANDS__ ===\n\t\t\t\t\t'boolean'\n\t\t\t\t\t\t? pageModule.__ABSOLUTE_PAGE_HAS_ISLANDS__\n\t\t\t\t\t\t: false;\n\t\t\t\tconst usesLegacyAnimations =\n\t\t\t\t\tpageModule.__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ ===\n\t\t\t\t\ttrue;\n\n\t\t\t\tconst deps = baseDeps;\n\n\t\t\t\tconst tokenMap = discoverTokens(pageModule);\n\t\t\t\tconst selector = resolveSelector(\n\t\t\t\t\tdeps,\n\t\t\t\t\tresolvedPagePath,\n\t\t\t\t\tPageComponent\n\t\t\t\t);\n\t\t\t\tlastSelector = selector;\n\n\t\t\t\tconst htmlString = `<!DOCTYPE html><html>${resolvedHeadTag}<body><${selector}></${selector}></body></html>`;\n\n\t\t\t\tresetSsrSanitizer();\n\t\t\t\tconst sanitizer = getSsrSanitizer(deps);\n\t\t\t\t// The page module's `providers` export is the source of truth\n\t\t\t\t// for page-level DI — `bootstrapApplication` reads it on the\n\t\t\t\t// client (see compileAngular.ts client bootstrap). Mirror that\n\t\t\t\t// on the server so anything that requires `provideRouter`,\n\t\t\t\t// `provideAnimations`, etc. resolves the same way during SSR.\n\t\t\t\tconst pageProvidersExport = Reflect.get(\n\t\t\t\t\tpageModule,\n\t\t\t\t\t'providers'\n\t\t\t\t);\n\t\t\t\tconst pageProviders: ReadonlyArray<\n\t\t\t\t\tProvider | EnvironmentProviders\n\t\t\t\t> = Array.isArray(pageProvidersExport)\n\t\t\t\t\t? pageProvidersExport\n\t\t\t\t\t: [];\n\t\t\t\tconst combinedProviders = [\n\t\t\t\t\t...(await buildRouterRedirectProviders(deps, responseInit)),\n\t\t\t\t\t...pageProviders,\n\t\t\t\t\t...(await buildServerAnimationProviders(\n\t\t\t\t\t\tusesLegacyAnimations\n\t\t\t\t\t))\n\t\t\t\t];\n\t\t\t\tconst providers = buildProviders(\n\t\t\t\t\tdeps,\n\t\t\t\t\tsanitizer,\n\t\t\t\t\tmaybeProps,\n\t\t\t\t\ttokenMap,\n\t\t\t\t\tinput.request,\n\t\t\t\t\tinput.requestContext,\n\t\t\t\t\tresponseInit,\n\t\t\t\t\tcombinedProviders\n\t\t\t\t);\n\n\t\t\t\tconst rawHtml: string = await renderAngularApp(\n\t\t\t\t\tdeps,\n\t\t\t\t\tPageComponent,\n\t\t\t\t\tproviders,\n\t\t\t\t\thtmlString,\n\t\t\t\t\tresolvedUrl\n\t\t\t\t);\n\t\t\t\tconst shouldProcessIslands =\n\t\t\t\t\thasIslands || rawHtml.includes('<absolute-island');\n\t\t\t\tconst htmlWithLoweredIslands = shouldProcessIslands\n\t\t\t\t\t? await lowerAngularServerIslands(rawHtml)\n\t\t\t\t\t: rawHtml;\n\n\t\t\t\tconst html = injectIslandPageContext(\n\t\t\t\t\tinjectSsrScripts(\n\t\t\t\t\t\thtmlWithLoweredIslands,\n\t\t\t\t\t\trequestId,\n\t\t\t\t\t\tresolvedIndexPath,\n\t\t\t\t\t\tmaybeProps\n\t\t\t\t\t),\n\t\t\t\t\t{ hasIslands: shouldProcessIslands }\n\t\t\t\t);\n\n\t\t\t\treturn new Response(html, withHtmlContentType(responseInit));\n\t\t\t};\n\n\t\t\treturn await runWithStreamingSlotWarningScope(\n\t\t\t\t() =>\n\t\t\t\t\toptions?.collectStreamingSlots === true\n\t\t\t\t\t\t? withRegisteredStreamingSlots(\n\t\t\t\t\t\t\t\trenderPageResponse,\n\t\t\t\t\t\t\t\toptions\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t: renderPageResponse(),\n\t\t\t\t{ handlerCallsite }\n\t\t\t);\n\t\t} catch (error) {\n\t\t\tconsole.error('[SSR] Angular render error:', error);\n\n\t\t\tconst pageName = derivePageName(resolvedPagePath);\n\t\t\tconst conventionResponse = await renderConventionError(\n\t\t\t\t'angular',\n\t\t\t\tpageName,\n\t\t\t\terror\n\t\t\t);\n\t\t\tif (conventionResponse) return conventionResponse;\n\n\t\t\treturn new Response(ssrErrorPage('angular', error), {\n\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\tstatus: 500\n\t\t\t});\n\t\t}\n\t});\n};\n",
|
|
6
|
+
"import type { EnvironmentProviders, Provider } from '@angular/core';\nimport { resolveAngularRuntimePath } from './resolveAngularPackage';\n\nlet noopAnimationProvidersPromise: Promise<\n\t(Provider | EnvironmentProviders)[]\n> | null = null;\n\nconst loadNoopAnimationProviders = async () => {\n\tconst animations = await import(\n\t\tresolveAngularRuntimePath('@angular/platform-browser/animations')\n\t);\n\n\treturn animations.provideNoopAnimations();\n};\n\nexport const buildServerAnimationProviders = (\n\tusesLegacyAnimations: boolean\n) => {\n\tif (!usesLegacyAnimations) return Promise.resolve([]);\n\n\tnoopAnimationProvidersPromise ??= loadNoopAnimationProviders();\n\n\treturn noopAnimationProvidersPromise;\n};\n",
|
|
7
|
+
"import type { EnvironmentProviders, Provider } from '@angular/core';\nimport type { AngularDeps } from '../../types/angular';\nimport { resolveAngularRuntimePath } from './resolveAngularPackage';\n\ntype AngularRouterModule = typeof import('@angular/router');\n\nconst DEFAULT_REDIRECT_STATUS = 302;\nconst SUCCESS_STATUS = 200;\n\nconst isRouterRedirectCancel = (\n\tevent: unknown,\n\trouterModule: AngularRouterModule\n) =>\n\tevent instanceof routerModule.NavigationCancel &&\n\tevent.code === routerModule.NavigationCancellationCode.Redirect;\n\nconst getNavigationStartUrl = (\n\tevent: unknown,\n\trouterModule: AngularRouterModule\n) => {\n\tif (!(event instanceof routerModule.NavigationStart)) return null;\n\n\treturn event.url;\n};\n\nconst applyRedirectResponse = (\n\tresponseInit: ResponseInit | undefined,\n\tlocation: string\n) => {\n\tif (!responseInit) return;\n\n\tconst headers = new Headers(responseInit.headers);\n\theaders.set('Location', location);\n\tresponseInit.headers = headers;\n\n\tif (\n\t\ttypeof responseInit.status === 'undefined' ||\n\t\tresponseInit.status === SUCCESS_STATUS\n\t) {\n\t\tresponseInit.status = DEFAULT_REDIRECT_STATUS;\n\t}\n};\n\nconst buildRedirectEventHandler = (\n\tresponseInit: ResponseInit | undefined,\n\trouterModule: AngularRouterModule\n) => {\n\tlet waitingForRedirectTarget = false;\n\n\treturn (event: unknown) => {\n\t\tif (isRouterRedirectCancel(event, routerModule)) {\n\t\t\twaitingForRedirectTarget = true;\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (!waitingForRedirectTarget) return;\n\n\t\tconst redirectUrl = getNavigationStartUrl(event, routerModule);\n\t\tif (!redirectUrl) return;\n\n\t\tapplyRedirectResponse(responseInit, redirectUrl);\n\t\twaitingForRedirectTarget = false;\n\t};\n};\n\nexport const buildRouterRedirectProviders = async (\n\tdeps: AngularDeps,\n\tresponseInit: ResponseInit | undefined\n) => {\n\tlet routerModule: AngularRouterModule;\n\n\ttry {\n\t\trouterModule = await import(\n\t\t\tresolveAngularRuntimePath('@angular/router')\n\t\t);\n\t} catch {\n\t\treturn [];\n\t}\n\n\treturn [\n\t\t{\n\t\t\tmulti: true,\n\t\t\tprovide: deps.ENVIRONMENT_INITIALIZER,\n\t\t\tuseValue: () => {\n\t\t\t\tconst router = deps.inject(routerModule.Router, {\n\t\t\t\t\toptional: true\n\t\t\t\t});\n\t\t\t\tif (!router) return;\n\n\t\t\t\trouter.events.subscribe(\n\t\t\t\t\tbuildRedirectEventHandler(responseInit, routerModule)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t] satisfies (Provider | EnvironmentProviders)[];\n};\n",
|
|
8
|
+
"import type {\n\tIslandFramework,\n\tIslandHydrate,\n\tRuntimeIslandRenderProps\n} from '../../types/island';\nimport { requireCurrentIslandRegistry } from '../core/currentIslandRegistry';\nimport { renderIslandMarkup } from '../core/renderIslandMarkup';\n\nconst ANGULAR_ISLAND_TAG_RE =\n\t/<absolute-island\\b([^>]*)>[\\s\\S]*?<\\/absolute-island>/gi;\nconst ATTRIBUTE_RE =\n\t/([A-Za-z_:][-A-Za-z0-9_:.]*)\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)')/g;\n\nconst islandFrameworks: IslandFramework[] = [\n\t'react',\n\t'svelte',\n\t'vue',\n\t'angular'\n];\n\nconst islandHydrationModes: IslandHydrate[] = [\n\t'load',\n\t'idle',\n\t'visible',\n\t'none'\n];\n\nconst decodeHtmlAttribute = (value: string) =>\n\tvalue\n\t\t.replaceAll('"', '\"')\n\t\t.replaceAll('"', '\"')\n\t\t.replaceAll(''', \"'\")\n\t\t.replaceAll(''', \"'\")\n\t\t.replaceAll('&', '&')\n\t\t.replaceAll('<', '<')\n\t\t.replaceAll('>', '>');\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n\ttypeof value === 'object' && value !== null;\n\nconst isIslandFramework = (value: string): value is IslandFramework =>\n\tislandFrameworks.some((framework) => framework === value);\n\nconst isIslandHydrate = (value: string): value is IslandHydrate =>\n\tislandHydrationModes.some((mode) => mode === value);\n\nconst parseAttributes = (attributeString: string) => {\n\tconst attributes = new Map<string, string>();\n\tlet match = ATTRIBUTE_RE.exec(attributeString);\n\n\twhile (match) {\n\t\tconst [, key, doubleQuotedValue, singleQuotedValue] = match;\n\t\tmatch = ATTRIBUTE_RE.exec(attributeString);\n\t\tif (!key) continue;\n\n\t\tattributes.set(\n\t\t\tkey,\n\t\t\tdecodeHtmlAttribute(doubleQuotedValue ?? singleQuotedValue ?? '')\n\t\t);\n\t}\n\n\tATTRIBUTE_RE.lastIndex = 0;\n\n\treturn attributes;\n};\n\nconst parseAngularIslandProps = (\n\tattributeString: string\n): RuntimeIslandRenderProps | null => {\n\tconst attributes = parseAttributes(attributeString);\n\tconst component = attributes.get('component');\n\tconst framework = attributes.get('framework');\n\tconst hydrate = attributes.get('hydrate') ?? 'load';\n\tconst serializedProps = attributes.get('data-abs-props') ?? '{}';\n\n\tif (!component || !framework) {\n\t\treturn null;\n\t}\n\n\tif (!isIslandFramework(framework) || !isIslandHydrate(hydrate)) {\n\t\treturn null;\n\t}\n\n\tlet parsedProps: Record<string, unknown> = {};\n\ttry {\n\t\tconst candidate: unknown = JSON.parse(serializedProps);\n\t\tparsedProps = isRecord(candidate) ? candidate : {};\n\t} catch {\n\t\t// parsedProps remains default {}\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tframework,\n\t\thydrate,\n\t\tprops: parsedProps\n\t};\n};\n\nexport const lowerAngularServerIslands = async (html: string) => {\n\tif (!ANGULAR_ISLAND_TAG_RE.test(html)) {\n\t\treturn html;\n\t}\n\n\tconst registry = requireCurrentIslandRegistry();\n\tANGULAR_ISLAND_TAG_RE.lastIndex = 0;\n\n\tconst segments: {\n\t\tbefore: string;\n\t\tprops: ReturnType<typeof parseAngularIslandProps>;\n\t\tfullMatch: string;\n\t}[] = [];\n\tlet lastIndex = 0;\n\tlet match = ANGULAR_ISLAND_TAG_RE.exec(html);\n\n\twhile (match) {\n\t\tconst [fullMatch, rawAttributeString] = match;\n\t\tconst attributeString = rawAttributeString ?? '';\n\t\tsegments.push({\n\t\t\tbefore: html.slice(lastIndex, match.index),\n\t\t\tfullMatch,\n\t\t\tprops: parseAngularIslandProps(attributeString)\n\t\t});\n\t\tlastIndex = match.index + fullMatch.length;\n\t\tmatch = ANGULAR_ISLAND_TAG_RE.exec(html);\n\t}\n\n\tANGULAR_ISLAND_TAG_RE.lastIndex = 0;\n\n\tconst renderedSegments = await Promise.all(\n\t\tsegments.map(\n\t\t\tasync (segment) =>\n\t\t\t\tsegment.before +\n\t\t\t\t(segment.props\n\t\t\t\t\t? await renderIslandMarkup(registry, segment.props)\n\t\t\t\t\t: segment.fullMatch)\n\t\t)\n\t);\n\n\treturn renderedSegments.join('') + html.slice(lastIndex);\n};\n",
|
|
9
|
+
"import type { SecurityContext } from '@angular/core';\nimport type { SafeValue } from '@angular/platform-browser';\nimport type { AngularDeps } from '../../types/angular';\n\nconst escapeHtml = (str: string) =>\n\tString(str)\n\t\t.replace(/&/g, '&')\n\t\t.replace(/</g, '<')\n\t\t.replace(/>/g, '>')\n\t\t.replace(/\"/g, '"');\n\nconst bypassValue = (value: string): SafeValue => ({\n\tchangingThisBreaksApplicationSecurity: value\n});\n\n// Deferred: SsrSanitizer class is built after deps load because it\n// extends DomSanitizer which comes from the lazy import. We cache the\n// class + singleton instance after the first request.\nlet ssrSanitizer: InstanceType<AngularDeps['DomSanitizer']> | null = null;\n\nexport const getSsrSanitizer = (deps: AngularDeps) => {\n\tif (ssrSanitizer) return ssrSanitizer;\n\n\tconst SsrSanitizerClass = class extends deps.DomSanitizer {\n\t\tsanitize(ctx: SecurityContext, value: SafeValue | string | null) {\n\t\t\tif (value === null) return null;\n\t\t\tlet strValue: string;\n\t\t\tlet isTrustedHtml = false;\n\t\t\tif (typeof value === 'string') {\n\t\t\t\tstrValue = value;\n\t\t\t} else if (\n\t\t\t\ttypeof value === 'object' &&\n\t\t\t\t'changingThisBreaksApplicationSecurity' in value\n\t\t\t) {\n\t\t\t\tstrValue = String(value.changingThisBreaksApplicationSecurity);\n\t\t\t\tisTrustedHtml = true;\n\t\t\t} else {\n\t\t\t\tstrValue = String(value);\n\t\t\t}\n\n\t\t\tif (ctx === deps.SecurityContext.HTML) {\n\t\t\t\tif (isTrustedHtml) {\n\t\t\t\t\treturn strValue;\n\t\t\t\t}\n\n\t\t\t\treturn escapeHtml(strValue);\n\t\t\t}\n\n\t\t\treturn strValue;\n\t\t}\n\t\tbypassSecurityTrustHtml(value: string) {\n\t\t\treturn bypassValue(value);\n\t\t}\n\t\tbypassSecurityTrustStyle(value: string) {\n\t\t\treturn bypassValue(value);\n\t\t}\n\t\tbypassSecurityTrustScript(value: string) {\n\t\t\treturn bypassValue(value);\n\t\t}\n\t\tbypassSecurityTrustUrl(value: string) {\n\t\t\treturn bypassValue(value);\n\t\t}\n\t\tbypassSecurityTrustResourceUrl(value: string) {\n\t\t\treturn bypassValue(value);\n\t\t}\n\t};\n\n\tssrSanitizer = new SsrSanitizerClass();\n\n\treturn ssrSanitizer;\n};\nexport const resetSsrSanitizer = () => {\n\tssrSanitizer = null;\n};\n"
|
|
10
|
+
],
|
|
11
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;;;ACAA,IAAI,gCAEO;AAEX,IAAM,6BAA6B,YAAY;AAAA,EAC9C,MAAM,aAAa,MAClB,iCAA0B,sCAAsC;AAAA,EAGjE,OAAO,WAAW,sBAAsB;AAAA;AAGlC,IAA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QAAQ,mBAAmB,IAClC,sBACA,CAAC;AAAA,QACJ,MAAM,oBAAoB;AAAA,UACzB,GAAI,MAAM,6BAA6B,MAAM,YAAY;AAAA,UACzD,GAAG;AAAA,UACH,GAAI,MAAM,8BACT,oBACD;AAAA,QACD;AAAA,QACA,MAAM,YAAY,eACjB,MACA,WACA,YACA,UACA,MAAM,SACN,MAAM,gBACN,cACA,iBACD;AAAA,QAEA,MAAM,UAAkB,MAAM,iBAC7B,MACA,eACA,WACA,YACA,WACD;AAAA,QACA,MAAM,uBACL,cAAc,QAAQ,SAAS,kBAAkB;AAAA,QAClD,MAAM,yBAAyB,uBAC5B,MAAM,0BAA0B,OAAO,IACvC;AAAA,QAEH,MAAM,OAAO,wBACZ,iBACC,wBACA,WACA,mBACA,UACD,GACA,EAAE,YAAY,qBAAqB,CACpC;AAAA,QAEA,OAAO,IAAI,SAAS,MAAM,oBAAoB,YAAY,CAAC;AAAA;AAAA,MAG5D,OAAO,MAAM,iCACZ,MACC,SAAS,0BAA0B,OAChC,6BACA,oBACA,OACD,IACC,mBAAmB,GACvB,EAAE,gBAAgB,CACnB;AAAA,MACC,OAAO,OAAO;AAAA,MACf,QAAQ,MAAM,+BAA+B,KAAK;AAAA,MAElD,MAAM,WAAW,eAAe,gBAAgB;AAAA,MAChD,MAAM,qBAAqB,MAAM,sBAChC,WACA,UACA,KACD;AAAA,MACA,IAAI;AAAA,QAAoB,OAAO;AAAA,MAE/B,OAAO,IAAI,SAAS,aAAa,WAAW,KAAK,GAAG;AAAA,QACnD,SAAS,EAAE,gBAAgB,YAAY;AAAA,QACvC,QAAQ;AAAA,MACT,CAAC;AAAA;AAAA,GAEF;AAAA;",
|
|
12
|
+
"debugId": "90BA6F5F775B36CE64756E2164756E21",
|
|
13
|
+
"names": []
|
|
14
|
+
}
|
|
@@ -40,7 +40,7 @@ var resolveAngularRuntimePath = (specifier) => {
|
|
|
40
40
|
return resolveAngularPackage(specifier);
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
-
export {
|
|
43
|
+
export { resolveAngularRuntimePath };
|
|
44
44
|
|
|
45
|
-
//# debugId=
|
|
46
|
-
//# sourceMappingURL=chunk-
|
|
45
|
+
//# debugId=962497DD515683EC64756E2164756E21
|
|
46
|
+
//# sourceMappingURL=chunk-m97ze5hz.js.map
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"import { existsSync, readFileSync } from 'node:fs';\nimport { join, resolve } from 'node:path';\n\n/**\n * Resolve Angular package paths from the compiled runtime node_modules first,\n * then the app's process.cwd()/node_modules, falling back to the bare specifier.\n * This prevents Bun's baked import.meta.dir from resolving Angular packages\n * from the absolutejs source tree instead of the consumer's project when\n * running from a published npm package.\n */\nexport const resolveAngularPackageDir = (specifier: string) => {\n\tconst fromCompiledRuntime = process.env.ABSOLUTE_BUILD_DIR\n\t\t? resolve(process.env.ABSOLUTE_BUILD_DIR, 'node_modules', specifier)\n\t\t: null;\n\tif (fromCompiledRuntime && existsSync(fromCompiledRuntime)) {\n\t\treturn fromCompiledRuntime;\n\t}\n\n\tconst fromProject = resolve(process.cwd(), 'node_modules', specifier);\n\n\tif (existsSync(fromProject)) {\n\t\treturn fromProject;\n\t}\n\n\treturn null;\n};\n\nconst resolvePackageEntry = (packageDir: string) => {\n\ttry {\n\t\tconst pkg = JSON.parse(\n\t\t\treadFileSync(join(packageDir, 'package.json'), 'utf-8')\n\t\t);\n\t\tconst rootExport = pkg.exports?.['.'];\n\t\tconst entry =\n\t\t\t(typeof rootExport === 'string'\n\t\t\t\t? rootExport\n\t\t\t\t: rootExport?.default) ??\n\t\t\tpkg.module ??\n\t\t\tpkg.main ??\n\t\t\t'index.js';\n\n\t\treturn join(packageDir, entry);\n\t} catch {\n\t\treturn packageDir;\n\t}\n};\n\nexport const resolveAngularPackage = (specifier: string) => {\n\tconst packageDir = resolveAngularPackageDir(specifier);\n\tif (packageDir) return resolvePackageEntry(packageDir);\n\n\treturn specifier;\n};\n\nconst toSafeVendorName = (specifier: string) =>\n\tspecifier.replace(/^@/, '').replace(/\\//g, '_');\n\n/** Prefer the linked Bun-target vendor file built by\n * `buildAngularServerVendor`. The file is at\n * `<ABSOLUTE_BUILD_DIR>/angular/vendor/server/<safe>.js`, which is what every\n * server bundle's `@angular/*` imports get rewritten to point at. Sharing\n * this path keeps SSR's class identity unified — the dual-package hazard\n * that produces NG0201 only appears when the runtime imports a *different*\n * copy from the bundles. Falls back to `resolveAngularPackage` (node_modules)\n * when no vendor file is available — e.g. running tests outside an\n * absolutejs build, or before the vendor pass completes. */\nexport const resolveAngularRuntimePath = (specifier: string) => {\n\tconst buildDir = process.env.ABSOLUTE_BUILD_DIR;\n\tif (buildDir) {\n\t\tconst vendorPath = join(\n\t\t\tbuildDir,\n\t\t\t'angular',\n\t\t\t'vendor',\n\t\t\t'server',\n\t\t\t`${toSafeVendorName(specifier)}.js`\n\t\t);\n\t\tif (existsSync(vendorPath)) return vendorPath;\n\t}\n\n\treturn resolveAngularPackage(specifier);\n};\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": ";;AAAA;AACA;AASO,IAAM,2BAA2B,CAAC,cAAsB;AAAA,EAC9D,MAAM,sBAAsB,QAAQ,IAAI,qBACrC,QAAQ,QAAQ,IAAI,oBAAoB,gBAAgB,SAAS,IACjE;AAAA,EACH,IAAI,uBAAuB,WAAW,mBAAmB,GAAG;AAAA,IAC3D,OAAO;AAAA,EACR;AAAA,EAEA,MAAM,cAAc,QAAQ,QAAQ,IAAI,GAAG,gBAAgB,SAAS;AAAA,EAEpE,IAAI,WAAW,WAAW,GAAG;AAAA,IAC5B,OAAO;AAAA,EACR;AAAA,EAEA,OAAO;AAAA;AAGR,IAAM,sBAAsB,CAAC,eAAuB;AAAA,EACnD,IAAI;AAAA,IACH,MAAM,MAAM,KAAK,MAChB,aAAa,KAAK,YAAY,cAAc,GAAG,OAAO,CACvD;AAAA,IACA,MAAM,aAAa,IAAI,UAAU;AAAA,IACjC,MAAM,SACJ,OAAO,eAAe,WACpB,aACA,YAAY,YACf,IAAI,UACJ,IAAI,QACJ;AAAA,IAED,OAAO,KAAK,YAAY,KAAK;AAAA,IAC5B,MAAM;AAAA,IACP,OAAO;AAAA;AAAA;AAIF,IAAM,wBAAwB,CAAC,cAAsB;AAAA,EAC3D,MAAM,aAAa,yBAAyB,SAAS;AAAA,EACrD,IAAI;AAAA,IAAY,OAAO,oBAAoB,UAAU;AAAA,EAErD,OAAO;AAAA;AAGR,IAAM,mBAAmB,CAAC,cACzB,UAAU,QAAQ,MAAM,EAAE,EAAE,QAAQ,OAAO,GAAG;AAWxC,IAAM,4BAA4B,CAAC,cAAsB;AAAA,EAC/D,MAAM,WAAW,QAAQ,IAAI;AAAA,EAC7B,IAAI,UAAU;AAAA,IACb,MAAM,aAAa,KAClB,UACA,WACA,UACA,UACA,GAAG,iBAAiB,SAAS,MAC9B;AAAA,IACA,IAAI,WAAW,UAAU;AAAA,MAAG,OAAO;AAAA,EACpC;AAAA,EAEA,OAAO,sBAAsB,SAAS;AAAA;",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "962497DD515683EC64756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
getAngularDeps,
|
|
4
4
|
withSuppressedAngularDevLogs
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-jpkjdgsk.js";
|
|
6
6
|
import {
|
|
7
7
|
getSsrContextId
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-pnscgw95.js";
|
|
9
9
|
import {
|
|
10
10
|
__require
|
|
11
11
|
} from "./chunk-bmgqm774.js";
|
|
@@ -181,4 +181,4 @@ var renderAngularIslandToHtml = async (component, props, islandId) => {
|
|
|
181
181
|
export { getAngularIslandSelector, mountAngularIsland, renderAngularIslandToHtml };
|
|
182
182
|
|
|
183
183
|
//# debugId=22272B760DC7CB5D64756E2164756E21
|
|
184
|
-
//# sourceMappingURL=chunk-
|
|
184
|
+
//# sourceMappingURL=chunk-p5zgj77m.js.map
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/utils/registerClientScript.ts
|
|
3
|
+
var scriptRegistry = new Map;
|
|
4
|
+
var requestCounter = 0;
|
|
5
|
+
var getRequestId = () => `req_${Date.now()}_${++requestCounter}`;
|
|
6
|
+
var ssrContextGetter = null;
|
|
7
|
+
var getSsrContextId = () => ssrContextGetter?.() || Object.getOwnPropertyDescriptor(globalThis, "__absolutejs_requestId")?.value;
|
|
8
|
+
var registerClientScript = (script, requestId) => {
|
|
9
|
+
const id = requestId || getSsrContextId() || getRequestId();
|
|
10
|
+
if (!scriptRegistry.has(id)) {
|
|
11
|
+
scriptRegistry.set(id, new Set);
|
|
12
|
+
}
|
|
13
|
+
scriptRegistry.get(id)?.add(script);
|
|
14
|
+
return id;
|
|
15
|
+
};
|
|
16
|
+
var setSsrContextGetter = (getter) => {
|
|
17
|
+
ssrContextGetter = getter;
|
|
18
|
+
};
|
|
19
|
+
if (typeof globalThis !== "undefined") {
|
|
20
|
+
Object.assign(globalThis, { registerClientScript });
|
|
21
|
+
}
|
|
22
|
+
var clearAllClientScripts = () => {
|
|
23
|
+
scriptRegistry.clear();
|
|
24
|
+
};
|
|
25
|
+
var generateClientScriptCode = (scripts) => {
|
|
26
|
+
if (scripts.length === 0) {
|
|
27
|
+
return "";
|
|
28
|
+
}
|
|
29
|
+
const scriptCode = scripts.map((script, index) => {
|
|
30
|
+
const funcString = script.toString();
|
|
31
|
+
const bodyMatch = funcString.match(/\{([\s\S]*)\}/);
|
|
32
|
+
if (!bodyMatch || !bodyMatch[1]) {
|
|
33
|
+
return "";
|
|
34
|
+
}
|
|
35
|
+
const body = bodyMatch[1].trim();
|
|
36
|
+
return `
|
|
37
|
+
(function() {
|
|
38
|
+
var executed = false;
|
|
39
|
+
function executeScript_${index}() {
|
|
40
|
+
if (executed) return;
|
|
41
|
+
executed = true;
|
|
42
|
+
${body}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (document.readyState === 'complete' || document.readyState === 'interactive') {
|
|
46
|
+
executeScript_${index}();
|
|
47
|
+
} else {
|
|
48
|
+
document.addEventListener('DOMContentLoaded', executeScript_${index});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Watch for hydration-added elements
|
|
52
|
+
var observer = new MutationObserver(function() {
|
|
53
|
+
executeScript_${index}();
|
|
54
|
+
if (executed) observer.disconnect();
|
|
55
|
+
});
|
|
56
|
+
if (!executed) {
|
|
57
|
+
observer.observe(document.body || document.documentElement, { childList: true, subtree: true });
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Single fallback timeout
|
|
61
|
+
setTimeout(function() {
|
|
62
|
+
executeScript_${index}();
|
|
63
|
+
observer.disconnect();
|
|
64
|
+
}, 1000);
|
|
65
|
+
})();`;
|
|
66
|
+
}).join(`
|
|
67
|
+
`);
|
|
68
|
+
return `<script>
|
|
69
|
+
(function() {
|
|
70
|
+
${scriptCode}
|
|
71
|
+
})();
|
|
72
|
+
</script>`;
|
|
73
|
+
};
|
|
74
|
+
var getAndClearClientScripts = (requestId) => {
|
|
75
|
+
const id = requestId || ssrContextGetter?.();
|
|
76
|
+
if (!id)
|
|
77
|
+
return [];
|
|
78
|
+
const scripts = scriptRegistry.get(id);
|
|
79
|
+
if (!scripts) {
|
|
80
|
+
return [];
|
|
81
|
+
}
|
|
82
|
+
const scriptArray = Array.from(scripts);
|
|
83
|
+
scriptRegistry.delete(id);
|
|
84
|
+
return scriptArray;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export { getSsrContextId, registerClientScript, setSsrContextGetter, clearAllClientScripts, generateClientScriptCode, getAndClearClientScripts };
|
|
88
|
+
|
|
89
|
+
//# debugId=9DFF481135ABC22A64756E2164756E21
|
|
90
|
+
//# sourceMappingURL=chunk-pnscgw95.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/utils/registerClientScript.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"/**\n * Utility for registering client-side scripts that need to run after Angular SSR hydration.\n *\n * This is necessary because Angular's lifecycle hooks don't always run reliably on the client\n * after SSR hydration, especially for event listeners attached to DOM elements.\n *\n * Usage in Angular components:\n * ```typescript\n * import { registerClientScript } from '@absolutejs/absolute';\n *\n * // Register an event listener script\n * registerClientScript(() => {\n * const element = document.querySelector('.my-element');\n * if (element) {\n * element.addEventListener('click', () => {\n * console.log('Clicked!');\n * });\n * }\n * });\n * ```\n *\n * The script will be automatically injected into the HTML response and executed on the client.\n */\n\n// Request-scoped registry for client scripts\n// Each request gets its own set of scripts to inject\nconst scriptRegistry = new Map<string, Set<() => void>>();\n\n// Generate a unique request ID for tracking scripts per request\nlet requestCounter = 0;\nconst getRequestId = () => `req_${Date.now()}_${++requestCounter}`;\n\n// Allow SSR frameworks to inject a request context getter (e.g. AsyncLocalStorage)\nlet ssrContextGetter: (() => string | undefined) | null = null;\nexport const getSsrContextId = () =>\n\tssrContextGetter?.() ||\n\tObject.getOwnPropertyDescriptor(globalThis, '__absolutejs_requestId')\n\t\t?.value;\nexport const registerClientScript = (\n\tscript: () => void,\n\trequestId?: string\n) => {\n\t// Try to get requestId from explicit arg, then Async Context, then global fallback\n\tconst id = requestId || getSsrContextId() || getRequestId();\n\n\tif (!scriptRegistry.has(id)) {\n\t\tscriptRegistry.set(id, new Set());\n\t}\n\n\tscriptRegistry.get(id)?.add(script);\n\n\treturn id;\n};\nexport const setSsrContextGetter = (getter: () => string | undefined) => {\n\tssrContextGetter = getter;\n};\n\n// Make registerClientScript available globally during SSR for Angular components\n// Using type assertion for globalThis extension\nif (typeof globalThis !== 'undefined') {\n\tObject.assign(globalThis, { registerClientScript });\n}\n\n/**\n * Get all registered scripts for a request and clear them.\n * This is called by the page handler after rendering.\n *\n * @param requestId - The request ID to get scripts for\n * @returns Array of script functions, or empty array if none registered\n */\nexport const clearAllClientScripts = () => {\n\tscriptRegistry.clear();\n};\nexport const generateClientScriptCode = (scripts: (() => void)[]) => {\n\tif (scripts.length === 0) {\n\t\treturn '';\n\t}\n\n\t// Convert functions to strings and wrap in IIFE\n\tconst scriptCode = scripts\n\t\t.map((script, index) => {\n\t\t\t// Get the function body as a string\n\t\t\tconst funcString = script.toString();\n\n\t\t\t// Extract the body (everything between { and })\n\t\t\tconst bodyMatch = funcString.match(/\\{([\\s\\S]*)\\}/);\n\t\t\tif (!bodyMatch || !bodyMatch[1]) {\n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\tconst body = bodyMatch[1].trim();\n\n\t\t\t// Wrap in IIFE with MutationObserver for DOM readiness\n\t\t\treturn `\n\t(function() {\n\t\tvar executed = false;\n\t\tfunction executeScript_${index}() {\n\t\t\tif (executed) return;\n\t\t\texecuted = true;\n\t\t\t${body}\n\t\t}\n\n\t\tif (document.readyState === 'complete' || document.readyState === 'interactive') {\n\t\t\texecuteScript_${index}();\n\t\t} else {\n\t\t\tdocument.addEventListener('DOMContentLoaded', executeScript_${index});\n\t\t}\n\n\t\t// Watch for hydration-added elements\n\t\tvar observer = new MutationObserver(function() {\n\t\t\texecuteScript_${index}();\n\t\t\tif (executed) observer.disconnect();\n\t\t});\n\t\tif (!executed) {\n\t\t\tobserver.observe(document.body || document.documentElement, { childList: true, subtree: true });\n\t\t}\n\n\t\t// Single fallback timeout\n\t\tsetTimeout(function() {\n\t\t\texecuteScript_${index}();\n\t\t\tobserver.disconnect();\n\t\t}, 1000);\n\t})();`;\n\t\t})\n\t\t.join('\\n');\n\n\treturn `<script>\n(function() {\n${scriptCode}\n})();\n</script>`;\n};\nexport const getAndClearClientScripts = (requestId?: string) => {\n\tconst id = requestId || ssrContextGetter?.();\n\tif (!id) return [];\n\n\tconst scripts = scriptRegistry.get(id);\n\tif (!scripts) {\n\t\treturn [];\n\t}\n\n\tconst scriptArray = Array.from(scripts);\n\tscriptRegistry.delete(id);\n\n\treturn scriptArray;\n};\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AAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBASA;AAAA;AAAA;AAAA;AAAA,GAIhB,EACA,KAAK;AAAA,CAAI;AAAA,EAEX,OAAO;AAAA;AAAA,EAEN;AAAA;AAAA;AAAA;AAIK,IAAM,2BAA2B,CAAC,cAAuB;AAAA,EAC/D,MAAM,KAAK,aAAa,mBAAmB;AAAA,EAC3C,IAAI,CAAC;AAAA,IAAI,OAAO,CAAC;AAAA,EAEjB,MAAM,UAAU,eAAe,IAAI,EAAE;AAAA,EACrC,IAAI,CAAC,SAAS;AAAA,IACb,OAAO,CAAC;AAAA,EACT;AAAA,EAEA,MAAM,cAAc,MAAM,KAAK,OAAO;AAAA,EACtC,eAAe,OAAO,EAAE;AAAA,EAExB,OAAO;AAAA;",
|
|
8
|
+
"debugId": "9DFF481135ABC22A64756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
computeAngularServerVendorPathsAsync,
|
|
7
7
|
computeAngularVendorPaths,
|
|
8
8
|
computeAngularVendorPathsAsync
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-1rfh7hw9.js";
|
|
10
10
|
import"./chunk-7kjj42xm.js";
|
|
11
11
|
import"./chunk-bmgqm774.js";
|
|
12
12
|
export {
|
|
@@ -19,4 +19,4 @@ export {
|
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
//# debugId=C6F3C3EFFE1C979664756E2164756E21
|
|
22
|
-
//# sourceMappingURL=chunk-
|
|
22
|
+
//# sourceMappingURL=chunk-r6e8pytx.js.map
|
package/dist/client/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
mountAngularIsland
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-p5zgj77m.js";
|
|
5
5
|
import {
|
|
6
6
|
initializeIslandMarkupSnapshot
|
|
7
7
|
} from "../chunk-fak944et.js";
|
|
8
|
-
import"../chunk-
|
|
9
|
-
import"../chunk-
|
|
10
|
-
import"../chunk-
|
|
8
|
+
import"../chunk-jpkjdgsk.js";
|
|
9
|
+
import"../chunk-m97ze5hz.js";
|
|
10
|
+
import"../chunk-pnscgw95.js";
|
|
11
11
|
import {
|
|
12
12
|
getStreamSwapRuntimeScript
|
|
13
13
|
} from "../chunk-s6defjk2.js";
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
logStartupTimingBlock,
|
|
15
15
|
setCurrentPageIslandMetadata,
|
|
16
16
|
transformCurrentStaticPageHtml
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-bgb8k1qs.js";
|
|
18
18
|
import {
|
|
19
19
|
disposeTailwindCompiler,
|
|
20
20
|
incrementalTailwindBuild,
|
|
@@ -66,14 +66,13 @@ import {
|
|
|
66
66
|
getSsrContextId,
|
|
67
67
|
registerClientScript,
|
|
68
68
|
setSsrContextGetter
|
|
69
|
-
} from "./chunk-
|
|
70
|
-
import"./chunk-0r32762k.js";
|
|
69
|
+
} from "./chunk-pnscgw95.js";
|
|
71
70
|
import"./chunk-s6defjk2.js";
|
|
72
71
|
import"./chunk-p5504p14.js";
|
|
73
72
|
import {
|
|
74
73
|
renderIslandMarkup,
|
|
75
74
|
renderIslandResult
|
|
76
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-9j59emg3.js";
|
|
77
76
|
import"./chunk-9ve9jq72.js";
|
|
78
77
|
import"./chunk-7fw6x3js.js";
|
|
79
78
|
import"./chunk-mbazhahf.js";
|
|
@@ -452,7 +451,7 @@ var prepareDev = async (config, buildDir) => {
|
|
|
452
451
|
patchElysiaRouteRegistrationCallsites();
|
|
453
452
|
recordStep("patch route registration", stepStartedAt);
|
|
454
453
|
stepStartedAt = performance.now();
|
|
455
|
-
const { devBuild } = await import("./chunk-
|
|
454
|
+
const { devBuild } = await import("./chunk-1x4fxm57.js");
|
|
456
455
|
const result = await devBuild(config);
|
|
457
456
|
recordStep("devBuild", stepStartedAt);
|
|
458
457
|
stepStartedAt = performance.now();
|
|
@@ -7282,5 +7281,5 @@ export {
|
|
|
7282
7281
|
ANGULAR_INIT_TIMEOUT_MS
|
|
7283
7282
|
};
|
|
7284
7283
|
|
|
7285
|
-
//# debugId=
|
|
7284
|
+
//# debugId=88F7788C5C4FEF4264756E2164756E21
|
|
7286
7285
|
//# sourceMappingURL=index.js.map
|