@parcel/rsc 2.13.1-canary.3404 → 2.13.1-canary.3412
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 +3 -0
- package/package.json +2 -2
- package/src/client.tsx +8 -3
package/lib/client.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/* @jsxRuntime automatic */ import { ReactNode } from 'react';
|
|
2
2
|
import { HydrationOptions } from 'react-dom/client';
|
|
3
|
+
type CallServerCallback = <T>(id: string, args: any[]) => Promise<T>;
|
|
4
|
+
export declare function setServerCallback(cb: CallServerCallback): void;
|
|
3
5
|
export type CallServerCallback = <T>(id: string, args: any[]) => Promise<T>;
|
|
4
6
|
export interface HydrateOptions extends HydrationOptions {
|
|
5
7
|
callServer?: CallServerCallback;
|
|
@@ -10,3 +12,4 @@ export interface RSCRequestInit extends Omit<RequestInit, 'body'> {
|
|
|
10
12
|
body?: any;
|
|
11
13
|
}
|
|
12
14
|
export declare function fetchRSC<T>(url: string | URL | Request, options?: RSCRequestInit): Promise<T>;
|
|
15
|
+
export { };
|
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.3412+a4249c53a",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"react": "^19",
|
|
45
45
|
"react-dom": "^19"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "a4249c53abcc8ca546d823f97881f91b7c493385"
|
|
48
48
|
}
|
package/src/client.tsx
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
/* @jsxRuntime automatic */
|
|
2
|
-
import {
|
|
3
|
-
import {createFromReadableStream, createFromFetch, encodeReply, setServerCallback, createTemporaryReferenceSet} from 'react-server-dom-parcel/client';
|
|
2
|
+
import {ReactNode, startTransition, useInsertionEffect} from 'react';
|
|
3
|
+
import {createFromReadableStream, createFromFetch, encodeReply, setServerCallback as setReactServerCallback, createTemporaryReferenceSet} from 'react-server-dom-parcel/client';
|
|
4
4
|
import {rscStream} from 'rsc-html-stream/client';
|
|
5
|
-
import {
|
|
5
|
+
import {hydrateRoot, HydrationOptions, Root} from 'react-dom/client';
|
|
6
|
+
|
|
7
|
+
type CallServerCallback = <T>(id: string, args: any[]) => Promise<T>;
|
|
8
|
+
export function setServerCallback(cb: CallServerCallback): void {
|
|
9
|
+
return setReactServerCallback(cb);
|
|
10
|
+
}
|
|
6
11
|
|
|
7
12
|
// Stream in initial RSC payload embedded in the HTML.
|
|
8
13
|
let initialRSCPayload: Promise<ReactNode>;
|