vite-plugin-react-server 1.1.18 → 1.1.19

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 (71) hide show
  1. package/README.md +7 -3
  2. package/dist/package.json +1 -1
  3. package/dist/plugin/config/defaults.d.ts +1 -1
  4. package/dist/plugin/config/defaults.d.ts.map +1 -1
  5. package/dist/plugin/config/defaults.js +2 -2
  6. package/dist/plugin/config/defaults.js.map +1 -1
  7. package/dist/plugin/config/resolveOptions.d.ts.map +1 -1
  8. package/dist/plugin/config/resolveOptions.js +4 -4
  9. package/dist/plugin/config/resolveOptions.js.map +1 -1
  10. package/dist/plugin/helpers/handleServerAction.d.ts +34 -0
  11. package/dist/plugin/helpers/handleServerAction.d.ts.map +1 -0
  12. package/dist/plugin/helpers/handleServerAction.js +48 -0
  13. package/dist/plugin/helpers/handleServerAction.js.map +1 -0
  14. package/dist/plugin/loader/handleExports.d.ts +16 -10
  15. package/dist/plugin/loader/handleExports.d.ts.map +1 -1
  16. package/dist/plugin/loader/handleExports.js +32 -16
  17. package/dist/plugin/loader/handleExports.js.map +1 -1
  18. package/dist/plugin/loader/transformModuleIfNeeded.d.ts.map +1 -1
  19. package/dist/plugin/loader/transformModuleIfNeeded.js +22 -11
  20. package/dist/plugin/loader/transformModuleIfNeeded.js.map +1 -1
  21. package/dist/plugin/loader/transformModuleWithPreservedFunctions.d.ts +21 -0
  22. package/dist/plugin/loader/transformModuleWithPreservedFunctions.d.ts.map +1 -1
  23. package/dist/plugin/loader/transformModuleWithPreservedFunctions.js +398 -73
  24. package/dist/plugin/loader/transformModuleWithPreservedFunctions.js.map +1 -1
  25. package/dist/plugin/loader/types.d.ts +9 -3
  26. package/dist/plugin/loader/types.d.ts.map +1 -1
  27. package/dist/plugin/react-client/configureWorkerRequestHandler.d.ts.map +1 -1
  28. package/dist/plugin/react-client/configureWorkerRequestHandler.js +12 -69
  29. package/dist/plugin/react-client/configureWorkerRequestHandler.js.map +1 -1
  30. package/dist/plugin/react-client/handleWorkerServerAction.d.ts +12 -0
  31. package/dist/plugin/react-client/handleWorkerServerAction.d.ts.map +1 -0
  32. package/dist/plugin/react-client/handleWorkerServerAction.js +47 -0
  33. package/dist/plugin/react-client/handleWorkerServerAction.js.map +1 -0
  34. package/dist/plugin/react-server/configureReactServer.js.map +1 -1
  35. package/dist/plugin/react-server/handleServerAction.d.ts +1 -1
  36. package/dist/plugin/react-server/handleServerAction.d.ts.map +1 -1
  37. package/dist/plugin/react-server/handleServerAction.js +42 -6
  38. package/dist/plugin/react-server/handleServerAction.js.map +1 -1
  39. package/dist/plugin/react-server/plugin.js +2 -2
  40. package/dist/plugin/react-server/plugin.js.map +1 -1
  41. package/dist/plugin/react-static/plugin.d.ts.map +1 -1
  42. package/dist/plugin/react-static/plugin.js +10 -2
  43. package/dist/plugin/react-static/plugin.js.map +1 -1
  44. package/dist/plugin/source-map/createMappingsSerializer.js +128 -157
  45. package/dist/plugin/source-map/createMappingsSerializer.js.map +1 -0
  46. package/dist/plugin/types.d.ts +5 -7
  47. package/dist/plugin/types.d.ts.map +1 -1
  48. package/dist/plugin/vendor/types.js +1 -0
  49. package/dist/plugin/worker/rsc/handleRender.d.ts.map +1 -1
  50. package/dist/plugin/worker/rsc/handleRender.js +0 -1
  51. package/dist/plugin/worker/rsc/handleRender.js.map +1 -1
  52. package/dist/plugin/worker/rsc/handlers.js.map +1 -1
  53. package/dist/tsconfig.tsbuildinfo +1 -1
  54. package/package.json +1 -1
  55. package/plugin/config/defaults.tsx +5 -2
  56. package/plugin/config/resolveOptions.ts +9 -10
  57. package/plugin/helpers/handleServerAction.ts +79 -0
  58. package/plugin/loader/handleExports.ts +50 -40
  59. package/plugin/loader/transformModuleIfNeeded.ts +50 -15
  60. package/plugin/loader/transformModuleWithPreservedFunctions.ts +496 -126
  61. package/plugin/loader/types.ts +12 -4
  62. package/plugin/react-client/configureWorkerRequestHandler.ts +11 -87
  63. package/plugin/react-client/handleWorkerServerAction.ts +74 -0
  64. package/plugin/react-server/configureReactServer.ts +1 -1
  65. package/plugin/react-server/handleServerAction.ts +49 -12
  66. package/plugin/react-server/plugin.ts +2 -2
  67. package/plugin/react-static/plugin.ts +10 -2
  68. package/plugin/types.ts +6 -7
  69. package/plugin/vendor/types.ts +1 -0
  70. package/plugin/worker/rsc/handleRender.ts +0 -2
  71. package/plugin/worker/rsc/handlers.ts +3 -3
@@ -4,30 +4,70 @@
4
4
  * MIT License
5
5
  */
6
6
  import { handleExports } from './handleExports.js';
7
+ import { createMappingsSerializer } from '../source-map/createMappingsSerializer.js';
7
8
 
8
- function createClientReferenceError(name) {
9
- return `Attempted to call ${name}() from the server but ${name} is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.`;
9
+ function generateSourceMap(moduleId, source, lines, mappingInfos, originalSourceMap) {
10
+ const createMapping = createMappingsSerializer();
11
+ let mappings = "";
12
+ for (let i = 0; i < lines.length; i++) {
13
+ const info = mappingInfos[i] || { generatedLine: i + 1, originalLine: 1, originalColumn: 0 };
14
+ mappings += createMapping(
15
+ info.generatedLine,
16
+ 0,
17
+ 0,
18
+ // sourceIndex
19
+ info.originalLine,
20
+ info.originalColumn,
21
+ -1
22
+ // nameIndex
23
+ );
24
+ }
25
+ mappings += createMapping(
26
+ lines.length + 1,
27
+ 0,
28
+ 0,
29
+ source.split("\n").length,
30
+ 0,
31
+ -1
32
+ );
33
+ const sourceMap = {
34
+ version: 3,
35
+ file: moduleId,
36
+ sources: originalSourceMap?.sources || [moduleId],
37
+ sourcesContent: originalSourceMap?.sourcesContent || [source],
38
+ mappings,
39
+ sourceRoot: originalSourceMap?.sourceRoot || "",
40
+ names: originalSourceMap?.names || []
41
+ };
42
+ return `data:application/json;charset=utf-8;base64,${Buffer.from(JSON.stringify(sourceMap)).toString("base64")}`;
10
43
  }
11
44
  function transformModuleWithPreservedFunctions(source, moduleId, program, isServerFunction, isClientComponent) {
12
- let sourceWithoutDirective = source;
13
- let directiveEnd = 0;
14
- for (const node of program.body) {
15
- if (node.type !== "ExpressionStatement") {
16
- break;
17
- }
18
- let directive = null;
19
- if ("directive" in node && typeof node.directive === "string") {
20
- directive = node.directive;
21
- } else if (node.expression.type === "Literal" && typeof node.expression.value === "string" && (node.expression.value === "use server" || node.expression.value === "use client")) {
22
- directive = node.expression.value;
23
- }
24
- if (directive && "start" in node && "end" in node) {
25
- directiveEnd = node.end;
45
+ let sourceMappingURL = null;
46
+ let sourceMappingStart = 0;
47
+ let sourceMappingEnd = 0;
48
+ let sourceMappingLines = 0;
49
+ let originalSourceMap = null;
50
+ const sourceMapMatch = source.match(/\/\/[#@] sourceMappingURL=(.+)$/m);
51
+ if (sourceMapMatch) {
52
+ sourceMappingURL = sourceMapMatch[1];
53
+ sourceMappingStart = sourceMapMatch.index;
54
+ sourceMappingEnd = sourceMapMatch.index + sourceMapMatch[0].length;
55
+ sourceMappingLines = sourceMapMatch[0].split("\n").length - 1;
56
+ if (sourceMappingURL.startsWith("data:application/json;base64,")) {
57
+ const base64 = sourceMappingURL.slice("data:application/json;base64,".length);
58
+ originalSourceMap = JSON.parse(Buffer.from(base64, "base64").toString());
26
59
  }
27
60
  }
28
- if (directiveEnd > 0) {
29
- sourceWithoutDirective = source.slice(directiveEnd).trim();
61
+ let sourceWithoutMap = source;
62
+ if (sourceMappingStart > 0) {
63
+ sourceWithoutMap = source.slice(0, sourceMappingStart) + "\n".repeat(sourceMappingLines) + source.slice(sourceMappingEnd);
30
64
  }
65
+ let sourceWithoutDirective = sourceWithoutMap;
66
+ let directiveEnd = 0;
67
+ let hasFileLevelServerDirective = false;
68
+ let hasFileLevelClientDirective = false;
69
+ let hasFunctionLevelClientDirective = false;
70
+ let hasFunctionLevelServerDirective = false;
31
71
  const { exportNames, exports } = handleExports(
32
72
  sourceWithoutDirective,
33
73
  program,
@@ -35,71 +75,356 @@ function transformModuleWithPreservedFunctions(source, moduleId, program, isServ
35
75
  isClientComponent
36
76
  );
37
77
  const moduleIdLiteral = JSON.stringify(moduleId);
38
- if (Boolean(isServerFunction)) {
39
- const imports = [
40
- 'import { registerServerReference } from "react-server-dom-esm/server.node";'
41
- ];
42
- const registrations = [];
78
+ function checkForDirective(node) {
79
+ if (node.type === "ExpressionStatement") {
80
+ if ("directive" in node && typeof node.directive === "string") {
81
+ return node.directive;
82
+ } else if (node.expression.type === "Literal" && typeof node.expression.value === "string" && (node.expression.value === "use server" || node.expression.value === "use client")) {
83
+ return node.expression.value;
84
+ }
85
+ }
86
+ return null;
87
+ }
88
+ for (const node of program.body) {
89
+ const directive = checkForDirective(node);
90
+ if (directive) {
91
+ if (directive === "use server") {
92
+ if (node.start === 0) {
93
+ hasFileLevelServerDirective = true;
94
+ } else {
95
+ hasFunctionLevelServerDirective = true;
96
+ }
97
+ }
98
+ if (directive === "use client") {
99
+ if (node.start === 0) {
100
+ hasFileLevelClientDirective = true;
101
+ } else {
102
+ hasFunctionLevelClientDirective = true;
103
+ }
104
+ }
105
+ if ("start" in node && "end" in node) {
106
+ directiveEnd = Math.max(directiveEnd, node.end);
107
+ }
108
+ }
109
+ if (node.type === "ExportNamedDeclaration" && node.declaration?.type === "FunctionDeclaration") {
110
+ const funcNode = node.declaration;
111
+ if (funcNode.body?.body) {
112
+ for (const stmt of funcNode.body.body) {
113
+ const directive2 = checkForDirective(stmt);
114
+ if (directive2 === "use server") {
115
+ hasFunctionLevelServerDirective = true;
116
+ const name = funcNode.id?.name;
117
+ if (name) {
118
+ const exportInfo = exports.get(name);
119
+ if (exportInfo) {
120
+ exportInfo.declaration = exportInfo.declaration?.replace(
121
+ /^export\s+function\s+/,
122
+ "export async function "
123
+ );
124
+ exportInfo.isAsync = true;
125
+ }
126
+ }
127
+ break;
128
+ }
129
+ }
130
+ }
131
+ } else if (node.type === "FunctionDeclaration") {
132
+ if (node.body?.body) {
133
+ for (const stmt of node.body.body) {
134
+ const directive2 = checkForDirective(stmt);
135
+ if (directive2 === "use server") {
136
+ hasFunctionLevelServerDirective = true;
137
+ const name = node.id?.name;
138
+ if (name) {
139
+ const exportInfo = exports.get(name);
140
+ if (exportInfo) {
141
+ exportInfo.declaration = exportInfo.declaration?.replace(
142
+ /^export\s+function\s+/,
143
+ "export async function "
144
+ );
145
+ exportInfo.isAsync = true;
146
+ }
147
+ }
148
+ break;
149
+ }
150
+ }
151
+ }
152
+ } else if (node.type === "VariableDeclaration") {
153
+ for (const decl of node.declarations) {
154
+ if (decl.init?.type === "FunctionExpression" || decl.init?.type === "ArrowFunctionExpression") {
155
+ const body = decl.init.body;
156
+ if (body.type === "BlockStatement" && body.body) {
157
+ for (const stmt of body.body) {
158
+ const directive2 = checkForDirective(stmt);
159
+ if (directive2 === "use server") {
160
+ hasFunctionLevelServerDirective = true;
161
+ const name = decl.id.type === "Identifier" ? decl.id.name : void 0;
162
+ if (name) {
163
+ const exportInfo = exports.get(name);
164
+ if (exportInfo) {
165
+ exportInfo.declaration = exportInfo.declaration?.replace(
166
+ /^export\s+function\s+/,
167
+ "export async function "
168
+ );
169
+ exportInfo.isAsync = true;
170
+ }
171
+ }
172
+ break;
173
+ }
174
+ }
175
+ }
176
+ }
177
+ }
178
+ }
179
+ }
180
+ if (hasFileLevelClientDirective && hasFileLevelServerDirective) {
181
+ throw new Error(`Module ${moduleId} cannot have both "use client" and "use server" directives`);
182
+ }
183
+ if (hasFunctionLevelClientDirective) {
184
+ throw new Error(`Module ${moduleId} cannot have function-level "use client" directives - only file-level is allowed`);
185
+ }
186
+ if (Boolean(isClientComponent) && !hasFileLevelClientDirective) {
187
+ throw new Error(`Module ${moduleId} is marked as a client component but has no "use client" directive`);
188
+ }
189
+ if (Boolean(isServerFunction) && !hasFileLevelServerDirective && !hasFunctionLevelServerDirective) {
190
+ if (process.env["NODE_ENV"] !== "production") {
191
+ console.log("Error for file", moduleId, source);
192
+ }
193
+ throw new Error(`Module ${moduleId} is marked as a server function but has no "use server" directive`);
194
+ }
195
+ if (directiveEnd > 0) {
196
+ sourceWithoutDirective = source.slice(directiveEnd).trim();
197
+ }
198
+ if (Boolean(isClientComponent) && exportNames.length === 0) {
199
+ throw new Error(`Module ${moduleId} is marked as a client component but has no exports to transform`);
200
+ }
201
+ if (Boolean(isServerFunction) && exportNames.length === 0) {
202
+ throw new Error(`Module ${moduleId} is marked as a server function but has no exports to transform`);
203
+ }
204
+ if (Boolean(isClientComponent)) {
205
+ const output = [];
206
+ const mappingInfos = [];
207
+ const clientImport = process.env["NODE_ENV"] === "production" ? 'import { registerClientReference } from "react-server-dom-esm/server";' : 'import { registerClientReference } from "react-server-dom-esm/server.node";';
208
+ output.push(clientImport);
209
+ mappingInfos.push({ generatedLine: 1, originalLine: 1, originalColumn: 0 });
210
+ let lineNum = 2;
43
211
  for (const name of exportNames) {
44
212
  const exportInfo = exports.get(name);
45
213
  if (exportInfo) {
46
214
  const exportName = name === "default" && exportInfo.localName ? exportInfo.localName : name;
47
- registrations.push(
48
- `registerServerReference(${exportName}, ${moduleIdLiteral}, ${JSON.stringify(
49
- name
50
- )});`
51
- );
215
+ if (name === "default") {
216
+ output.push(
217
+ `export default registerClientReference(function() {throw new Error("Attempted to call the default export of ${moduleIdLiteral} from the server but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.");}, ${moduleIdLiteral}, "default");`
218
+ );
219
+ } else {
220
+ output.push(
221
+ `export const ${exportName} = registerClientReference(function() {throw new Error("Attempted to call ${exportName}() from the server but ${exportName} is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.");}, ${moduleIdLiteral}, ${JSON.stringify(name)});`
222
+ );
223
+ }
224
+ mappingInfos.push({
225
+ generatedLine: lineNum,
226
+ originalLine: exportInfo.loc?.line || 1,
227
+ originalColumn: exportInfo.loc?.column || 0
228
+ });
229
+ lineNum++;
52
230
  }
53
231
  }
54
- const newSource = [...imports, sourceWithoutDirective, ...registrations].join("\n\n");
55
- let mappings = "";
56
- const sourceLines = source.split("\n");
57
- for (let i = 0; i < sourceLines.length; i++) {
58
- }
59
- const sourceMap = {
60
- version: 3,
61
- file: moduleId,
62
- sources: [moduleId],
63
- sourcesContent: [newSource],
64
- // Use transformed source content
65
- mappings,
66
- sourceRoot: "",
67
- names: []
68
- };
69
- return newSource + "\n//# sourceMappingURL=data:application/json;charset=utf-8;base64," + Buffer.from(JSON.stringify(sourceMap)).toString("base64");
232
+ const newClientSource = output.join("\n\n");
233
+ const sourceMapBase64 = generateSourceMap(
234
+ moduleId,
235
+ source,
236
+ output,
237
+ mappingInfos,
238
+ originalSourceMap
239
+ );
240
+ return `${newClientSource}
241
+ //# sourceMappingURL=${sourceMapBase64}`;
70
242
  }
71
- if (!!isClientComponent) {
72
- const imports = [
73
- 'import { registerClientReference } from "react-server-dom-esm/server.node";'
74
- ];
75
- const declarations = [];
76
- for (const name of exportNames) {
77
- const errorMessage = createClientReferenceError(name);
78
- if (name === "default") {
79
- declarations.push(`export default registerClientReference(function() {
80
- throw new Error("${errorMessage}");
81
- }, ${moduleIdLiteral}, "default");`);
82
- } else {
83
- declarations.push(`export const ${name} = registerClientReference(function() {
84
- throw new Error("${errorMessage}");
85
- }, ${moduleIdLiteral}, ${JSON.stringify(name)});`);
243
+ if (Boolean(isServerFunction)) {
244
+ let hasServerDirective = function(node) {
245
+ if (hasFileLevelServerDirective) return true;
246
+ if (node.body?.body) {
247
+ for (const stmt of node.body.body) {
248
+ const directive = checkForDirective(stmt);
249
+ if (directive === "use server") return true;
250
+ }
86
251
  }
87
- }
88
- const newSource = [...imports, ...declarations].join("\n\n");
89
- let mappings = "";
90
- const sourceMap = {
91
- version: 3,
92
- file: moduleId,
93
- sources: [moduleId],
94
- sourcesContent: [newSource],
95
- // Use transformed source content
96
- mappings,
97
- sourceRoot: "",
98
- names: []
252
+ return false;
99
253
  };
100
- return newSource + "\n//# sourceMappingURL=data:application/json;charset=utf-8;base64," + Buffer.from(JSON.stringify(sourceMap)).toString("base64");
254
+ const exportedEntries = [];
255
+ const localNames = /* @__PURE__ */ new Set();
256
+ let newSource = source;
257
+ let directiveEnd2 = 0;
258
+ for (const node of program.body) {
259
+ const directive = checkForDirective(node);
260
+ if (directive === "use server" || directive === "use client") {
261
+ if (node.start === 0) {
262
+ directiveEnd2 = node.end;
263
+ } else {
264
+ newSource = newSource.slice(0, node.start) + newSource.slice(node.end);
265
+ }
266
+ continue;
267
+ }
268
+ switch (node.type) {
269
+ case "ExportDefaultDeclaration":
270
+ if (node.declaration.type === "FunctionDeclaration" && node.declaration.id) {
271
+ const name = node.declaration.id.name;
272
+ if (hasServerDirective(node.declaration)) {
273
+ exportedEntries.push({
274
+ localName: name,
275
+ exportedName: "default",
276
+ type: "function",
277
+ loc: node.declaration.id.loc?.start || { line: 1, column: 0 }
278
+ });
279
+ localNames.add(name);
280
+ }
281
+ } else if (node.declaration.type === "ClassDeclaration" && node.declaration.id) {
282
+ const name = node.declaration.id.name;
283
+ exportedEntries.push({
284
+ localName: name,
285
+ exportedName: "default",
286
+ type: "class",
287
+ loc: node.declaration.id.loc?.start || { line: 1, column: 0 }
288
+ });
289
+ localNames.add(name);
290
+ }
291
+ break;
292
+ case "ExportNamedDeclaration":
293
+ if (node.declaration) {
294
+ if (node.declaration.type === "FunctionDeclaration" && node.declaration.id) {
295
+ const name = node.declaration.id.name;
296
+ if (hasServerDirective(node.declaration)) {
297
+ exportedEntries.push({
298
+ localName: name,
299
+ exportedName: name,
300
+ type: "function",
301
+ loc: node.declaration.id.loc?.start || { line: 1, column: 0 }
302
+ });
303
+ localNames.add(name);
304
+ }
305
+ } else if (node.declaration.type === "ClassDeclaration" && node.declaration.id) {
306
+ const name = node.declaration.id.name;
307
+ exportedEntries.push({
308
+ localName: name,
309
+ exportedName: name,
310
+ type: "class",
311
+ loc: node.declaration.id.loc?.start || { line: 1, column: 0 }
312
+ });
313
+ localNames.add(name);
314
+ } else if (node.declaration.type === "VariableDeclaration") {
315
+ for (const decl of node.declaration.declarations) {
316
+ if (decl.id.type === "Identifier") {
317
+ const name = decl.id.name;
318
+ if (decl.init) {
319
+ if (decl.init.type === "FunctionExpression" || decl.init.type === "ArrowFunctionExpression") {
320
+ if (hasServerDirective(decl.init)) {
321
+ exportedEntries.push({
322
+ localName: name,
323
+ exportedName: name,
324
+ type: "function",
325
+ loc: decl.id.loc?.start || { line: 1, column: 0 }
326
+ });
327
+ localNames.add(name);
328
+ }
329
+ } else {
330
+ exportedEntries.push({
331
+ localName: name,
332
+ exportedName: name,
333
+ type: "value",
334
+ loc: decl.id.loc?.start || { line: 1, column: 0 }
335
+ });
336
+ localNames.add(name);
337
+ }
338
+ }
339
+ }
340
+ }
341
+ }
342
+ }
343
+ if (node.specifiers) {
344
+ for (const spec of node.specifiers) {
345
+ if (spec.type === "ExportSpecifier") {
346
+ const localName = spec.local.type === "Identifier" ? spec.local.name : "";
347
+ const exportedName = spec.exported.type === "Identifier" ? spec.exported.name : "";
348
+ if (localName && exportedName) {
349
+ const originalDecl = program.body.find(
350
+ (n) => n.type === "FunctionDeclaration" && n.id?.name === localName || n.type === "ClassDeclaration" && n.id?.name === localName || n.type === "VariableDeclaration" && n.declarations.some(
351
+ (d) => d.id.type === "Identifier" && d.id.name === localName
352
+ )
353
+ );
354
+ let loc = { line: 1, column: 0 };
355
+ if (originalDecl) {
356
+ if (originalDecl.type === "FunctionDeclaration" && hasServerDirective(originalDecl)) {
357
+ loc = originalDecl.id?.loc?.start || loc;
358
+ exportedEntries.push({
359
+ localName,
360
+ exportedName,
361
+ type: "function",
362
+ loc
363
+ });
364
+ localNames.add(localName);
365
+ } else if (originalDecl.type === "ClassDeclaration") {
366
+ loc = originalDecl.id?.loc?.start || loc;
367
+ exportedEntries.push({
368
+ localName,
369
+ exportedName,
370
+ type: "class",
371
+ loc
372
+ });
373
+ localNames.add(localName);
374
+ } else if (originalDecl.type === "VariableDeclaration") {
375
+ const decl = originalDecl.declarations.find((d) => d.id.type === "Identifier" && d.id.name === localName);
376
+ loc = decl?.id?.loc?.start || loc;
377
+ exportedEntries.push({
378
+ localName,
379
+ exportedName,
380
+ type: "value",
381
+ loc
382
+ });
383
+ localNames.add(localName);
384
+ }
385
+ }
386
+ }
387
+ }
388
+ }
389
+ }
390
+ break;
391
+ }
392
+ }
393
+ if (directiveEnd2 > 0) {
394
+ newSource = newSource.slice(directiveEnd2).trim();
395
+ }
396
+ const lines = [];
397
+ const mappingInfos = [];
398
+ const serverImport = process.env["NODE_ENV"] === "production" ? 'import { registerServerReference } from "react-server-dom-esm/server";' : 'import { registerServerReference } from "react-server-dom-esm/server.node";';
399
+ lines.push(serverImport);
400
+ mappingInfos.push({ generatedLine: 1, originalLine: 1, originalColumn: 0 });
401
+ lines.push(newSource);
402
+ mappingInfos.push({ generatedLine: 2, originalLine: 1, originalColumn: 0 });
403
+ let lineNum = lines.length + 1;
404
+ for (const entry of exportedEntries) {
405
+ if (entry.type === "function") {
406
+ lines.push(`if (typeof ${entry.localName} === "function") `);
407
+ }
408
+ lines.push(`registerServerReference(${entry.localName}, ${JSON.stringify(moduleId)}, ${JSON.stringify(entry.exportedName)});`);
409
+ mappingInfos.push({
410
+ generatedLine: lineNum,
411
+ originalLine: entry.loc?.line || 1,
412
+ originalColumn: entry.loc?.column || 0
413
+ });
414
+ lineNum++;
415
+ }
416
+ const newTransformedSource = lines.join("\n");
417
+ const sourceMapBase64 = generateSourceMap(
418
+ moduleId,
419
+ source,
420
+ lines,
421
+ mappingInfos,
422
+ originalSourceMap
423
+ );
424
+ return `${newTransformedSource}
425
+ //# sourceMappingURL=${sourceMapBase64}`;
101
426
  }
102
- throw new Error("Invalid module type");
427
+ return sourceWithoutMap;
103
428
  }
104
429
 
105
430
  export { transformModuleWithPreservedFunctions };
@@ -1 +1 @@
1
- {"version":3,"file":"transformModuleWithPreservedFunctions.js","sources":["../../../plugin/loader/transformModuleWithPreservedFunctions.ts"],"sourcesContent":["/**\n * # RSC Boundary Handling\n *\n * This file provides the core transformation logic for React Server Components (RSC) boundaries.\n *\n * - **Server Loader**: Always strips implementation for client modules, exports error-throwing references.\n * - **Client Loader**: Always strips implementation for server modules, exports error-throwing references.\n * - **Browser**: Only client modules are passed through as-is.\n *\n * All transformations are handled by `transformModuleWithPreservedFunctions` for consistency.\n *\n * ## Error Behavior\n *\n * - If a client component is imported on the server, the export is a function that throws a clear error.\n * - If a server action is imported on the client, the export is a function that throws a clear error.\n *\n * This ensures that implementation details are never leaked across boundaries and errors are easy to debug.\n */\nimport { handleExports } from \"./handleExports.js\";\nimport type { Program } from \"./types.js\";\nimport { createMappingsSerializer } from \"../source-map/createMappingsSerializer.js\";\n\nexport interface TransformOptions {\n id: string;\n exportNames: string[];\n beforeExports: string;\n afterExports: string;\n isServerModule?: boolean;\n isClientModule?: boolean;\n program?: Program;\n}\n\n/**\n * Creates a client reference error message\n */\nfunction createClientReferenceError(name: string): string {\n return `Attempted to call ${name}() from the server but ${name} is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.`;\n}\n\n/**\n * Transforms a module for RSC boundaries.\n * - Server modules: exports are wrapped with server references while preserving functionality.\n * - Client modules: exports are replaced with client references or errors, depending on environment.\n * - Only the correct references are exported; implementation is never leaked across boundaries.\n *\n * @param source - The original module source code.\n * @param moduleId - The module's unique identifier.\n * @param url - The module's URL.\n * @param program - The parsed AST.\n * @param map - The source map for the source code.\n * @param isServerFunction - Whether the module is a server function.\n * @param isClientComponent - Whether the module is a client component.\n * @returns The transformed source code.\n */\nexport function transformModuleWithPreservedFunctions(\n source: string,\n moduleId: string,\n program: Program,\n isServerFunction: boolean | RegExpMatchArray | null,\n isClientComponent: boolean | RegExpMatchArray | null\n): string {\n // Find and remove directives using AST\n let sourceWithoutDirective = source;\n let directiveEnd = 0;\n \n // Only look at top-level directives\n for (const node of program.body) {\n if (node.type !== \"ExpressionStatement\") {\n break;\n }\n\n let directive: string | null = null;\n if (\"directive\" in node && typeof node.directive === \"string\") {\n directive = node.directive;\n } else if (\n node.expression.type === \"Literal\" &&\n typeof node.expression.value === \"string\" &&\n (node.expression.value === \"use server\" || node.expression.value === \"use client\")\n ) {\n directive = node.expression.value;\n }\n\n if (directive && \"start\" in node && \"end\" in node) {\n directiveEnd = node.end;\n }\n }\n\n // Remove the directive and any whitespace after it\n if (directiveEnd > 0) {\n sourceWithoutDirective = source.slice(directiveEnd).trim();\n }\n\n // Get export names and create module ID literal\n const { exportNames, exports } = handleExports(\n sourceWithoutDirective,\n program,\n isServerFunction,\n isClientComponent\n );\n const moduleIdLiteral = JSON.stringify(moduleId);\n\n // For server modules in server environment, register server references\n if (Boolean(isServerFunction)) {\n const imports = [\n 'import { registerServerReference } from \"react-server-dom-esm/server.node\";',\n ];\n const registrations: string[] = [];\n\n // Register each export\n for (const name of exportNames) {\n const exportInfo = exports.get(name);\n if (exportInfo) {\n // For default exports, use the localName if available\n const exportName =\n name === \"default\" && exportInfo.localName\n ? exportInfo.localName\n : name;\n // Register all exports in server modules\n registrations.push(\n `registerServerReference(${exportName}, ${moduleIdLiteral}, ${JSON.stringify(\n name\n )});`\n );\n }\n }\n\n // Create new source with registrations\n // First, add the imports at the top\n const newSource = [...imports, sourceWithoutDirective, ...registrations].join(\"\\n\\n\");\n\n // Handle source maps\n let mappings = \"\";\n const createMapping = createMappingsSerializer();\n let generatedLine = 1;\n\n // Map the import line to the first line of the original source\n createMapping(generatedLine, 0, 0, 0, 0, -1);\n generatedLine++;\n\n // Map the registration lines to the first line of the original source\n for (let i = 0; i < registrations.length; i++) {\n createMapping(generatedLine, 0, 0, 1, 0, -1);\n generatedLine++;\n }\n\n // Map the original source lines, skipping the directive line\n const sourceLines = source.split(\"\\n\");\n for (let i = 0; i < sourceLines.length; i++) {\n createMapping(generatedLine, 0, 0, i + 1, 0, -1); // +1 because we skip directive line\n generatedLine++;\n }\n\n // Add source map to the output with original source content\n const sourceMap = {\n version: 3,\n file: moduleId,\n sources: [moduleId],\n sourcesContent: [newSource], // Use transformed source content\n mappings,\n sourceRoot: \"\",\n names: [],\n };\n\n return (\n newSource +\n \"\\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,\" +\n Buffer.from(JSON.stringify(sourceMap)).toString(\"base64\")\n );\n // end of server module\n }\n if (!!isClientComponent) {\n // For client modules in server environment, register client references\n const imports = [\n 'import { registerClientReference } from \"react-server-dom-esm/server.node\";',\n ];\n const declarations: string[] = [];\n\n for (const name of exportNames) {\n const errorMessage = createClientReferenceError(name);\n if (name === \"default\") {\n declarations.push(`export default registerClientReference(function() {\nthrow new Error(\"${errorMessage}\");\n}, ${moduleIdLiteral}, \"default\");`);\n } else {\n declarations.push(`export const ${name} = registerClientReference(function() {\nthrow new Error(\"${errorMessage}\");\n}, ${moduleIdLiteral}, ${JSON.stringify(name)});`);\n }\n }\n // Create new source with declarations\n const newSource = [...imports, ...declarations].join(\"\\n\\n\");\n\n // Handle source maps for client modules\n let mappings = \"\";\n const createMapping = createMappingsSerializer();\n let generatedLine = 1;\n\n // Map the import line to the first line of the original source\n createMapping(generatedLine, 0, 0, 0, 0, -1);\n generatedLine++;\n\n // Map the declaration lines to the first line of the original source\n for (let i = 0; i < declarations.length; i++) {\n createMapping(generatedLine, 0, 0, 1, 0, -1);\n generatedLine++;\n }\n\n // Add source map to the output with original source content\n const sourceMap = {\n version: 3,\n file: moduleId,\n sources: [moduleId],\n sourcesContent: [newSource], // Use transformed source content\n mappings,\n sourceRoot: \"\",\n names: [],\n };\n\n return (\n newSource +\n \"\\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,\" +\n Buffer.from(JSON.stringify(sourceMap)).toString(\"base64\")\n );\n }\n throw new Error(\"Invalid module type\");\n}\n"],"names":[],"mappings":";;;;;;;AAmCA,SAAS,2BAA2B,IAAsB,EAAA;AACxD,EAAO,OAAA,CAAA,kBAAA,EAAqB,IAAI,CAAA,uBAAA,EAA0B,IAAI,CAAA,kKAAA,CAAA;AAChE;AAiBO,SAAS,qCACd,CAAA,MAAA,EACA,QACA,EAAA,OAAA,EACA,kBACA,iBACQ,EAAA;AAER,EAAA,IAAI,sBAAyB,GAAA,MAAA;AAC7B,EAAA,IAAI,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9B,MAAM,MAAA,YAAA,GAAe,2BAA2B,IAAI,CAAA;AACpD,MAAA,IAAI,SAAS,SAAW,EAAA;AACtB,QAAA,YAAA,CAAa,IAAK,CAAA,CAAA;AAAA,iBAAA,EACP,YAAY,CAAA;AAAA,GAAA,EAC1B,eAAe,CAAe,aAAA,CAAA,CAAA;AAAA,OACtB,MAAA;AACL,QAAa,YAAA,CAAA,IAAA,CAAK,gBAAgB,IAAI,CAAA;AAAA,iBAAA,EAC3B,YAAY,CAAA;AAAA,GAAA,EAC1B,eAAe,CAAK,EAAA,EAAA,IAAA,CAAK,SAAU,CAAA,IAAI,CAAC,CAAI,EAAA,CAAA,CAAA;AAAA;AAC3C;AAGF,IAAM,MAAA,SAAA,GAAY,CAAC,GAAG,OAAA,EAAS,GAAG,YAAY,CAAA,CAAE,KAAK,MAAM,CAAA;AAG3D,IAAA,IAAI,QAAW,GAAA,EAAA;AAef,IAAA,MAAM,SAAY,GAAA;AAAA,MAChB,OAAS,EAAA,CAAA;AAAA,MACT,IAAM,EAAA,QAAA;AAAA,MACN,OAAA,EAAS,CAAC,QAAQ,CAAA;AAAA,MAClB,cAAA,EAAgB,CAAC,SAAS,CAAA;AAAA;AAAA,MAC1B,QAAA;AAAA,MACA,UAAY,EAAA,EAAA;AAAA,MACZ,OAAO;AAAC,KACV;AAEA,IACE,OAAA,SAAA,GACA,oEACA,GAAA,MAAA,CAAO,IAAK,CAAA,IAAA,CAAK,UAAU,SAAS,CAAC,CAAE,CAAA,QAAA,CAAS,QAAQ,CAAA;AAAA;AAG5D,EAAM,MAAA,IAAI,MAAM,qBAAqB,CAAA;AACvC;;;;"}
1
+ {"version":3,"file":"transformModuleWithPreservedFunctions.js","sources":["../../../plugin/loader/transformModuleWithPreservedFunctions.ts"],"sourcesContent":["/**\n * # RSC Boundary Handling\n *\n * This file provides the core transformation logic for React Server Components (RSC) boundaries.\n *\n * - **Server Loader**: Always strips implementation for client modules, exports error-throwing references.\n * - **Client Loader**: Always strips implementation for server modules, exports error-throwing references.\n * - **Browser**: Only client modules are passed through as-is.\n *\n * All transformations are handled by `transformModuleWithPreservedFunctions` for consistency.\n *\n * ## Error Behavior\n *\n * - If a client component is imported on the server, the export is a function that throws a clear error.\n * - If a server action is imported on the client, the export is a function that throws a clear error.\n *\n * This ensures that implementation details are never leaked across boundaries and errors are easy to debug.\n */\nimport { handleExports } from \"./handleExports.js\";\nimport type { Program } from \"./types.js\";\nimport { createMappingsSerializer } from \"../source-map/createMappingsSerializer.js\";\n\nexport interface TransformOptions {\n id: string;\n exportNames: string[];\n beforeExports: string;\n afterExports: string;\n isServerModule?: boolean;\n isClientModule?: boolean;\n program?: Program;\n}\n\n// Helper type for mapping info\ninterface MappingInfo {\n generatedLine: number;\n originalLine: number;\n originalColumn: number;\n}\n\nfunction generateSourceMap(\n moduleId: string,\n source: string,\n lines: string[],\n mappingInfos: MappingInfo[],\n originalSourceMap?: any\n) {\n const createMapping = createMappingsSerializer();\n let mappings = '';\n\n // Create a mapping for each line\n for (let i = 0; i < lines.length; i++) {\n const info = mappingInfos[i] || { generatedLine: i + 1, originalLine: 1, originalColumn: 0 };\n mappings += createMapping(\n info.generatedLine,\n 0,\n 0, // sourceIndex\n info.originalLine,\n info.originalColumn,\n -1 // nameIndex\n );\n }\n\n // Add a final mapping for the end of the file\n mappings += createMapping(\n lines.length + 1,\n 0,\n 0,\n source.split('\\n').length,\n 0,\n -1\n );\n\n const sourceMap = {\n version: 3,\n file: moduleId,\n sources: originalSourceMap?.sources || [moduleId],\n sourcesContent: originalSourceMap?.sourcesContent || [source],\n mappings,\n sourceRoot: originalSourceMap?.sourceRoot || \"\",\n names: originalSourceMap?.names || [],\n };\n\n return `data:application/json;charset=utf-8;base64,${Buffer.from(JSON.stringify(sourceMap)).toString(\"base64\")}`;\n}\n\n/**\n * --- React RSC Directive Handling ---\n *\n * 1. 'use client' at file top:\n * - Pass through code as-is (after removing directive).\n * - Do not transform or register anything.\n * - Required for React client features to work.\n * - See: https://react.dev/reference/rsc/use-client\n *\n * 2. 'use server' at file top:\n * - Register all exported async functions as server actions.\n * - See: https://react.dev/reference/rsc/use-server#caveats\n *\n * 3. 'use server' at function top:\n * - Register only that async function as a server action.\n * - See: https://react.dev/reference/rsc/use-server#caveats\n *\n * 4. No directive:\n * - Treat as a normal shared or server-only module.\n * - No special registration or transformation.\n */\n\n/**\n * Transforms a module for RSC boundaries.\n * - Server modules: exports are wrapped with server references while preserving functionality.\n * - Client modules: exports are replaced with client references or errors, depending on environment.\n * - Only the correct references are exported; implementation is never leaked across boundaries.\n *\n * @param source - The original module source code.\n * @param moduleId - The module's unique identifier.\n * @param url - The module's URL.\n * @param program - The parsed AST.\n * @param map - The source map for the source code.\n * @param isServerFunction - Whether the module is a server function.\n * @param isClientComponent - Whether the module is a client component.\n * @returns The transformed source code.\n */\nexport function transformModuleWithPreservedFunctions(\n source: string,\n moduleId: string,\n program: Program,\n isServerFunction: boolean | RegExpMatchArray | null,\n isClientComponent: boolean | RegExpMatchArray | null\n): string {\n // Check for existing source map\n let sourceMappingURL = null;\n let sourceMappingStart = 0;\n let sourceMappingEnd = 0;\n let sourceMappingLines = 0;\n let originalSourceMap = null;\n\n // Look for source map comment\n const sourceMapMatch = source.match(/\\/\\/[#@] sourceMappingURL=(.+)$/m);\n if (sourceMapMatch) {\n sourceMappingURL = sourceMapMatch[1];\n sourceMappingStart = sourceMapMatch.index!;\n sourceMappingEnd = sourceMapMatch.index! + sourceMapMatch[0].length;\n sourceMappingLines = sourceMapMatch[0].split('\\n').length - 1;\n\n // If it's a data URL, parse it\n if (sourceMappingURL.startsWith('data:application/json;base64,')) {\n const base64 = sourceMappingURL.slice('data:application/json;base64,'.length);\n originalSourceMap = JSON.parse(Buffer.from(base64, 'base64').toString());\n }\n }\n\n // Remove the old source map if present\n let sourceWithoutMap = source;\n if (sourceMappingStart > 0) {\n sourceWithoutMap = source.slice(0, sourceMappingStart) + '\\n'.repeat(sourceMappingLines) + source.slice(sourceMappingEnd);\n }\n\n // Remove directives from source code\n let sourceWithoutDirective = sourceWithoutMap;\n let directiveEnd = 0;\n let hasFileLevelServerDirective = false;\n let hasFileLevelClientDirective = false;\n let hasFunctionLevelClientDirective = false;\n let hasFunctionLevelServerDirective = false;\n\n // Get export names and create module ID literal\n const { exportNames, exports } = handleExports(\n sourceWithoutDirective,\n program,\n isServerFunction,\n isClientComponent\n );\n const moduleIdLiteral = JSON.stringify(moduleId);\n\n // Helper function to check for directives in a node\n function checkForDirective(node: any): string | null {\n if (node.type === \"ExpressionStatement\") {\n if (\"directive\" in node && typeof node.directive === \"string\") {\n return node.directive;\n } else if (\n node.expression.type === \"Literal\" &&\n typeof node.expression.value === \"string\" &&\n (node.expression.value === \"use server\" || node.expression.value === \"use client\")\n ) {\n return node.expression.value;\n }\n }\n return null;\n }\n\n // Check for file-level and function-level directives\n for (const node of program.body) {\n const directive = checkForDirective(node);\n if (directive) {\n if (directive === \"use server\") {\n if (node.start === 0) {\n hasFileLevelServerDirective = true;\n } else {\n hasFunctionLevelServerDirective = true;\n }\n }\n if (directive === \"use client\") {\n if (node.start === 0) {\n hasFileLevelClientDirective = true;\n } else {\n hasFunctionLevelClientDirective = true;\n }\n }\n if (\"start\" in node && \"end\" in node) {\n directiveEnd = Math.max(directiveEnd, node.end);\n }\n }\n\n // Check for function-level server directives in function bodies\n if (node.type === \"ExportNamedDeclaration\" && node.declaration?.type === \"FunctionDeclaration\") {\n const funcNode = node.declaration;\n if (funcNode.body?.body) {\n for (const stmt of funcNode.body.body) {\n const directive = checkForDirective(stmt);\n if (directive === \"use server\") {\n hasFunctionLevelServerDirective = true;\n // Mark this specific function as having a server directive\n const name = funcNode.id?.name;\n if (name) {\n const exportInfo = exports.get(name);\n if (exportInfo) {\n exportInfo.declaration = exportInfo.declaration?.replace(\n /^export\\s+function\\s+/,\n 'export async function '\n );\n exportInfo.isAsync = true;\n }\n }\n break;\n }\n }\n }\n } else if (node.type === \"FunctionDeclaration\") {\n if (node.body?.body) {\n for (const stmt of node.body.body) {\n const directive = checkForDirective(stmt);\n if (directive === \"use server\") {\n hasFunctionLevelServerDirective = true;\n // Mark this specific function as having a server directive\n const name = node.id?.name;\n if (name) {\n const exportInfo = exports.get(name);\n if (exportInfo) {\n exportInfo.declaration = exportInfo.declaration?.replace(\n /^export\\s+function\\s+/,\n 'export async function '\n );\n exportInfo.isAsync = true;\n }\n }\n break;\n }\n }\n }\n } else if (node.type === \"VariableDeclaration\") {\n for (const decl of node.declarations) {\n if (decl.init?.type === \"FunctionExpression\" || decl.init?.type === \"ArrowFunctionExpression\") {\n const body = decl.init.body;\n if (body.type === \"BlockStatement\" && body.body) {\n for (const stmt of body.body) {\n const directive = checkForDirective(stmt);\n if (directive === \"use server\") {\n hasFunctionLevelServerDirective = true;\n const name = decl.id.type === \"Identifier\" ? decl.id.name : undefined;\n if (name) {\n const exportInfo = exports.get(name);\n if (exportInfo) {\n exportInfo.declaration = exportInfo.declaration?.replace(\n /^export\\s+function\\s+/,\n 'export async function '\n );\n exportInfo.isAsync = true;\n }\n }\n break;\n }\n }\n }\n }\n }\n }\n }\n\n // Validate directive combinations\n if (hasFileLevelClientDirective && hasFileLevelServerDirective) {\n throw new Error(`Module ${moduleId} cannot have both \"use client\" and \"use server\" directives`);\n }\n\n if (hasFunctionLevelClientDirective) {\n throw new Error(`Module ${moduleId} cannot have function-level \"use client\" directives - only file-level is allowed`);\n }\n\n // Validate against user's explicit intent\n if (Boolean(isClientComponent) && !hasFileLevelClientDirective) {\n throw new Error(`Module ${moduleId} is marked as a client component but has no \"use client\" directive`);\n }\n\n if (Boolean(isServerFunction) && !hasFileLevelServerDirective && !hasFunctionLevelServerDirective) {\n if(process.env['NODE_ENV'] !== \"production\") {\n console.log(\"Error for file\", moduleId, source);\n }\n throw new Error(`Module ${moduleId} is marked as a server function but has no \"use server\" directive`);\n }\n\n // Remove the directive and any whitespace after it\n if (directiveEnd > 0) {\n sourceWithoutDirective = source.slice(directiveEnd).trim();\n }\n\n // Validate that there are exports to transform if explicitly marked\n if (Boolean(isClientComponent) && exportNames.length === 0) {\n throw new Error(`Module ${moduleId} is marked as a client component but has no exports to transform`);\n }\n\n if (Boolean(isServerFunction) && exportNames.length === 0) {\n throw new Error(`Module ${moduleId} is marked as a server function but has no exports to transform`);\n }\n\n // For client modules in server environment, replace with client references\n if (Boolean(isClientComponent)) {\n const output: string[] = [];\n const mappingInfos: MappingInfo[] = [];\n\n // Add registerClientReference import\n const clientImport = process.env['NODE_ENV'] === 'production'\n ? 'import { registerClientReference } from \"react-server-dom-esm/server\";'\n : 'import { registerClientReference } from \"react-server-dom-esm/server.node\";';\n output.push(clientImport);\n mappingInfos.push({ generatedLine: 1, originalLine: 1, originalColumn: 0 });\n\n // Register each export\n let lineNum = 2;\n for (const name of exportNames) {\n const exportInfo = exports.get(name);\n if (exportInfo) {\n // For default exports, use the localName if available\n const exportName =\n name === \"default\" && exportInfo.localName\n ? exportInfo.localName\n : name;\n if (name === 'default') {\n output.push(\n `export default registerClientReference(function() {` +\n `throw new Error(\"Attempted to call the default export of ${moduleIdLiteral} from the server but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.\");` +\n `}, ${moduleIdLiteral}, \"default\");`\n );\n } else {\n output.push(\n `export const ${exportName} = registerClientReference(function() {` +\n `throw new Error(\"Attempted to call ${exportName}() from the server but ${exportName} is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.\");` +\n `}, ${moduleIdLiteral}, ${JSON.stringify(name)});`\n );\n }\n // Create a mapping for each registration line\n mappingInfos.push({ \n generatedLine: lineNum, \n originalLine: exportInfo.loc?.line || 1, \n originalColumn: exportInfo.loc?.column || 0 \n });\n lineNum++;\n }\n }\n\n const newClientSource = output.join(\"\\n\\n\");\n const sourceMapBase64 = generateSourceMap(\n moduleId,\n source,\n output,\n mappingInfos,\n originalSourceMap\n );\n return `${newClientSource}\\n//# sourceMappingURL=${sourceMapBase64}`;\n }\n\n // For server modules in client environment, replace with server references\n if (Boolean(isServerFunction)) {\n // First collect all exports that need registration\n const exportedEntries: Array<{ localName: string; exportedName: string; type: string; loc?: { line: number; column: number } }> = [];\n const localNames = new Set();\n\n // Helper to check if a function has a \"use server\" directive\n function hasServerDirective(node: any): boolean {\n if (hasFileLevelServerDirective) return true;\n if (node.body?.body) {\n for (const stmt of node.body.body) {\n const directive = checkForDirective(stmt);\n if (directive === \"use server\") return true;\n }\n }\n return false;\n }\n\n // First pass: collect exports and remove directives\n let newSource = source;\n let directiveEnd = 0;\n\n for (const node of program.body) {\n // Handle directives\n const directive = checkForDirective(node);\n if (directive === \"use server\" || directive === \"use client\") {\n if (node.start === 0) {\n directiveEnd = node.end;\n } else {\n // Remove function-level directive\n newSource = newSource.slice(0, node.start) + newSource.slice(node.end);\n }\n continue;\n }\n\n // Collect exports that need registration, with loc\n switch (node.type) {\n case 'ExportDefaultDeclaration':\n if (node.declaration.type === 'FunctionDeclaration' && node.declaration.id) {\n const name = node.declaration.id.name;\n if (hasServerDirective(node.declaration)) {\n exportedEntries.push({\n localName: name,\n exportedName: 'default',\n type: 'function',\n loc: node.declaration.id.loc?.start || { line: 1, column: 0 }\n });\n localNames.add(name);\n }\n } else if (node.declaration.type === 'ClassDeclaration' && node.declaration.id) {\n const name = node.declaration.id.name;\n exportedEntries.push({\n localName: name,\n exportedName: 'default',\n type: 'class',\n loc: node.declaration.id.loc?.start || { line: 1, column: 0 }\n });\n localNames.add(name);\n }\n break;\n case 'ExportNamedDeclaration':\n if (node.declaration) {\n if (node.declaration.type === 'FunctionDeclaration' && node.declaration.id) {\n const name = node.declaration.id.name;\n if (hasServerDirective(node.declaration)) {\n exportedEntries.push({\n localName: name,\n exportedName: name,\n type: 'function',\n loc: node.declaration.id.loc?.start || { line: 1, column: 0 }\n });\n localNames.add(name);\n }\n } else if (node.declaration.type === 'ClassDeclaration' && node.declaration.id) {\n const name = node.declaration.id.name;\n exportedEntries.push({\n localName: name,\n exportedName: name,\n type: 'class',\n loc: node.declaration.id.loc?.start || { line: 1, column: 0 }\n });\n localNames.add(name);\n } else if (node.declaration.type === 'VariableDeclaration') {\n for (const decl of node.declaration.declarations) {\n if (decl.id.type === 'Identifier') {\n const name = decl.id.name;\n if (decl.init) {\n if (decl.init.type === 'FunctionExpression' || decl.init.type === 'ArrowFunctionExpression') {\n if (hasServerDirective(decl.init)) {\n exportedEntries.push({\n localName: name,\n exportedName: name,\n type: 'function',\n loc: decl.id.loc?.start || { line: 1, column: 0 }\n });\n localNames.add(name);\n }\n } else {\n // Register non-function values\n exportedEntries.push({\n localName: name,\n exportedName: name,\n type: 'value',\n loc: decl.id.loc?.start || { line: 1, column: 0 }\n });\n localNames.add(name);\n }\n }\n }\n }\n }\n }\n if (node.specifiers) {\n for (const spec of node.specifiers) {\n if (spec.type === 'ExportSpecifier') {\n const localName = spec.local.type === 'Identifier' ? spec.local.name : '';\n const exportedName = spec.exported.type === 'Identifier' ? spec.exported.name : '';\n if (localName && exportedName) {\n // Find the original declaration to check for directive\n const originalDecl = program.body.find(n => \n (n.type === 'FunctionDeclaration' && n.id?.name === localName) ||\n (n.type === 'ClassDeclaration' && n.id?.name === localName) ||\n (n.type === 'VariableDeclaration' && n.declarations.some(d => \n d.id.type === 'Identifier' && d.id.name === localName\n ))\n );\n let loc = { line: 1, column: 0 };\n if (originalDecl) {\n if (originalDecl.type === 'FunctionDeclaration' && hasServerDirective(originalDecl)) {\n loc = originalDecl.id?.loc?.start || loc;\n exportedEntries.push({\n localName,\n exportedName,\n type: 'function',\n loc\n });\n localNames.add(localName);\n } else if (originalDecl.type === 'ClassDeclaration') {\n loc = originalDecl.id?.loc?.start || loc;\n exportedEntries.push({\n localName,\n exportedName,\n type: 'class',\n loc\n });\n localNames.add(localName);\n } else if (originalDecl.type === 'VariableDeclaration') {\n // Find the right declaration\n const decl = originalDecl.declarations.find(d => d.id.type === 'Identifier' && d.id.name === localName);\n loc = decl?.id?.loc?.start || loc;\n exportedEntries.push({\n localName,\n exportedName,\n type: 'value',\n loc\n });\n localNames.add(localName);\n }\n }\n }\n }\n }\n }\n break;\n }\n }\n\n // Remove file-level directive if present\n if (directiveEnd > 0) {\n newSource = newSource.slice(directiveEnd).trim();\n }\n\n // Add import and registrations\n const lines: string[] = [];\n const mappingInfos: MappingInfo[] = [];\n \n // Add import statement\n const serverImport = process.env['NODE_ENV'] === 'production' \n ? 'import { registerServerReference } from \"react-server-dom-esm/server\";'\n : 'import { registerServerReference } from \"react-server-dom-esm/server.node\";';\n lines.push(serverImport);\n mappingInfos.push({ generatedLine: 1, originalLine: 1, originalColumn: 0 });\n\n // Add the original source code\n lines.push(newSource);\n mappingInfos.push({ generatedLine: 2, originalLine: 1, originalColumn: 0 });\n\n // Add registrations after the source code\n let lineNum = lines.length + 1;\n for (const entry of exportedEntries) {\n if (entry.type === 'function') {\n lines.push(`if (typeof ${entry.localName} === \"function\") `);\n }\n lines.push(`registerServerReference(${entry.localName}, ${JSON.stringify(moduleId)}, ${JSON.stringify(entry.exportedName)});`);\n // Create a mapping for each registration line\n mappingInfos.push({ \n generatedLine: lineNum, \n originalLine: entry.loc?.line || 1, \n originalColumn: entry.loc?.column || 0 \n });\n lineNum++;\n }\n\n const newTransformedSource = lines.join('\\n');\n const sourceMapBase64 = generateSourceMap(\n moduleId,\n source,\n lines,\n mappingInfos,\n originalSourceMap\n );\n return `${newTransformedSource}\\n//# sourceMappingURL=${sourceMapBase64}`;\n }\n\n // For non-server, non-client modules, return as is\n return sourceWithoutMap;\n}\n"],"names":["directive","directiveEnd"],"mappings":";;;;;;;;AAuCA,SAAS,iBACP,CAAA,QAAA,EACA,MACA,EAAA,KAAA,EACA,cACA,iBACA,EAAA;AACA,EAAA,MAAM,gBAAgB,wBAAyB,EAAA;AAC/C,EAAA,IAAI,QAAW,GAAA,EAAA;AAGf,EAAA,KAAA,IAAS,CAAI,GAAA,CAAA,EAAG,CAAI,GAAA,KAAA,CAAM,QAAQ,CAAK,EAAA,EAAA;AACrC,IAAM,MAAA,IAAA,GAAO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G,CAAA;AAG1E,IAAI,IAAA,OAAA,GAAU,MAAM,MAAS,GAAA,CAAA;AAC7B,IAAA,KAAA,MAAW,SAAS,eAAiB,EAAA;AACnC,MAAI,IAAA,KAAA,CAAM,SAAS,UAAY,EAAA;AAC7B,QAAA,KAAA,CAAM,IAAK,CAAA,CAAA,WAAA,EAAc,KAAM,CAAA,SAAS,CAAmB,iBAAA,CAAA,CAAA;AAAA;AAE7D,MAAA,KAAA,CAAM,IAAK,CAAA,CAAA,wBAAA,EAA2B,KAAM,CAAA,SAAS,KAAK,IAAK,CAAA,SAAA,CAAU,QAAQ,CAAC,KAAK,IAAK,CAAA,SAAA,CAAU,KAAM,CAAA,YAAY,CAAC,CAAI,EAAA,CAAA,CAAA;AAE7H,MAAA,YAAA,CAAa,IAAK,CAAA;AAAA,QAChB,aAAe,EAAA,OAAA;AAAA,QACf,YAAA,EAAc,KAAM,CAAA,GAAA,EAAK,IAAQ,IAAA,CAAA;AAAA,QACjC,cAAA,EAAgB,KAAM,CAAA,GAAA,EAAK,MAAU,IAAA;AAAA,OACtC,CAAA;AACD,MAAA,OAAA,EAAA;AAAA;AAGF,IAAM,MAAA,oBAAA,GAAuB,KAAM,CAAA,IAAA,CAAK,IAAI,CAAA;AAC5C,IAAA,MAAM,eAAkB,GAAA,iBAAA;AAAA,MACtB,QAAA;AAAA,MACA,MAAA;AAAA,MACA,KAAA;AAAA,MACA,YAAA;AAAA,MACA;AAAA,KACF;AACA,IAAA,OAAO,GAAG,oBAAoB;AAAA,qBAAA,EAA0B,eAAe,CAAA,CAAA;AAAA;AAIzE,EAAO,OAAA,gBAAA;AACT;;;;"}
@@ -1,8 +1,14 @@
1
- import type { Program as AcornProgram, Statement } from "acorn";
1
+ import type { Program as AcornProgram, Statement, Node as AcornNode } from "acorn";
2
2
  export type Directive = Statement & {
3
3
  directive: string;
4
4
  };
5
- export interface Program extends AcornProgram {
6
- exports?: string[];
5
+ export type Node = AcornNode;
6
+ export interface ExportInfo {
7
+ name: string;
8
+ localName?: string;
9
+ type: "function" | "variable" | "class" | "unknown";
10
+ isServerAction?: boolean;
11
+ node?: Node;
7
12
  }
13
+ export type Program = AcornProgram;
8
14
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../plugin/loader/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGhE,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG;IAClC,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,WAAW,OAAQ,SAAQ,YAAY;IAC3C,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../plugin/loader/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,YAAY,EAAE,SAAS,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,OAAO,CAAC;AAGnF,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG;IAClC,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,IAAI,GAAG,SAAS,CAAC;AAE7B,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,UAAU,GAAG,UAAU,GAAG,OAAO,GAAG,SAAS,CAAC;IACpD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,IAAI,CAAC,EAAE,IAAI,CAAC;CACb;AAED,MAAM,MAAM,OAAO,GAAG,YAAY,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"configureWorkerRequestHandler.d.ts","sourceRoot":"","sources":["../../../plugin/react-client/configureWorkerRequestHandler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACZ,WAAW,EACX,aAAa,EAEb,mBAAmB,EAEpB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAe,MAAM,qBAAqB,CAAC;AAalE;;;;;GAKG;AACH,wBAAsB,6BAA6B,CACjD,CAAC,SAAS,WAAW,GAAG,WAAW,EACnC,SAAS,SAAS,YAAY,GAAG,YAAY,EAC7C,EACA,MAAM,EACN,mBAAmB,EACnB,WAAW,EAAE,YAAY,EACzB,UAAU,EACV,SAAS,GACV,EAAE;IACD,MAAM,EAAE,aAAa,CAAC;IACtB,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,WAAW,EAAE,mBAAmB,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;IAC/C,UAAU,EAAE,cAAc,CAAC;IAC3B,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;CAC9C,iBAmRA"}
1
+ {"version":3,"file":"configureWorkerRequestHandler.d.ts","sourceRoot":"","sources":["../../../plugin/react-client/configureWorkerRequestHandler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACZ,WAAW,EACX,aAAa,EAEb,mBAAmB,EAEpB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAe,MAAM,qBAAqB,CAAC;AAYlE;;;;;GAKG;AACH,wBAAsB,6BAA6B,CACjD,CAAC,SAAS,WAAW,GAAG,WAAW,EACnC,SAAS,SAAS,YAAY,GAAG,YAAY,EAC7C,EACA,MAAM,EACN,mBAAmB,EACnB,WAAW,EAAE,YAAY,EACzB,UAAU,EACV,SAAS,GACV,EAAE;IACD,MAAM,EAAE,aAAa,CAAC;IACtB,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,WAAW,EAAE,mBAAmB,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;IAC/C,UAAU,EAAE,cAAc,CAAC;IAC3B,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;CAC9C,iBAwMA"}