@renr/parcel-rsc-router 1.0.0-beta.12 → 1.0.0-beta.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/dist/esm/client-entry.mjs +1 -1
- package/dist/esm/client-entry.mjs.map +1 -1
- package/dist/esm/index.mjs +1 -0
- package/dist/esm/prerender.d.mts +20 -0
- package/dist/esm/prerender.d.mts.map +1 -0
- package/dist/esm/prerender.mjs +133 -0
- package/dist/esm/prerender.mjs.map +1 -0
- package/package.json +9 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @renr/parcel-rsc-router
|
|
2
2
|
|
|
3
|
-
A client-side router designed for React Server Components (RSC) applications built with Parcel
|
|
3
|
+
A client-side router designed for static React Server Components (RSC) applications built with Parcel 3.
|
|
4
4
|
|
|
5
5
|
⚠️ This package is an alpha / work in progress.
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ A client-side router designed for React Server Components (RSC) applications bui
|
|
|
8
8
|
|
|
9
9
|
- **Client-side navigation:** Navigate between pages using the `<Link>` component.
|
|
10
10
|
- **Route prefetching:** Automatically prefetches RSC payloads on hover or focus for instant navigation.
|
|
11
|
-
- **Type safety:** Type-safe route definitions via `@renr/parcel-
|
|
11
|
+
- **Type safety:** Type-safe route definitions via `@renr/parcel-plugin-rsc-router` (the Link's `to` prop is typed).
|
|
12
12
|
- **Programmatic navigation:** Control navigation programmatically using the `useRouter` hook.
|
|
13
13
|
- **Location access:** Access the current URL and its properties with the `useLocation` hook.
|
|
14
14
|
- **Route data access:** Retrieve data associated with the current route using the `useCurrentRoute` hook.
|
|
@@ -18,7 +18,7 @@ A client-side router designed for React Server Components (RSC) applications bui
|
|
|
18
18
|
|
|
19
19
|
## Installation
|
|
20
20
|
|
|
21
|
-
For the initial Parcel static RSC site setup see https://parceljs.org/recipes/rsc
|
|
21
|
+
For the initial Parcel static RSC site setup see https://v3.parceljs.org/recipes/rsc/, or check out the example app [here](https://github.com/renrizzolo/parcel-rsc-react/tree/main/apps/my-static-site).
|
|
22
22
|
|
|
23
23
|
Install the package using your preferred package manager:
|
|
24
24
|
|
|
@@ -30,14 +30,14 @@ npm install @renr/parcel-rsc-router
|
|
|
30
30
|
yarn add @renr/parcel-rsc-router
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
Install the required
|
|
33
|
+
Install the required Parcel config and plugin:
|
|
34
34
|
|
|
35
35
|
```bash
|
|
36
|
-
pnpm add @renr/parcel-
|
|
36
|
+
pnpm add -D @renr/parcel-config-rsc-router
|
|
37
37
|
# or
|
|
38
|
-
npm install @renr/parcel-
|
|
38
|
+
npm install -D @renr/parcel-config-rsc-router
|
|
39
39
|
# or
|
|
40
|
-
yarn add @renr/parcel-
|
|
40
|
+
yarn add -D @renr/parcel-config-rsc-router
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
## Usage
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-entry.mjs","names":[],"sources":["../../src/client-entry.ts"],"sourcesContent":["\"use client-entry\";\n\nimport { hydrate } from \"@parcel/rsc/client\";\nimport type { ReactNode } from \"react\";\n\nexport const updateRoot: (value: ReactNode, cb?: () => void) => void =\n hydrate();\n"],"mappings":";;;AAKA,MAAa,aACX,QAAQ"}
|
|
1
|
+
{"version":3,"file":"client-entry.mjs","names":[],"sources":["../../src/client-entry.ts"],"sourcesContent":["\"use client-entry\";\n\nimport { hydrate } from \"@parcel/rsc/client\";\nimport type { ReactNode } from \"react\";\n\nexport const updateRoot: (value: ReactNode, cb?: () => void) => void =\n typeof document !== \"undefined\" ? hydrate() : () => {};\n"],"mappings":";;;AAKA,MAAa,aACX,OAAO,aAAa,cAAc,QAAQ,UAAU,CAAC"}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { PageProps, RouteData, TocNode } from "./types.mjs";
|
|
2
|
+
import { ComponentType } from "react";
|
|
3
|
+
//#region src/prerender.d.ts
|
|
4
|
+
export interface PrerenderPageModule {
|
|
5
|
+
default: ComponentType<PageProps>;
|
|
6
|
+
tableOfContents?: TocNode[];
|
|
7
|
+
[key: string]: unknown;
|
|
8
|
+
}
|
|
9
|
+
export interface PrerenderOptions {
|
|
10
|
+
routes: RouteData[];
|
|
11
|
+
pages: Record<string, PrerenderPageModule>;
|
|
12
|
+
bootstrapComponent?: ComponentType;
|
|
13
|
+
outDir?: string;
|
|
14
|
+
staticDir?: string;
|
|
15
|
+
/** Maximum number of routes to prerender concurrently. Defaults to 6. */
|
|
16
|
+
concurrency?: number;
|
|
17
|
+
}
|
|
18
|
+
export declare function prerenderStaticSite({ routes, pages, bootstrapComponent, outDir, staticDir, concurrency }: PrerenderOptions): Promise<void>;
|
|
19
|
+
//#endregion
|
|
20
|
+
//# sourceMappingURL=prerender.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prerender.d.mts","names":[],"sources":["../../src/prerender.tsx"],"mappings":";;;iBAMiB;EACf,SAAS,cAAc;EACvB,kBAAkB;GACjB;;iBAGc;EACf,QAAQ;EACR,OAAO,eAAe;EACtB,qBAAqB;EACrB;EACA;;EAEA;;wBA6EoB,sBACpB,QACA,OACA,oBACA,QAGA,WACA,eACC,mBAAmB"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import fs from "node:fs/promises";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { renderHTML, renderRSC } from "@parcel/rsc/server";
|
|
5
|
+
//#region src/prerender.tsx
|
|
6
|
+
function hasBootstrapScript(value) {
|
|
7
|
+
return typeof value === "function" && typeof value.bootstrapScript === "string" && Boolean(value.bootstrapScript);
|
|
8
|
+
}
|
|
9
|
+
function findBootstrapInElement(node, depth = 0) {
|
|
10
|
+
if (depth > 5 || !node || typeof node !== "object") return;
|
|
11
|
+
if (Array.isArray(node)) {
|
|
12
|
+
for (const child of node) {
|
|
13
|
+
const found = findBootstrapInElement(child, depth + 1);
|
|
14
|
+
if (found) return found;
|
|
15
|
+
}
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const maybeElement = node;
|
|
19
|
+
if (hasBootstrapScript(maybeElement.type)) return maybeElement.type;
|
|
20
|
+
if (maybeElement.props && "children" in maybeElement.props) return findBootstrapInElement(maybeElement.props.children, depth + 1);
|
|
21
|
+
}
|
|
22
|
+
function resolveBootstrapComponent(PageComponent, props) {
|
|
23
|
+
var _PageComponent$constr;
|
|
24
|
+
if (hasBootstrapScript(PageComponent)) return PageComponent;
|
|
25
|
+
if (((_PageComponent$constr = PageComponent.constructor) === null || _PageComponent$constr === void 0 ? void 0 : _PageComponent$constr.name) === "AsyncFunction") return;
|
|
26
|
+
try {
|
|
27
|
+
const rendered = PageComponent(props);
|
|
28
|
+
if (rendered && typeof rendered === "object" && "then" in rendered && typeof rendered.then === "function") {
|
|
29
|
+
rendered.catch(() => {});
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
return findBootstrapInElement(rendered);
|
|
33
|
+
} catch (_unused) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
async function prerenderStaticSite({ routes, pages, bootstrapComponent, outDir = process.env.PARCEL_RSC_OUT_DIR ? path.resolve(process.env.PARCEL_RSC_OUT_DIR) : path.resolve(process.cwd(), "dist"), staticDir = path.resolve(process.cwd(), "static"), concurrency = 6 }) {
|
|
38
|
+
var _Object$values$find;
|
|
39
|
+
await fs.mkdir(outDir, { recursive: true });
|
|
40
|
+
try {
|
|
41
|
+
await fs.cp(staticDir, outDir, { recursive: true });
|
|
42
|
+
} catch (_unused2) {}
|
|
43
|
+
const allPages = routes.map((route) => {
|
|
44
|
+
const mod = pages[route.html];
|
|
45
|
+
const { default: _default, tableOfContents, ...exports } = mod !== null && mod !== void 0 ? mod : {};
|
|
46
|
+
return {
|
|
47
|
+
url: route.html,
|
|
48
|
+
name: route.slug,
|
|
49
|
+
exports,
|
|
50
|
+
tableOfContents
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
const probedBootstrapByRoute = /* @__PURE__ */ new Map();
|
|
54
|
+
let fallbackBootstrap = bootstrapComponent !== null && bootstrapComponent !== void 0 ? bootstrapComponent : (_Object$values$find = Object.values(pages).find((mod) => hasBootstrapScript(mod === null || mod === void 0 ? void 0 : mod.default))) === null || _Object$values$find === void 0 ? void 0 : _Object$values$find.default;
|
|
55
|
+
if (!fallbackBootstrap) for (const route of routes) {
|
|
56
|
+
const mod = pages[route.html];
|
|
57
|
+
if (!(mod === null || mod === void 0 ? void 0 : mod.default)) continue;
|
|
58
|
+
const { default: PageComponent, tableOfContents, ...exports } = mod;
|
|
59
|
+
const resolved = resolveBootstrapComponent(PageComponent, {
|
|
60
|
+
pages: allPages,
|
|
61
|
+
currentPage: {
|
|
62
|
+
url: route.html,
|
|
63
|
+
name: route.slug,
|
|
64
|
+
exports,
|
|
65
|
+
tableOfContents
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
probedBootstrapByRoute.set(route.html, resolved);
|
|
69
|
+
if (resolved) {
|
|
70
|
+
fallbackBootstrap = resolved;
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
const activeRoutes = routes.filter((route) => {
|
|
75
|
+
var _pages$route$html;
|
|
76
|
+
return Boolean((_pages$route$html = pages[route.html]) === null || _pages$route$html === void 0 ? void 0 : _pages$route$html.default);
|
|
77
|
+
});
|
|
78
|
+
const dirsToCreate = /* @__PURE__ */ new Set();
|
|
79
|
+
for (const route of activeRoutes) {
|
|
80
|
+
dirsToCreate.add(path.dirname(path.join(outDir, route.html.slice(1))));
|
|
81
|
+
dirsToCreate.add(path.dirname(path.join(outDir, route.rsc.slice(1))));
|
|
82
|
+
}
|
|
83
|
+
await Promise.all(Array.from(dirsToCreate, (dir) => fs.mkdir(dir, { recursive: true })));
|
|
84
|
+
const renderRoute = async (route) => {
|
|
85
|
+
const mod = pages[route.html];
|
|
86
|
+
if (!(mod === null || mod === void 0 ? void 0 : mod.default)) return;
|
|
87
|
+
const { default: PageComponent, tableOfContents, ...exports } = mod;
|
|
88
|
+
const currentPage = {
|
|
89
|
+
url: route.html,
|
|
90
|
+
name: route.slug,
|
|
91
|
+
exports,
|
|
92
|
+
tableOfContents
|
|
93
|
+
};
|
|
94
|
+
const pageProps = {
|
|
95
|
+
pages: allPages,
|
|
96
|
+
currentPage
|
|
97
|
+
};
|
|
98
|
+
const element = /* @__PURE__ */ jsx(PageComponent, { ...pageProps });
|
|
99
|
+
let componentWithBootstrap;
|
|
100
|
+
if (hasBootstrapScript(PageComponent)) componentWithBootstrap = PageComponent;
|
|
101
|
+
else if (bootstrapComponent) componentWithBootstrap = bootstrapComponent;
|
|
102
|
+
else if (probedBootstrapByRoute.has(route.html)) {
|
|
103
|
+
var _probedBootstrapByRou;
|
|
104
|
+
componentWithBootstrap = (_probedBootstrapByRou = probedBootstrapByRoute.get(route.html)) !== null && _probedBootstrapByRou !== void 0 ? _probedBootstrapByRou : fallbackBootstrap;
|
|
105
|
+
} else {
|
|
106
|
+
var _resolveBootstrapComp;
|
|
107
|
+
componentWithBootstrap = (_resolveBootstrapComp = resolveBootstrapComponent(PageComponent, pageProps)) !== null && _resolveBootstrapComp !== void 0 ? _resolveBootstrapComp : fallbackBootstrap;
|
|
108
|
+
}
|
|
109
|
+
const htmlFilePath = path.join(outDir, route.html.slice(1));
|
|
110
|
+
const rscFilePath = path.join(outDir, route.rsc.slice(1));
|
|
111
|
+
const [html, rsc] = await Promise.all([renderHTML(element, { component: componentWithBootstrap }).then((htmlStream) => new Response(htmlStream).text()), new Response(renderRSC(element)).text()]);
|
|
112
|
+
await Promise.all([fs.writeFile(htmlFilePath, html, "utf-8"), fs.writeFile(rscFilePath, rsc, "utf-8")]);
|
|
113
|
+
};
|
|
114
|
+
const workerCount = Math.max(1, Math.min(concurrency, activeRoutes.length));
|
|
115
|
+
let nextIndex = 0;
|
|
116
|
+
let aborted = false;
|
|
117
|
+
const workers = Array.from({ length: workerCount }, async () => {
|
|
118
|
+
while (!aborted && nextIndex < activeRoutes.length) {
|
|
119
|
+
const route = activeRoutes[nextIndex++];
|
|
120
|
+
if (route) try {
|
|
121
|
+
await renderRoute(route);
|
|
122
|
+
} catch (err) {
|
|
123
|
+
aborted = true;
|
|
124
|
+
throw err;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
await Promise.all(workers);
|
|
129
|
+
}
|
|
130
|
+
//#endregion
|
|
131
|
+
export { prerenderStaticSite };
|
|
132
|
+
|
|
133
|
+
//# sourceMappingURL=prerender.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prerender.mjs","names":[],"sources":["../../src/prerender.tsx"],"sourcesContent":["import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport type { ComponentType } from \"react\";\nimport { renderHTML, renderRSC } from \"@parcel/rsc/server\";\nimport type { Page, PageProps, RouteData, TocNode } from \"./types.js\";\n\nexport interface PrerenderPageModule {\n default: ComponentType<PageProps>;\n tableOfContents?: TocNode[];\n [key: string]: unknown;\n}\n\nexport interface PrerenderOptions {\n routes: RouteData[];\n pages: Record<string, PrerenderPageModule>;\n bootstrapComponent?: ComponentType;\n outDir?: string;\n staticDir?: string;\n /** Maximum number of routes to prerender concurrently. Defaults to 6. */\n concurrency?: number;\n}\n\nfunction hasBootstrapScript(\n value: unknown\n): value is ComponentType & { bootstrapScript: string } {\n return (\n typeof value === \"function\" &&\n typeof (value as { bootstrapScript?: unknown }).bootstrapScript ===\n \"string\" &&\n Boolean((value as { bootstrapScript?: string }).bootstrapScript)\n );\n}\n\nfunction findBootstrapInElement(\n node: unknown,\n depth = 0\n): ComponentType | undefined {\n if (depth > 5 || !node || typeof node !== \"object\") {\n return undefined;\n }\n\n if (Array.isArray(node)) {\n for (const child of node) {\n const found = findBootstrapInElement(child, depth + 1);\n if (found) {\n return found;\n }\n }\n return undefined;\n }\n\n const maybeElement = node as {\n type?: unknown;\n props?: { children?: unknown };\n };\n if (hasBootstrapScript(maybeElement.type)) {\n return maybeElement.type;\n }\n\n if (maybeElement.props && \"children\" in maybeElement.props) {\n return findBootstrapInElement(maybeElement.props.children, depth + 1);\n }\n\n return undefined;\n}\n\nfunction resolveBootstrapComponent(\n PageComponent: ComponentType<PageProps>,\n props: PageProps\n): ComponentType | undefined {\n if (hasBootstrapScript(PageComponent)) {\n return PageComponent as unknown as ComponentType;\n }\n\n // Avoid invoking async server components outside React's render lifecycle.\n if (PageComponent.constructor?.name === \"AsyncFunction\") {\n return undefined;\n }\n\n try {\n const rendered = (PageComponent as (p: PageProps) => unknown)(props);\n if (\n rendered &&\n typeof rendered === \"object\" &&\n \"then\" in rendered &&\n typeof (rendered as { then?: unknown }).then === \"function\"\n ) {\n (rendered as Promise<unknown>).catch(() => {});\n return undefined;\n }\n return findBootstrapInElement(rendered);\n } catch {\n return undefined;\n }\n}\n\nexport async function prerenderStaticSite({\n routes,\n pages,\n bootstrapComponent,\n outDir = process.env.PARCEL_RSC_OUT_DIR\n ? path.resolve(process.env.PARCEL_RSC_OUT_DIR)\n : path.resolve(process.cwd(), \"dist\"),\n staticDir = path.resolve(process.cwd(), \"static\"),\n concurrency = 6,\n}: PrerenderOptions): Promise<void> {\n await fs.mkdir(outDir, { recursive: true });\n\n try {\n await fs.cp(staticDir, outDir, { recursive: true });\n } catch {\n // ignore if staticDir doesn't exist\n }\n\n const allPages: Page[] = routes.map((route) => {\n const mod = pages[route.html];\n const { default: _default, tableOfContents, ...exports } = mod ?? {};\n return {\n url: route.html,\n name: route.slug,\n exports,\n tableOfContents,\n };\n });\n\n const probedBootstrapByRoute = new Map<string, ComponentType | undefined>();\n\n let fallbackBootstrap: ComponentType | undefined =\n bootstrapComponent ??\n (Object.values(pages).find((mod) => hasBootstrapScript(mod?.default))\n ?.default as ComponentType | undefined);\n\n // If no page module carries bootstrapScript directly (e.g. an MDX-only site where\n // `'use server-entry'` lives on the layout component wrapped by each `.mdx` file),\n // probe page wrappers until one yields a layout's bootstrapScript and cache the result\n // so that route is not invoked twice.\n if (!fallbackBootstrap) {\n for (const route of routes) {\n const mod = pages[route.html];\n if (!mod?.default) continue;\n const { default: PageComponent, tableOfContents, ...exports } = mod;\n const resolved = resolveBootstrapComponent(PageComponent, {\n pages: allPages,\n currentPage: {\n url: route.html,\n name: route.slug,\n exports,\n tableOfContents,\n },\n });\n probedBootstrapByRoute.set(route.html, resolved);\n if (resolved) {\n fallbackBootstrap = resolved;\n break;\n }\n }\n }\n\n const activeRoutes = routes.filter((route) =>\n Boolean(pages[route.html]?.default)\n );\n\n // Pre-create all unique output subdirectories once up front.\n const dirsToCreate = new Set<string>();\n for (const route of activeRoutes) {\n dirsToCreate.add(path.dirname(path.join(outDir, route.html.slice(1))));\n dirsToCreate.add(path.dirname(path.join(outDir, route.rsc.slice(1))));\n }\n await Promise.all(\n Array.from(dirsToCreate, (dir) => fs.mkdir(dir, { recursive: true }))\n );\n\n const renderRoute = async (route: RouteData): Promise<void> => {\n const mod = pages[route.html];\n if (!mod?.default) return;\n\n const { default: PageComponent, tableOfContents, ...exports } = mod;\n const currentPage: PageProps[\"currentPage\"] = {\n url: route.html,\n name: route.slug,\n exports,\n tableOfContents,\n };\n\n const pageProps: PageProps = {\n pages: allPages,\n currentPage,\n };\n\n const element = <PageComponent {...pageProps} />;\n\n let componentWithBootstrap: ComponentType | undefined;\n if (hasBootstrapScript(PageComponent)) {\n componentWithBootstrap = PageComponent as unknown as ComponentType;\n } else if (bootstrapComponent) {\n componentWithBootstrap = bootstrapComponent;\n } else if (probedBootstrapByRoute.has(route.html)) {\n componentWithBootstrap =\n probedBootstrapByRoute.get(route.html) ?? fallbackBootstrap;\n } else {\n componentWithBootstrap =\n resolveBootstrapComponent(PageComponent, pageProps) ??\n fallbackBootstrap;\n }\n\n const htmlFilePath = path.join(outDir, route.html.slice(1));\n const rscFilePath = path.join(outDir, route.rsc.slice(1));\n\n const [html, rsc] = await Promise.all([\n renderHTML(element, { component: componentWithBootstrap }).then(\n (htmlStream) => new Response(htmlStream).text()\n ),\n new Response(renderRSC(element)).text(),\n ]);\n\n await Promise.all([\n fs.writeFile(htmlFilePath, html, \"utf-8\"),\n fs.writeFile(rscFilePath, rsc, \"utf-8\"),\n ]);\n };\n\n const workerCount = Math.max(1, Math.min(concurrency, activeRoutes.length));\n let nextIndex = 0;\n let aborted = false;\n\n const workers = Array.from({ length: workerCount }, async () => {\n while (!aborted && nextIndex < activeRoutes.length) {\n const route = activeRoutes[nextIndex++];\n if (route) {\n try {\n await renderRoute(route);\n } catch (err) {\n aborted = true;\n throw err;\n }\n }\n }\n });\n\n await Promise.all(workers);\n}\n"],"mappings":";;;;;AAsBA,SAAS,mBACP,OACsD;CACtD,OACE,OAAO,UAAU,cACjB,OAAQ,MAAwC,oBAC9C,YACF,QAAS,MAAuC,eAAe;AAEnE;AAEA,SAAS,uBACP,MACA,QAAQ,GACmB;CAC3B,IAAI,QAAQ,KAAK,CAAC,QAAQ,OAAO,SAAS,UACxC;CAGF,IAAI,MAAM,QAAQ,IAAI,GAAG;EACvB,KAAK,MAAM,SAAS,MAAM;GACxB,MAAM,QAAQ,uBAAuB,OAAO,QAAQ,CAAC;GACrD,IAAI,OACF,OAAO;EAEX;EACA;CACF;CAEA,MAAM,eAAe;CAIrB,IAAI,mBAAmB,aAAa,IAAI,GACtC,OAAO,aAAa;CAGtB,IAAI,aAAa,SAAS,cAAc,aAAa,OACnD,OAAO,uBAAuB,aAAa,MAAM,UAAU,QAAQ,CAAC;AAIxE;AAEA,SAAS,0BACP,eACA,OAC2B;;CAC3B,IAAI,mBAAmB,aAAa,GAClC,OAAO;CAIT,MAAA,wBAAI,cAAc,iBAAA,QAAA,0BAAA,KAAA,IAAA,KAAA,IAAA,sBAAa,UAAS,iBACtC;CAGF,IAAI;EACF,MAAM,WAAY,cAA4C,KAAK;EACnE,IACE,YACA,OAAO,aAAa,YACpB,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AA,IAAA,wBAAK;EAC9C,OAAO;;GACL,0BAAA,wBACE,0BAA0B,eAAe,SAAS,OAAA,QAAA,0BAAA,KAAA,IAAA,wBAClD;EACJ;EAEA,MAAM,eAAe,KAAK,KAAK,QAAQ,MAAM,KAAK,MAAM,CAAC,CAAC;EAC1D,MAAM,cAAc,KAAK,KAAK,QAAQ,MAAM,IAAI,MAAM,CAAC,CAAC;EAExD,MAAM,CAAC,MAAM,OAAO,MAAM,QAAQ,IAAI,CACpC,WAAW,SAAS,EAAE,WAAW,uBAAuB,CAAC,CAAC,CAAC,MACxD,eAAe,IAAI,SAAS,UAAU,CAAC,CAAC,KAAK,CAChD,GACA,IAAI,SAAS,UAAU,OAAO,CAAC,CAAC,CAAC,KAAK,CACxC,CAAC;EAED,MAAM,QAAQ,IAAI,CAChB,GAAG,UAAU,cAAc,MAAM,OAAO,GACxC,GAAG,UAAU,aAAa,KAAK,OAAO,CACxC,CAAC;CACH;CAEA,MAAM,cAAc,KAAK,IAAI,GAAG,KAAK,IAAI,aAAa,aAAa,MAAM,CAAC;CAC1E,IAAI,YAAY;CAChB,IAAI,UAAU;CAEd,MAAM,UAAU,MAAM,KAAK,EAAE,QAAQ,YAAY,GAAG,YAAY;EAC9D,OAAO,CAAC,WAAW,YAAY,aAAa,QAAQ;GAClD,MAAM,QAAQ,aAAa;GAC3B,IAAI,OACF,IAAI;IACF,MAAM,YAAY,KAAK;GACzB,SAAS,KAAK;IACZ,UAAU;IACV,MAAM;GACR;EAEJ;CACF,CAAC;CAED,MAAM,QAAQ,IAAI,OAAO;AAC3B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@renr/parcel-rsc-router",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.14",
|
|
4
4
|
"author": "Ren Rizzolo",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Parcel rsc router",
|
|
@@ -24,17 +24,23 @@
|
|
|
24
24
|
"types": "./dist/esm/index.d.mts",
|
|
25
25
|
"import": "./dist/esm/index.mjs",
|
|
26
26
|
"default": "./dist/esm/index.mjs"
|
|
27
|
+
},
|
|
28
|
+
"./prerender": {
|
|
29
|
+
"types": "./dist/esm/prerender.d.mts",
|
|
30
|
+
"import": "./dist/esm/prerender.mjs",
|
|
31
|
+
"default": "./dist/esm/prerender.mjs"
|
|
27
32
|
}
|
|
28
33
|
},
|
|
29
34
|
"peerDependencies": {
|
|
30
35
|
"react": "^19",
|
|
31
|
-
"@parcel/rsc": "^
|
|
36
|
+
"@parcel/rsc": "^3.0.0-alpha.3",
|
|
32
37
|
"react-server-dom-parcel": "^19"
|
|
33
38
|
},
|
|
34
39
|
"devDependencies": {
|
|
40
|
+
"@types/node": "^25.6.2",
|
|
35
41
|
"react": "^19.3.0",
|
|
36
42
|
"@types/react": "^19.3.0",
|
|
37
|
-
"@parcel/rsc": "^
|
|
43
|
+
"@parcel/rsc": "^3.0.0-alpha.3"
|
|
38
44
|
},
|
|
39
45
|
"sideEffects": false,
|
|
40
46
|
"publishConfig": {
|