@absolutejs/absolute 0.19.0-beta.807 → 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 +1091 -70
- 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/angular/islands.d.ts +1 -0
- package/dist/src/client/hydrators/react.d.ts +3 -0
- package/dist/src/client/hydrators/svelte.d.ts +2 -0
- package/dist/src/client/hydrators/vue.d.ts +2 -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-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-1x4fxm57.js +0 -51
- package/dist/chunk-1x4fxm57.js.map +0 -9
- 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-3g91wb4f.js +0 -358
- package/dist/chunk-3g91wb4f.js.map +0 -10
- package/dist/chunk-3rea1gam.js +0 -4403
- package/dist/chunk-3rea1gam.js.map +0 -28
- 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-629x0yh4.js +0 -20
- package/dist/chunk-629x0yh4.js.map +0 -9
- 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-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-9c5tj4k3.js +0 -130
- package/dist/chunk-9c5tj4k3.js.map +0 -10
- package/dist/chunk-9j59emg3.js +0 -184
- package/dist/chunk-9j59emg3.js.map +0 -11
- 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-bgb8k1qs.js +0 -672
- package/dist/chunk-bgb8k1qs.js.map +0 -15
- 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-d7mwkzry.js +0 -261
- package/dist/chunk-d7mwkzry.js.map +0 -10
- 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-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-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-kwgh8rmg.js +0 -426
- package/dist/chunk-kwgh8rmg.js.map +0 -14
- 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-p5zgj77m.js +0 -184
- package/dist/chunk-p5zgj77m.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-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
|
-
}
|