react-server-dom-webpack 19.0.0-rc-34d0c5e357-20240607 → 19.0.0-rc-6230622a1a-20240610
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 +52 -28
- package/cjs/react-server-dom-webpack-client.edge.development.js +52 -28
- package/cjs/react-server-dom-webpack-client.node.development.js +53 -29
- package/cjs/react-server-dom-webpack-client.node.unbundled.development.js +53 -29
- package/cjs/react-server-dom-webpack-server.browser.development.js +108 -29
- package/cjs/react-server-dom-webpack-server.browser.production.js +5 -1
- package/cjs/react-server-dom-webpack-server.edge.development.js +108 -29
- package/cjs/react-server-dom-webpack-server.edge.production.js +5 -1
- package/cjs/react-server-dom-webpack-server.node.development.js +108 -29
- package/cjs/react-server-dom-webpack-server.node.production.js +5 -1
- package/cjs/react-server-dom-webpack-server.node.unbundled.development.js +108 -29
- package/cjs/react-server-dom-webpack-server.node.unbundled.production.js +5 -1
- package/package.json +3 -3
@@ -42,6 +42,9 @@ if (!ReactSharedInternalsServer) {
|
|
42
42
|
throw new Error('The "react" package in this environment is not configured correctly. ' + 'The "react-server" condition must be enabled in any environment that ' + 'runs React Server Components.');
|
43
43
|
}
|
44
44
|
|
45
|
+
// -----------------------------------------------------------------------------
|
46
|
+
var enablePostpone = false;
|
47
|
+
|
45
48
|
function error(format) {
|
46
49
|
{
|
47
50
|
{
|
@@ -49,38 +52,51 @@ function error(format) {
|
|
49
52
|
args[_key2 - 1] = arguments[_key2];
|
50
53
|
}
|
51
54
|
|
52
|
-
printWarning('error', format, args);
|
55
|
+
printWarning('error', format, args, new Error('react-stack-top-frame'));
|
53
56
|
}
|
54
57
|
}
|
55
|
-
}
|
58
|
+
} // eslint-disable-next-line react-internal/no-production-logging
|
56
59
|
|
57
|
-
function printWarning(level, format, args) {
|
60
|
+
function printWarning(level, format, args, currentStack) {
|
58
61
|
// When changing this logic, you might want to also
|
59
62
|
// update consoleWithStackDev.www.js as well.
|
60
63
|
{
|
61
|
-
var
|
62
|
-
|
63
|
-
if (stack !== '') {
|
64
|
-
format += '%s';
|
65
|
-
args = args.concat([stack]);
|
66
|
-
} // eslint-disable-next-line react-internal/safe-string-coercion
|
64
|
+
var isErrorLogger = format === '%s\n\n%s\n' || format === '%o\n\n%s\n\n%s\n';
|
67
65
|
|
66
|
+
if (ReactSharedInternalsServer.getCurrentStack) {
|
67
|
+
// We only add the current stack to the console when createTask is not supported.
|
68
|
+
// Since createTask requires DevTools to be open to work, this means that stacks
|
69
|
+
// can be lost while DevTools isn't open but we can't detect this.
|
70
|
+
var stack = ReactSharedInternalsServer.getCurrentStack(currentStack);
|
68
71
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
+
if (stack !== '') {
|
73
|
+
format += '%s';
|
74
|
+
args = args.concat([stack]);
|
75
|
+
}
|
76
|
+
}
|
72
77
|
|
73
|
-
|
78
|
+
if (isErrorLogger) {
|
79
|
+
// Don't prefix our default logging formatting in ReactFiberErrorLoggger.
|
80
|
+
// Don't toString the arguments.
|
81
|
+
args.unshift(format);
|
82
|
+
} else {
|
83
|
+
// TODO: Remove this prefix and stop toStringing in the wrapper and
|
84
|
+
// instead do it at each callsite as needed.
|
85
|
+
// Careful: RN currently depends on this prefix
|
86
|
+
// eslint-disable-next-line react-internal/safe-string-coercion
|
87
|
+
args = args.map(function (item) {
|
88
|
+
return String(item);
|
89
|
+
});
|
90
|
+
args.unshift('Warning: ' + format);
|
91
|
+
} // We intentionally don't use spread (or .apply) directly because it
|
74
92
|
// breaks IE9: https://github.com/facebook/react/issues/13610
|
75
93
|
// eslint-disable-next-line react-internal/no-production-logging
|
76
94
|
|
77
|
-
|
95
|
+
|
96
|
+
Function.prototype.apply.call(console[level], console, args);
|
78
97
|
}
|
79
98
|
}
|
80
99
|
|
81
|
-
// -----------------------------------------------------------------------------
|
82
|
-
var enablePostpone = false;
|
83
|
-
|
84
100
|
function scheduleWork(callback) {
|
85
101
|
setImmediate(callback);
|
86
102
|
}
|
@@ -1576,6 +1592,37 @@ function describeObjectForErrorMessage(objectOrArray, expandedName) {
|
|
1576
1592
|
|
1577
1593
|
var ReactSharedInternals = ReactSharedInternalsServer;
|
1578
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
|
+
|
1579
1626
|
var ObjectPrototype = Object.prototype;
|
1580
1627
|
var stringify = JSON.stringify; // Serializable values
|
1581
1628
|
// Thenable<ReactClientValue>
|
@@ -1638,6 +1685,7 @@ function createRequest(model, bundlerConfig, onError, identifierPrefix, onPostpo
|
|
1638
1685
|
|
1639
1686
|
{
|
1640
1687
|
request.environmentName = environmentName === undefined ? 'Server' : environmentName;
|
1688
|
+
request.didWarnForKey = null;
|
1641
1689
|
}
|
1642
1690
|
|
1643
1691
|
var rootTask = createTask(request, model, null, false, abortSet);
|
@@ -2023,7 +2071,8 @@ function callLazyInitInDEV(lazy) {
|
|
2023
2071
|
}
|
2024
2072
|
|
2025
2073
|
function renderFunctionComponent(request, task, key, Component, props, owner, // DEV-only
|
2026
|
-
stack
|
2074
|
+
stack, // DEV-only
|
2075
|
+
validated) // DEV-only
|
2027
2076
|
{
|
2028
2077
|
// Reset the task's thenable state before continuing, so that if a later
|
2029
2078
|
// component suspends we can reuse the same task object. If the same
|
@@ -2065,12 +2114,23 @@ stack) // DEV-only
|
|
2065
2114
|
result = callComponentInDEV(Component, props, componentDebugInfo);
|
2066
2115
|
}
|
2067
2116
|
|
2068
|
-
if (typeof result === 'object' && result !== null) {
|
2117
|
+
if (typeof result === 'object' && result !== null && !isClientReference(result)) {
|
2069
2118
|
if (typeof result.then === 'function') {
|
2070
2119
|
// When the return value is in children position we can resolve it immediately,
|
2071
2120
|
// to its value without a wrapper if it's synchronously available.
|
2072
2121
|
var thenable = result;
|
2073
2122
|
|
2123
|
+
{
|
2124
|
+
// If the thenable resolves to an element, then it was in a static position,
|
2125
|
+
// the return value of a Server Component. That doesn't need further validation
|
2126
|
+
// of keys. The Server Component itself would have had a key.
|
2127
|
+
thenable.then(function (resolvedValue) {
|
2128
|
+
if (typeof resolvedValue === 'object' && resolvedValue !== null && resolvedValue.$$typeof === REACT_ELEMENT_TYPE) {
|
2129
|
+
resolvedValue._store.validated = 1;
|
2130
|
+
}
|
2131
|
+
}, function () {});
|
2132
|
+
}
|
2133
|
+
|
2074
2134
|
if (thenable.status === 'fulfilled') {
|
2075
2135
|
return thenable.value;
|
2076
2136
|
} // TODO: Once we accept Promises as children on the client, we can just return
|
@@ -2141,6 +2201,11 @@ stack) // DEV-only
|
|
2141
2201
|
{
|
2142
2202
|
result._debugInfo = _iterableChild._debugInfo;
|
2143
2203
|
}
|
2204
|
+
} else if (result.$$typeof === REACT_ELEMENT_TYPE) {
|
2205
|
+
// If the server component renders to an element, then it was in a static position.
|
2206
|
+
// That doesn't need further validation of keys. The Server Component itself would
|
2207
|
+
// have had a key.
|
2208
|
+
result._store.validated = 1;
|
2144
2209
|
}
|
2145
2210
|
} // Track this element's key on the Server Component on the keyPath context..
|
2146
2211
|
|
@@ -2167,12 +2232,26 @@ stack) // DEV-only
|
|
2167
2232
|
}
|
2168
2233
|
|
2169
2234
|
function renderFragment(request, task, children) {
|
2235
|
+
{
|
2236
|
+
for (var i = 0; i < children.length; i++) {
|
2237
|
+
var child = children[i];
|
2238
|
+
|
2239
|
+
if (child !== null && typeof child === 'object' && child.$$typeof === REACT_ELEMENT_TYPE) {
|
2240
|
+
var element = child;
|
2241
|
+
|
2242
|
+
if (element.key === null && !element._store.validated) {
|
2243
|
+
element._store.validated = 2;
|
2244
|
+
}
|
2245
|
+
}
|
2246
|
+
}
|
2247
|
+
}
|
2248
|
+
|
2170
2249
|
if (task.keyPath !== null) {
|
2171
2250
|
// We have a Server Component that specifies a key but we're now splitting
|
2172
2251
|
// the tree using a fragment.
|
2173
2252
|
var fragment = [REACT_ELEMENT_TYPE, REACT_FRAGMENT_TYPE, task.keyPath, {
|
2174
2253
|
children: children
|
2175
|
-
}];
|
2254
|
+
}, null] ;
|
2176
2255
|
|
2177
2256
|
if (!task.implicitSlot) {
|
2178
2257
|
// If this was keyed inside a set. I.e. the outer Server Component was keyed
|
@@ -2229,7 +2308,7 @@ function renderAsyncFragment(request, task, children, getAsyncIterator) {
|
|
2229
2308
|
// the tree using a fragment.
|
2230
2309
|
var fragment = [REACT_ELEMENT_TYPE, REACT_FRAGMENT_TYPE, task.keyPath, {
|
2231
2310
|
children: children
|
2232
|
-
}];
|
2311
|
+
}, null] ;
|
2233
2312
|
|
2234
2313
|
if (!task.implicitSlot) {
|
2235
2314
|
// If this was keyed inside a set. I.e. the outer Server Component was keyed
|
@@ -2260,7 +2339,8 @@ function renderAsyncFragment(request, task, children, getAsyncIterator) {
|
|
2260
2339
|
}
|
2261
2340
|
|
2262
2341
|
function renderClientElement(task, type, key, props, owner, // DEV-only
|
2263
|
-
stack
|
2342
|
+
stack, // DEV-only
|
2343
|
+
validated) // DEV-only
|
2264
2344
|
{
|
2265
2345
|
// We prepend the terminal client element that actually gets serialized with
|
2266
2346
|
// the keys of any Server Components which are not serialized.
|
@@ -2311,7 +2391,8 @@ function outlineTask(request, task) {
|
|
2311
2391
|
}
|
2312
2392
|
|
2313
2393
|
function renderElement(request, task, type, key, ref, props, owner, // DEV only
|
2314
|
-
stack
|
2394
|
+
stack, // DEV only
|
2395
|
+
validated) // DEV only
|
2315
2396
|
{
|
2316
2397
|
if (ref !== null && ref !== undefined) {
|
2317
2398
|
// When the ref moves to the regular props object this will implicitly
|
@@ -3253,9 +3334,8 @@ function emitPostponeChunk(request, id, postponeInstance) {
|
|
3253
3334
|
|
3254
3335
|
try {
|
3255
3336
|
// eslint-disable-next-line react-internal/safe-string-coercion
|
3256
|
-
reason = String(postponeInstance.message);
|
3257
|
-
|
3258
|
-
stack = String(postponeInstance.stack);
|
3337
|
+
reason = String(postponeInstance.message);
|
3338
|
+
stack = getStack(postponeInstance);
|
3259
3339
|
} catch (x) {}
|
3260
3340
|
|
3261
3341
|
row = serializeRowHeader('P', id) + stringify({
|
@@ -3278,9 +3358,8 @@ function emitErrorChunk(request, id, digest, error) {
|
|
3278
3358
|
try {
|
3279
3359
|
if (error instanceof Error) {
|
3280
3360
|
// eslint-disable-next-line react-internal/safe-string-coercion
|
3281
|
-
message = String(error.message);
|
3282
|
-
|
3283
|
-
stack = String(error.stack);
|
3361
|
+
message = String(error.message);
|
3362
|
+
stack = getStack(error);
|
3284
3363
|
} else if (typeof error === 'object' && error !== null) {
|
3285
3364
|
message = describeObjectForErrorMessage(error);
|
3286
3365
|
} else {
|
@@ -973,7 +973,11 @@ function renderFunctionComponent(request, task, key, Component, props) {
|
|
973
973
|
thenableIndexCounter = 0;
|
974
974
|
thenableState = prevThenableState;
|
975
975
|
Component = Component(props, void 0);
|
976
|
-
if (
|
976
|
+
if (
|
977
|
+
"object" === typeof Component &&
|
978
|
+
null !== Component &&
|
979
|
+
Component.$$typeof !== CLIENT_REFERENCE_TAG$1
|
980
|
+
) {
|
977
981
|
if ("function" === typeof Component.then) {
|
978
982
|
props = Component;
|
979
983
|
if ("fulfilled" === props.status) return props.value;
|
@@ -42,6 +42,9 @@ if (!ReactSharedInternalsServer) {
|
|
42
42
|
throw new Error('The "react" package in this environment is not configured correctly. ' + 'The "react-server" condition must be enabled in any environment that ' + 'runs React Server Components.');
|
43
43
|
}
|
44
44
|
|
45
|
+
// -----------------------------------------------------------------------------
|
46
|
+
var enablePostpone = false;
|
47
|
+
|
45
48
|
function error(format) {
|
46
49
|
{
|
47
50
|
{
|
@@ -49,38 +52,51 @@ function error(format) {
|
|
49
52
|
args[_key2 - 1] = arguments[_key2];
|
50
53
|
}
|
51
54
|
|
52
|
-
printWarning('error', format, args);
|
55
|
+
printWarning('error', format, args, new Error('react-stack-top-frame'));
|
53
56
|
}
|
54
57
|
}
|
55
|
-
}
|
58
|
+
} // eslint-disable-next-line react-internal/no-production-logging
|
56
59
|
|
57
|
-
function printWarning(level, format, args) {
|
60
|
+
function printWarning(level, format, args, currentStack) {
|
58
61
|
// When changing this logic, you might want to also
|
59
62
|
// update consoleWithStackDev.www.js as well.
|
60
63
|
{
|
61
|
-
var
|
62
|
-
|
63
|
-
if (stack !== '') {
|
64
|
-
format += '%s';
|
65
|
-
args = args.concat([stack]);
|
66
|
-
} // eslint-disable-next-line react-internal/safe-string-coercion
|
64
|
+
var isErrorLogger = format === '%s\n\n%s\n' || format === '%o\n\n%s\n\n%s\n';
|
67
65
|
|
66
|
+
if (ReactSharedInternalsServer.getCurrentStack) {
|
67
|
+
// We only add the current stack to the console when createTask is not supported.
|
68
|
+
// Since createTask requires DevTools to be open to work, this means that stacks
|
69
|
+
// can be lost while DevTools isn't open but we can't detect this.
|
70
|
+
var stack = ReactSharedInternalsServer.getCurrentStack(currentStack);
|
68
71
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
+
if (stack !== '') {
|
73
|
+
format += '%s';
|
74
|
+
args = args.concat([stack]);
|
75
|
+
}
|
76
|
+
}
|
72
77
|
|
73
|
-
|
78
|
+
if (isErrorLogger) {
|
79
|
+
// Don't prefix our default logging formatting in ReactFiberErrorLoggger.
|
80
|
+
// Don't toString the arguments.
|
81
|
+
args.unshift(format);
|
82
|
+
} else {
|
83
|
+
// TODO: Remove this prefix and stop toStringing in the wrapper and
|
84
|
+
// instead do it at each callsite as needed.
|
85
|
+
// Careful: RN currently depends on this prefix
|
86
|
+
// eslint-disable-next-line react-internal/safe-string-coercion
|
87
|
+
args = args.map(function (item) {
|
88
|
+
return String(item);
|
89
|
+
});
|
90
|
+
args.unshift('Warning: ' + format);
|
91
|
+
} // We intentionally don't use spread (or .apply) directly because it
|
74
92
|
// breaks IE9: https://github.com/facebook/react/issues/13610
|
75
93
|
// eslint-disable-next-line react-internal/no-production-logging
|
76
94
|
|
77
|
-
|
95
|
+
|
96
|
+
Function.prototype.apply.call(console[level], console, args);
|
78
97
|
}
|
79
98
|
}
|
80
99
|
|
81
|
-
// -----------------------------------------------------------------------------
|
82
|
-
var enablePostpone = false;
|
83
|
-
|
84
100
|
function scheduleWork(callback) {
|
85
101
|
setImmediate(callback);
|
86
102
|
}
|
@@ -1576,6 +1592,37 @@ function describeObjectForErrorMessage(objectOrArray, expandedName) {
|
|
1576
1592
|
|
1577
1593
|
var ReactSharedInternals = ReactSharedInternalsServer;
|
1578
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
|
+
|
1579
1626
|
var ObjectPrototype = Object.prototype;
|
1580
1627
|
var stringify = JSON.stringify; // Serializable values
|
1581
1628
|
// Thenable<ReactClientValue>
|
@@ -1638,6 +1685,7 @@ function createRequest(model, bundlerConfig, onError, identifierPrefix, onPostpo
|
|
1638
1685
|
|
1639
1686
|
{
|
1640
1687
|
request.environmentName = environmentName === undefined ? 'Server' : environmentName;
|
1688
|
+
request.didWarnForKey = null;
|
1641
1689
|
}
|
1642
1690
|
|
1643
1691
|
var rootTask = createTask(request, model, null, false, abortSet);
|
@@ -2023,7 +2071,8 @@ function callLazyInitInDEV(lazy) {
|
|
2023
2071
|
}
|
2024
2072
|
|
2025
2073
|
function renderFunctionComponent(request, task, key, Component, props, owner, // DEV-only
|
2026
|
-
stack
|
2074
|
+
stack, // DEV-only
|
2075
|
+
validated) // DEV-only
|
2027
2076
|
{
|
2028
2077
|
// Reset the task's thenable state before continuing, so that if a later
|
2029
2078
|
// component suspends we can reuse the same task object. If the same
|
@@ -2065,12 +2114,23 @@ stack) // DEV-only
|
|
2065
2114
|
result = callComponentInDEV(Component, props, componentDebugInfo);
|
2066
2115
|
}
|
2067
2116
|
|
2068
|
-
if (typeof result === 'object' && result !== null) {
|
2117
|
+
if (typeof result === 'object' && result !== null && !isClientReference(result)) {
|
2069
2118
|
if (typeof result.then === 'function') {
|
2070
2119
|
// When the return value is in children position we can resolve it immediately,
|
2071
2120
|
// to its value without a wrapper if it's synchronously available.
|
2072
2121
|
var thenable = result;
|
2073
2122
|
|
2123
|
+
{
|
2124
|
+
// If the thenable resolves to an element, then it was in a static position,
|
2125
|
+
// the return value of a Server Component. That doesn't need further validation
|
2126
|
+
// of keys. The Server Component itself would have had a key.
|
2127
|
+
thenable.then(function (resolvedValue) {
|
2128
|
+
if (typeof resolvedValue === 'object' && resolvedValue !== null && resolvedValue.$$typeof === REACT_ELEMENT_TYPE) {
|
2129
|
+
resolvedValue._store.validated = 1;
|
2130
|
+
}
|
2131
|
+
}, function () {});
|
2132
|
+
}
|
2133
|
+
|
2074
2134
|
if (thenable.status === 'fulfilled') {
|
2075
2135
|
return thenable.value;
|
2076
2136
|
} // TODO: Once we accept Promises as children on the client, we can just return
|
@@ -2141,6 +2201,11 @@ stack) // DEV-only
|
|
2141
2201
|
{
|
2142
2202
|
result._debugInfo = _iterableChild._debugInfo;
|
2143
2203
|
}
|
2204
|
+
} else if (result.$$typeof === REACT_ELEMENT_TYPE) {
|
2205
|
+
// If the server component renders to an element, then it was in a static position.
|
2206
|
+
// That doesn't need further validation of keys. The Server Component itself would
|
2207
|
+
// have had a key.
|
2208
|
+
result._store.validated = 1;
|
2144
2209
|
}
|
2145
2210
|
} // Track this element's key on the Server Component on the keyPath context..
|
2146
2211
|
|
@@ -2167,12 +2232,26 @@ stack) // DEV-only
|
|
2167
2232
|
}
|
2168
2233
|
|
2169
2234
|
function renderFragment(request, task, children) {
|
2235
|
+
{
|
2236
|
+
for (var i = 0; i < children.length; i++) {
|
2237
|
+
var child = children[i];
|
2238
|
+
|
2239
|
+
if (child !== null && typeof child === 'object' && child.$$typeof === REACT_ELEMENT_TYPE) {
|
2240
|
+
var element = child;
|
2241
|
+
|
2242
|
+
if (element.key === null && !element._store.validated) {
|
2243
|
+
element._store.validated = 2;
|
2244
|
+
}
|
2245
|
+
}
|
2246
|
+
}
|
2247
|
+
}
|
2248
|
+
|
2170
2249
|
if (task.keyPath !== null) {
|
2171
2250
|
// We have a Server Component that specifies a key but we're now splitting
|
2172
2251
|
// the tree using a fragment.
|
2173
2252
|
var fragment = [REACT_ELEMENT_TYPE, REACT_FRAGMENT_TYPE, task.keyPath, {
|
2174
2253
|
children: children
|
2175
|
-
}];
|
2254
|
+
}, null] ;
|
2176
2255
|
|
2177
2256
|
if (!task.implicitSlot) {
|
2178
2257
|
// If this was keyed inside a set. I.e. the outer Server Component was keyed
|
@@ -2229,7 +2308,7 @@ function renderAsyncFragment(request, task, children, getAsyncIterator) {
|
|
2229
2308
|
// the tree using a fragment.
|
2230
2309
|
var fragment = [REACT_ELEMENT_TYPE, REACT_FRAGMENT_TYPE, task.keyPath, {
|
2231
2310
|
children: children
|
2232
|
-
}];
|
2311
|
+
}, null] ;
|
2233
2312
|
|
2234
2313
|
if (!task.implicitSlot) {
|
2235
2314
|
// If this was keyed inside a set. I.e. the outer Server Component was keyed
|
@@ -2260,7 +2339,8 @@ function renderAsyncFragment(request, task, children, getAsyncIterator) {
|
|
2260
2339
|
}
|
2261
2340
|
|
2262
2341
|
function renderClientElement(task, type, key, props, owner, // DEV-only
|
2263
|
-
stack
|
2342
|
+
stack, // DEV-only
|
2343
|
+
validated) // DEV-only
|
2264
2344
|
{
|
2265
2345
|
// We prepend the terminal client element that actually gets serialized with
|
2266
2346
|
// the keys of any Server Components which are not serialized.
|
@@ -2311,7 +2391,8 @@ function outlineTask(request, task) {
|
|
2311
2391
|
}
|
2312
2392
|
|
2313
2393
|
function renderElement(request, task, type, key, ref, props, owner, // DEV only
|
2314
|
-
stack
|
2394
|
+
stack, // DEV only
|
2395
|
+
validated) // DEV only
|
2315
2396
|
{
|
2316
2397
|
if (ref !== null && ref !== undefined) {
|
2317
2398
|
// When the ref moves to the regular props object this will implicitly
|
@@ -3253,9 +3334,8 @@ function emitPostponeChunk(request, id, postponeInstance) {
|
|
3253
3334
|
|
3254
3335
|
try {
|
3255
3336
|
// eslint-disable-next-line react-internal/safe-string-coercion
|
3256
|
-
reason = String(postponeInstance.message);
|
3257
|
-
|
3258
|
-
stack = String(postponeInstance.stack);
|
3337
|
+
reason = String(postponeInstance.message);
|
3338
|
+
stack = getStack(postponeInstance);
|
3259
3339
|
} catch (x) {}
|
3260
3340
|
|
3261
3341
|
row = serializeRowHeader('P', id) + stringify({
|
@@ -3278,9 +3358,8 @@ function emitErrorChunk(request, id, digest, error) {
|
|
3278
3358
|
try {
|
3279
3359
|
if (error instanceof Error) {
|
3280
3360
|
// eslint-disable-next-line react-internal/safe-string-coercion
|
3281
|
-
message = String(error.message);
|
3282
|
-
|
3283
|
-
stack = String(error.stack);
|
3361
|
+
message = String(error.message);
|
3362
|
+
stack = getStack(error);
|
3284
3363
|
} else if (typeof error === 'object' && error !== null) {
|
3285
3364
|
message = describeObjectForErrorMessage(error);
|
3286
3365
|
} else {
|
@@ -973,7 +973,11 @@ function renderFunctionComponent(request, task, key, Component, props) {
|
|
973
973
|
thenableIndexCounter = 0;
|
974
974
|
thenableState = prevThenableState;
|
975
975
|
Component = Component(props, void 0);
|
976
|
-
if (
|
976
|
+
if (
|
977
|
+
"object" === typeof Component &&
|
978
|
+
null !== Component &&
|
979
|
+
Component.$$typeof !== CLIENT_REFERENCE_TAG$1
|
980
|
+
) {
|
977
981
|
if ("function" === typeof Component.then) {
|
978
982
|
props = Component;
|
979
983
|
if ("fulfilled" === props.status) return props.value;
|
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-6230622a1a-20240610",
|
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-6230622a1a-20240610",
|
81
|
+
"react-dom": "19.0.0-rc-6230622a1a-20240610",
|
82
82
|
"webpack": "^5.59.0"
|
83
83
|
},
|
84
84
|
"dependencies": {
|