react-server-dom-webpack 19.0.0-rc.0 → 19.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/react-server-dom-webpack-client.browser.development.js +2483 -3269
- package/cjs/react-server-dom-webpack-client.browser.production.js +420 -215
- package/cjs/react-server-dom-webpack-client.edge.development.js +2656 -3546
- package/cjs/react-server-dom-webpack-client.edge.production.js +424 -218
- package/cjs/react-server-dom-webpack-client.node.development.js +2693 -3498
- package/cjs/react-server-dom-webpack-client.node.production.js +546 -263
- package/cjs/react-server-dom-webpack-client.node.unbundled.development.js +2638 -3434
- package/cjs/react-server-dom-webpack-client.node.unbundled.production.js +526 -257
- package/cjs/react-server-dom-webpack-plugin.js +11 -11
- package/cjs/react-server-dom-webpack-server.browser.development.js +3700 -5229
- package/cjs/react-server-dom-webpack-server.browser.production.js +447 -276
- package/cjs/react-server-dom-webpack-server.edge.development.js +3730 -5241
- package/cjs/react-server-dom-webpack-server.edge.production.js +435 -283
- package/cjs/react-server-dom-webpack-server.node.development.js +3794 -5384
- package/cjs/react-server-dom-webpack-server.node.production.js +428 -289
- package/cjs/react-server-dom-webpack-server.node.unbundled.development.js +3756 -5310
- package/cjs/react-server-dom-webpack-server.node.unbundled.production.js +421 -284
- package/esm/react-server-dom-webpack-node-loader.production.js +238 -44
- package/package.json +27 -4
- package/server.browser.js +12 -2
- package/server.edge.js +12 -2
- package/server.node.js +13 -2
- package/server.node.unbundled.js +13 -2
- package/static.browser.js +12 -0
- package/static.edge.js +12 -0
- package/static.js +6 -0
- package/static.node.js +12 -0
- package/static.node.unbundled.js +12 -0
@@ -9,6 +9,8 @@
|
|
9
9
|
*/
|
10
10
|
|
11
11
|
import * as acorn from 'acorn-loose';
|
12
|
+
import readMappings from 'webpack-sources/lib/helpers/readMappings.js';
|
13
|
+
import createMappingsSerializer from 'webpack-sources/lib/helpers/createMappingsSerializer.js';
|
12
14
|
|
13
15
|
const assign = Object.assign;
|
14
16
|
|
@@ -39,47 +41,67 @@ async function getSource(url, context, defaultGetSource) {
|
|
39
41
|
return defaultGetSource(url, context, defaultGetSource);
|
40
42
|
}
|
41
43
|
|
42
|
-
function
|
44
|
+
function addExportedEntry(exportedEntries, localNames, localName, exportedName, type, loc) {
|
45
|
+
if (localNames.has(localName)) {
|
46
|
+
// If the same local name is exported more than once, we only need one of the names.
|
47
|
+
return;
|
48
|
+
}
|
49
|
+
|
50
|
+
exportedEntries.push({
|
51
|
+
localName,
|
52
|
+
exportedName,
|
53
|
+
type,
|
54
|
+
loc,
|
55
|
+
originalLine: -1,
|
56
|
+
originalColumn: -1,
|
57
|
+
originalSource: -1,
|
58
|
+
nameIndex: -1
|
59
|
+
});
|
60
|
+
}
|
61
|
+
|
62
|
+
function addLocalExportedNames(exportedEntries, localNames, node) {
|
43
63
|
switch (node.type) {
|
44
64
|
case 'Identifier':
|
45
|
-
|
65
|
+
addExportedEntry(exportedEntries, localNames, node.name, node.name, null, node.loc);
|
46
66
|
return;
|
47
67
|
|
48
68
|
case 'ObjectPattern':
|
49
|
-
for (let i = 0; i < node.properties.length; i++) addLocalExportedNames(
|
69
|
+
for (let i = 0; i < node.properties.length; i++) addLocalExportedNames(exportedEntries, localNames, node.properties[i]);
|
50
70
|
|
51
71
|
return;
|
52
72
|
|
53
73
|
case 'ArrayPattern':
|
54
74
|
for (let i = 0; i < node.elements.length; i++) {
|
55
75
|
const element = node.elements[i];
|
56
|
-
if (element) addLocalExportedNames(
|
76
|
+
if (element) addLocalExportedNames(exportedEntries, localNames, element);
|
57
77
|
}
|
58
78
|
|
59
79
|
return;
|
60
80
|
|
61
81
|
case 'Property':
|
62
|
-
addLocalExportedNames(
|
82
|
+
addLocalExportedNames(exportedEntries, localNames, node.value);
|
63
83
|
return;
|
64
84
|
|
65
85
|
case 'AssignmentPattern':
|
66
|
-
addLocalExportedNames(
|
86
|
+
addLocalExportedNames(exportedEntries, localNames, node.left);
|
67
87
|
return;
|
68
88
|
|
69
89
|
case 'RestElement':
|
70
|
-
addLocalExportedNames(
|
90
|
+
addLocalExportedNames(exportedEntries, localNames, node.argument);
|
71
91
|
return;
|
72
92
|
|
73
93
|
case 'ParenthesizedExpression':
|
74
|
-
addLocalExportedNames(
|
94
|
+
addLocalExportedNames(exportedEntries, localNames, node.expression);
|
75
95
|
return;
|
76
96
|
}
|
77
97
|
}
|
78
98
|
|
79
|
-
function transformServerModule(source,
|
80
|
-
|
81
|
-
|
82
|
-
const
|
99
|
+
function transformServerModule(source, program, url, sourceMap, loader) {
|
100
|
+
const body = program.body; // This entry list needs to be in source location order.
|
101
|
+
|
102
|
+
const exportedEntries = []; // Dedupe set.
|
103
|
+
|
104
|
+
const localNames = new Set();
|
83
105
|
|
84
106
|
for (let i = 0; i < body.length; i++) {
|
85
107
|
const node = body[i];
|
@@ -91,11 +113,10 @@ function transformServerModule(source, body, url, loader) {
|
|
91
113
|
|
92
114
|
case 'ExportDefaultDeclaration':
|
93
115
|
if (node.declaration.type === 'Identifier') {
|
94
|
-
localNames
|
116
|
+
addExportedEntry(exportedEntries, localNames, node.declaration.name, 'default', null, node.declaration.loc);
|
95
117
|
} else if (node.declaration.type === 'FunctionDeclaration') {
|
96
118
|
if (node.declaration.id) {
|
97
|
-
localNames
|
98
|
-
localTypes.set(node.declaration.id.name, 'function');
|
119
|
+
addExportedEntry(exportedEntries, localNames, node.declaration.id.name, 'default', 'function', node.declaration.id.loc);
|
99
120
|
}
|
100
121
|
}
|
101
122
|
|
@@ -107,15 +128,11 @@ function transformServerModule(source, body, url, loader) {
|
|
107
128
|
const declarations = node.declaration.declarations;
|
108
129
|
|
109
130
|
for (let j = 0; j < declarations.length; j++) {
|
110
|
-
addLocalExportedNames(localNames, declarations[j].id);
|
131
|
+
addLocalExportedNames(exportedEntries, localNames, declarations[j].id);
|
111
132
|
}
|
112
133
|
} else {
|
113
134
|
const name = node.declaration.id.name;
|
114
|
-
localNames
|
115
|
-
|
116
|
-
if (node.declaration.type === 'FunctionDeclaration') {
|
117
|
-
localTypes.set(name, 'function');
|
118
|
-
}
|
135
|
+
addExportedEntry(exportedEntries, localNames, name, name, node.declaration.type === 'FunctionDeclaration' ? 'function' : null, node.declaration.id.loc);
|
119
136
|
}
|
120
137
|
}
|
121
138
|
|
@@ -124,7 +141,7 @@ function transformServerModule(source, body, url, loader) {
|
|
124
141
|
|
125
142
|
for (let j = 0; j < specifiers.length; j++) {
|
126
143
|
const specifier = specifiers[j];
|
127
|
-
localNames
|
144
|
+
addExportedEntry(exportedEntries, localNames, specifier.local.name, specifier.exported.name, null, specifier.local.loc);
|
128
145
|
}
|
129
146
|
}
|
130
147
|
|
@@ -132,22 +149,159 @@ function transformServerModule(source, body, url, loader) {
|
|
132
149
|
}
|
133
150
|
}
|
134
151
|
|
135
|
-
|
136
|
-
|
137
|
-
|
152
|
+
let mappings = sourceMap && typeof sourceMap.mappings === 'string' ? sourceMap.mappings : '';
|
153
|
+
let newSrc = source;
|
154
|
+
|
155
|
+
if (exportedEntries.length > 0) {
|
156
|
+
let lastSourceIndex = 0;
|
157
|
+
let lastOriginalLine = 0;
|
158
|
+
let lastOriginalColumn = 0;
|
159
|
+
let lastNameIndex = 0;
|
160
|
+
let sourceLineCount = 0;
|
161
|
+
let lastMappedLine = 0;
|
162
|
+
|
163
|
+
if (sourceMap) {
|
164
|
+
// We iterate source mapping entries and our matched exports in parallel to source map
|
165
|
+
// them to their original location.
|
166
|
+
let nextEntryIdx = 0;
|
167
|
+
let nextEntryLine = exportedEntries[nextEntryIdx].loc.start.line;
|
168
|
+
let nextEntryColumn = exportedEntries[nextEntryIdx].loc.start.column;
|
169
|
+
readMappings(mappings, (generatedLine, generatedColumn, sourceIndex, originalLine, originalColumn, nameIndex) => {
|
170
|
+
if (generatedLine > nextEntryLine || generatedLine === nextEntryLine && generatedColumn > nextEntryColumn) {
|
171
|
+
// We're past the entry which means that the best match we have is the previous entry.
|
172
|
+
if (lastMappedLine === nextEntryLine) {
|
173
|
+
// Match
|
174
|
+
exportedEntries[nextEntryIdx].originalLine = lastOriginalLine;
|
175
|
+
exportedEntries[nextEntryIdx].originalColumn = lastOriginalColumn;
|
176
|
+
exportedEntries[nextEntryIdx].originalSource = lastSourceIndex;
|
177
|
+
exportedEntries[nextEntryIdx].nameIndex = lastNameIndex;
|
178
|
+
}
|
179
|
+
|
180
|
+
nextEntryIdx++;
|
181
|
+
|
182
|
+
if (nextEntryIdx < exportedEntries.length) {
|
183
|
+
nextEntryLine = exportedEntries[nextEntryIdx].loc.start.line;
|
184
|
+
nextEntryColumn = exportedEntries[nextEntryIdx].loc.start.column;
|
185
|
+
} else {
|
186
|
+
nextEntryLine = -1;
|
187
|
+
nextEntryColumn = -1;
|
188
|
+
}
|
189
|
+
}
|
190
|
+
|
191
|
+
lastMappedLine = generatedLine;
|
192
|
+
|
193
|
+
if (sourceIndex > -1) {
|
194
|
+
lastSourceIndex = sourceIndex;
|
195
|
+
}
|
196
|
+
|
197
|
+
if (originalLine > -1) {
|
198
|
+
lastOriginalLine = originalLine;
|
199
|
+
}
|
200
|
+
|
201
|
+
if (originalColumn > -1) {
|
202
|
+
lastOriginalColumn = originalColumn;
|
203
|
+
}
|
204
|
+
|
205
|
+
if (nameIndex > -1) {
|
206
|
+
lastNameIndex = nameIndex;
|
207
|
+
}
|
208
|
+
});
|
209
|
+
|
210
|
+
if (nextEntryIdx < exportedEntries.length) {
|
211
|
+
if (lastMappedLine === nextEntryLine) {
|
212
|
+
// Match
|
213
|
+
exportedEntries[nextEntryIdx].originalLine = lastOriginalLine;
|
214
|
+
exportedEntries[nextEntryIdx].originalColumn = lastOriginalColumn;
|
215
|
+
exportedEntries[nextEntryIdx].originalSource = lastSourceIndex;
|
216
|
+
exportedEntries[nextEntryIdx].nameIndex = lastNameIndex;
|
217
|
+
}
|
218
|
+
}
|
219
|
+
|
220
|
+
for (let lastIdx = mappings.length - 1; lastIdx >= 0 && mappings[lastIdx] === ';'; lastIdx--) {
|
221
|
+
// If the last mapped lines don't contain any segments, we don't get a callback from readMappings
|
222
|
+
// so we need to pad the number of mapped lines, with one for each empty line.
|
223
|
+
lastMappedLine++;
|
224
|
+
}
|
225
|
+
|
226
|
+
sourceLineCount = program.loc.end.line;
|
227
|
+
|
228
|
+
if (sourceLineCount < lastMappedLine) {
|
229
|
+
throw new Error('The source map has more mappings than there are lines.');
|
230
|
+
} // If the original source string had more lines than there are mappings in the source map.
|
231
|
+
// Add some extra padding of unmapped lines so that any lines that we add line up.
|
138
232
|
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
233
|
+
|
234
|
+
for (let extraLines = sourceLineCount - lastMappedLine; extraLines > 0; extraLines--) {
|
235
|
+
mappings += ';';
|
236
|
+
}
|
237
|
+
} else {
|
238
|
+
// If a file doesn't have a source map then we generate a blank source map that just
|
239
|
+
// contains the original content and segments pointing to the original lines.
|
240
|
+
sourceLineCount = 1;
|
241
|
+
let idx = -1;
|
242
|
+
|
243
|
+
while ((idx = source.indexOf('\n', idx + 1)) !== -1) {
|
244
|
+
sourceLineCount++;
|
245
|
+
}
|
246
|
+
|
247
|
+
mappings = 'AAAA' + ';AACA'.repeat(sourceLineCount - 1);
|
248
|
+
sourceMap = {
|
249
|
+
version: 3,
|
250
|
+
sources: [url],
|
251
|
+
sourcesContent: [source],
|
252
|
+
mappings: mappings,
|
253
|
+
sourceRoot: ''
|
254
|
+
};
|
255
|
+
lastSourceIndex = 0;
|
256
|
+
lastOriginalLine = sourceLineCount;
|
257
|
+
lastOriginalColumn = 0;
|
258
|
+
lastNameIndex = -1;
|
259
|
+
lastMappedLine = sourceLineCount;
|
260
|
+
|
261
|
+
for (let i = 0; i < exportedEntries.length; i++) {
|
262
|
+
// Point each entry to original location.
|
263
|
+
const entry = exportedEntries[i];
|
264
|
+
entry.originalSource = 0;
|
265
|
+
entry.originalLine = entry.loc.start.line; // We use column zero since we do the short-hand line-only source maps above.
|
266
|
+
|
267
|
+
entry.originalColumn = 0; // entry.loc.start.column;
|
268
|
+
}
|
145
269
|
}
|
146
270
|
|
147
|
-
newSrc += '
|
148
|
-
newSrc +=
|
149
|
-
|
150
|
-
|
271
|
+
newSrc += '\n\n;';
|
272
|
+
newSrc += 'import {registerServerReference} from "react-server-dom-webpack/server";\n';
|
273
|
+
|
274
|
+
if (mappings) {
|
275
|
+
mappings += ';;';
|
276
|
+
}
|
277
|
+
|
278
|
+
const createMapping = createMappingsSerializer(); // Create an empty mapping pointing to where we last left off to reset the counters.
|
279
|
+
|
280
|
+
let generatedLine = 1;
|
281
|
+
createMapping(generatedLine, 0, lastSourceIndex, lastOriginalLine, lastOriginalColumn, lastNameIndex);
|
282
|
+
|
283
|
+
for (let i = 0; i < exportedEntries.length; i++) {
|
284
|
+
const entry = exportedEntries[i];
|
285
|
+
generatedLine++;
|
286
|
+
|
287
|
+
if (entry.type !== 'function') {
|
288
|
+
// We first check if the export is a function and if so annotate it.
|
289
|
+
newSrc += 'if (typeof ' + entry.localName + ' === "function") ';
|
290
|
+
}
|
291
|
+
|
292
|
+
newSrc += 'registerServerReference(' + entry.localName + ',';
|
293
|
+
newSrc += JSON.stringify(url) + ',';
|
294
|
+
newSrc += JSON.stringify(entry.exportedName) + ');\n';
|
295
|
+
mappings += createMapping(generatedLine, 0, entry.originalSource, entry.originalLine, entry.originalColumn, entry.nameIndex);
|
296
|
+
}
|
297
|
+
}
|
298
|
+
|
299
|
+
if (sourceMap) {
|
300
|
+
// Override with an new mappings and serialize an inline source map.
|
301
|
+
sourceMap.mappings = mappings;
|
302
|
+
newSrc += '//# sourceMappingURL=data:application/json;charset=utf-8;base64,' + Buffer.from(JSON.stringify(sourceMap)).toString('base64');
|
303
|
+
}
|
304
|
+
|
151
305
|
return newSrc;
|
152
306
|
}
|
153
307
|
|
@@ -277,7 +431,8 @@ async function parseExportNamesInto(body, names, parentURL, loader) {
|
|
277
431
|
}
|
278
432
|
}
|
279
433
|
|
280
|
-
async function transformClientModule(
|
434
|
+
async function transformClientModule(program, url, sourceMap, loader) {
|
435
|
+
const body = program.body;
|
281
436
|
const names = [];
|
282
437
|
await parseExportNamesInto(body, names, url, loader);
|
283
438
|
|
@@ -293,7 +448,7 @@ async function transformClientModule(body, url, loader) {
|
|
293
448
|
if (name === 'default') {
|
294
449
|
newSrc += 'export default ';
|
295
450
|
newSrc += 'registerClientReference(function() {';
|
296
|
-
newSrc += 'throw new Error(' + JSON.stringify("Attempted to call the default export of " + url + " 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.") + ');';
|
451
|
+
newSrc += 'throw new Error(' + JSON.stringify("Attempted to call the default export of " + url + " 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.") + ');';
|
297
452
|
} else {
|
298
453
|
newSrc += 'export const ' + name + ' = ';
|
299
454
|
newSrc += 'registerClientReference(function() {';
|
@@ -303,7 +458,9 @@ async function transformClientModule(body, url, loader) {
|
|
303
458
|
newSrc += '},';
|
304
459
|
newSrc += JSON.stringify(url) + ',';
|
305
460
|
newSrc += JSON.stringify(name) + ');\n';
|
306
|
-
}
|
461
|
+
} // TODO: Generate source maps for Client Reference functions so they can point to their
|
462
|
+
// original locations.
|
463
|
+
|
307
464
|
|
308
465
|
return newSrc;
|
309
466
|
}
|
@@ -336,13 +493,28 @@ async function transformModuleIfNeeded(source, url, loader) {
|
|
336
493
|
return source;
|
337
494
|
}
|
338
495
|
|
339
|
-
let
|
496
|
+
let sourceMappingURL = null;
|
497
|
+
let sourceMappingStart = 0;
|
498
|
+
let sourceMappingEnd = 0;
|
499
|
+
let sourceMappingLines = 0;
|
500
|
+
let program;
|
340
501
|
|
341
502
|
try {
|
342
|
-
|
503
|
+
program = acorn.parse(source, {
|
343
504
|
ecmaVersion: '2024',
|
344
|
-
sourceType: 'module'
|
345
|
-
|
505
|
+
sourceType: 'module',
|
506
|
+
locations: true,
|
507
|
+
|
508
|
+
onComment(block, text, start, end, startLoc, endLoc) {
|
509
|
+
if (text.startsWith('# sourceMappingURL=') || text.startsWith('@ sourceMappingURL=')) {
|
510
|
+
sourceMappingURL = text.slice(19);
|
511
|
+
sourceMappingStart = start;
|
512
|
+
sourceMappingEnd = end;
|
513
|
+
sourceMappingLines = endLoc.line - startLoc.line;
|
514
|
+
}
|
515
|
+
}
|
516
|
+
|
517
|
+
});
|
346
518
|
} catch (x) {
|
347
519
|
// eslint-disable-next-line react-internal/no-production-logging
|
348
520
|
console.error('Error parsing %s %s', url, x.message);
|
@@ -351,6 +523,7 @@ async function transformModuleIfNeeded(source, url, loader) {
|
|
351
523
|
|
352
524
|
let useClient = false;
|
353
525
|
let useServer = false;
|
526
|
+
const body = program.body;
|
354
527
|
|
355
528
|
for (let i = 0; i < body.length; i++) {
|
356
529
|
const node = body[i];
|
@@ -376,11 +549,32 @@ async function transformModuleIfNeeded(source, url, loader) {
|
|
376
549
|
throw new Error('Cannot have both "use client" and "use server" directives in the same file.');
|
377
550
|
}
|
378
551
|
|
552
|
+
let sourceMap = null;
|
553
|
+
|
554
|
+
if (sourceMappingURL) {
|
555
|
+
const sourceMapResult = await loader(sourceMappingURL, // $FlowFixMe
|
556
|
+
{
|
557
|
+
format: 'json',
|
558
|
+
conditions: [],
|
559
|
+
importAssertions: {
|
560
|
+
type: 'json'
|
561
|
+
},
|
562
|
+
importAttributes: {
|
563
|
+
type: 'json'
|
564
|
+
}
|
565
|
+
}, loader);
|
566
|
+
const sourceMapString = typeof sourceMapResult.source === 'string' ? sourceMapResult.source : // $FlowFixMe
|
567
|
+
sourceMapResult.source.toString('utf8');
|
568
|
+
sourceMap = JSON.parse(sourceMapString); // Strip the source mapping comment. We'll re-add it below if needed.
|
569
|
+
|
570
|
+
source = source.slice(0, sourceMappingStart) + '\n'.repeat(sourceMappingLines) + source.slice(sourceMappingEnd);
|
571
|
+
}
|
572
|
+
|
379
573
|
if (useClient) {
|
380
|
-
return transformClientModule(
|
574
|
+
return transformClientModule(program, url, sourceMap, loader);
|
381
575
|
}
|
382
576
|
|
383
|
-
return transformServerModule(source,
|
577
|
+
return transformServerModule(source, program, url, sourceMap);
|
384
578
|
}
|
385
579
|
|
386
580
|
async function transformSource(source, context, defaultTransformSource) {
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "react-server-dom-webpack",
|
3
3
|
"description": "React Server Components bindings for DOM using Webpack. This is intended to be integrated into meta-frameworks. It is not intended to be imported directly.",
|
4
|
-
"version": "19.0.0-rc.
|
4
|
+
"version": "19.0.0-rc.1",
|
5
5
|
"keywords": [
|
6
6
|
"react"
|
7
7
|
],
|
@@ -23,6 +23,11 @@
|
|
23
23
|
"server.edge.js",
|
24
24
|
"server.node.js",
|
25
25
|
"server.node.unbundled.js",
|
26
|
+
"static.js",
|
27
|
+
"static.browser.js",
|
28
|
+
"static.edge.js",
|
29
|
+
"static.node.js",
|
30
|
+
"static.node.unbundled.js",
|
26
31
|
"node-register.js",
|
27
32
|
"cjs/",
|
28
33
|
"esm/"
|
@@ -63,6 +68,23 @@
|
|
63
68
|
"./server.edge": "./server.edge.js",
|
64
69
|
"./server.node": "./server.node.js",
|
65
70
|
"./server.node.unbundled": "./server.node.unbundled.js",
|
71
|
+
"./static": {
|
72
|
+
"react-server": {
|
73
|
+
"workerd": "./static.edge.js",
|
74
|
+
"deno": "./static.browser.js",
|
75
|
+
"node": {
|
76
|
+
"webpack": "./static.node.js",
|
77
|
+
"default": "./static.node.unbundled.js"
|
78
|
+
},
|
79
|
+
"edge-light": "./static.edge.js",
|
80
|
+
"browser": "./static.browser.js"
|
81
|
+
},
|
82
|
+
"default": "./static.js"
|
83
|
+
},
|
84
|
+
"./static.browser": "./static.browser.js",
|
85
|
+
"./static.edge": "./static.edge.js",
|
86
|
+
"./static.node": "./static.node.js",
|
87
|
+
"./static.node.unbundled": "./static.node.unbundled.js",
|
66
88
|
"./node-loader": "./esm/react-server-dom-webpack-node-loader.production.js",
|
67
89
|
"./node-register": "./node-register.js",
|
68
90
|
"./package.json": "./package.json"
|
@@ -77,12 +99,13 @@
|
|
77
99
|
"node": ">=0.10.0"
|
78
100
|
},
|
79
101
|
"peerDependencies": {
|
80
|
-
"react": "19.0.0-rc.
|
81
|
-
"react-dom": "19.0.0-rc.
|
102
|
+
"react": "19.0.0-rc.1",
|
103
|
+
"react-dom": "19.0.0-rc.1",
|
82
104
|
"webpack": "^5.59.0"
|
83
105
|
},
|
84
106
|
"dependencies": {
|
85
107
|
"acorn-loose": "^8.3.0",
|
86
|
-
"neo-async": "^2.6.1"
|
108
|
+
"neo-async": "^2.6.1",
|
109
|
+
"webpack-sources": "^3.2.0"
|
87
110
|
}
|
88
111
|
}
|
package/server.browser.js
CHANGED
@@ -1,7 +1,17 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
+
var s;
|
3
4
|
if (process.env.NODE_ENV === 'production') {
|
4
|
-
|
5
|
+
s = require('./cjs/react-server-dom-webpack-server.browser.production.js');
|
5
6
|
} else {
|
6
|
-
|
7
|
+
s = require('./cjs/react-server-dom-webpack-server.browser.development.js');
|
7
8
|
}
|
9
|
+
|
10
|
+
exports.renderToReadableStream = s.renderToReadableStream;
|
11
|
+
exports.decodeReply = s.decodeReply;
|
12
|
+
exports.decodeAction = s.decodeAction;
|
13
|
+
exports.decodeFormState = s.decodeFormState;
|
14
|
+
exports.registerServerReference = s.registerServerReference;
|
15
|
+
exports.registerClientReference = s.registerClientReference;
|
16
|
+
exports.createClientModuleProxy = s.createClientModuleProxy;
|
17
|
+
exports.createTemporaryReferenceSet = s.createTemporaryReferenceSet;
|
package/server.edge.js
CHANGED
@@ -1,7 +1,17 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
+
var s;
|
3
4
|
if (process.env.NODE_ENV === 'production') {
|
4
|
-
|
5
|
+
s = require('./cjs/react-server-dom-webpack-server.edge.production.js');
|
5
6
|
} else {
|
6
|
-
|
7
|
+
s = require('./cjs/react-server-dom-webpack-server.edge.development.js');
|
7
8
|
}
|
9
|
+
|
10
|
+
exports.renderToReadableStream = s.renderToReadableStream;
|
11
|
+
exports.decodeReply = s.decodeReply;
|
12
|
+
exports.decodeAction = s.decodeAction;
|
13
|
+
exports.decodeFormState = s.decodeFormState;
|
14
|
+
exports.registerServerReference = s.registerServerReference;
|
15
|
+
exports.registerClientReference = s.registerClientReference;
|
16
|
+
exports.createClientModuleProxy = s.createClientModuleProxy;
|
17
|
+
exports.createTemporaryReferenceSet = s.createTemporaryReferenceSet;
|
package/server.node.js
CHANGED
@@ -1,7 +1,18 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
+
var s;
|
3
4
|
if (process.env.NODE_ENV === 'production') {
|
4
|
-
|
5
|
+
s = require('./cjs/react-server-dom-webpack-server.node.production.js');
|
5
6
|
} else {
|
6
|
-
|
7
|
+
s = require('./cjs/react-server-dom-webpack-server.node.development.js');
|
7
8
|
}
|
9
|
+
|
10
|
+
exports.renderToPipeableStream = s.renderToPipeableStream;
|
11
|
+
exports.decodeReplyFromBusboy = s.decodeReplyFromBusboy;
|
12
|
+
exports.decodeReply = s.decodeReply;
|
13
|
+
exports.decodeAction = s.decodeAction;
|
14
|
+
exports.decodeFormState = s.decodeFormState;
|
15
|
+
exports.registerServerReference = s.registerServerReference;
|
16
|
+
exports.registerClientReference = s.registerClientReference;
|
17
|
+
exports.createClientModuleProxy = s.createClientModuleProxy;
|
18
|
+
exports.createTemporaryReferenceSet = s.createTemporaryReferenceSet;
|
package/server.node.unbundled.js
CHANGED
@@ -1,7 +1,18 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
+
var s;
|
3
4
|
if (process.env.NODE_ENV === 'production') {
|
4
|
-
|
5
|
+
s = require('./cjs/react-server-dom-webpack-server.node.unbundled.production.js');
|
5
6
|
} else {
|
6
|
-
|
7
|
+
s = require('./cjs/react-server-dom-webpack-server.node.unbundled.development.js');
|
7
8
|
}
|
9
|
+
|
10
|
+
exports.renderToPipeableStream = s.renderToPipeableStream;
|
11
|
+
exports.decodeReplyFromBusboy = s.decodeReplyFromBusboy;
|
12
|
+
exports.decodeReply = s.decodeReply;
|
13
|
+
exports.decodeAction = s.decodeAction;
|
14
|
+
exports.decodeFormState = s.decodeFormState;
|
15
|
+
exports.registerServerReference = s.registerServerReference;
|
16
|
+
exports.registerClientReference = s.registerClientReference;
|
17
|
+
exports.createClientModuleProxy = s.createClientModuleProxy;
|
18
|
+
exports.createTemporaryReferenceSet = s.createTemporaryReferenceSet;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var s;
|
4
|
+
if (process.env.NODE_ENV === 'production') {
|
5
|
+
s = require('./cjs/react-server-dom-webpack-server.browser.production.js');
|
6
|
+
} else {
|
7
|
+
s = require('./cjs/react-server-dom-webpack-server.browser.development.js');
|
8
|
+
}
|
9
|
+
|
10
|
+
if (s.prerender) {
|
11
|
+
exports.prerender = s.prerender;
|
12
|
+
}
|
package/static.edge.js
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var s;
|
4
|
+
if (process.env.NODE_ENV === 'production') {
|
5
|
+
s = require('./cjs/react-server-dom-webpack-server.edge.production.js');
|
6
|
+
} else {
|
7
|
+
s = require('./cjs/react-server-dom-webpack-server.edge.development.js');
|
8
|
+
}
|
9
|
+
|
10
|
+
if (s.prerender) {
|
11
|
+
exports.prerender = s.prerender;
|
12
|
+
}
|
package/static.js
ADDED
package/static.node.js
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var s;
|
4
|
+
if (process.env.NODE_ENV === 'production') {
|
5
|
+
s = require('./cjs/react-server-dom-webpack-server.node.production.js');
|
6
|
+
} else {
|
7
|
+
s = require('./cjs/react-server-dom-webpack-server.node.development.js');
|
8
|
+
}
|
9
|
+
|
10
|
+
if (s.prerenderToNodeStream) {
|
11
|
+
exports.prerenderToNodeStream = s.prerenderToNodeStream;
|
12
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var s;
|
4
|
+
if (process.env.NODE_ENV === 'production') {
|
5
|
+
s = require('./cjs/react-server-dom-webpack-server.node.unbundled.production.js');
|
6
|
+
} else {
|
7
|
+
s = require('./cjs/react-server-dom-webpack-server.node.unbundled.development.js');
|
8
|
+
}
|
9
|
+
|
10
|
+
if (s.prerenderToNodeStream) {
|
11
|
+
exports.prerenderToNodeStream = s.prerenderToNodeStream;
|
12
|
+
}
|