@vitejs/plugin-rsc 0.5.21 → 0.5.22

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 (47) hide show
  1. package/dist/browser-CUMAmYC3.d.ts +6 -0
  2. package/dist/browser.d.ts +2 -2
  3. package/dist/browser.js +1 -3
  4. package/dist/{chunk-f2BShn47.js → chunk-BYIdrdsR.js} +8 -14
  5. package/dist/cjs-BdahOUyh.js +115 -0
  6. package/dist/core/browser.d.ts +1 -5
  7. package/dist/core/browser.js +3 -5
  8. package/dist/core/plugin.js +1 -2
  9. package/dist/core/rsc.d.ts +1 -1
  10. package/dist/core/rsc.js +4 -6
  11. package/dist/core/ssr.d.ts +1 -1
  12. package/dist/core/ssr.js +3 -5
  13. package/dist/{dist-yW9-EeG1.js → dist-rz-Bnebz.js} +1 -2
  14. package/dist/{encryption-utils-Bk5eKdu6.js → encryption-utils-BblioYEx.js} +1 -2
  15. package/dist/{server-action-B2zS9t-J.d.ts → index-2GoUFmVR.d.ts} +34 -1
  16. package/dist/index-D2a5dlVU.d.ts +70 -0
  17. package/dist/index.d.ts +1 -3
  18. package/dist/index.js +2 -6
  19. package/dist/{picocolors-B0A1T24z.js → picocolors-B6RAUUd2.js} +2 -5
  20. package/dist/plugin-DGxRH4Nv.d.ts +185 -0
  21. package/dist/plugin-DMfc_Eqq.js +1944 -0
  22. package/dist/plugin.d.ts +2 -179
  23. package/dist/plugin.js +2 -1468
  24. package/dist/plugins/cjs.js +2 -64
  25. package/dist/react/browser.d.ts +6 -6
  26. package/dist/react/browser.js +1 -3
  27. package/dist/react/rsc.d.ts +7 -6
  28. package/dist/react/rsc.js +2 -6
  29. package/dist/react/ssr.d.ts +2 -1
  30. package/dist/react/ssr.js +1 -3
  31. package/dist/rsc.d.ts +1 -3
  32. package/dist/rsc.js +2 -4
  33. package/dist/scope-DKCDtt0O.js +211 -0
  34. package/dist/{shared-Dhw3vs8e.js → shared-BViDMJTQ.js} +2 -3
  35. package/dist/{shared-d80_k_tn.js → shared-DeahDSXi.js} +1 -2
  36. package/dist/ssr.d.ts +1 -3
  37. package/dist/ssr.js +2 -4
  38. package/dist/transforms/index.d.ts +2 -2
  39. package/dist/transforms/index.js +367 -3
  40. package/dist/utils/encryption-runtime.js +3 -5
  41. package/dist/utils/rpc.js +1 -3
  42. package/package.json +9 -10
  43. package/dist/cjs-v2jRTNln.js +0 -59
  44. package/dist/import-environment-B994HXEc.d.ts +0 -11
  45. package/dist/index-BIbdRBfk.d.ts +0 -26
  46. package/dist/server-action-JkEy-6yW.js +0 -344
  47. package/dist/validate-import-DJumtHRw.js +0 -498
package/dist/plugin.d.ts CHANGED
@@ -1,179 +1,2 @@
1
- import { t as EnvironmentImportMeta } from "./import-environment-B994HXEc.js";
2
- import { s as TransformWrapExportFilter } from "./server-action-B2zS9t-J.js";
3
- import "./transforms/index.js";
4
- import MagicString from "magic-string";
5
- import { Plugin, ResolvedConfig, Rollup, ViteDevServer, parseAstAsync } from "vite";
6
-
7
- //#region src/plugin.d.ts
8
- type ClientReferenceMeta = {
9
- importId: string;
10
- referenceKey: string;
11
- packageSource?: string;
12
- exportNames: string[];
13
- renderedExports: string[];
14
- serverChunk?: string;
15
- groupChunkId?: string;
16
- };
17
- type ServerRerferenceMeta = {
18
- importId: string;
19
- referenceKey: string;
20
- exportNames: string[];
21
- };
22
- /**
23
- * @experimental
24
- */
25
- declare class RscPluginManager {
26
- server: ViteDevServer;
27
- config: ResolvedConfig;
28
- bundles: Record<string, Rollup.OutputBundle>;
29
- buildAssetsManifest: AssetsManifest | undefined;
30
- isScanBuild: boolean;
31
- clientReferenceMetaMap: Record<string, ClientReferenceMeta>;
32
- clientReferenceGroups: Record<string, ClientReferenceMeta[]>;
33
- serverReferenceMetaMap: Record<string, ServerRerferenceMeta>;
34
- serverResourcesMetaMap: Record<string, {
35
- key: string;
36
- }>;
37
- environmentImportMetaMap: Record<string, Record<string, Record<string, EnvironmentImportMeta>>>;
38
- stabilize(): void;
39
- toRelativeId(id: string): string;
40
- writeAssetsManifest(environmentNames: string[]): void;
41
- writeEnvironmentImportsManifest(): void;
42
- }
43
- type RscPluginOptions = {
44
- /**
45
- * shorthand for configuring `environments.(name).build.rollupOptions.input.index`
46
- */
47
- entries?: Partial<Record<"client" | "ssr" | "rsc", string>>; /** @default { enviornmentName: "rsc", entryName: "index" } */
48
- serverHandler?: {
49
- environmentName: string;
50
- entryName: string;
51
- } | false; /** @default false */
52
- loadModuleDevProxy?: boolean;
53
- rscCssTransform?: false | {
54
- filter?: (id: string) => boolean;
55
- };
56
- /**
57
- * @deprecated This option is a no-op and will be removed in a future major.
58
- */
59
- copyServerAssetsToClient?: (fileName: string) => boolean;
60
- /**
61
- * This option allows disabling action closure encryption for debugging purpose.
62
- * @default true
63
- */
64
- enableActionEncryption?: boolean;
65
- /**
66
- * By default, the plugin uses a build-time generated encryption key for
67
- * "use server" closure argument binding.
68
- * This can be overwritten by configuring `defineEncryptionKey` option,
69
- * for example, to obtain a key through environment variable during runtime.
70
- * cf. https://nextjs.org/docs/app/guides/data-security#overwriting-encryption-keys-advanced
71
- */
72
- defineEncryptionKey?: string; /** Escape hatch for Waku's `allowServer` */
73
- keepUseCientProxy?: boolean;
74
- /**
75
- * Enable build-time validation of 'client-only' and 'server-only' imports
76
- * @default true
77
- */
78
- validateImports?: boolean;
79
- /**
80
- * use `Plugin.buildApp` hook (introduced on Vite 7) instead of `builder.buildApp` configuration
81
- * for better composability with other plugins.
82
- * @default true since Vite 7
83
- */
84
- useBuildAppHook?: boolean;
85
- /**
86
- * Skip the default buildApp orchestration for downstream frameworks
87
- * to implement custom build pipelines using `getPluginApi()`.
88
- * @experimental
89
- * @default false
90
- */
91
- customBuildApp?: boolean;
92
- /**
93
- * Custom environment configuration
94
- * @experimental
95
- * @default { browser: 'client', ssr: 'ssr', rsc: 'rsc' }
96
- */
97
- environment?: {
98
- browser?: string;
99
- ssr?: string;
100
- rsc?: string;
101
- };
102
- /**
103
- * Custom chunking strategy for client reference modules.
104
- *
105
- * This function allows you to group multiple client components into
106
- * custom chunks instead of having each module in its own chunk.
107
- * By default, client chunks are grouped by `meta.serverChunk`.
108
- */
109
- clientChunks?: (meta: {
110
- /** client reference module id */id: string; /** normalized client reference module id */
111
- normalizedId: string; /** server chunk which includes a corresponding client reference proxy module */
112
- serverChunk: string;
113
- }) => string | undefined;
114
- /**
115
- * Controls whether CSS links use React's `precedence` attribute.
116
- * @experimental
117
- * @default true
118
- */
119
- cssLinkPrecedence?: boolean;
120
- /**
121
- * Opt out of the default "index" client entry convention.
122
- * When enabled, the plugin will not:
123
- * - Require an entry chunk named "index"
124
- * - Automatically include client entry deps in each client reference's dependencies
125
- *
126
- * Note: `import.meta.viteRsc.loadBootstrapScriptContent` cannot be used with this option.
127
- *
128
- * Use this when you manually handle client entry setup and preloading.
129
- *
130
- * @experimental
131
- * @default false
132
- */
133
- customClientEntry?: boolean;
134
- };
135
- type PluginApi = {
136
- manager: RscPluginManager;
137
- };
138
- /** @experimental */
139
- declare function getPluginApi(config: Pick<ResolvedConfig, "plugins">): PluginApi | undefined;
140
- /** @experimental */
141
- declare function vitePluginRscMinimal(rscPluginOptions?: RscPluginOptions, manager?: RscPluginManager): Plugin[];
142
- declare global {
143
- function __VITE_ENVIRONMENT_RUNNER_IMPORT__(environmentName: string, id: string): Promise<any>;
144
- }
145
- declare function vitePluginRsc(rscPluginOptions?: RscPluginOptions): Plugin[];
146
- declare class RuntimeAsset {
147
- runtime: string;
148
- constructor(value: string);
149
- }
150
- type AssetsManifest = {
151
- bootstrapScriptContent: string | RuntimeAsset;
152
- clientReferenceDeps: Record<string, AssetDeps>;
153
- serverResources?: Record<string, Pick<AssetDeps, "css">>;
154
- cssLinkPrecedence?: boolean;
155
- };
156
- type AssetDeps = {
157
- js: (string | RuntimeAsset)[];
158
- css: (string | RuntimeAsset)[];
159
- };
160
- type ResolvedAssetsManifest = {
161
- bootstrapScriptContent: string;
162
- clientReferenceDeps: Record<string, ResolvedAssetDeps>;
163
- serverResources?: Record<string, Pick<ResolvedAssetDeps, "css">>;
164
- cssLinkPrecedence?: boolean;
165
- };
166
- type ResolvedAssetDeps = {
167
- js: string[];
168
- css: string[];
169
- };
170
- declare function transformRscCssExport(options: {
171
- ast: Awaited<ReturnType<typeof parseAstAsync>>;
172
- code: string;
173
- id?: string;
174
- filter: TransformWrapExportFilter;
175
- }): Promise<{
176
- output: MagicString;
177
- } | undefined>;
178
- //#endregion
179
- export { AssetDeps, AssetsManifest, PluginApi, ResolvedAssetDeps, ResolvedAssetsManifest, type RscPluginManager, RscPluginOptions, vitePluginRsc as default, getPluginApi, transformRscCssExport, vitePluginRscMinimal };
1
+ import { a as ResolvedAssetsManifest, c as getPluginApi, d as vitePluginRscMinimal, i as ResolvedAssetDeps, l as transformRscCssExport, n as AssetsManifest, o as RscPluginManager, r as PluginApi, s as RscPluginOptions, t as AssetDeps, u as vitePluginRsc } from "./plugin-DGxRH4Nv.js";
2
+ export { AssetDeps, AssetsManifest, PluginApi, ResolvedAssetDeps, ResolvedAssetsManifest, RscPluginManager, RscPluginOptions, vitePluginRsc as default, getPluginApi, transformRscCssExport, vitePluginRscMinimal };