@parcel/rsc 2.13.1-canary.3402 → 2.13.1-canary.3404
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/lib/client.d.ts +1 -1
- package/package.json +5 -2
- package/src/client.tsx +3 -3
- package/src/ssg.d.ts +17 -0
package/lib/client.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { HydrationOptions } from 'react-dom/client';
|
|
3
3
|
export type CallServerCallback = <T>(id: string, args: any[]) => Promise<T>;
|
|
4
4
|
export interface HydrateOptions extends HydrationOptions {
|
|
5
|
-
|
|
5
|
+
callServer?: CallServerCallback;
|
|
6
6
|
onHmrReload?: () => void;
|
|
7
7
|
}
|
|
8
8
|
export declare function hydrate(options?: HydrateOptions): (value: ReactNode, cb?: () => void) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parcel/rsc",
|
|
3
|
-
"version": "2.13.1-canary.
|
|
3
|
+
"version": "2.13.1-canary.3404+548c70b72",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -15,6 +15,9 @@
|
|
|
15
15
|
},
|
|
16
16
|
"sideEffects": false,
|
|
17
17
|
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./src/ssg.d.ts"
|
|
20
|
+
},
|
|
18
21
|
"./client": {
|
|
19
22
|
"types": "./lib/client.d.ts",
|
|
20
23
|
"default": "./src/client.tsx"
|
|
@@ -41,5 +44,5 @@
|
|
|
41
44
|
"react": "^19",
|
|
42
45
|
"react-dom": "^19"
|
|
43
46
|
},
|
|
44
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "548c70b72ab67f22457e74736d4371d24525fa99"
|
|
45
48
|
}
|
package/src/client.tsx
CHANGED
|
@@ -16,13 +16,13 @@ function RSCRoot({value, cb}: {value?: ReactNode, cb?: () => void}) {
|
|
|
16
16
|
|
|
17
17
|
export type CallServerCallback = <T>(id: string, args: any[]) => Promise<T>;
|
|
18
18
|
export interface HydrateOptions extends HydrationOptions {
|
|
19
|
-
|
|
19
|
+
callServer?: CallServerCallback,
|
|
20
20
|
onHmrReload?: () => void
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export function hydrate(options?: HydrateOptions): (value: ReactNode, cb?: () => void) => void {
|
|
24
|
-
if (options?.
|
|
25
|
-
setServerCallback(options.
|
|
24
|
+
if (options?.callServer) {
|
|
25
|
+
setServerCallback(options.callServer);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
if (options?.onHmrReload) {
|
package/src/ssg.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface Page {
|
|
2
|
+
url: string;
|
|
3
|
+
name: string;
|
|
4
|
+
tableOfContents?: TocNode[];
|
|
5
|
+
exports?: Record<string, any>;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface TocNode {
|
|
9
|
+
title: string;
|
|
10
|
+
level: number;
|
|
11
|
+
children: TocNode[];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface PageProps {
|
|
15
|
+
pages: Page[];
|
|
16
|
+
currentPage: Page;
|
|
17
|
+
}
|