@vitejs/plugin-rsc 0.5.26 → 0.5.28

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.
Files changed (57) hide show
  1. package/README.md +34 -18
  2. package/dist/browser.d.ts +3 -3
  3. package/dist/{cjs-BdahOUyh.js → cjs-Cxg_7upE.js} +3 -3
  4. package/dist/client-BrwlzXgg.d.ts +19 -0
  5. package/dist/core/browser.d.ts +1 -1
  6. package/dist/core/browser.js +2 -2
  7. package/dist/core/plugin.d.ts +0 -1
  8. package/dist/core/rsc.d.ts +1 -19
  9. package/dist/core/rsc.js +20 -4
  10. package/dist/core/ssr.d.ts +1 -2
  11. package/dist/core/ssr.js +2 -2
  12. package/dist/{encryption-utils-BblioYEx.js → encryption-utils-BNbYHtC4.js} +1 -1
  13. package/dist/{index-2GoUFmVR.d.ts → index-BjJe9jqG.d.ts} +52 -20
  14. package/dist/{index-D2a5dlVU.d.ts → index-CqNlZcWp.d.ts} +12 -1
  15. package/dist/index.d.ts +1 -1
  16. package/dist/index.js +1 -1
  17. package/dist/{picocolors-BDx0CW3k.js → picocolors-DFVOi1sR.js} +4 -2
  18. package/dist/{plugin-BhzHKRFo.js → plugin-BOTpkess.js} +89 -20
  19. package/dist/{plugin-DGxRH4Nv.d.ts → plugin-CaLiN8ED.d.ts} +71 -64
  20. package/dist/plugin.d.ts +2 -2
  21. package/dist/plugin.js +1 -1
  22. package/dist/plugins/cjs.d.ts +0 -1
  23. package/dist/plugins/cjs.js +1 -1
  24. package/dist/react/browser.d.ts +2 -3
  25. package/dist/react/rsc/client.d.ts +2 -0
  26. package/dist/react/rsc/client.js +16 -0
  27. package/dist/react/rsc/server.d.ts +3 -0
  28. package/dist/react/rsc/server.js +20 -0
  29. package/dist/react/rsc.d.ts +3 -24
  30. package/dist/react/rsc.js +3 -31
  31. package/dist/react/ssr.d.ts +4 -3
  32. package/dist/react/ssr.js +3 -1
  33. package/dist/rsc/client.d.ts +2 -0
  34. package/dist/rsc/client.js +3 -0
  35. package/dist/rsc/server.d.ts +16 -0
  36. package/dist/rsc/server.js +20 -0
  37. package/dist/rsc-CGkkhLG3.d.ts +21 -0
  38. package/dist/rsc.d.ts +4 -16
  39. package/dist/rsc.js +4 -41
  40. package/dist/{scope-DKCDtt0O.js → scope-Do08R7C2.js} +4 -38
  41. package/dist/server-DTkvSyJT.d.ts +20 -0
  42. package/dist/shared-D42sHPD1.js +25 -0
  43. package/dist/{shared-BViDMJTQ.js → shared-Y4B6DJ99.js} +2 -1
  44. package/dist/ssr.d.ts +12 -12
  45. package/dist/ssr.js +12 -7
  46. package/dist/transforms/index.d.ts +2 -2
  47. package/dist/transforms/index.js +133 -34
  48. package/dist/utils/encryption-runtime.js +5 -5
  49. package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.browser.development.js +2 -2
  50. package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.node.development.js +70 -33
  51. package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.node.production.js +69 -29
  52. package/dist/vendor/react-server-dom/package.json +3 -3
  53. package/package.json +13 -13
  54. package/dist/chunk-DpdyVxdi.js +0 -25
  55. /package/dist/{browser-CUMAmYC3.d.ts → browser-DI_Wyg5Y.d.ts} +0 -0
  56. /package/dist/{dist-rz-Bnebz.js → dist-uqdtSkzK.js} +0 -0
  57. /package/dist/{shared-DeahDSXi.js → shared-B6H2TbnP.js} +0 -0
package/README.md CHANGED
@@ -444,14 +444,31 @@ export default defineConfig({
444
444
 
445
445
  ## RSC runtime (react-server-dom) API
446
446
 
447
- ### `@vitejs/plugin-rsc/rsc`
447
+ ### `@vitejs/plugin-rsc/rsc/server`
448
448
 
449
- This module re-exports RSC runtime API provided by `react-server-dom/server.edge` and `react-server-dom/client.edge` such as:
449
+ This module provides Vite-integrated RSC runtime APIs based on
450
+ `react-server-dom/server.edge` for use in the RSC environment:
450
451
 
451
452
  - `renderToReadableStream`: RSC serialization (React VDOM -> RSC stream)
452
- - `createFromReadableStream`: RSC deserialization (RSC stream -> React VDOM). This is also available on rsc environment itself. For example, it allows saving serialized RSC and deserializing it for later use.
453
- - `decodeAction/decodeReply/decodeFormState/loadServerAction/createTemporaryReferenceSet`
454
- - `encodeReply/createClientTemporaryReferenceSet`
453
+ - `decodeAction/decodeReply/decodeFormState/loadServerAction`
454
+ - `registerClientReference/registerServerReference`
455
+ - `createTemporaryReferenceSet`
456
+
457
+ ### `@vitejs/plugin-rsc/rsc/client`
458
+
459
+ This module provides Vite-integrated RSC runtime APIs based on
460
+ `react-server-dom/client.edge` for use in the RSC environment:
461
+
462
+ - `createFromReadableStream`: RSC deserialization (RSC stream -> React VDOM)
463
+ - `encodeReply`
464
+ - `createClientTemporaryReferenceSet`
465
+
466
+ Together, these APIs allow a React VDOM to be serialized, saved as an RSC stream, and later deserialized within the same `rsc` environment.
467
+
468
+ ### `@vitejs/plugin-rsc/rsc`
469
+
470
+ This module re-exports `@vitejs/plugin-rsc/rsc/server` and
471
+ `@vitejs/plugin-rsc/rsc/client`.
455
472
 
456
473
  #### Vite-specific extension: `renderToReadableStream` (experimental)
457
474
 
@@ -479,17 +496,23 @@ function renderToReadableStream<T>(
479
496
 
480
497
  ### `@vitejs/plugin-rsc/ssr`
481
498
 
482
- This module re-exports RSC runtime API provided by `react-server-dom/client.edge`
499
+ This module provides Vite-integrated RSC runtime APIs based on
500
+ `react-server-dom/client.edge` for use in the SSR environment:
483
501
 
484
- - `createFromReadableStream`: RSC deserialization (RSC stream -> React VDOM)
502
+ - `createFromReadableStream`: Deserializes an RSC stream into a React VDOM
503
+ - `encodeReply`: Serializes server function arguments
504
+ - `createTemporaryReferenceSet`: Creates a temporary reference set shared by deserialization and reply serialization
485
505
 
486
506
  ### `@vitejs/plugin-rsc/browser`
487
507
 
488
- This module re-exports RSC runtime API provided by `react-server-dom/client.browser`
508
+ This module provides Vite-integrated RSC runtime APIs based on
509
+ `react-server-dom/client.browser` for use in the browser environment:
489
510
 
490
- - `createFromReadableStream`: RSC deserialization (RSC stream -> React VDOM)
491
- - `createFromFetch`: a robust way of `createFromReadableStream((await fetch("...")).body)`
492
- - `encodeReply/setServerCallback`: server function related...
511
+ - `createFromReadableStream`: Deserializes an RSC stream into a React VDOM
512
+ - `createFromFetch`: Deserializes an RSC response from a fetch promise
513
+ - `encodeReply`: Serializes server function arguments
514
+ - `createTemporaryReferenceSet`: Creates a temporary reference set shared by deserialization and reply serialization
515
+ - `setServerCallback`: Configures how server functions are called
493
516
 
494
517
  ## Tips
495
518
 
@@ -667,13 +690,6 @@ Note that while there are official npm packages [`server-only`](https://www.npmj
667
690
 
668
691
  This build-time validation is enabled by default and can be disabled by setting `validateImports: false` in the plugin options.
669
692
 
670
- ## Architecture Documentation
671
-
672
- For developers interested in the internal architecture:
673
-
674
- - **[docs/architecture.md](docs/architecture.md)** - Build pipeline, data flow, and key components
675
- - **[docs/bundler-comparison.md](docs/bundler-comparison.md)** - How different bundlers approach RSC
676
-
677
693
  ## Credits
678
694
 
679
695
  This project builds on fundamental techniques and insights from pioneering Vite RSC implementations.
package/dist/browser.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as CallServerCallback } from "./index-D2a5dlVU.js";
2
- import { t as setRequireModule } from "./browser-CUMAmYC3.js";
1
+ import { n as CallServerCallback } from "./index-CqNlZcWp.js";
2
+ import { t as setRequireModule } from "./browser-DI_Wyg5Y.js";
3
3
  import { callServer, createFromFetch, createFromReadableStream, createServerReference, createTemporaryReferenceSet, encodeReply, findSourceMapURL, setServerCallback } from "./react/browser.js";
4
- export { CallServerCallback, callServer, createFromFetch, createFromReadableStream, createServerReference, createTemporaryReferenceSet, encodeReply, findSourceMapURL, setRequireModule, setServerCallback };
4
+ export { type CallServerCallback, callServer, createFromFetch, createFromReadableStream, createServerReference, createTemporaryReferenceSet, encodeReply, findSourceMapURL, setRequireModule, setServerCallback };
@@ -1,6 +1,6 @@
1
- import { t as createDebug } from "./dist-rz-Bnebz.js";
2
- import { t as buildScopeTree } from "./scope-DKCDtt0O.js";
3
- import { n as parseIdQuery } from "./shared-DeahDSXi.js";
1
+ import { t as createDebug } from "./dist-uqdtSkzK.js";
2
+ import { t as buildScopeTree } from "./scope-Do08R7C2.js";
3
+ import { n as parseIdQuery } from "./shared-B6H2TbnP.js";
4
4
  import fs from "node:fs";
5
5
  import path from "node:path";
6
6
  import { fileURLToPath, pathToFileURL } from "node:url";
@@ -0,0 +1,19 @@
1
+ import { a as CreateFromReadableStreamEdgeOptions, c as EncodeReplyFunction, r as ClientTemporaryReferenceSet } from "./index-CqNlZcWp.js";
2
+ //#region src/react/rsc/client.d.ts
3
+ declare function createFromReadableStream<T>(stream: ReadableStream<Uint8Array>, options?: CreateFromReadableStreamEdgeOptions, extraOptions?: {
4
+ /**
5
+ * Preserve server references for re-serialization without loading their modules.
6
+ * Preserved references cannot be invoked in the current RSC environment.
7
+ *
8
+ * Disabled by default because this API also decodes bound server action
9
+ * arguments, which must revive references as callable implementations.
10
+ *
11
+ * @experimental
12
+ * @default false
13
+ */
14
+ preserveServerReferences?: boolean;
15
+ }): Promise<T>;
16
+ declare const encodeReply: EncodeReplyFunction;
17
+ declare const createClientTemporaryReferenceSet: () => ClientTemporaryReferenceSet;
18
+ //#endregion
19
+ export { createFromReadableStream as n, encodeReply as r, createClientTemporaryReferenceSet as t };
@@ -1,2 +1,2 @@
1
- import { t as setRequireModule } from "../browser-CUMAmYC3.js";
1
+ import { t as setRequireModule } from "../browser-DI_Wyg5Y.js";
2
2
  export { setRequireModule };
@@ -1,5 +1,5 @@
1
- import { n as memoize } from "../dist-rz-Bnebz.js";
2
- import { a as setInternalRequire, i as removeReferenceCacheTag } from "../shared-BViDMJTQ.js";
1
+ import { n as memoize } from "../dist-uqdtSkzK.js";
2
+ import { a as removeReferenceCacheTag, o as setInternalRequire } from "../shared-Y4B6DJ99.js";
3
3
  //#region src/core/browser.ts
4
4
  let init = false;
5
5
  function setRequireModule(options) {
@@ -1,5 +1,4 @@
1
1
  import { Plugin } from "vite";
2
-
3
2
  //#region src/core/plugin.d.ts
4
3
  declare function vitePluginRscCore(): Plugin[];
5
4
  //#endregion
@@ -1,20 +1,2 @@
1
- import { c as ModuleMap, t as BundlerConfig } from "../index-D2a5dlVU.js";
2
-
3
- //#region src/core/rsc.d.ts
4
- declare function setRequireModule(options: {
5
- load: (id: string) => unknown;
6
- }): void;
7
- declare function loadServerAction(id: string): Promise<Function>;
8
- declare function createServerManifest(): BundlerConfig;
9
- declare function createServerDecodeClientManifest(): ModuleMap;
10
- declare function createClientManifest(options?: {
11
- /**
12
- * @internal
13
- */
14
- onClientReference?: (metadata: {
15
- id: string;
16
- name: string;
17
- }) => void;
18
- }): BundlerConfig;
19
- //#endregion
1
+ import { a as setRequireModule, i as loadServerAction, n as createServerDecodeClientManifest, r as createServerManifest, t as createClientManifest } from "../rsc-CGkkhLG3.js";
20
2
  export { createClientManifest, createServerDecodeClientManifest, createServerManifest, loadServerAction, setRequireModule };
package/dist/core/rsc.js CHANGED
@@ -1,5 +1,5 @@
1
- import { i as tinyassert, n as memoize } from "../dist-rz-Bnebz.js";
2
- import { a as setInternalRequire, i as removeReferenceCacheTag, n as SERVER_REFERENCE_PREFIX, r as createReferenceCacheTag, t as SERVER_DECODE_CLIENT_PREFIX } from "../shared-BViDMJTQ.js";
1
+ import { i as tinyassert, n as memoize } from "../dist-uqdtSkzK.js";
2
+ import { a as removeReferenceCacheTag, i as createReferenceCacheTag, n as SERVER_REFERENCE_PREFIX, o as setInternalRequire, r as SERVER_REFERENCE_PRESERVE_PREFIX, t as SERVER_DECODE_CLIENT_PREFIX } from "../shared-Y4B6DJ99.js";
3
3
  import * as ReactServer from "@vitejs/plugin-rsc/vendor/react-server-dom/server.edge";
4
4
  //#region src/core/rsc.ts
5
5
  let init = false;
@@ -11,6 +11,21 @@ function setRequireModule(options) {
11
11
  return options.load(removeReferenceCacheTag(id));
12
12
  };
13
13
  globalThis.__vite_rsc_server_require__ = memoize(async (id) => {
14
+ if (id.startsWith("$$preserve:")) {
15
+ id = id.slice(SERVER_REFERENCE_PRESERVE_PREFIX.length);
16
+ id = removeReferenceCacheTag(id);
17
+ const target = {};
18
+ const getOrCreateServerReference = (name) => {
19
+ return target[name] ??= ReactServer.registerServerReference(() => {
20
+ throw new Error(`Unexpectedly decoded server reference '${id}#${name}' is called on server`);
21
+ }, id, name);
22
+ };
23
+ return new Proxy(target, { getOwnPropertyDescriptor(_target, name) {
24
+ if (typeof name !== "string" || name === "then") return Reflect.getOwnPropertyDescriptor(target, name);
25
+ getOrCreateServerReference(name);
26
+ return Reflect.getOwnPropertyDescriptor(target, name);
27
+ } });
28
+ }
14
29
  if (id.startsWith("$$decode-client:")) {
15
30
  id = id.slice(SERVER_DECODE_CLIENT_PREFIX.length);
16
31
  id = removeReferenceCacheTag(id);
@@ -34,7 +49,8 @@ async function loadServerAction(id) {
34
49
  const [file, name] = id.split("#");
35
50
  return (await requireModule(file))[name];
36
51
  }
37
- function createServerManifest() {
52
+ function createServerManifest(options) {
53
+ const prefix = options?.preserveServerReferences ? SERVER_REFERENCE_PRESERVE_PREFIX : "";
38
54
  const cacheTag = import.meta.env.DEV ? createReferenceCacheTag() : "";
39
55
  return new Proxy({}, { get(_target, $$id, _receiver) {
40
56
  tinyassert(typeof $$id === "string");
@@ -42,7 +58,7 @@ function createServerManifest() {
42
58
  tinyassert(id);
43
59
  tinyassert(name);
44
60
  return {
45
- id: SERVER_REFERENCE_PREFIX + id + cacheTag,
61
+ id: SERVER_REFERENCE_PREFIX + prefix + id + cacheTag,
46
62
  name,
47
63
  chunks: [],
48
64
  async: true
@@ -1,5 +1,4 @@
1
- import { u as ServerConsumerManifest } from "../index-D2a5dlVU.js";
2
-
1
+ import { d as ServerConsumerManifest } from "../index-CqNlZcWp.js";
3
2
  //#region src/core/ssr.d.ts
4
3
  declare function setRequireModule(options: {
5
4
  load: (id: string) => unknown;
package/dist/core/ssr.js CHANGED
@@ -1,5 +1,5 @@
1
- import { n as memoize } from "../dist-rz-Bnebz.js";
2
- import { a as setInternalRequire, i as removeReferenceCacheTag } from "../shared-BViDMJTQ.js";
1
+ import { n as memoize } from "../dist-uqdtSkzK.js";
2
+ import { a as removeReferenceCacheTag, o as setInternalRequire } from "../shared-Y4B6DJ99.js";
3
3
  //#region src/core/ssr.ts
4
4
  let init = false;
5
5
  function setRequireModule(options) {
@@ -52,7 +52,7 @@ async function generateEncryptionKey() {
52
52
  return new Uint8Array(exported);
53
53
  }
54
54
  async function encryptBuffer(data, key) {
55
- const iv = crypto.getRandomValues(new Uint8Array(16));
55
+ const iv = crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(16));
56
56
  const encrypted = await crypto.subtle.encrypt({
57
57
  name: "AES-GCM",
58
58
  iv
@@ -1,6 +1,5 @@
1
1
  import MagicString from "magic-string";
2
-
3
- //#region ../../node_modules/.pnpm/@types+estree@1.0.8/node_modules/@types/estree/index.d.ts
2
+ //#region ../../node_modules/.pnpm/@types+estree@1.0.9/node_modules/@types/estree/index.d.ts
4
3
  // This definition file follows a somewhat unusual format. ESTree allows
5
4
  // runtime type checks based on the `type` parameter. In order to explain this
6
5
  // to typescript we want to use discriminated union types:
@@ -84,7 +83,8 @@ interface Directive extends BaseNode {
84
83
  interface BaseFunction extends BaseNode {
85
84
  params: Pattern[];
86
85
  generator?: boolean | undefined;
87
- async?: boolean | undefined; // The body is either BlockStatement or Expression because arrow functions
86
+ async?: boolean | undefined;
87
+ // The body is either BlockStatement or Expression because arrow functions
88
88
  // can have a body that's either. FunctionDeclarations and
89
89
  // FunctionExpressions have only BlockStatement bodies.
90
90
  body: BlockStatement | Expression;
@@ -250,7 +250,7 @@ interface PrivateIdentifier extends BaseNode {
250
250
  }
251
251
  interface Property extends BaseNode {
252
252
  type: "Property";
253
- key: Expression | PrivateIdentifier;
253
+ key: Expression;
254
254
  value: Expression | Pattern; // Could be an AssignmentProperty
255
255
  kind: "init" | "get" | "set";
256
256
  method: boolean;
@@ -405,7 +405,8 @@ interface TemplateElement extends BaseNode {
405
405
  type: "TemplateElement";
406
406
  tail: boolean;
407
407
  value: {
408
- /** It is null when the template literal is tagged and the text has an invalid escape (e.g. - tag`\unicode and \u{55}`) */cooked?: string | null | undefined;
408
+ /** It is null when the template literal is tagged and the text has an invalid escape (e.g. - tag`\unicode and \u{55}`) */
409
+ cooked?: string | null | undefined;
409
410
  raw: string;
410
411
  };
411
412
  }
@@ -525,11 +526,7 @@ interface AwaitExpression extends BaseExpression {
525
526
  }
526
527
  //#endregion
527
528
  //#region src/transforms/hoist.d.ts
528
- declare function transformHoistInlineDirective(input: string, ast: Program, {
529
- runtime,
530
- rejectNonAsyncFunction,
531
- ...options
532
- }: {
529
+ declare function transformHoistInlineDirective(input: string, ast: Program, { runtime, rejectNonAsyncFunction, ...options }: {
533
530
  runtime: (value: string, name: string, meta: {
534
531
  directiveMatch: RegExpMatchArray;
535
532
  }) => string;
@@ -546,8 +543,33 @@ declare function findDirectives(ast: Program, directive: string): Literal[];
546
543
  //#endregion
547
544
  //#region src/transforms/wrap-export.d.ts
548
545
  type ExportMeta = {
546
+ /**
547
+ * The local declaration name when statically available.
548
+ *
549
+ * - `"Page"` for `export function Page() {}`
550
+ * - `"Page"` for `export const Page = () => {}`
551
+ * - `undefined` for `export default () => {}`
552
+ * - `undefined` for `export { Page }`
553
+ */
549
554
  declName?: string;
555
+ /**
556
+ * Whether the exported value is statically known to be a function.
557
+ *
558
+ * - `true` for `export const Page = () => {}`
559
+ * - `false` for `export const value = 1`
560
+ * - `undefined` for `export const value = getValue()`
561
+ * - `undefined` for `export default Page`
562
+ */
550
563
  isFunction?: boolean;
564
+ /**
565
+ * The local identifier referenced by a default export.
566
+ * The RSC CSS transform uses this to detect a component by its capitalized
567
+ * local name and preserve that name on the generated wrapper.
568
+ *
569
+ * - `"Page"` for `const Page = () => {}; export default Page`
570
+ * - `undefined` for `export default function Page() {}`
571
+ * - `undefined` for `export default () => {}`
572
+ */
551
573
  defaultExportIdentifierName?: string;
552
574
  };
553
575
  type TransformWrapExportFilter = (name: string, meta: ExportMeta) => boolean;
@@ -564,16 +586,17 @@ declare function transformWrapExport(input: string, ast: Program, options: Trans
564
586
  //#endregion
565
587
  //#region src/transforms/proxy-export.d.ts
566
588
  type TransformProxyExportOptions = {
567
- /** Required for source map and `keep` options */code?: string;
589
+ /** Required for source map and `keep` options */
590
+ code?: string;
568
591
  runtime: (name: string, meta?: {
569
592
  value: string;
570
593
  }) => string;
571
594
  ignoreExportAllDeclaration?: boolean;
572
595
  rejectNonAsyncFunction?: boolean;
573
596
  /**
574
- * escape hatch for Waku's `allowServer`
575
- * @default false
576
- */
597
+ * escape hatch for Waku's `allowServer`
598
+ * @default false
599
+ */
577
600
  keep?: boolean;
578
601
  };
579
602
  declare function transformDirectiveProxyExport(ast: Program, options: {
@@ -589,11 +612,6 @@ declare function transformProxyExport(ast: Program, options: TransformProxyExpor
589
612
  //#endregion
590
613
  //#region src/transforms/utils.d.ts
591
614
  declare function hasDirective(body: Program["body"], directive: string): boolean;
592
- declare function getExportNames(ast: Program, options: {
593
- ignoreExportAllDeclaration?: boolean;
594
- }): {
595
- exportNames: string[];
596
- };
597
615
  declare function extractNames(param: Pattern): string[];
598
616
  declare function extractIdentifiers(param: Pattern, nodes?: Identifier[]): Identifier[];
599
617
  declare function validateNonAsyncFunction(opts: {
@@ -614,4 +632,18 @@ declare function transformServerActionServer(input: string, ast: Program, option
614
632
  names: string[];
615
633
  };
616
634
  //#endregion
617
- export { hasDirective as a, transformDirectiveProxyExport as c, TransformWrapExportOptions as d, transformWrapExport as f, getExportNames as i, transformProxyExport as l, transformHoistInlineDirective as m, extractIdentifiers as n, validateNonAsyncFunction as o, findDirectives as p, extractNames as r, TransformProxyExportOptions as s, transformServerActionServer as t, TransformWrapExportFilter as u };
635
+ //#region src/transforms/expand-export-all.d.ts
636
+ interface TransformExpandExportAllContext {
637
+ resolve: (source: string, importer: string) => Promise<string | undefined>;
638
+ load: (id: string) => Promise<Program>;
639
+ }
640
+ interface TransformExpandExportAllOptions extends TransformExpandExportAllContext {
641
+ code: string;
642
+ ast: Program;
643
+ importer: string;
644
+ }
645
+ declare function transformExpandExportAll(options: TransformExpandExportAllOptions): Promise<{
646
+ code: string;
647
+ } | undefined>;
648
+ //#endregion
649
+ export { extractIdentifiers as a, validateNonAsyncFunction as c, transformProxyExport as d, TransformWrapExportFilter as f, transformHoistInlineDirective as g, findDirectives as h, transformServerActionServer as i, TransformProxyExportOptions as l, transformWrapExport as m, TransformExpandExportAllOptions as n, extractNames as o, TransformWrapExportOptions as p, transformExpandExportAll as r, hasDirective as s, TransformExpandExportAllContext as t, transformDirectiveProxyExport as u };
@@ -35,6 +35,7 @@ interface RenderToReadableStreamOptions {
35
35
  interface CreateFromReadableStreamBrowserOptions {
36
36
  callServer?: CallServerCallback;
37
37
  debugChannel?: DebugChannel;
38
+ encodeFormAction?: EncodeFormActionCallback;
38
39
  endTime?: number;
39
40
  environmentName?: string;
40
41
  replayConsoleLogs?: boolean;
@@ -43,6 +44,7 @@ interface CreateFromReadableStreamBrowserOptions {
43
44
  }
44
45
  interface CreateFromReadableStreamEdgeOptions {
45
46
  debugChannel?: DebugChannel;
47
+ encodeFormAction?: EncodeFormActionCallback;
46
48
  endTime?: number;
47
49
  environmentName?: string;
48
50
  nonce?: string;
@@ -58,6 +60,15 @@ interface EncodeReplyOptions {
58
60
  temporaryReferences?: ClientTemporaryReferenceSet;
59
61
  signal?: AbortSignal;
60
62
  }
63
+ type EncodeFormActionCallback = (id: string, args: Promise<unknown[]>) => ReactCustomFormAction;
64
+ type ReactCustomFormAction = {
65
+ name?: string;
66
+ action?: string;
67
+ encType?: string;
68
+ method?: string;
69
+ target?: string;
70
+ data?: FormData | null;
71
+ };
61
72
  type EncodeReplyFunction = (value: unknown[], options?: EncodeReplyOptions) => Promise<string | FormData>;
62
73
  type DecodeReplyFunction = (body: string | FormData, options?: DecodeReplyOptions) => Promise<unknown[]>;
63
74
  type DebugChannel = {
@@ -67,4 +78,4 @@ type DebugChannel = {
67
78
  type ServerTemporaryReferenceSet = unknown;
68
79
  type ClientTemporaryReferenceSet = unknown;
69
80
  //#endregion
70
- export { CreateFromReadableStreamEdgeOptions as a, ModuleMap as c, ServerTemporaryReferenceSet as d, CreateFromReadableStreamBrowserOptions as i, RenderToReadableStreamOptions as l, CallServerCallback as n, DecodeReplyFunction as o, ClientTemporaryReferenceSet as r, EncodeReplyFunction as s, BundlerConfig as t, ServerConsumerManifest as u };
81
+ export { CreateFromReadableStreamEdgeOptions as a, EncodeReplyFunction as c, ServerConsumerManifest as d, ServerTemporaryReferenceSet as f, CreateFromReadableStreamBrowserOptions as i, ModuleMap as l, CallServerCallback as n, DecodeReplyFunction as o, ClientTemporaryReferenceSet as r, EncodeFormActionCallback as s, BundlerConfig as t, RenderToReadableStreamOptions as u };
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { c as getPluginApi, r as PluginApi, s as RscPluginOptions, u as vitePluginRsc } from "./plugin-DGxRH4Nv.js";
1
+ import { c as getPluginApi, r as PluginApi, s as RscPluginOptions, u as vitePluginRsc } from "./plugin-CaLiN8ED.js";
2
2
  export { type PluginApi, type RscPluginOptions, vitePluginRsc as default, getPluginApi };
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { r as vitePluginRsc, t as getPluginApi } from "./plugin-BhzHKRFo.js";
1
+ import { r as vitePluginRsc, t as getPluginApi } from "./plugin-BOTpkess.js";
2
2
  export { vitePluginRsc as default, getPluginApi };
@@ -1,7 +1,9 @@
1
- import { t as __commonJSMin } from "./chunk-DpdyVxdi.js";
1
+ import { a as __commonJSMin } from "./plugin-BOTpkess.js";
2
2
  //#region ../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
3
3
  var require_picocolors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4
- let p = process || {}, argv = p.argv || [], env = p.env || {};
4
+ let p = process || {};
5
+ let argv = p.argv || [];
6
+ let env = p.env || {};
5
7
  let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
6
8
  let formatter = (open, close, replace = open) => (input) => {
7
9
  let string = "" + input, index = string.indexOf(close, open.length);