@absolutejs/absolute 0.19.0-beta.808 → 0.19.0-beta.809
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/browser.js +9801 -57
- package/dist/angular/browser.js.map +246 -4
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +14877 -60
- package/dist/angular/index.js.map +281 -4
- package/dist/angular/server.js +5610 -45
- package/dist/angular/server.js.map +51 -3
- package/dist/build.js +18092 -45
- package/dist/build.js.map +99 -3
- package/dist/cli/index.js +317 -86
- package/dist/client/index.js +1100 -40
- package/dist/client/index.js.map +24 -4
- package/dist/core/streamingSlotRegistrar.js +108 -11
- package/dist/core/streamingSlotRegistrar.js.map +4 -3
- package/dist/core/streamingSlotRegistry.js +169 -7
- package/dist/core/streamingSlotRegistry.js.map +5 -3
- package/dist/index.js +19957 -547
- package/dist/index.js.map +116 -3
- package/dist/islands/browser.js +228 -9
- package/dist/islands/browser.js.map +9 -4
- package/dist/islands/index.js +1908 -17
- package/dist/islands/index.js.map +27 -3
- package/dist/react/browser.js +328 -12
- package/dist/react/browser.js.map +12 -4
- package/dist/react/components/index.js +167 -16
- package/dist/react/components/index.js.map +6 -3
- package/dist/react/hooks/index.js +183 -8
- package/dist/react/hooks/index.js.map +7 -3
- package/dist/react/index.js +3627 -36
- package/dist/react/index.js.map +45 -4
- package/dist/react/jsxDevRuntimeCompat.js +61 -2
- package/dist/react/jsxDevRuntimeCompat.js.map +2 -2
- package/dist/react/server.js +1789 -18
- package/dist/react/server.js.map +21 -3
- package/dist/src/angular/injectorPatch.d.ts +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/svelte/browser.js +247 -12
- package/dist/svelte/browser.js.map +10 -3
- package/dist/svelte/index.js +3732 -37
- package/dist/svelte/index.js.map +47 -4
- package/dist/svelte/server.js +2794 -21
- package/dist/svelte/server.js.map +27 -3
- package/dist/vue/browser.js +348 -12
- package/dist/vue/browser.js.map +12 -4
- package/dist/vue/components/Image.js +240 -7
- package/dist/vue/components/Image.js.map +6 -3
- package/dist/vue/components/index.js +544 -11
- package/dist/vue/components/index.js.map +9 -3
- package/dist/vue/index.js +4212 -52
- package/dist/vue/index.js.map +50 -4
- package/dist/vue/server.js +1849 -18
- package/dist/vue/server.js.map +21 -3
- package/package.json +1 -1
- package/dist/chunk-0867j0r0.js +0 -136
- package/dist/chunk-0867j0r0.js.map +0 -10
- package/dist/chunk-0kdc6r16.js +0 -20
- package/dist/chunk-0kdc6r16.js.map +0 -10
- package/dist/chunk-102fp7xe.js +0 -63
- package/dist/chunk-102fp7xe.js.map +0 -10
- package/dist/chunk-11zpfqz6.js +0 -19
- package/dist/chunk-11zpfqz6.js.map +0 -10
- package/dist/chunk-1rfh7hw9.js +0 -319
- package/dist/chunk-1rfh7hw9.js.map +0 -11
- package/dist/chunk-25v9t56f.js +0 -29
- package/dist/chunk-25v9t56f.js.map +0 -11
- package/dist/chunk-2f21eenc.js +0 -21
- package/dist/chunk-2f21eenc.js.map +0 -10
- package/dist/chunk-2ga2znex.js +0 -13
- package/dist/chunk-2ga2znex.js.map +0 -9
- package/dist/chunk-30yrw0f6.js +0 -33
- package/dist/chunk-30yrw0f6.js.map +0 -10
- package/dist/chunk-38jwhqcw.js +0 -4410
- package/dist/chunk-38jwhqcw.js.map +0 -28
- package/dist/chunk-3g91wb4f.js +0 -358
- package/dist/chunk-3g91wb4f.js.map +0 -10
- package/dist/chunk-3yjzpcne.js +0 -34
- package/dist/chunk-3yjzpcne.js.map +0 -10
- package/dist/chunk-41bf6aqt.js +0 -17
- package/dist/chunk-41bf6aqt.js.map +0 -9
- package/dist/chunk-4d39r92n.js +0 -81
- package/dist/chunk-4d39r92n.js.map +0 -10
- package/dist/chunk-5003emhv.js +0 -17
- package/dist/chunk-5003emhv.js.map +0 -10
- package/dist/chunk-5f67rsed.js +0 -466
- package/dist/chunk-5f67rsed.js.map +0 -10
- package/dist/chunk-5fhp1jap.js +0 -9169
- package/dist/chunk-5fhp1jap.js.map +0 -236
- package/dist/chunk-6pdj08z3.js +0 -73
- package/dist/chunk-6pdj08z3.js.map +0 -12
- package/dist/chunk-6qjbrt0k.js +0 -13
- package/dist/chunk-6qjbrt0k.js.map +0 -9
- package/dist/chunk-6sccb4jr.js +0 -14
- package/dist/chunk-6sccb4jr.js.map +0 -9
- package/dist/chunk-798spvzv.js +0 -50
- package/dist/chunk-798spvzv.js.map +0 -10
- package/dist/chunk-7fw6x3js.js +0 -131
- package/dist/chunk-7fw6x3js.js.map +0 -11
- package/dist/chunk-7kjj42xm.js +0 -11
- package/dist/chunk-7kjj42xm.js.map +0 -10
- package/dist/chunk-7mtstdqn.js +0 -90
- package/dist/chunk-7mtstdqn.js.map +0 -10
- package/dist/chunk-851whwc7.js +0 -17
- package/dist/chunk-851whwc7.js.map +0 -10
- package/dist/chunk-85n68sy6.js +0 -103
- package/dist/chunk-85n68sy6.js.map +0 -10
- package/dist/chunk-8kcfffry.js +0 -35
- package/dist/chunk-8kcfffry.js.map +0 -10
- package/dist/chunk-8qqxc1h2.js +0 -426
- package/dist/chunk-8qqxc1h2.js.map +0 -14
- package/dist/chunk-92fsjfpp.js +0 -1731
- package/dist/chunk-92fsjfpp.js.map +0 -11
- package/dist/chunk-93sqk7be.js +0 -139
- package/dist/chunk-93sqk7be.js.map +0 -12
- package/dist/chunk-94gvx0hg.js +0 -28
- package/dist/chunk-94gvx0hg.js.map +0 -10
- package/dist/chunk-9c5tj4k3.js +0 -130
- package/dist/chunk-9c5tj4k3.js.map +0 -10
- package/dist/chunk-9ve9jq72.js +0 -203
- package/dist/chunk-9ve9jq72.js.map +0 -10
- package/dist/chunk-9xrsjeem.js +0 -12
- package/dist/chunk-9xrsjeem.js.map +0 -9
- package/dist/chunk-a9mvyp04.js +0 -87
- package/dist/chunk-a9mvyp04.js.map +0 -10
- package/dist/chunk-b3gbnrwe.js +0 -21
- package/dist/chunk-b3gbnrwe.js.map +0 -10
- package/dist/chunk-bmgqm774.js +0 -65
- package/dist/chunk-bmgqm774.js.map +0 -9
- package/dist/chunk-bxfghpma.js +0 -69
- package/dist/chunk-bxfghpma.js.map +0 -10
- package/dist/chunk-c1jfjnka.js +0 -74
- package/dist/chunk-c1jfjnka.js.map +0 -10
- package/dist/chunk-cbkrwmvh.js +0 -80
- package/dist/chunk-cbkrwmvh.js.map +0 -10
- package/dist/chunk-cdxd7sy2.js +0 -71
- package/dist/chunk-cdxd7sy2.js.map +0 -10
- package/dist/chunk-cg95827x.js +0 -21
- package/dist/chunk-cg95827x.js.map +0 -10
- package/dist/chunk-cm0g4q6w.js +0 -149
- package/dist/chunk-cm0g4q6w.js.map +0 -10
- package/dist/chunk-cwfy538a.js +0 -51
- package/dist/chunk-cwfy538a.js.map +0 -9
- package/dist/chunk-d7mwkzry.js +0 -261
- package/dist/chunk-d7mwkzry.js.map +0 -10
- package/dist/chunk-d8w0qm28.js +0 -184
- package/dist/chunk-d8w0qm28.js.map +0 -11
- package/dist/chunk-d9c0am65.js +0 -12
- package/dist/chunk-d9c0am65.js.map +0 -10
- package/dist/chunk-daqghmg8.js +0 -12
- package/dist/chunk-daqghmg8.js.map +0 -9
- package/dist/chunk-e3r9fxaa.js +0 -149
- package/dist/chunk-e3r9fxaa.js.map +0 -10
- package/dist/chunk-e8eecyrq.js +0 -244
- package/dist/chunk-e8eecyrq.js.map +0 -10
- package/dist/chunk-ex2hxe0v.js +0 -160
- package/dist/chunk-ex2hxe0v.js.map +0 -11
- package/dist/chunk-fak944et.js +0 -91
- package/dist/chunk-fak944et.js.map +0 -10
- package/dist/chunk-ff70rnhd.js +0 -672
- package/dist/chunk-ff70rnhd.js.map +0 -15
- package/dist/chunk-fygx2ymm.js +0 -118
- package/dist/chunk-fygx2ymm.js.map +0 -12
- package/dist/chunk-g15qj669.js +0 -271
- package/dist/chunk-g15qj669.js.map +0 -11
- package/dist/chunk-gd6wmknh.js +0 -121
- package/dist/chunk-gd6wmknh.js.map +0 -11
- package/dist/chunk-gf0ygptk.js +0 -85
- package/dist/chunk-gf0ygptk.js.map +0 -11
- package/dist/chunk-gytkmthr.js +0 -220
- package/dist/chunk-gytkmthr.js.map +0 -10
- package/dist/chunk-h5bbfn3n.js +0 -28
- package/dist/chunk-h5bbfn3n.js.map +0 -11
- package/dist/chunk-h6mye9r3.js +0 -93
- package/dist/chunk-h6mye9r3.js.map +0 -10
- package/dist/chunk-hcsmxw1v.js +0 -85
- package/dist/chunk-hcsmxw1v.js.map +0 -10
- package/dist/chunk-hyjs4bqs.js +0 -8
- package/dist/chunk-hyjs4bqs.js.map +0 -10
- package/dist/chunk-j88z31ep.js +0 -25
- package/dist/chunk-j88z31ep.js.map +0 -10
- package/dist/chunk-jn91vzkh.js +0 -66
- package/dist/chunk-jn91vzkh.js.map +0 -10
- package/dist/chunk-jpkjdgsk.js +0 -167
- package/dist/chunk-jpkjdgsk.js.map +0 -11
- package/dist/chunk-jwxt8gnp.js +0 -13
- package/dist/chunk-jwxt8gnp.js.map +0 -9
- package/dist/chunk-kk8w9rh5.js +0 -195
- package/dist/chunk-kk8w9rh5.js.map +0 -10
- package/dist/chunk-m97ze5hz.js +0 -46
- package/dist/chunk-m97ze5hz.js.map +0 -10
- package/dist/chunk-mbazhahf.js +0 -60
- package/dist/chunk-mbazhahf.js.map +0 -10
- package/dist/chunk-mgfwq18r.js +0 -15
- package/dist/chunk-mgfwq18r.js.map +0 -9
- package/dist/chunk-mtgf69xn.js +0 -88
- package/dist/chunk-mtgf69xn.js.map +0 -10
- package/dist/chunk-mtxzyxpg.js +0 -102
- package/dist/chunk-mtxzyxpg.js.map +0 -10
- package/dist/chunk-nehhtthw.js +0 -225
- package/dist/chunk-nehhtthw.js.map +0 -10
- package/dist/chunk-p5504p14.js +0 -16
- package/dist/chunk-p5504p14.js.map +0 -10
- package/dist/chunk-pnscgw95.js +0 -90
- package/dist/chunk-pnscgw95.js.map +0 -10
- package/dist/chunk-pvpp4pvs.js +0 -17
- package/dist/chunk-pvpp4pvs.js.map +0 -10
- package/dist/chunk-qh75agse.js +0 -95
- package/dist/chunk-qh75agse.js.map +0 -10
- package/dist/chunk-qxq2zcty.js +0 -52
- package/dist/chunk-qxq2zcty.js.map +0 -10
- package/dist/chunk-r6e8pytx.js +0 -22
- package/dist/chunk-r6e8pytx.js.map +0 -9
- package/dist/chunk-r7jmgqnw.js +0 -114
- package/dist/chunk-r7jmgqnw.js.map +0 -10
- package/dist/chunk-s6defjk2.js +0 -116
- package/dist/chunk-s6defjk2.js.map +0 -10
- package/dist/chunk-sd39p726.js +0 -619
- package/dist/chunk-sd39p726.js.map +0 -10
- package/dist/chunk-swrnzs4c.js +0 -63
- package/dist/chunk-swrnzs4c.js.map +0 -10
- package/dist/chunk-tfe3sb44.js +0 -33
- package/dist/chunk-tfe3sb44.js.map +0 -10
- package/dist/chunk-tjr0kcev.js +0 -41
- package/dist/chunk-tjr0kcev.js.map +0 -9
- package/dist/chunk-tx9edm1x.js +0 -34
- package/dist/chunk-tx9edm1x.js.map +0 -10
- package/dist/chunk-txhm2vb5.js +0 -18
- package/dist/chunk-txhm2vb5.js.map +0 -9
- package/dist/chunk-v5vmsxmy.js +0 -526
- package/dist/chunk-v5vmsxmy.js.map +0 -12
- package/dist/chunk-vjhxm8n2.js +0 -29
- package/dist/chunk-vjhxm8n2.js.map +0 -9
- package/dist/chunk-vkrpm7kc.js +0 -247
- package/dist/chunk-vkrpm7kc.js.map +0 -12
- package/dist/chunk-w3m4m5we.js +0 -4925
- package/dist/chunk-w3m4m5we.js.map +0 -12
- package/dist/chunk-wrxtn9ve.js +0 -18
- package/dist/chunk-wrxtn9ve.js.map +0 -10
- package/dist/chunk-wwzvp0zn.js +0 -192
- package/dist/chunk-wwzvp0zn.js.map +0 -10
- package/dist/chunk-x09cskqd.js +0 -377
- package/dist/chunk-x09cskqd.js.map +0 -10
- package/dist/chunk-xnt8c6h2.js +0 -576
- package/dist/chunk-xnt8c6h2.js.map +0 -10
- package/dist/chunk-xw0tx842.js +0 -13
- package/dist/chunk-xw0tx842.js.map +0 -9
- package/dist/chunk-xx5b6b9m.js +0 -69
- package/dist/chunk-xx5b6b9m.js.map +0 -10
- package/dist/chunk-xz1kdswj.js +0 -21
- package/dist/chunk-xz1kdswj.js.map +0 -9
- package/dist/chunk-y84qnsd3.js +0 -32
- package/dist/chunk-y84qnsd3.js.map +0 -10
- package/dist/chunk-ywjn0rad.js +0 -14
- package/dist/chunk-ywjn0rad.js.map +0 -9
- package/dist/chunk-z9nvhm6r.js +0 -13
- package/dist/chunk-z9nvhm6r.js.map +0 -9
- package/dist/chunk-zhmvdpk6.js +0 -15
- package/dist/chunk-zhmvdpk6.js.map +0 -9
- package/dist/chunk-zrg9d4zw.js +0 -784
- package/dist/chunk-zrg9d4zw.js.map +0 -10
package/dist/chunk-85n68sy6.js
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
// src/build/buildReactVendor.ts
|
|
3
|
-
import { existsSync, mkdirSync } from "fs";
|
|
4
|
-
import { join, resolve } from "path";
|
|
5
|
-
import { rm } from "fs/promises";
|
|
6
|
-
var {build: bunBuild } = globalThis.Bun;
|
|
7
|
-
var resolveJsxDevRuntimeCompatPath = () => {
|
|
8
|
-
const candidates = [
|
|
9
|
-
resolve(import.meta.dir, "react", "jsxDevRuntimeCompat.js"),
|
|
10
|
-
resolve(import.meta.dir, "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
11
|
-
resolve(import.meta.dir, "..", "react", "jsxDevRuntimeCompat.js"),
|
|
12
|
-
resolve(import.meta.dir, "..", "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
13
|
-
resolve(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
|
|
14
|
-
resolve(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
|
|
15
|
-
];
|
|
16
|
-
for (const candidate of candidates) {
|
|
17
|
-
if (existsSync(candidate)) {
|
|
18
|
-
return candidate.replace(/\\/g, "/");
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
return (candidates[0] ?? resolve(import.meta.dir, "react", "jsxDevRuntimeCompat.js")).replace(/\\/g, "/");
|
|
22
|
-
};
|
|
23
|
-
var jsxDevRuntimeCompatPath = resolveJsxDevRuntimeCompatPath();
|
|
24
|
-
var reactSpecifiers = [
|
|
25
|
-
"react",
|
|
26
|
-
"react-dom",
|
|
27
|
-
"react-dom/client",
|
|
28
|
-
"react/jsx-runtime",
|
|
29
|
-
"react/jsx-dev-runtime"
|
|
30
|
-
];
|
|
31
|
-
var isResolvable = (specifier) => {
|
|
32
|
-
try {
|
|
33
|
-
Bun.resolveSync(specifier, process.cwd());
|
|
34
|
-
return true;
|
|
35
|
-
} catch {
|
|
36
|
-
return false;
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
var resolveVendorSpecifiers = () => {
|
|
40
|
-
if (isResolvable("react-refresh/runtime")) {
|
|
41
|
-
return [...reactSpecifiers, "react-refresh/runtime"];
|
|
42
|
-
}
|
|
43
|
-
return reactSpecifiers;
|
|
44
|
-
};
|
|
45
|
-
var toSafeFileName = (specifier) => specifier.replace(/\//g, "_");
|
|
46
|
-
var computeVendorPaths = () => {
|
|
47
|
-
const paths = {};
|
|
48
|
-
for (const specifier of resolveVendorSpecifiers()) {
|
|
49
|
-
paths[specifier] = `/react/vendor/${toSafeFileName(specifier)}.js`;
|
|
50
|
-
}
|
|
51
|
-
return paths;
|
|
52
|
-
};
|
|
53
|
-
var generateEntrySource = async (specifier) => {
|
|
54
|
-
if (specifier === "react/jsx-dev-runtime") {
|
|
55
|
-
return `export { Fragment, jsxDEV } from '${jsxDevRuntimeCompatPath}';
|
|
56
|
-
`;
|
|
57
|
-
}
|
|
58
|
-
const mod = await import(specifier);
|
|
59
|
-
const exportNames = Object.keys(mod).filter((key) => key !== "default" && key !== "__esModule");
|
|
60
|
-
const lines = [];
|
|
61
|
-
if (exportNames.length > 0) {
|
|
62
|
-
lines.push(`export { ${exportNames.join(", ")} } from '${specifier}';`);
|
|
63
|
-
}
|
|
64
|
-
if ("default" in mod) {
|
|
65
|
-
lines.push(`export { default } from '${specifier}';`);
|
|
66
|
-
}
|
|
67
|
-
return `${lines.join(`
|
|
68
|
-
`)}
|
|
69
|
-
`;
|
|
70
|
-
};
|
|
71
|
-
var buildReactVendor = async (buildDir) => {
|
|
72
|
-
const vendorDir = join(buildDir, "react", "vendor");
|
|
73
|
-
mkdirSync(vendorDir, { recursive: true });
|
|
74
|
-
const tmpDir = join(buildDir, "_vendor_tmp");
|
|
75
|
-
mkdirSync(tmpDir, { recursive: true });
|
|
76
|
-
const specifiers = resolveVendorSpecifiers();
|
|
77
|
-
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
78
|
-
const safeName = toSafeFileName(specifier);
|
|
79
|
-
const entryPath = join(tmpDir, `${safeName}.ts`);
|
|
80
|
-
const source = await generateEntrySource(specifier);
|
|
81
|
-
await Bun.write(entryPath, source);
|
|
82
|
-
return entryPath;
|
|
83
|
-
}));
|
|
84
|
-
const result = await bunBuild({
|
|
85
|
-
entrypoints,
|
|
86
|
-
format: "esm",
|
|
87
|
-
minify: false,
|
|
88
|
-
naming: "[name].[ext]",
|
|
89
|
-
outdir: vendorDir,
|
|
90
|
-
splitting: true,
|
|
91
|
-
target: "browser",
|
|
92
|
-
throw: false
|
|
93
|
-
});
|
|
94
|
-
await rm(tmpDir, { force: true, recursive: true });
|
|
95
|
-
if (!result.success) {
|
|
96
|
-
console.warn("\u26A0\uFE0F React vendor build had errors:", result.logs);
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
export { computeVendorPaths, buildReactVendor };
|
|
101
|
-
|
|
102
|
-
//# debugId=DA15DD9162F09FED64756E2164756E21
|
|
103
|
-
//# sourceMappingURL=chunk-85n68sy6.js.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/build/buildReactVendor.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"import { existsSync, mkdirSync } from 'node:fs';\nimport { join, resolve } from 'node:path';\nimport { rm } from 'node:fs/promises';\nimport { build as bunBuild } from 'bun';\n\nconst resolveJsxDevRuntimeCompatPath = () => {\n\tconst candidates = [\n\t\tresolve(import.meta.dir, 'react', 'jsxDevRuntimeCompat.js'),\n\t\tresolve(import.meta.dir, 'src', 'react', 'jsxDevRuntimeCompat.ts'),\n\t\tresolve(import.meta.dir, '..', 'react', 'jsxDevRuntimeCompat.js'),\n\t\tresolve(import.meta.dir, '..', 'src', 'react', 'jsxDevRuntimeCompat.ts'),\n\t\tresolve(import.meta.dir, '..', '..', 'dist', 'react', 'jsxDevRuntimeCompat.js'),\n\t\tresolve(import.meta.dir, '..', '..', 'src', 'react', 'jsxDevRuntimeCompat.ts')\n\t];\n\tfor (const candidate of candidates) {\n\t\tif (existsSync(candidate)) {\n\t\t\treturn candidate.replace(/\\\\/g, '/');\n\t\t}\n\t}\n\n\treturn (candidates[0] ?? resolve(import.meta.dir, 'react', 'jsxDevRuntimeCompat.js')).replace(\n\t\t/\\\\/g,\n\t\t'/'\n\t);\n};\n\nconst jsxDevRuntimeCompatPath = resolveJsxDevRuntimeCompatPath();\n\n/** Bare specifiers that need stable vendor builds */\nconst reactSpecifiers = [\n\t'react',\n\t'react-dom',\n\t'react-dom/client',\n\t'react/jsx-runtime',\n\t'react/jsx-dev-runtime'\n];\n\nconst isResolvable = (specifier: string) => {\n\ttry {\n\t\tBun.resolveSync(specifier, process.cwd());\n\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n};\n\n/** Includes react-refresh/runtime when the package is installed (dev HMR) */\nconst resolveVendorSpecifiers = () => {\n\tif (isResolvable('react-refresh/runtime')) {\n\t\treturn [...reactSpecifiers, 'react-refresh/runtime'];\n\t}\n\n\treturn reactSpecifiers;\n};\n\n/** Convert a bare specifier to a safe filename: react-dom/client → react-dom_client */\nconst toSafeFileName = (specifier: string) =>\n\tspecifier.replace(/\\//g, '_');\n\n/** Compute the deterministic vendor paths mapping (no build needed).\n * This can be called before vendor files exist on disk. */\nexport const computeVendorPaths = () => {\n\tconst paths: Record<string, string> = {};\n\tfor (const specifier of resolveVendorSpecifiers()) {\n\t\tpaths[specifier] = `/react/vendor/${toSafeFileName(specifier)}.js`;\n\t}\n\n\treturn paths;\n};\n\n/** Introspect a package's exports at runtime and generate an entry file\n * with explicit named re-exports. This is necessary because React is a\n * CJS module — `export * from 'react'` can't statically determine the\n * export names, so Bun produces an empty re-export. */\nconst generateEntrySource = async (specifier: string) => {\n\tif (specifier === 'react/jsx-dev-runtime') {\n\t\treturn `export { Fragment, jsxDEV } from '${jsxDevRuntimeCompatPath}';\\n`;\n\t}\n\n\tconst mod = await import(specifier);\n\tconst exportNames = Object.keys(mod).filter(\n\t\t(key) => key !== 'default' && key !== '__esModule'\n\t);\n\n\tconst lines: string[] = [];\n\tif (exportNames.length > 0) {\n\t\tlines.push(`export { ${exportNames.join(', ')} } from '${specifier}';`);\n\t}\n\tif ('default' in mod) {\n\t\tlines.push(`export { default } from '${specifier}';`);\n\t}\n\n\treturn `${lines.join('\\n') }\\n`;\n};\n\n/** Build React packages into stable vendor files (no content hash).\n * Output goes to {buildDir}/react/vendor/ with predictable names like\n * react.js, react-dom_client.js, etc. These files never change between\n * rebuilds, so the browser always loads React from a single source. */\nexport const buildReactVendor = async (buildDir: string) => {\n\tconst vendorDir = join(buildDir, 'react', 'vendor');\n\tmkdirSync(vendorDir, { recursive: true });\n\n\tconst tmpDir = join(buildDir, '_vendor_tmp');\n\tmkdirSync(tmpDir, { recursive: true });\n\n\tconst specifiers = resolveVendorSpecifiers();\n\n\t// Create temp entry files with explicit named exports\n\tconst entrypoints = await Promise.all(\n\t\tspecifiers.map(async (specifier) => {\n\t\t\tconst safeName = toSafeFileName(specifier);\n\t\t\tconst entryPath = join(tmpDir, `${safeName}.ts`);\n\t\t\tconst source = await generateEntrySource(specifier);\n\t\t\tawait Bun.write(entryPath, source);\n\n\t\t\treturn entryPath;\n\t\t})\n\t);\n\n\tconst result = await bunBuild({\n\t\tentrypoints,\n\t\tformat: 'esm',\n\t\tminify: false,\n\t\tnaming: '[name].[ext]',\n\t\toutdir: vendorDir,\n\t\tsplitting: true,\n\t\ttarget: 'browser',\n\t\tthrow: false\n\t});\n\n\tawait rm(tmpDir, { force: true, recursive: true });\n\n\tif (!result.success) {\n\t\tconsole.warn('⚠️ React vendor build had errors:', result.logs);\n\t}\n};\n"
|
|
6
|
-
],
|
|
7
|
-
"mappings": "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",
|
|
8
|
-
"debugId": "DA15DD9162F09FED64756E2164756E21",
|
|
9
|
-
"names": []
|
|
10
|
-
}
|
package/dist/chunk-8kcfffry.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
// src/core/islands.ts
|
|
3
|
-
var defineIslandComponent = (component, options) => ({
|
|
4
|
-
component,
|
|
5
|
-
export: options.export,
|
|
6
|
-
source: options.source
|
|
7
|
-
});
|
|
8
|
-
var defineIslandRegistry = (registry) => registry;
|
|
9
|
-
var isRecord = (value) => typeof value === "object" && value !== null;
|
|
10
|
-
var getIslandBuildReference = (component) => {
|
|
11
|
-
if (!isIslandComponentDefinition(component))
|
|
12
|
-
return null;
|
|
13
|
-
return {
|
|
14
|
-
export: component.export,
|
|
15
|
-
source: component.source
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
var isIslandComponentDefinition = (value) => isRecord(value) && ("component" in value) && ("source" in value) && typeof value.source === "string";
|
|
19
|
-
function getIslandComponent(component) {
|
|
20
|
-
if (isIslandComponentDefinition(component)) {
|
|
21
|
-
return component.component;
|
|
22
|
-
}
|
|
23
|
-
return component;
|
|
24
|
-
}
|
|
25
|
-
var parseIslandProps = (rawProps) => {
|
|
26
|
-
if (!rawProps)
|
|
27
|
-
return {};
|
|
28
|
-
return JSON.parse(rawProps);
|
|
29
|
-
};
|
|
30
|
-
var serializeIslandProps = (props) => JSON.stringify(props ?? {});
|
|
31
|
-
|
|
32
|
-
export { defineIslandComponent, defineIslandRegistry, getIslandBuildReference, isIslandComponentDefinition, getIslandComponent, parseIslandProps, serializeIslandProps };
|
|
33
|
-
|
|
34
|
-
//# debugId=730C288CB38BBBFB64756E2164756E21
|
|
35
|
-
//# sourceMappingURL=chunk-8kcfffry.js.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/core/islands.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"import type {\n\tIslandComponentDefinition,\n\tIslandRegistry,\n\tIslandRegistryInput\n} from '../../types/island';\n\nexport const defineIslandComponent = <Component>(\n\tcomponent: Component,\n\toptions: {\n\t\texport?: string;\n\t\tsource: string;\n\t}\n): IslandComponentDefinition<Component> => ({\n\tcomponent,\n\texport: options.export,\n\tsource: options.source\n});\nexport const defineIslandRegistry = <T extends IslandRegistryInput>(\n\tregistry: IslandRegistry<T>\n) => registry;\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n\ttypeof value === 'object' && value !== null;\n\nexport const getIslandBuildReference = <Component>(\n\tcomponent: Component | IslandComponentDefinition<Component>\n) => {\n\tif (!isIslandComponentDefinition(component)) return null;\n\n\treturn {\n\t\texport: component.export,\n\t\tsource: component.source\n\t};\n};\nexport const isIslandComponentDefinition = <Component>(\n\tvalue: Component | IslandComponentDefinition<Component>\n): value is IslandComponentDefinition<Component> =>\n\tisRecord(value) &&\n\t'component' in value &&\n\t'source' in value &&\n\ttypeof value.source === 'string';\n\nexport function getIslandComponent<Component>(component: Component): Component;\nexport function getIslandComponent<Component>(\n\tcomponent: IslandComponentDefinition<Component>\n): Component;\nexport function getIslandComponent<Component>(\n\tcomponent: Component | IslandComponentDefinition<Component>\n) {\n\tif (isIslandComponentDefinition(component)) {\n\t\treturn component.component;\n\t}\n\n\treturn component;\n}\nexport const parseIslandProps = (rawProps: string | null) => {\n\tif (!rawProps) return {};\n\n\treturn JSON.parse(rawProps);\n};\nexport const serializeIslandProps = (props: unknown) =>\n\tJSON.stringify(props ?? {});\n\nexport {\n\tgetIslandManifestEntries,\n\tgetIslandManifestKey\n} from './islandManifest';\n"
|
|
6
|
-
],
|
|
7
|
-
"mappings": ";;AAMO,IAAM,wBAAwB,CACpC,WACA,aAI2C;AAAA,EAC3C;AAAA,EACA,QAAQ,QAAQ;AAAA,EAChB,QAAQ,QAAQ;AACjB;AACO,IAAM,uBAAuB,CACnC,aACI;AAEL,IAAM,WAAW,CAAC,UACjB,OAAO,UAAU,YAAY,UAAU;AAEjC,IAAM,0BAA0B,CACtC,cACI;AAAA,EACJ,IAAI,CAAC,4BAA4B,SAAS;AAAA,IAAG,OAAO;AAAA,EAEpD,OAAO;AAAA,IACN,QAAQ,UAAU;AAAA,IAClB,QAAQ,UAAU;AAAA,EACnB;AAAA;AAEM,IAAM,8BAA8B,CAC1C,UAEA,SAAS,KAAK,MACd,eAAe,WACf,YAAY,UACZ,OAAO,MAAM,WAAW;AAMlB,SAAS,kBAA6B,CAC5C,WACC;AAAA,EACD,IAAI,4BAA4B,SAAS,GAAG;AAAA,IAC3C,OAAO,UAAU;AAAA,EAClB;AAAA,EAEA,OAAO;AAAA;AAED,IAAM,mBAAmB,CAAC,aAA4B;AAAA,EAC5D,IAAI,CAAC;AAAA,IAAU,OAAO,CAAC;AAAA,EAEvB,OAAO,KAAK,MAAM,QAAQ;AAAA;AAEpB,IAAM,uBAAuB,CAAC,UACpC,KAAK,UAAU,SAAS,CAAC,CAAC;",
|
|
8
|
-
"debugId": "730C288CB38BBBFB64756E2164756E21",
|
|
9
|
-
"names": []
|
|
10
|
-
}
|
package/dist/chunk-8qqxc1h2.js
DELETED
|
@@ -1,426 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
buildProviders,
|
|
4
|
-
cacheRouteData,
|
|
5
|
-
clearSelectorCache,
|
|
6
|
-
discoverTokens,
|
|
7
|
-
getAngularDeps,
|
|
8
|
-
injectSsrScripts,
|
|
9
|
-
renderAngularApp,
|
|
10
|
-
resolveSelector
|
|
11
|
-
} from "./chunk-jpkjdgsk.js";
|
|
12
|
-
import {
|
|
13
|
-
resolveAngularRuntimePath
|
|
14
|
-
} from "./chunk-m97ze5hz.js";
|
|
15
|
-
import {
|
|
16
|
-
captureStreamingSlotWarningCallsite,
|
|
17
|
-
runWithStreamingSlotWarningScope,
|
|
18
|
-
ssrErrorPage
|
|
19
|
-
} from "./chunk-gd6wmknh.js";
|
|
20
|
-
import {
|
|
21
|
-
getCurrentRouteRegistrationCallsite
|
|
22
|
-
} from "./chunk-mtgf69xn.js";
|
|
23
|
-
import {
|
|
24
|
-
setSsrContextGetter
|
|
25
|
-
} from "./chunk-pnscgw95.js";
|
|
26
|
-
import {
|
|
27
|
-
derivePageName,
|
|
28
|
-
injectIslandPageContext,
|
|
29
|
-
renderConventionError,
|
|
30
|
-
withRegisteredStreamingSlots
|
|
31
|
-
} from "./chunk-v5vmsxmy.js";
|
|
32
|
-
import {
|
|
33
|
-
isSsrCacheDirty
|
|
34
|
-
} from "./chunk-d9c0am65.js";
|
|
35
|
-
import {
|
|
36
|
-
requireCurrentIslandRegistry
|
|
37
|
-
} from "./chunk-5003emhv.js";
|
|
38
|
-
import {
|
|
39
|
-
renderIslandMarkup
|
|
40
|
-
} from "./chunk-d8w0qm28.js";
|
|
41
|
-
import {
|
|
42
|
-
BASE_36_RADIX,
|
|
43
|
-
RANDOM_ID_END_INDEX
|
|
44
|
-
} from "./chunk-qh75agse.js";
|
|
45
|
-
import {
|
|
46
|
-
__require
|
|
47
|
-
} from "./chunk-bmgqm774.js";
|
|
48
|
-
|
|
49
|
-
// src/angular/pageHandler.ts
|
|
50
|
-
import { AsyncLocalStorage } from "async_hooks";
|
|
51
|
-
import { mkdir, symlink } from "fs/promises";
|
|
52
|
-
import { tmpdir } from "os";
|
|
53
|
-
import { basename, dirname, join, resolve } from "path";
|
|
54
|
-
|
|
55
|
-
// src/angular/animationProviders.ts
|
|
56
|
-
var noopAnimationProvidersPromise = null;
|
|
57
|
-
var loadNoopAnimationProviders = async () => {
|
|
58
|
-
const animations = await import(resolveAngularRuntimePath("@angular/platform-browser/animations"));
|
|
59
|
-
return animations.provideNoopAnimations();
|
|
60
|
-
};
|
|
61
|
-
var buildServerAnimationProviders = (usesLegacyAnimations) => {
|
|
62
|
-
if (!usesLegacyAnimations)
|
|
63
|
-
return Promise.resolve([]);
|
|
64
|
-
noopAnimationProvidersPromise ??= loadNoopAnimationProviders();
|
|
65
|
-
return noopAnimationProvidersPromise;
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
// src/angular/routerRedirectProviders.ts
|
|
69
|
-
var DEFAULT_REDIRECT_STATUS = 302;
|
|
70
|
-
var SUCCESS_STATUS = 200;
|
|
71
|
-
var isRouterRedirectCancel = (event, routerModule) => event instanceof routerModule.NavigationCancel && event.code === routerModule.NavigationCancellationCode.Redirect;
|
|
72
|
-
var getNavigationStartUrl = (event, routerModule) => {
|
|
73
|
-
if (!(event instanceof routerModule.NavigationStart))
|
|
74
|
-
return null;
|
|
75
|
-
return event.url;
|
|
76
|
-
};
|
|
77
|
-
var applyRedirectResponse = (responseInit, location) => {
|
|
78
|
-
if (!responseInit)
|
|
79
|
-
return;
|
|
80
|
-
const headers = new Headers(responseInit.headers);
|
|
81
|
-
headers.set("Location", location);
|
|
82
|
-
responseInit.headers = headers;
|
|
83
|
-
if (typeof responseInit.status === "undefined" || responseInit.status === SUCCESS_STATUS) {
|
|
84
|
-
responseInit.status = DEFAULT_REDIRECT_STATUS;
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
var buildRedirectEventHandler = (responseInit, routerModule) => {
|
|
88
|
-
let waitingForRedirectTarget = false;
|
|
89
|
-
return (event) => {
|
|
90
|
-
if (isRouterRedirectCancel(event, routerModule)) {
|
|
91
|
-
waitingForRedirectTarget = true;
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
if (!waitingForRedirectTarget)
|
|
95
|
-
return;
|
|
96
|
-
const redirectUrl = getNavigationStartUrl(event, routerModule);
|
|
97
|
-
if (!redirectUrl)
|
|
98
|
-
return;
|
|
99
|
-
applyRedirectResponse(responseInit, redirectUrl);
|
|
100
|
-
waitingForRedirectTarget = false;
|
|
101
|
-
};
|
|
102
|
-
};
|
|
103
|
-
var buildRouterRedirectProviders = async (deps, responseInit) => {
|
|
104
|
-
let routerModule;
|
|
105
|
-
try {
|
|
106
|
-
routerModule = await import(resolveAngularRuntimePath("@angular/router"));
|
|
107
|
-
} catch {
|
|
108
|
-
return [];
|
|
109
|
-
}
|
|
110
|
-
return [
|
|
111
|
-
{
|
|
112
|
-
multi: true,
|
|
113
|
-
provide: deps.ENVIRONMENT_INITIALIZER,
|
|
114
|
-
useValue: () => {
|
|
115
|
-
const router = deps.inject(routerModule.Router, {
|
|
116
|
-
optional: true
|
|
117
|
-
});
|
|
118
|
-
if (!router)
|
|
119
|
-
return;
|
|
120
|
-
router.events.subscribe(buildRedirectEventHandler(responseInit, routerModule));
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
];
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
// src/angular/lowerServerIslands.ts
|
|
127
|
-
var ANGULAR_ISLAND_TAG_RE = /<absolute-island\b([^>]*)>[\s\S]*?<\/absolute-island>/gi;
|
|
128
|
-
var ATTRIBUTE_RE = /([A-Za-z_:][-A-Za-z0-9_:.]*)\s*=\s*(?:"([^"]*)"|'([^']*)')/g;
|
|
129
|
-
var islandFrameworks = [
|
|
130
|
-
"react",
|
|
131
|
-
"svelte",
|
|
132
|
-
"vue",
|
|
133
|
-
"angular"
|
|
134
|
-
];
|
|
135
|
-
var islandHydrationModes = [
|
|
136
|
-
"load",
|
|
137
|
-
"idle",
|
|
138
|
-
"visible",
|
|
139
|
-
"none"
|
|
140
|
-
];
|
|
141
|
-
var decodeHtmlAttribute = (value) => value.replaceAll(""", '"').replaceAll(""", '"').replaceAll("'", "'").replaceAll("'", "'").replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">");
|
|
142
|
-
var isRecord = (value) => typeof value === "object" && value !== null;
|
|
143
|
-
var isIslandFramework = (value) => islandFrameworks.some((framework) => framework === value);
|
|
144
|
-
var isIslandHydrate = (value) => islandHydrationModes.some((mode) => mode === value);
|
|
145
|
-
var parseAttributes = (attributeString) => {
|
|
146
|
-
const attributes = new Map;
|
|
147
|
-
let match = ATTRIBUTE_RE.exec(attributeString);
|
|
148
|
-
while (match) {
|
|
149
|
-
const [, key, doubleQuotedValue, singleQuotedValue] = match;
|
|
150
|
-
match = ATTRIBUTE_RE.exec(attributeString);
|
|
151
|
-
if (!key)
|
|
152
|
-
continue;
|
|
153
|
-
attributes.set(key, decodeHtmlAttribute(doubleQuotedValue ?? singleQuotedValue ?? ""));
|
|
154
|
-
}
|
|
155
|
-
ATTRIBUTE_RE.lastIndex = 0;
|
|
156
|
-
return attributes;
|
|
157
|
-
};
|
|
158
|
-
var parseAngularIslandProps = (attributeString) => {
|
|
159
|
-
const attributes = parseAttributes(attributeString);
|
|
160
|
-
const component = attributes.get("component");
|
|
161
|
-
const framework = attributes.get("framework");
|
|
162
|
-
const hydrate = attributes.get("hydrate") ?? "load";
|
|
163
|
-
const serializedProps = attributes.get("data-abs-props") ?? "{}";
|
|
164
|
-
if (!component || !framework) {
|
|
165
|
-
return null;
|
|
166
|
-
}
|
|
167
|
-
if (!isIslandFramework(framework) || !isIslandHydrate(hydrate)) {
|
|
168
|
-
return null;
|
|
169
|
-
}
|
|
170
|
-
let parsedProps = {};
|
|
171
|
-
try {
|
|
172
|
-
const candidate = JSON.parse(serializedProps);
|
|
173
|
-
parsedProps = isRecord(candidate) ? candidate : {};
|
|
174
|
-
} catch {}
|
|
175
|
-
return {
|
|
176
|
-
component,
|
|
177
|
-
framework,
|
|
178
|
-
hydrate,
|
|
179
|
-
props: parsedProps
|
|
180
|
-
};
|
|
181
|
-
};
|
|
182
|
-
var lowerAngularServerIslands = async (html) => {
|
|
183
|
-
if (!ANGULAR_ISLAND_TAG_RE.test(html)) {
|
|
184
|
-
return html;
|
|
185
|
-
}
|
|
186
|
-
const registry = requireCurrentIslandRegistry();
|
|
187
|
-
ANGULAR_ISLAND_TAG_RE.lastIndex = 0;
|
|
188
|
-
const segments = [];
|
|
189
|
-
let lastIndex = 0;
|
|
190
|
-
let match = ANGULAR_ISLAND_TAG_RE.exec(html);
|
|
191
|
-
while (match) {
|
|
192
|
-
const [fullMatch, rawAttributeString] = match;
|
|
193
|
-
const attributeString = rawAttributeString ?? "";
|
|
194
|
-
segments.push({
|
|
195
|
-
before: html.slice(lastIndex, match.index),
|
|
196
|
-
fullMatch,
|
|
197
|
-
props: parseAngularIslandProps(attributeString)
|
|
198
|
-
});
|
|
199
|
-
lastIndex = match.index + fullMatch.length;
|
|
200
|
-
match = ANGULAR_ISLAND_TAG_RE.exec(html);
|
|
201
|
-
}
|
|
202
|
-
ANGULAR_ISLAND_TAG_RE.lastIndex = 0;
|
|
203
|
-
const renderedSegments = await Promise.all(segments.map(async (segment) => segment.before + (segment.props ? await renderIslandMarkup(registry, segment.props) : segment.fullMatch)));
|
|
204
|
-
return renderedSegments.join("") + html.slice(lastIndex);
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
// src/angular/ssrSanitizer.ts
|
|
208
|
-
var escapeHtml = (str) => String(str).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
209
|
-
var bypassValue = (value) => ({
|
|
210
|
-
changingThisBreaksApplicationSecurity: value
|
|
211
|
-
});
|
|
212
|
-
var ssrSanitizer = null;
|
|
213
|
-
var getSsrSanitizer = (deps) => {
|
|
214
|
-
if (ssrSanitizer)
|
|
215
|
-
return ssrSanitizer;
|
|
216
|
-
const SsrSanitizerClass = class extends deps.DomSanitizer {
|
|
217
|
-
sanitize(ctx, value) {
|
|
218
|
-
if (value === null)
|
|
219
|
-
return null;
|
|
220
|
-
let strValue;
|
|
221
|
-
let isTrustedHtml = false;
|
|
222
|
-
if (typeof value === "string") {
|
|
223
|
-
strValue = value;
|
|
224
|
-
} else if (typeof value === "object" && "changingThisBreaksApplicationSecurity" in value) {
|
|
225
|
-
strValue = String(value.changingThisBreaksApplicationSecurity);
|
|
226
|
-
isTrustedHtml = true;
|
|
227
|
-
} else {
|
|
228
|
-
strValue = String(value);
|
|
229
|
-
}
|
|
230
|
-
if (ctx === deps.SecurityContext.HTML) {
|
|
231
|
-
if (isTrustedHtml) {
|
|
232
|
-
return strValue;
|
|
233
|
-
}
|
|
234
|
-
return escapeHtml(strValue);
|
|
235
|
-
}
|
|
236
|
-
return strValue;
|
|
237
|
-
}
|
|
238
|
-
bypassSecurityTrustHtml(value) {
|
|
239
|
-
return bypassValue(value);
|
|
240
|
-
}
|
|
241
|
-
bypassSecurityTrustStyle(value) {
|
|
242
|
-
return bypassValue(value);
|
|
243
|
-
}
|
|
244
|
-
bypassSecurityTrustScript(value) {
|
|
245
|
-
return bypassValue(value);
|
|
246
|
-
}
|
|
247
|
-
bypassSecurityTrustUrl(value) {
|
|
248
|
-
return bypassValue(value);
|
|
249
|
-
}
|
|
250
|
-
bypassSecurityTrustResourceUrl(value) {
|
|
251
|
-
return bypassValue(value);
|
|
252
|
-
}
|
|
253
|
-
};
|
|
254
|
-
ssrSanitizer = new SsrSanitizerClass;
|
|
255
|
-
return ssrSanitizer;
|
|
256
|
-
};
|
|
257
|
-
var resetSsrSanitizer = () => {
|
|
258
|
-
ssrSanitizer = null;
|
|
259
|
-
};
|
|
260
|
-
|
|
261
|
-
// src/angular/pageHandler.ts
|
|
262
|
-
var lastSelector = "angular-page";
|
|
263
|
-
var isRecord2 = (value) => typeof value === "object" && value !== null;
|
|
264
|
-
var isAngularComponent = (value) => typeof value === "function";
|
|
265
|
-
var isAngularPageDefinition = (value) => isRecord2(value) && isAngularComponent(value.component);
|
|
266
|
-
var resolvePageComponent = (pageModule) => {
|
|
267
|
-
const page = Reflect.get(pageModule, "page");
|
|
268
|
-
if (isAngularPageDefinition(page)) {
|
|
269
|
-
return page.component;
|
|
270
|
-
}
|
|
271
|
-
const defaultExport = pageModule.default;
|
|
272
|
-
if (isAngularPageDefinition(defaultExport)) {
|
|
273
|
-
return defaultExport.component;
|
|
274
|
-
}
|
|
275
|
-
if (isAngularComponent(defaultExport)) {
|
|
276
|
-
return defaultExport;
|
|
277
|
-
}
|
|
278
|
-
return Object.values(pageModule).find((value) => isAngularComponent(value));
|
|
279
|
-
};
|
|
280
|
-
var compilerImportPromise = null;
|
|
281
|
-
var ensureAngularCompiler = () => {
|
|
282
|
-
if (false)
|
|
283
|
-
;
|
|
284
|
-
if (!compilerImportPromise) {
|
|
285
|
-
compilerImportPromise = import(resolveAngularRuntimePath("@angular/compiler"));
|
|
286
|
-
}
|
|
287
|
-
return compilerImportPromise;
|
|
288
|
-
};
|
|
289
|
-
var readAngularPageModule = (value) => isRecord2(value) ? value : null;
|
|
290
|
-
var resolveAngularSsrOutDir = () => process.env.ABSOLUTE_ANGULAR_SSR_OUTDIR ?? join(tmpdir(), "absolutejs", "generated", "angular-ssr");
|
|
291
|
-
var ensureAngularSsrNodeModules = async (outDir) => {
|
|
292
|
-
const outRoot = resolve(dirname(dirname(outDir)));
|
|
293
|
-
const nodeModulesLink = join(outRoot, "node_modules");
|
|
294
|
-
if (process.env.ABSOLUTE_ANGULAR_SSR_OUTDIR) {
|
|
295
|
-
return;
|
|
296
|
-
}
|
|
297
|
-
if (nodeModulesLink === resolve(process.cwd(), "node_modules")) {
|
|
298
|
-
return;
|
|
299
|
-
}
|
|
300
|
-
if (await Bun.file(nodeModulesLink).exists()) {
|
|
301
|
-
return;
|
|
302
|
-
}
|
|
303
|
-
await mkdir(outRoot, { recursive: true });
|
|
304
|
-
try {
|
|
305
|
-
await symlink(resolve(process.cwd(), "node_modules"), nodeModulesLink, "dir");
|
|
306
|
-
} catch (error) {
|
|
307
|
-
if (!(error instanceof Error) || !("code" in error) || error.code !== "EEXIST") {
|
|
308
|
-
throw error;
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
};
|
|
312
|
-
var resolveRuntimeAngularModulePath = async (pagePath) => {
|
|
313
|
-
if (!pagePath.endsWith(".ts")) {
|
|
314
|
-
return pagePath;
|
|
315
|
-
}
|
|
316
|
-
const outDir = resolveAngularSsrOutDir();
|
|
317
|
-
await ensureAngularSsrNodeModules(outDir);
|
|
318
|
-
const { compileAngularFileJIT } = await import("./chunk-92fsjfpp.js");
|
|
319
|
-
const outputs = await compileAngularFileJIT(pagePath, outDir, process.cwd());
|
|
320
|
-
const expectedFileName = basename(pagePath).replace(/\.ts$/, ".js");
|
|
321
|
-
return outputs.find((output) => output.endsWith(`/${expectedFileName}`)) ?? outputs.find((output) => output.endsWith(`\\${expectedFileName}`)) ?? outputs[0] ?? pagePath;
|
|
322
|
-
};
|
|
323
|
-
var withHtmlContentType = (responseInit = {}) => {
|
|
324
|
-
const headers = new Headers(responseInit.headers);
|
|
325
|
-
if (!headers.has("Content-Type")) {
|
|
326
|
-
headers.set("Content-Type", "text/html");
|
|
327
|
-
}
|
|
328
|
-
return { ...responseInit, headers };
|
|
329
|
-
};
|
|
330
|
-
var resolveRequestRenderUrl = (request) => {
|
|
331
|
-
if (!request)
|
|
332
|
-
return "/";
|
|
333
|
-
try {
|
|
334
|
-
const parsed = new URL(request.url);
|
|
335
|
-
return `${parsed.pathname}${parsed.search}`;
|
|
336
|
-
} catch {
|
|
337
|
-
return "/";
|
|
338
|
-
}
|
|
339
|
-
};
|
|
340
|
-
var assertNoHandlerProviders = (input) => {
|
|
341
|
-
if (!("providers" in input))
|
|
342
|
-
return;
|
|
343
|
-
throw new Error("Angular handler providers are not supported. Export `providers` from the Angular page module, or inject REQUEST / REQUEST_CONTEXT for request-scoped data.");
|
|
344
|
-
};
|
|
345
|
-
var angularSsrContext = new AsyncLocalStorage;
|
|
346
|
-
setSsrContextGetter(() => angularSsrContext.getStore());
|
|
347
|
-
var handleAngularPageRequest = async (input) => {
|
|
348
|
-
const requestId = `angular_${Date.now()}_${Math.random().toString(BASE_36_RADIX).substring(2, RANDOM_ID_END_INDEX)}`;
|
|
349
|
-
return angularSsrContext.run(requestId, async () => {
|
|
350
|
-
await ensureAngularCompiler();
|
|
351
|
-
const resolvedHeadTag = input.headTag ?? "<head></head>";
|
|
352
|
-
const resolvedIndexPath = input.indexPath;
|
|
353
|
-
const options = input;
|
|
354
|
-
const resolvedPagePath = input.pagePath;
|
|
355
|
-
const maybeProps = input.props;
|
|
356
|
-
const responseInit = input.responseInit ?? {};
|
|
357
|
-
const resolvedUrl = resolveRequestRenderUrl(input.request);
|
|
358
|
-
cacheRouteData(resolvedPagePath, {
|
|
359
|
-
headTag: resolvedHeadTag,
|
|
360
|
-
props: maybeProps
|
|
361
|
-
});
|
|
362
|
-
if (isSsrCacheDirty("angular")) {
|
|
363
|
-
clearSelectorCache();
|
|
364
|
-
const script = resolvedIndexPath ? `<script>import(${JSON.stringify(resolvedIndexPath)});</script>` : "";
|
|
365
|
-
const html = `<!DOCTYPE html><html>${resolvedHeadTag}<body><${lastSelector}></${lastSelector}>${script}</body></html>`;
|
|
366
|
-
return new Response(html, {
|
|
367
|
-
headers: { "Content-Type": "text/html" }
|
|
368
|
-
});
|
|
369
|
-
}
|
|
370
|
-
try {
|
|
371
|
-
assertNoHandlerProviders(input);
|
|
372
|
-
const handlerCallsite = options?.collectStreamingSlots === true ? undefined : getCurrentRouteRegistrationCallsite() ?? captureStreamingSlotWarningCallsite();
|
|
373
|
-
const renderPageResponse = async () => {
|
|
374
|
-
const baseDeps = await getAngularDeps();
|
|
375
|
-
const runtimePagePath = await resolveRuntimeAngularModulePath(resolvedPagePath);
|
|
376
|
-
const importedPageModule = await import(runtimePagePath);
|
|
377
|
-
const pageModule = readAngularPageModule(importedPageModule);
|
|
378
|
-
if (!pageModule) {
|
|
379
|
-
throw new Error(`Invalid Angular page module: ${resolvedPagePath}`);
|
|
380
|
-
}
|
|
381
|
-
const PageComponent = resolvePageComponent(pageModule);
|
|
382
|
-
if (!isAngularComponent(PageComponent)) {
|
|
383
|
-
throw new Error(`Angular page module must export an Angular component: ${resolvedPagePath}`);
|
|
384
|
-
}
|
|
385
|
-
const hasIslands = typeof pageModule.__ABSOLUTE_PAGE_HAS_ISLANDS__ === "boolean" ? pageModule.__ABSOLUTE_PAGE_HAS_ISLANDS__ : false;
|
|
386
|
-
const usesLegacyAnimations = pageModule.__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ === true;
|
|
387
|
-
const deps = baseDeps;
|
|
388
|
-
const tokenMap = discoverTokens(pageModule);
|
|
389
|
-
const selector = resolveSelector(deps, resolvedPagePath, PageComponent);
|
|
390
|
-
lastSelector = selector;
|
|
391
|
-
const htmlString = `<!DOCTYPE html><html>${resolvedHeadTag}<body><${selector}></${selector}></body></html>`;
|
|
392
|
-
resetSsrSanitizer();
|
|
393
|
-
const sanitizer = getSsrSanitizer(deps);
|
|
394
|
-
const pageProvidersExport = Reflect.get(pageModule, "providers");
|
|
395
|
-
const pageProviders = Array.isArray(pageProvidersExport) ? pageProvidersExport : [];
|
|
396
|
-
const combinedProviders = [
|
|
397
|
-
...await buildRouterRedirectProviders(deps, responseInit),
|
|
398
|
-
...pageProviders,
|
|
399
|
-
...await buildServerAnimationProviders(usesLegacyAnimations)
|
|
400
|
-
];
|
|
401
|
-
const providers = buildProviders(deps, sanitizer, maybeProps, tokenMap, input.request, input.requestContext, responseInit, combinedProviders);
|
|
402
|
-
const rawHtml = await renderAngularApp(deps, PageComponent, providers, htmlString, resolvedUrl);
|
|
403
|
-
const shouldProcessIslands = hasIslands || rawHtml.includes("<absolute-island");
|
|
404
|
-
const htmlWithLoweredIslands = shouldProcessIslands ? await lowerAngularServerIslands(rawHtml) : rawHtml;
|
|
405
|
-
const html = injectIslandPageContext(injectSsrScripts(htmlWithLoweredIslands, requestId, resolvedIndexPath, maybeProps), { hasIslands: shouldProcessIslands });
|
|
406
|
-
return new Response(html, withHtmlContentType(responseInit));
|
|
407
|
-
};
|
|
408
|
-
return await runWithStreamingSlotWarningScope(() => options?.collectStreamingSlots === true ? withRegisteredStreamingSlots(renderPageResponse, options) : renderPageResponse(), { handlerCallsite });
|
|
409
|
-
} catch (error) {
|
|
410
|
-
console.error("[SSR] Angular render error:", error);
|
|
411
|
-
const pageName = derivePageName(resolvedPagePath);
|
|
412
|
-
const conventionResponse = await renderConventionError("angular", pageName, error);
|
|
413
|
-
if (conventionResponse)
|
|
414
|
-
return conventionResponse;
|
|
415
|
-
return new Response(ssrErrorPage("angular", error), {
|
|
416
|
-
headers: { "Content-Type": "text/html" },
|
|
417
|
-
status: 500
|
|
418
|
-
});
|
|
419
|
-
}
|
|
420
|
-
});
|
|
421
|
-
};
|
|
422
|
-
|
|
423
|
-
export { handleAngularPageRequest };
|
|
424
|
-
|
|
425
|
-
//# debugId=169FECE93C6CCCB564756E2164756E21
|
|
426
|
-
//# sourceMappingURL=chunk-8qqxc1h2.js.map
|