react-server-dom-webpack 19.0.0-rc-bf3a29d097-20240603 → 19.0.0-rc-1df34bdf62-20240605
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 +3 -3
- package/cjs/react-server-dom-webpack-client.edge.development.js +3 -3
- package/cjs/react-server-dom-webpack-client.node.development.js +3 -3
- package/cjs/react-server-dom-webpack-client.node.unbundled.development.js +3 -3
- package/cjs/react-server-dom-webpack-server.browser.development.js +40 -11
- package/cjs/react-server-dom-webpack-server.edge.development.js +40 -11
- package/cjs/react-server-dom-webpack-server.node.development.js +40 -11
- package/cjs/react-server-dom-webpack-server.node.unbundled.development.js +40 -11
- package/package.json +3 -3
@@ -414,12 +414,12 @@ function error(format) {
|
|
414
414
|
args[_key2 - 1] = arguments[_key2];
|
415
415
|
}
|
416
416
|
|
417
|
-
printWarning('error', format, args);
|
417
|
+
printWarning('error', format, args, new Error('react-stack-top-frame'));
|
418
418
|
}
|
419
419
|
}
|
420
420
|
} // eslint-disable-next-line react-internal/no-production-logging
|
421
421
|
|
422
|
-
function printWarning(level, format, args) {
|
422
|
+
function printWarning(level, format, args, currentStack) {
|
423
423
|
// When changing this logic, you might want to also
|
424
424
|
// update consoleWithStackDev.www.js as well.
|
425
425
|
{
|
@@ -429,7 +429,7 @@ function printWarning(level, format, args) {
|
|
429
429
|
// We only add the current stack to the console when createTask is not supported.
|
430
430
|
// Since createTask requires DevTools to be open to work, this means that stacks
|
431
431
|
// can be lost while DevTools isn't open but we can't detect this.
|
432
|
-
var stack = ReactSharedInternals.getCurrentStack();
|
432
|
+
var stack = ReactSharedInternals.getCurrentStack(currentStack);
|
433
433
|
|
434
434
|
if (stack !== '') {
|
435
435
|
format += '%s';
|
@@ -433,12 +433,12 @@ function error(format) {
|
|
433
433
|
args[_key2 - 1] = arguments[_key2];
|
434
434
|
}
|
435
435
|
|
436
|
-
printWarning('error', format, args);
|
436
|
+
printWarning('error', format, args, new Error('react-stack-top-frame'));
|
437
437
|
}
|
438
438
|
}
|
439
439
|
} // eslint-disable-next-line react-internal/no-production-logging
|
440
440
|
|
441
|
-
function printWarning(level, format, args) {
|
441
|
+
function printWarning(level, format, args, currentStack) {
|
442
442
|
// When changing this logic, you might want to also
|
443
443
|
// update consoleWithStackDev.www.js as well.
|
444
444
|
{
|
@@ -448,7 +448,7 @@ function printWarning(level, format, args) {
|
|
448
448
|
// We only add the current stack to the console when createTask is not supported.
|
449
449
|
// Since createTask requires DevTools to be open to work, this means that stacks
|
450
450
|
// can be lost while DevTools isn't open but we can't detect this.
|
451
|
-
var stack = ReactSharedInternals.getCurrentStack();
|
451
|
+
var stack = ReactSharedInternals.getCurrentStack(currentStack);
|
452
452
|
|
453
453
|
if (stack !== '') {
|
454
454
|
format += '%s';
|
@@ -434,12 +434,12 @@ function error(format) {
|
|
434
434
|
args[_key2 - 1] = arguments[_key2];
|
435
435
|
}
|
436
436
|
|
437
|
-
printWarning('error', format, args);
|
437
|
+
printWarning('error', format, args, new Error('react-stack-top-frame'));
|
438
438
|
}
|
439
439
|
}
|
440
440
|
} // eslint-disable-next-line react-internal/no-production-logging
|
441
441
|
|
442
|
-
function printWarning(level, format, args) {
|
442
|
+
function printWarning(level, format, args, currentStack) {
|
443
443
|
// When changing this logic, you might want to also
|
444
444
|
// update consoleWithStackDev.www.js as well.
|
445
445
|
{
|
@@ -449,7 +449,7 @@ function printWarning(level, format, args) {
|
|
449
449
|
// We only add the current stack to the console when createTask is not supported.
|
450
450
|
// Since createTask requires DevTools to be open to work, this means that stacks
|
451
451
|
// can be lost while DevTools isn't open but we can't detect this.
|
452
|
-
var stack = ReactSharedInternals.getCurrentStack();
|
452
|
+
var stack = ReactSharedInternals.getCurrentStack(currentStack);
|
453
453
|
|
454
454
|
if (stack !== '') {
|
455
455
|
format += '%s';
|
@@ -387,12 +387,12 @@ function error(format) {
|
|
387
387
|
args[_key2 - 1] = arguments[_key2];
|
388
388
|
}
|
389
389
|
|
390
|
-
printWarning('error', format, args);
|
390
|
+
printWarning('error', format, args, new Error('react-stack-top-frame'));
|
391
391
|
}
|
392
392
|
}
|
393
393
|
} // eslint-disable-next-line react-internal/no-production-logging
|
394
394
|
|
395
|
-
function printWarning(level, format, args) {
|
395
|
+
function printWarning(level, format, args, currentStack) {
|
396
396
|
// When changing this logic, you might want to also
|
397
397
|
// update consoleWithStackDev.www.js as well.
|
398
398
|
{
|
@@ -402,7 +402,7 @@ function printWarning(level, format, args) {
|
|
402
402
|
// We only add the current stack to the console when createTask is not supported.
|
403
403
|
// Since createTask requires DevTools to be open to work, this means that stacks
|
404
404
|
// can be lost while DevTools isn't open but we can't detect this.
|
405
|
-
var stack = ReactSharedInternals.getCurrentStack();
|
405
|
+
var stack = ReactSharedInternals.getCurrentStack(currentStack);
|
406
406
|
|
407
407
|
if (stack !== '') {
|
408
408
|
format += '%s';
|
@@ -49,12 +49,12 @@ function error(format) {
|
|
49
49
|
args[_key2 - 1] = arguments[_key2];
|
50
50
|
}
|
51
51
|
|
52
|
-
printWarning('error', format, args);
|
52
|
+
printWarning('error', format, args, new Error('react-stack-top-frame'));
|
53
53
|
}
|
54
54
|
}
|
55
55
|
} // eslint-disable-next-line react-internal/no-production-logging
|
56
56
|
|
57
|
-
function printWarning(level, format, args) {
|
57
|
+
function printWarning(level, format, args, currentStack) {
|
58
58
|
// When changing this logic, you might want to also
|
59
59
|
// update consoleWithStackDev.www.js as well.
|
60
60
|
{
|
@@ -64,7 +64,7 @@ function printWarning(level, format, args) {
|
|
64
64
|
// We only add the current stack to the console when createTask is not supported.
|
65
65
|
// Since createTask requires DevTools to be open to work, this means that stacks
|
66
66
|
// can be lost while DevTools isn't open but we can't detect this.
|
67
|
-
var stack = ReactSharedInternalsServer.getCurrentStack();
|
67
|
+
var stack = ReactSharedInternalsServer.getCurrentStack(currentStack);
|
68
68
|
|
69
69
|
if (stack !== '') {
|
70
70
|
format += '%s';
|
@@ -1526,6 +1526,37 @@ function describeObjectForErrorMessage(objectOrArray, expandedName) {
|
|
1526
1526
|
|
1527
1527
|
var ReactSharedInternals = ReactSharedInternalsServer;
|
1528
1528
|
|
1529
|
+
function prepareStackTrace(error, structuredStackTrace) {
|
1530
|
+
var name = error.name || 'Error';
|
1531
|
+
var message = error.message || '';
|
1532
|
+
var stack = name + ': ' + message;
|
1533
|
+
|
1534
|
+
for (var i = 0; i < structuredStackTrace.length; i++) {
|
1535
|
+
stack += '\n at ' + structuredStackTrace[i].toString();
|
1536
|
+
}
|
1537
|
+
|
1538
|
+
return stack;
|
1539
|
+
}
|
1540
|
+
|
1541
|
+
function getStack(error) {
|
1542
|
+
// We override Error.prepareStackTrace with our own version that normalizes
|
1543
|
+
// the stack to V8 formatting even if the server uses other formatting.
|
1544
|
+
// It also ensures that source maps are NOT applied to this since that can
|
1545
|
+
// be slow we're better off doing that lazily from the client instead of
|
1546
|
+
// eagerly on the server. If the stack has already been read, then we might
|
1547
|
+
// not get a normalized stack and it might still have been source mapped.
|
1548
|
+
// So the client still needs to be resilient to this.
|
1549
|
+
var previousPrepare = Error.prepareStackTrace;
|
1550
|
+
Error.prepareStackTrace = prepareStackTrace;
|
1551
|
+
|
1552
|
+
try {
|
1553
|
+
// eslint-disable-next-line react-internal/safe-string-coercion
|
1554
|
+
return String(error.stack);
|
1555
|
+
} finally {
|
1556
|
+
Error.prepareStackTrace = previousPrepare;
|
1557
|
+
}
|
1558
|
+
}
|
1559
|
+
|
1529
1560
|
var ObjectPrototype = Object.prototype;
|
1530
1561
|
var stringify = JSON.stringify; // Serializable values
|
1531
1562
|
// Thenable<ReactClientValue>
|
@@ -2148,7 +2179,7 @@ function renderFragment(request, task, children) {
|
|
2148
2179
|
// the tree using a fragment.
|
2149
2180
|
var fragment = [REACT_ELEMENT_TYPE, REACT_FRAGMENT_TYPE, task.keyPath, {
|
2150
2181
|
children: children
|
2151
|
-
}];
|
2182
|
+
}, null] ;
|
2152
2183
|
|
2153
2184
|
if (!task.implicitSlot) {
|
2154
2185
|
// If this was keyed inside a set. I.e. the outer Server Component was keyed
|
@@ -2205,7 +2236,7 @@ function renderAsyncFragment(request, task, children, getAsyncIterator) {
|
|
2205
2236
|
// the tree using a fragment.
|
2206
2237
|
var fragment = [REACT_ELEMENT_TYPE, REACT_FRAGMENT_TYPE, task.keyPath, {
|
2207
2238
|
children: children
|
2208
|
-
}];
|
2239
|
+
}, null] ;
|
2209
2240
|
|
2210
2241
|
if (!task.implicitSlot) {
|
2211
2242
|
// If this was keyed inside a set. I.e. the outer Server Component was keyed
|
@@ -3229,9 +3260,8 @@ function emitPostponeChunk(request, id, postponeInstance) {
|
|
3229
3260
|
|
3230
3261
|
try {
|
3231
3262
|
// eslint-disable-next-line react-internal/safe-string-coercion
|
3232
|
-
reason = String(postponeInstance.message);
|
3233
|
-
|
3234
|
-
stack = String(postponeInstance.stack);
|
3263
|
+
reason = String(postponeInstance.message);
|
3264
|
+
stack = getStack(postponeInstance);
|
3235
3265
|
} catch (x) {}
|
3236
3266
|
|
3237
3267
|
row = serializeRowHeader('P', id) + stringify({
|
@@ -3254,9 +3284,8 @@ function emitErrorChunk(request, id, digest, error) {
|
|
3254
3284
|
try {
|
3255
3285
|
if (error instanceof Error) {
|
3256
3286
|
// eslint-disable-next-line react-internal/safe-string-coercion
|
3257
|
-
message = String(error.message);
|
3258
|
-
|
3259
|
-
stack = String(error.stack);
|
3287
|
+
message = String(error.message);
|
3288
|
+
stack = getStack(error);
|
3260
3289
|
} else if (typeof error === 'object' && error !== null) {
|
3261
3290
|
message = describeObjectForErrorMessage(error);
|
3262
3291
|
} else {
|
@@ -49,12 +49,12 @@ function error(format) {
|
|
49
49
|
args[_key2 - 1] = arguments[_key2];
|
50
50
|
}
|
51
51
|
|
52
|
-
printWarning('error', format, args);
|
52
|
+
printWarning('error', format, args, new Error('react-stack-top-frame'));
|
53
53
|
}
|
54
54
|
}
|
55
55
|
} // eslint-disable-next-line react-internal/no-production-logging
|
56
56
|
|
57
|
-
function printWarning(level, format, args) {
|
57
|
+
function printWarning(level, format, args, currentStack) {
|
58
58
|
// When changing this logic, you might want to also
|
59
59
|
// update consoleWithStackDev.www.js as well.
|
60
60
|
{
|
@@ -64,7 +64,7 @@ function printWarning(level, format, args) {
|
|
64
64
|
// We only add the current stack to the console when createTask is not supported.
|
65
65
|
// Since createTask requires DevTools to be open to work, this means that stacks
|
66
66
|
// can be lost while DevTools isn't open but we can't detect this.
|
67
|
-
var stack = ReactSharedInternalsServer.getCurrentStack();
|
67
|
+
var stack = ReactSharedInternalsServer.getCurrentStack(currentStack);
|
68
68
|
|
69
69
|
if (stack !== '') {
|
70
70
|
format += '%s';
|
@@ -1539,6 +1539,37 @@ function describeObjectForErrorMessage(objectOrArray, expandedName) {
|
|
1539
1539
|
|
1540
1540
|
var ReactSharedInternals = ReactSharedInternalsServer;
|
1541
1541
|
|
1542
|
+
function prepareStackTrace(error, structuredStackTrace) {
|
1543
|
+
var name = error.name || 'Error';
|
1544
|
+
var message = error.message || '';
|
1545
|
+
var stack = name + ': ' + message;
|
1546
|
+
|
1547
|
+
for (var i = 0; i < structuredStackTrace.length; i++) {
|
1548
|
+
stack += '\n at ' + structuredStackTrace[i].toString();
|
1549
|
+
}
|
1550
|
+
|
1551
|
+
return stack;
|
1552
|
+
}
|
1553
|
+
|
1554
|
+
function getStack(error) {
|
1555
|
+
// We override Error.prepareStackTrace with our own version that normalizes
|
1556
|
+
// the stack to V8 formatting even if the server uses other formatting.
|
1557
|
+
// It also ensures that source maps are NOT applied to this since that can
|
1558
|
+
// be slow we're better off doing that lazily from the client instead of
|
1559
|
+
// eagerly on the server. If the stack has already been read, then we might
|
1560
|
+
// not get a normalized stack and it might still have been source mapped.
|
1561
|
+
// So the client still needs to be resilient to this.
|
1562
|
+
var previousPrepare = Error.prepareStackTrace;
|
1563
|
+
Error.prepareStackTrace = prepareStackTrace;
|
1564
|
+
|
1565
|
+
try {
|
1566
|
+
// eslint-disable-next-line react-internal/safe-string-coercion
|
1567
|
+
return String(error.stack);
|
1568
|
+
} finally {
|
1569
|
+
Error.prepareStackTrace = previousPrepare;
|
1570
|
+
}
|
1571
|
+
}
|
1572
|
+
|
1542
1573
|
var ObjectPrototype = Object.prototype;
|
1543
1574
|
var stringify = JSON.stringify; // Serializable values
|
1544
1575
|
// Thenable<ReactClientValue>
|
@@ -2169,7 +2200,7 @@ function renderFragment(request, task, children) {
|
|
2169
2200
|
// the tree using a fragment.
|
2170
2201
|
var fragment = [REACT_ELEMENT_TYPE, REACT_FRAGMENT_TYPE, task.keyPath, {
|
2171
2202
|
children: children
|
2172
|
-
}];
|
2203
|
+
}, null] ;
|
2173
2204
|
|
2174
2205
|
if (!task.implicitSlot) {
|
2175
2206
|
// If this was keyed inside a set. I.e. the outer Server Component was keyed
|
@@ -2226,7 +2257,7 @@ function renderAsyncFragment(request, task, children, getAsyncIterator) {
|
|
2226
2257
|
// the tree using a fragment.
|
2227
2258
|
var fragment = [REACT_ELEMENT_TYPE, REACT_FRAGMENT_TYPE, task.keyPath, {
|
2228
2259
|
children: children
|
2229
|
-
}];
|
2260
|
+
}, null] ;
|
2230
2261
|
|
2231
2262
|
if (!task.implicitSlot) {
|
2232
2263
|
// If this was keyed inside a set. I.e. the outer Server Component was keyed
|
@@ -3256,9 +3287,8 @@ function emitPostponeChunk(request, id, postponeInstance) {
|
|
3256
3287
|
|
3257
3288
|
try {
|
3258
3289
|
// eslint-disable-next-line react-internal/safe-string-coercion
|
3259
|
-
reason = String(postponeInstance.message);
|
3260
|
-
|
3261
|
-
stack = String(postponeInstance.stack);
|
3290
|
+
reason = String(postponeInstance.message);
|
3291
|
+
stack = getStack(postponeInstance);
|
3262
3292
|
} catch (x) {}
|
3263
3293
|
|
3264
3294
|
row = serializeRowHeader('P', id) + stringify({
|
@@ -3281,9 +3311,8 @@ function emitErrorChunk(request, id, digest, error) {
|
|
3281
3311
|
try {
|
3282
3312
|
if (error instanceof Error) {
|
3283
3313
|
// eslint-disable-next-line react-internal/safe-string-coercion
|
3284
|
-
message = String(error.message);
|
3285
|
-
|
3286
|
-
stack = String(error.stack);
|
3314
|
+
message = String(error.message);
|
3315
|
+
stack = getStack(error);
|
3287
3316
|
} else if (typeof error === 'object' && error !== null) {
|
3288
3317
|
message = describeObjectForErrorMessage(error);
|
3289
3318
|
} else {
|
@@ -52,12 +52,12 @@ function error(format) {
|
|
52
52
|
args[_key2 - 1] = arguments[_key2];
|
53
53
|
}
|
54
54
|
|
55
|
-
printWarning('error', format, args);
|
55
|
+
printWarning('error', format, args, new Error('react-stack-top-frame'));
|
56
56
|
}
|
57
57
|
}
|
58
58
|
} // eslint-disable-next-line react-internal/no-production-logging
|
59
59
|
|
60
|
-
function printWarning(level, format, args) {
|
60
|
+
function printWarning(level, format, args, currentStack) {
|
61
61
|
// When changing this logic, you might want to also
|
62
62
|
// update consoleWithStackDev.www.js as well.
|
63
63
|
{
|
@@ -67,7 +67,7 @@ function printWarning(level, format, args) {
|
|
67
67
|
// We only add the current stack to the console when createTask is not supported.
|
68
68
|
// Since createTask requires DevTools to be open to work, this means that stacks
|
69
69
|
// can be lost while DevTools isn't open but we can't detect this.
|
70
|
-
var stack = ReactSharedInternalsServer.getCurrentStack();
|
70
|
+
var stack = ReactSharedInternalsServer.getCurrentStack(currentStack);
|
71
71
|
|
72
72
|
if (stack !== '') {
|
73
73
|
format += '%s';
|
@@ -1592,6 +1592,37 @@ function describeObjectForErrorMessage(objectOrArray, expandedName) {
|
|
1592
1592
|
|
1593
1593
|
var ReactSharedInternals = ReactSharedInternalsServer;
|
1594
1594
|
|
1595
|
+
function prepareStackTrace(error, structuredStackTrace) {
|
1596
|
+
var name = error.name || 'Error';
|
1597
|
+
var message = error.message || '';
|
1598
|
+
var stack = name + ': ' + message;
|
1599
|
+
|
1600
|
+
for (var i = 0; i < structuredStackTrace.length; i++) {
|
1601
|
+
stack += '\n at ' + structuredStackTrace[i].toString();
|
1602
|
+
}
|
1603
|
+
|
1604
|
+
return stack;
|
1605
|
+
}
|
1606
|
+
|
1607
|
+
function getStack(error) {
|
1608
|
+
// We override Error.prepareStackTrace with our own version that normalizes
|
1609
|
+
// the stack to V8 formatting even if the server uses other formatting.
|
1610
|
+
// It also ensures that source maps are NOT applied to this since that can
|
1611
|
+
// be slow we're better off doing that lazily from the client instead of
|
1612
|
+
// eagerly on the server. If the stack has already been read, then we might
|
1613
|
+
// not get a normalized stack and it might still have been source mapped.
|
1614
|
+
// So the client still needs to be resilient to this.
|
1615
|
+
var previousPrepare = Error.prepareStackTrace;
|
1616
|
+
Error.prepareStackTrace = prepareStackTrace;
|
1617
|
+
|
1618
|
+
try {
|
1619
|
+
// eslint-disable-next-line react-internal/safe-string-coercion
|
1620
|
+
return String(error.stack);
|
1621
|
+
} finally {
|
1622
|
+
Error.prepareStackTrace = previousPrepare;
|
1623
|
+
}
|
1624
|
+
}
|
1625
|
+
|
1595
1626
|
var ObjectPrototype = Object.prototype;
|
1596
1627
|
var stringify = JSON.stringify; // Serializable values
|
1597
1628
|
// Thenable<ReactClientValue>
|
@@ -2220,7 +2251,7 @@ function renderFragment(request, task, children) {
|
|
2220
2251
|
// the tree using a fragment.
|
2221
2252
|
var fragment = [REACT_ELEMENT_TYPE, REACT_FRAGMENT_TYPE, task.keyPath, {
|
2222
2253
|
children: children
|
2223
|
-
}];
|
2254
|
+
}, null] ;
|
2224
2255
|
|
2225
2256
|
if (!task.implicitSlot) {
|
2226
2257
|
// If this was keyed inside a set. I.e. the outer Server Component was keyed
|
@@ -2277,7 +2308,7 @@ function renderAsyncFragment(request, task, children, getAsyncIterator) {
|
|
2277
2308
|
// the tree using a fragment.
|
2278
2309
|
var fragment = [REACT_ELEMENT_TYPE, REACT_FRAGMENT_TYPE, task.keyPath, {
|
2279
2310
|
children: children
|
2280
|
-
}];
|
2311
|
+
}, null] ;
|
2281
2312
|
|
2282
2313
|
if (!task.implicitSlot) {
|
2283
2314
|
// If this was keyed inside a set. I.e. the outer Server Component was keyed
|
@@ -3303,9 +3334,8 @@ function emitPostponeChunk(request, id, postponeInstance) {
|
|
3303
3334
|
|
3304
3335
|
try {
|
3305
3336
|
// eslint-disable-next-line react-internal/safe-string-coercion
|
3306
|
-
reason = String(postponeInstance.message);
|
3307
|
-
|
3308
|
-
stack = String(postponeInstance.stack);
|
3337
|
+
reason = String(postponeInstance.message);
|
3338
|
+
stack = getStack(postponeInstance);
|
3309
3339
|
} catch (x) {}
|
3310
3340
|
|
3311
3341
|
row = serializeRowHeader('P', id) + stringify({
|
@@ -3328,9 +3358,8 @@ function emitErrorChunk(request, id, digest, error) {
|
|
3328
3358
|
try {
|
3329
3359
|
if (error instanceof Error) {
|
3330
3360
|
// eslint-disable-next-line react-internal/safe-string-coercion
|
3331
|
-
message = String(error.message);
|
3332
|
-
|
3333
|
-
stack = String(error.stack);
|
3361
|
+
message = String(error.message);
|
3362
|
+
stack = getStack(error);
|
3334
3363
|
} else if (typeof error === 'object' && error !== null) {
|
3335
3364
|
message = describeObjectForErrorMessage(error);
|
3336
3365
|
} else {
|
@@ -52,12 +52,12 @@ function error(format) {
|
|
52
52
|
args[_key2 - 1] = arguments[_key2];
|
53
53
|
}
|
54
54
|
|
55
|
-
printWarning('error', format, args);
|
55
|
+
printWarning('error', format, args, new Error('react-stack-top-frame'));
|
56
56
|
}
|
57
57
|
}
|
58
58
|
} // eslint-disable-next-line react-internal/no-production-logging
|
59
59
|
|
60
|
-
function printWarning(level, format, args) {
|
60
|
+
function printWarning(level, format, args, currentStack) {
|
61
61
|
// When changing this logic, you might want to also
|
62
62
|
// update consoleWithStackDev.www.js as well.
|
63
63
|
{
|
@@ -67,7 +67,7 @@ function printWarning(level, format, args) {
|
|
67
67
|
// We only add the current stack to the console when createTask is not supported.
|
68
68
|
// Since createTask requires DevTools to be open to work, this means that stacks
|
69
69
|
// can be lost while DevTools isn't open but we can't detect this.
|
70
|
-
var stack = ReactSharedInternalsServer.getCurrentStack();
|
70
|
+
var stack = ReactSharedInternalsServer.getCurrentStack(currentStack);
|
71
71
|
|
72
72
|
if (stack !== '') {
|
73
73
|
format += '%s';
|
@@ -1592,6 +1592,37 @@ function describeObjectForErrorMessage(objectOrArray, expandedName) {
|
|
1592
1592
|
|
1593
1593
|
var ReactSharedInternals = ReactSharedInternalsServer;
|
1594
1594
|
|
1595
|
+
function prepareStackTrace(error, structuredStackTrace) {
|
1596
|
+
var name = error.name || 'Error';
|
1597
|
+
var message = error.message || '';
|
1598
|
+
var stack = name + ': ' + message;
|
1599
|
+
|
1600
|
+
for (var i = 0; i < structuredStackTrace.length; i++) {
|
1601
|
+
stack += '\n at ' + structuredStackTrace[i].toString();
|
1602
|
+
}
|
1603
|
+
|
1604
|
+
return stack;
|
1605
|
+
}
|
1606
|
+
|
1607
|
+
function getStack(error) {
|
1608
|
+
// We override Error.prepareStackTrace with our own version that normalizes
|
1609
|
+
// the stack to V8 formatting even if the server uses other formatting.
|
1610
|
+
// It also ensures that source maps are NOT applied to this since that can
|
1611
|
+
// be slow we're better off doing that lazily from the client instead of
|
1612
|
+
// eagerly on the server. If the stack has already been read, then we might
|
1613
|
+
// not get a normalized stack and it might still have been source mapped.
|
1614
|
+
// So the client still needs to be resilient to this.
|
1615
|
+
var previousPrepare = Error.prepareStackTrace;
|
1616
|
+
Error.prepareStackTrace = prepareStackTrace;
|
1617
|
+
|
1618
|
+
try {
|
1619
|
+
// eslint-disable-next-line react-internal/safe-string-coercion
|
1620
|
+
return String(error.stack);
|
1621
|
+
} finally {
|
1622
|
+
Error.prepareStackTrace = previousPrepare;
|
1623
|
+
}
|
1624
|
+
}
|
1625
|
+
|
1595
1626
|
var ObjectPrototype = Object.prototype;
|
1596
1627
|
var stringify = JSON.stringify; // Serializable values
|
1597
1628
|
// Thenable<ReactClientValue>
|
@@ -2220,7 +2251,7 @@ function renderFragment(request, task, children) {
|
|
2220
2251
|
// the tree using a fragment.
|
2221
2252
|
var fragment = [REACT_ELEMENT_TYPE, REACT_FRAGMENT_TYPE, task.keyPath, {
|
2222
2253
|
children: children
|
2223
|
-
}];
|
2254
|
+
}, null] ;
|
2224
2255
|
|
2225
2256
|
if (!task.implicitSlot) {
|
2226
2257
|
// If this was keyed inside a set. I.e. the outer Server Component was keyed
|
@@ -2277,7 +2308,7 @@ function renderAsyncFragment(request, task, children, getAsyncIterator) {
|
|
2277
2308
|
// the tree using a fragment.
|
2278
2309
|
var fragment = [REACT_ELEMENT_TYPE, REACT_FRAGMENT_TYPE, task.keyPath, {
|
2279
2310
|
children: children
|
2280
|
-
}];
|
2311
|
+
}, null] ;
|
2281
2312
|
|
2282
2313
|
if (!task.implicitSlot) {
|
2283
2314
|
// If this was keyed inside a set. I.e. the outer Server Component was keyed
|
@@ -3303,9 +3334,8 @@ function emitPostponeChunk(request, id, postponeInstance) {
|
|
3303
3334
|
|
3304
3335
|
try {
|
3305
3336
|
// eslint-disable-next-line react-internal/safe-string-coercion
|
3306
|
-
reason = String(postponeInstance.message);
|
3307
|
-
|
3308
|
-
stack = String(postponeInstance.stack);
|
3337
|
+
reason = String(postponeInstance.message);
|
3338
|
+
stack = getStack(postponeInstance);
|
3309
3339
|
} catch (x) {}
|
3310
3340
|
|
3311
3341
|
row = serializeRowHeader('P', id) + stringify({
|
@@ -3328,9 +3358,8 @@ function emitErrorChunk(request, id, digest, error) {
|
|
3328
3358
|
try {
|
3329
3359
|
if (error instanceof Error) {
|
3330
3360
|
// eslint-disable-next-line react-internal/safe-string-coercion
|
3331
|
-
message = String(error.message);
|
3332
|
-
|
3333
|
-
stack = String(error.stack);
|
3361
|
+
message = String(error.message);
|
3362
|
+
stack = getStack(error);
|
3334
3363
|
} else if (typeof error === 'object' && error !== null) {
|
3335
3364
|
message = describeObjectForErrorMessage(error);
|
3336
3365
|
} else {
|
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-1df34bdf62-20240605",
|
5
5
|
"keywords": [
|
6
6
|
"react"
|
7
7
|
],
|
@@ -77,8 +77,8 @@
|
|
77
77
|
"node": ">=0.10.0"
|
78
78
|
},
|
79
79
|
"peerDependencies": {
|
80
|
-
"react": "19.0.0-rc-
|
81
|
-
"react-dom": "19.0.0-rc-
|
80
|
+
"react": "19.0.0-rc-1df34bdf62-20240605",
|
81
|
+
"react-dom": "19.0.0-rc-1df34bdf62-20240605",
|
82
82
|
"webpack": "^5.59.0"
|
83
83
|
},
|
84
84
|
"dependencies": {
|