react-server-dom-webpack 18.3.0-next-de7d1c907-20221223 → 18.3.0-next-5379b6123-20230105
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.development.js +5 -6
- package/cjs/react-server-dom-webpack-plugin.js +4 -0
- package/cjs/react-server-dom-webpack-server.browser.development.js +37 -36
- package/cjs/react-server-dom-webpack-server.node.development.js +37 -36
- package/package.json +3 -3
- package/umd/react-server-dom-webpack-client.development.js +5 -6
- package/umd/react-server-dom-webpack-server.browser.development.js +37 -36
@@ -390,10 +390,10 @@ function initializeModelChunk(chunk) {
|
|
390
390
|
initializingChunkBlockedModel = null;
|
391
391
|
|
392
392
|
try {
|
393
|
-
var
|
393
|
+
var value = parseModel(chunk._response, chunk.value);
|
394
394
|
|
395
395
|
if (initializingChunkBlockedModel !== null && initializingChunkBlockedModel.deps > 0) {
|
396
|
-
initializingChunkBlockedModel.value =
|
396
|
+
initializingChunkBlockedModel.value = value; // We discovered new dependencies on modules that are not yet resolved.
|
397
397
|
// We have to go the BLOCKED state until they're resolved.
|
398
398
|
|
399
399
|
var blockedChunk = chunk;
|
@@ -403,7 +403,7 @@ function initializeModelChunk(chunk) {
|
|
403
403
|
} else {
|
404
404
|
var initializedChunk = chunk;
|
405
405
|
initializedChunk.status = INITIALIZED;
|
406
|
-
initializedChunk.value =
|
406
|
+
initializedChunk.value = value;
|
407
407
|
}
|
408
408
|
} catch (error) {
|
409
409
|
var erroredChunk = chunk;
|
@@ -417,11 +417,10 @@ function initializeModelChunk(chunk) {
|
|
417
417
|
|
418
418
|
function initializeModuleChunk(chunk) {
|
419
419
|
try {
|
420
|
-
var
|
421
|
-
|
420
|
+
var value = requireModule(chunk.value);
|
422
421
|
var initializedChunk = chunk;
|
423
422
|
initializedChunk.status = INITIALIZED;
|
424
|
-
initializedChunk.value =
|
423
|
+
initializedChunk.value = value;
|
425
424
|
} catch (error) {
|
426
425
|
var erroredChunk = chunk;
|
427
426
|
erroredChunk.status = ERRORED;
|
@@ -49,6 +49,10 @@ var clientFileName = require.resolve('../client');
|
|
49
49
|
var PLUGIN_NAME = 'React Server Plugin';
|
50
50
|
class ReactFlightWebpackPlugin {
|
51
51
|
constructor(options) {
|
52
|
+
this.clientReferences = void 0;
|
53
|
+
this.chunkName = void 0;
|
54
|
+
this.manifestFilename = void 0;
|
55
|
+
|
52
56
|
if (!options || typeof options.isServer !== 'boolean') {
|
53
57
|
throw new Error(PLUGIN_NAME + ': You must specify the isServer option as a boolean.');
|
54
58
|
}
|
@@ -258,8 +258,8 @@ var REACT_LAZY_TYPE = Symbol.for('react.lazy');
|
|
258
258
|
var REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED = Symbol.for('react.default_value');
|
259
259
|
var REACT_MEMO_CACHE_SENTINEL = Symbol.for('react.memo_cache_sentinel');
|
260
260
|
|
261
|
-
// A reserved attribute.
|
262
261
|
// It is handled by React separately and shouldn't be written to the DOM.
|
262
|
+
|
263
263
|
var RESERVED = 0; // A simple string attribute.
|
264
264
|
// Attributes that aren't in the filter are presumed to have this type.
|
265
265
|
|
@@ -684,6 +684,8 @@ var rendererSigil;
|
|
684
684
|
rendererSigil = {};
|
685
685
|
} // Used to store the parent path of all context overrides in a shared linked list.
|
686
686
|
// Forming a reverse tree.
|
687
|
+
// The structure of a context snapshot is an implementation of this file.
|
688
|
+
// Currently, it's implemented as tracking the current active node.
|
687
689
|
|
688
690
|
|
689
691
|
var rootContextSnapshot = null; // We assume that this runtime owns the "current" field on all ReactContext instances.
|
@@ -1635,16 +1637,16 @@ function describeObjectForErrorMessage(objectOrArray, expandedName) {
|
|
1635
1637
|
var array = objectOrArray;
|
1636
1638
|
|
1637
1639
|
for (var i = 0; i < array.length; i++) {
|
1638
|
-
var
|
1640
|
+
var value = array[i];
|
1639
1641
|
var substr = void 0;
|
1640
1642
|
|
1641
|
-
if (typeof
|
1642
|
-
substr =
|
1643
|
-
} else if (typeof
|
1643
|
+
if (typeof value === 'string') {
|
1644
|
+
substr = value;
|
1645
|
+
} else if (typeof value === 'object' && value !== null) {
|
1644
1646
|
// $FlowFixMe[incompatible-call] found when upgrading Flow
|
1645
|
-
substr = '{' + describeObjectForErrorMessage(
|
1647
|
+
substr = '{' + describeObjectForErrorMessage(value) + '}';
|
1646
1648
|
} else {
|
1647
|
-
substr = '{' + describeValueForErrorMessage(
|
1649
|
+
substr = '{' + describeValueForErrorMessage(value) + '}';
|
1648
1650
|
}
|
1649
1651
|
|
1650
1652
|
if ('' + i === expandedName) {
|
@@ -1669,15 +1671,15 @@ function describeObjectForErrorMessage(objectOrArray, expandedName) {
|
|
1669
1671
|
str += ', ';
|
1670
1672
|
}
|
1671
1673
|
|
1672
|
-
var
|
1674
|
+
var _value = _array[_i];
|
1673
1675
|
|
1674
1676
|
var _substr = void 0;
|
1675
1677
|
|
1676
|
-
if (typeof
|
1678
|
+
if (typeof _value === 'object' && _value !== null) {
|
1677
1679
|
// $FlowFixMe[incompatible-call] found when upgrading Flow
|
1678
|
-
_substr = describeObjectForErrorMessage(
|
1680
|
+
_substr = describeObjectForErrorMessage(_value);
|
1679
1681
|
} else {
|
1680
|
-
_substr = describeValueForErrorMessage(
|
1682
|
+
_substr = describeValueForErrorMessage(_value);
|
1681
1683
|
}
|
1682
1684
|
|
1683
1685
|
if ('' + _i === expandedName) {
|
@@ -1708,18 +1710,18 @@ function describeObjectForErrorMessage(objectOrArray, expandedName) {
|
|
1708
1710
|
str += ' ';
|
1709
1711
|
var name = names[_i2];
|
1710
1712
|
str += describeKeyForErrorMessage(name) + '=';
|
1711
|
-
var
|
1713
|
+
var _value2 = object[name];
|
1712
1714
|
|
1713
1715
|
var _substr2 = void 0;
|
1714
1716
|
|
1715
|
-
if (name === expandedName && typeof
|
1717
|
+
if (name === expandedName && typeof _value2 === 'object' && _value2 !== null) {
|
1716
1718
|
// $FlowFixMe[incompatible-call] found when upgrading Flow
|
1717
|
-
_substr2 = describeObjectForErrorMessage(
|
1719
|
+
_substr2 = describeObjectForErrorMessage(_value2);
|
1718
1720
|
} else {
|
1719
|
-
_substr2 = describeValueForErrorMessage(
|
1721
|
+
_substr2 = describeValueForErrorMessage(_value2);
|
1720
1722
|
}
|
1721
1723
|
|
1722
|
-
if (typeof
|
1724
|
+
if (typeof _value2 !== 'string') {
|
1723
1725
|
_substr2 = '{' + _substr2 + '}';
|
1724
1726
|
}
|
1725
1727
|
|
@@ -1749,15 +1751,15 @@ function describeObjectForErrorMessage(objectOrArray, expandedName) {
|
|
1749
1751
|
|
1750
1752
|
var _name = _names[_i3];
|
1751
1753
|
str += describeKeyForErrorMessage(_name) + ': ';
|
1752
|
-
var
|
1754
|
+
var _value3 = _object[_name];
|
1753
1755
|
|
1754
1756
|
var _substr3 = void 0;
|
1755
1757
|
|
1756
|
-
if (typeof
|
1758
|
+
if (typeof _value3 === 'object' && _value3 !== null) {
|
1757
1759
|
// $FlowFixMe[incompatible-call] found when upgrading Flow
|
1758
|
-
_substr3 = describeObjectForErrorMessage(
|
1760
|
+
_substr3 = describeObjectForErrorMessage(_value3);
|
1759
1761
|
} else {
|
1760
|
-
_substr3 = describeValueForErrorMessage(
|
1762
|
+
_substr3 = describeValueForErrorMessage(_value3);
|
1761
1763
|
}
|
1762
1764
|
|
1763
1765
|
if (_name === expandedName) {
|
@@ -2074,34 +2076,34 @@ function retryTask(request, task) {
|
|
2074
2076
|
switchContext(task.context);
|
2075
2077
|
|
2076
2078
|
try {
|
2077
|
-
var
|
2079
|
+
var value = task.model;
|
2078
2080
|
|
2079
|
-
if (typeof
|
2081
|
+
if (typeof value === 'object' && value !== null && value.$$typeof === REACT_ELEMENT_TYPE) {
|
2080
2082
|
// TODO: Concatenate keys of parents onto children.
|
2081
|
-
var element =
|
2083
|
+
var element = value; // When retrying a component, reuse the thenableState from the
|
2082
2084
|
// previous attempt.
|
2083
2085
|
|
2084
2086
|
var prevThenableState = task.thenableState; // Attempt to render the Server Component.
|
2085
2087
|
// Doing this here lets us reuse this same task if the next component
|
2086
2088
|
// also suspends.
|
2087
2089
|
|
2088
|
-
task.model =
|
2089
|
-
|
2090
|
+
task.model = value;
|
2091
|
+
value = attemptResolveElement(element.type, element.key, element.ref, element.props, prevThenableState); // Successfully finished this component. We're going to keep rendering
|
2090
2092
|
// using the same task, but we reset its thenable state before continuing.
|
2091
2093
|
|
2092
2094
|
task.thenableState = null; // Keep rendering and reuse the same task. This inner loop is separate
|
2093
2095
|
// from the render above because we don't need to reset the thenable state
|
2094
2096
|
// until the next time something suspends and retries.
|
2095
2097
|
|
2096
|
-
while (typeof
|
2098
|
+
while (typeof value === 'object' && value !== null && value.$$typeof === REACT_ELEMENT_TYPE) {
|
2097
2099
|
// TODO: Concatenate keys of parents onto children.
|
2098
|
-
var nextElement =
|
2099
|
-
task.model =
|
2100
|
-
|
2100
|
+
var nextElement = value;
|
2101
|
+
task.model = value;
|
2102
|
+
value = attemptResolveElement(nextElement.type, nextElement.key, nextElement.ref, nextElement.props, null);
|
2101
2103
|
}
|
2102
2104
|
}
|
2103
2105
|
|
2104
|
-
var processedChunk = processModelChunk(request, task.id,
|
2106
|
+
var processedChunk = processModelChunk(request, task.id, value);
|
2105
2107
|
request.completedJSONChunks.push(processedChunk);
|
2106
2108
|
request.abortableTasks.delete(task);
|
2107
2109
|
task.status = COMPLETED;
|
@@ -2287,14 +2289,13 @@ function abort(request, reason) {
|
|
2287
2289
|
if (abortableTasks.size > 0) {
|
2288
2290
|
// We have tasks to abort. We'll emit one error row and then emit a reference
|
2289
2291
|
// to that row from every row that's still remaining.
|
2290
|
-
var
|
2291
|
-
|
2292
|
-
var digest = logRecoverableError(request, _error);
|
2292
|
+
var error = reason === undefined ? new Error('The render was aborted by the server without a reason.') : reason;
|
2293
|
+
var digest = logRecoverableError(request, error);
|
2293
2294
|
request.pendingChunks++;
|
2294
2295
|
var errorId = request.nextChunkId++;
|
2295
2296
|
|
2296
2297
|
if (true) {
|
2297
|
-
var _getErrorMessageAndSt4 = getErrorMessageAndStackDev(
|
2298
|
+
var _getErrorMessageAndSt4 = getErrorMessageAndStackDev(error),
|
2298
2299
|
message = _getErrorMessageAndSt4.message,
|
2299
2300
|
stack = _getErrorMessageAndSt4.stack;
|
2300
2301
|
|
@@ -2326,9 +2327,9 @@ function importServerContexts(contexts) {
|
|
2326
2327
|
for (var i = 0; i < contexts.length; i++) {
|
2327
2328
|
var _contexts$i = contexts[i],
|
2328
2329
|
name = _contexts$i[0],
|
2329
|
-
|
2330
|
+
value = _contexts$i[1];
|
2330
2331
|
var context = getOrCreateServerContext(name);
|
2331
|
-
pushProvider(context,
|
2332
|
+
pushProvider(context, value);
|
2332
2333
|
}
|
2333
2334
|
|
2334
2335
|
var importedContext = getActiveContext();
|
@@ -324,8 +324,8 @@ var REACT_LAZY_TYPE = Symbol.for('react.lazy');
|
|
324
324
|
var REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED = Symbol.for('react.default_value');
|
325
325
|
var REACT_MEMO_CACHE_SENTINEL = Symbol.for('react.memo_cache_sentinel');
|
326
326
|
|
327
|
-
// A reserved attribute.
|
328
327
|
// It is handled by React separately and shouldn't be written to the DOM.
|
328
|
+
|
329
329
|
var RESERVED = 0; // A simple string attribute.
|
330
330
|
// Attributes that aren't in the filter are presumed to have this type.
|
331
331
|
|
@@ -750,6 +750,8 @@ var rendererSigil;
|
|
750
750
|
rendererSigil = {};
|
751
751
|
} // Used to store the parent path of all context overrides in a shared linked list.
|
752
752
|
// Forming a reverse tree.
|
753
|
+
// The structure of a context snapshot is an implementation of this file.
|
754
|
+
// Currently, it's implemented as tracking the current active node.
|
753
755
|
|
754
756
|
|
755
757
|
var rootContextSnapshot = null; // We assume that this runtime owns the "current" field on all ReactContext instances.
|
@@ -1701,16 +1703,16 @@ function describeObjectForErrorMessage(objectOrArray, expandedName) {
|
|
1701
1703
|
var array = objectOrArray;
|
1702
1704
|
|
1703
1705
|
for (var i = 0; i < array.length; i++) {
|
1704
|
-
var
|
1706
|
+
var value = array[i];
|
1705
1707
|
var substr = void 0;
|
1706
1708
|
|
1707
|
-
if (typeof
|
1708
|
-
substr =
|
1709
|
-
} else if (typeof
|
1709
|
+
if (typeof value === 'string') {
|
1710
|
+
substr = value;
|
1711
|
+
} else if (typeof value === 'object' && value !== null) {
|
1710
1712
|
// $FlowFixMe[incompatible-call] found when upgrading Flow
|
1711
|
-
substr = '{' + describeObjectForErrorMessage(
|
1713
|
+
substr = '{' + describeObjectForErrorMessage(value) + '}';
|
1712
1714
|
} else {
|
1713
|
-
substr = '{' + describeValueForErrorMessage(
|
1715
|
+
substr = '{' + describeValueForErrorMessage(value) + '}';
|
1714
1716
|
}
|
1715
1717
|
|
1716
1718
|
if ('' + i === expandedName) {
|
@@ -1735,15 +1737,15 @@ function describeObjectForErrorMessage(objectOrArray, expandedName) {
|
|
1735
1737
|
str += ', ';
|
1736
1738
|
}
|
1737
1739
|
|
1738
|
-
var
|
1740
|
+
var _value = _array[_i];
|
1739
1741
|
|
1740
1742
|
var _substr = void 0;
|
1741
1743
|
|
1742
|
-
if (typeof
|
1744
|
+
if (typeof _value === 'object' && _value !== null) {
|
1743
1745
|
// $FlowFixMe[incompatible-call] found when upgrading Flow
|
1744
|
-
_substr = describeObjectForErrorMessage(
|
1746
|
+
_substr = describeObjectForErrorMessage(_value);
|
1745
1747
|
} else {
|
1746
|
-
_substr = describeValueForErrorMessage(
|
1748
|
+
_substr = describeValueForErrorMessage(_value);
|
1747
1749
|
}
|
1748
1750
|
|
1749
1751
|
if ('' + _i === expandedName) {
|
@@ -1774,18 +1776,18 @@ function describeObjectForErrorMessage(objectOrArray, expandedName) {
|
|
1774
1776
|
str += ' ';
|
1775
1777
|
var name = names[_i2];
|
1776
1778
|
str += describeKeyForErrorMessage(name) + '=';
|
1777
|
-
var
|
1779
|
+
var _value2 = object[name];
|
1778
1780
|
|
1779
1781
|
var _substr2 = void 0;
|
1780
1782
|
|
1781
|
-
if (name === expandedName && typeof
|
1783
|
+
if (name === expandedName && typeof _value2 === 'object' && _value2 !== null) {
|
1782
1784
|
// $FlowFixMe[incompatible-call] found when upgrading Flow
|
1783
|
-
_substr2 = describeObjectForErrorMessage(
|
1785
|
+
_substr2 = describeObjectForErrorMessage(_value2);
|
1784
1786
|
} else {
|
1785
|
-
_substr2 = describeValueForErrorMessage(
|
1787
|
+
_substr2 = describeValueForErrorMessage(_value2);
|
1786
1788
|
}
|
1787
1789
|
|
1788
|
-
if (typeof
|
1790
|
+
if (typeof _value2 !== 'string') {
|
1789
1791
|
_substr2 = '{' + _substr2 + '}';
|
1790
1792
|
}
|
1791
1793
|
|
@@ -1815,15 +1817,15 @@ function describeObjectForErrorMessage(objectOrArray, expandedName) {
|
|
1815
1817
|
|
1816
1818
|
var _name = _names[_i3];
|
1817
1819
|
str += describeKeyForErrorMessage(_name) + ': ';
|
1818
|
-
var
|
1820
|
+
var _value3 = _object[_name];
|
1819
1821
|
|
1820
1822
|
var _substr3 = void 0;
|
1821
1823
|
|
1822
|
-
if (typeof
|
1824
|
+
if (typeof _value3 === 'object' && _value3 !== null) {
|
1823
1825
|
// $FlowFixMe[incompatible-call] found when upgrading Flow
|
1824
|
-
_substr3 = describeObjectForErrorMessage(
|
1826
|
+
_substr3 = describeObjectForErrorMessage(_value3);
|
1825
1827
|
} else {
|
1826
|
-
_substr3 = describeValueForErrorMessage(
|
1828
|
+
_substr3 = describeValueForErrorMessage(_value3);
|
1827
1829
|
}
|
1828
1830
|
|
1829
1831
|
if (_name === expandedName) {
|
@@ -2140,34 +2142,34 @@ function retryTask(request, task) {
|
|
2140
2142
|
switchContext(task.context);
|
2141
2143
|
|
2142
2144
|
try {
|
2143
|
-
var
|
2145
|
+
var value = task.model;
|
2144
2146
|
|
2145
|
-
if (typeof
|
2147
|
+
if (typeof value === 'object' && value !== null && value.$$typeof === REACT_ELEMENT_TYPE) {
|
2146
2148
|
// TODO: Concatenate keys of parents onto children.
|
2147
|
-
var element =
|
2149
|
+
var element = value; // When retrying a component, reuse the thenableState from the
|
2148
2150
|
// previous attempt.
|
2149
2151
|
|
2150
2152
|
var prevThenableState = task.thenableState; // Attempt to render the Server Component.
|
2151
2153
|
// Doing this here lets us reuse this same task if the next component
|
2152
2154
|
// also suspends.
|
2153
2155
|
|
2154
|
-
task.model =
|
2155
|
-
|
2156
|
+
task.model = value;
|
2157
|
+
value = attemptResolveElement(element.type, element.key, element.ref, element.props, prevThenableState); // Successfully finished this component. We're going to keep rendering
|
2156
2158
|
// using the same task, but we reset its thenable state before continuing.
|
2157
2159
|
|
2158
2160
|
task.thenableState = null; // Keep rendering and reuse the same task. This inner loop is separate
|
2159
2161
|
// from the render above because we don't need to reset the thenable state
|
2160
2162
|
// until the next time something suspends and retries.
|
2161
2163
|
|
2162
|
-
while (typeof
|
2164
|
+
while (typeof value === 'object' && value !== null && value.$$typeof === REACT_ELEMENT_TYPE) {
|
2163
2165
|
// TODO: Concatenate keys of parents onto children.
|
2164
|
-
var nextElement =
|
2165
|
-
task.model =
|
2166
|
-
|
2166
|
+
var nextElement = value;
|
2167
|
+
task.model = value;
|
2168
|
+
value = attemptResolveElement(nextElement.type, nextElement.key, nextElement.ref, nextElement.props, null);
|
2167
2169
|
}
|
2168
2170
|
}
|
2169
2171
|
|
2170
|
-
var processedChunk = processModelChunk(request, task.id,
|
2172
|
+
var processedChunk = processModelChunk(request, task.id, value);
|
2171
2173
|
request.completedJSONChunks.push(processedChunk);
|
2172
2174
|
request.abortableTasks.delete(task);
|
2173
2175
|
task.status = COMPLETED;
|
@@ -2351,14 +2353,13 @@ function abort(request, reason) {
|
|
2351
2353
|
if (abortableTasks.size > 0) {
|
2352
2354
|
// We have tasks to abort. We'll emit one error row and then emit a reference
|
2353
2355
|
// to that row from every row that's still remaining.
|
2354
|
-
var
|
2355
|
-
|
2356
|
-
var digest = logRecoverableError(request, _error);
|
2356
|
+
var error = reason === undefined ? new Error('The render was aborted by the server without a reason.') : reason;
|
2357
|
+
var digest = logRecoverableError(request, error);
|
2357
2358
|
request.pendingChunks++;
|
2358
2359
|
var errorId = request.nextChunkId++;
|
2359
2360
|
|
2360
2361
|
if (true) {
|
2361
|
-
var _getErrorMessageAndSt4 = getErrorMessageAndStackDev(
|
2362
|
+
var _getErrorMessageAndSt4 = getErrorMessageAndStackDev(error),
|
2362
2363
|
message = _getErrorMessageAndSt4.message,
|
2363
2364
|
stack = _getErrorMessageAndSt4.stack;
|
2364
2365
|
|
@@ -2390,9 +2391,9 @@ function importServerContexts(contexts) {
|
|
2390
2391
|
for (var i = 0; i < contexts.length; i++) {
|
2391
2392
|
var _contexts$i = contexts[i],
|
2392
2393
|
name = _contexts$i[0],
|
2393
|
-
|
2394
|
+
value = _contexts$i[1];
|
2394
2395
|
var context = getOrCreateServerContext(name);
|
2395
|
-
pushProvider(context,
|
2396
|
+
pushProvider(context, value);
|
2396
2397
|
}
|
2397
2398
|
|
2398
2399
|
var importedContext = getActiveContext();
|
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": "18.3.0-next-
|
4
|
+
"version": "18.3.0-next-5379b6123-20230105",
|
5
5
|
"keywords": [
|
6
6
|
"react"
|
7
7
|
],
|
@@ -49,8 +49,8 @@
|
|
49
49
|
"node": ">=0.10.0"
|
50
50
|
},
|
51
51
|
"peerDependencies": {
|
52
|
-
"react": "18.3.0-next-
|
53
|
-
"react-dom": "18.3.0-next-
|
52
|
+
"react": "18.3.0-next-5379b6123-20230105",
|
53
|
+
"react-dom": "18.3.0-next-5379b6123-20230105",
|
54
54
|
"webpack": "^5.59.0"
|
55
55
|
},
|
56
56
|
"dependencies": {
|
@@ -387,10 +387,10 @@
|
|
387
387
|
initializingChunkBlockedModel = null;
|
388
388
|
|
389
389
|
try {
|
390
|
-
var
|
390
|
+
var value = parseModel(chunk._response, chunk.value);
|
391
391
|
|
392
392
|
if (initializingChunkBlockedModel !== null && initializingChunkBlockedModel.deps > 0) {
|
393
|
-
initializingChunkBlockedModel.value =
|
393
|
+
initializingChunkBlockedModel.value = value; // We discovered new dependencies on modules that are not yet resolved.
|
394
394
|
// We have to go the BLOCKED state until they're resolved.
|
395
395
|
|
396
396
|
var blockedChunk = chunk;
|
@@ -400,7 +400,7 @@
|
|
400
400
|
} else {
|
401
401
|
var initializedChunk = chunk;
|
402
402
|
initializedChunk.status = INITIALIZED;
|
403
|
-
initializedChunk.value =
|
403
|
+
initializedChunk.value = value;
|
404
404
|
}
|
405
405
|
} catch (error) {
|
406
406
|
var erroredChunk = chunk;
|
@@ -414,11 +414,10 @@
|
|
414
414
|
|
415
415
|
function initializeModuleChunk(chunk) {
|
416
416
|
try {
|
417
|
-
var
|
418
|
-
|
417
|
+
var value = requireModule(chunk.value);
|
419
418
|
var initializedChunk = chunk;
|
420
419
|
initializedChunk.status = INITIALIZED;
|
421
|
-
initializedChunk.value =
|
420
|
+
initializedChunk.value = value;
|
422
421
|
} catch (error) {
|
423
422
|
var erroredChunk = chunk;
|
424
423
|
erroredChunk.status = ERRORED;
|
@@ -254,8 +254,8 @@
|
|
254
254
|
var REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED = Symbol.for('react.default_value');
|
255
255
|
var REACT_MEMO_CACHE_SENTINEL = Symbol.for('react.memo_cache_sentinel');
|
256
256
|
|
257
|
-
// A reserved attribute.
|
258
257
|
// It is handled by React separately and shouldn't be written to the DOM.
|
258
|
+
|
259
259
|
var RESERVED = 0; // A simple string attribute.
|
260
260
|
// Attributes that aren't in the filter are presumed to have this type.
|
261
261
|
|
@@ -680,6 +680,8 @@
|
|
680
680
|
rendererSigil = {};
|
681
681
|
} // Used to store the parent path of all context overrides in a shared linked list.
|
682
682
|
// Forming a reverse tree.
|
683
|
+
// The structure of a context snapshot is an implementation of this file.
|
684
|
+
// Currently, it's implemented as tracking the current active node.
|
683
685
|
|
684
686
|
|
685
687
|
var rootContextSnapshot = null; // We assume that this runtime owns the "current" field on all ReactContext instances.
|
@@ -1631,16 +1633,16 @@
|
|
1631
1633
|
var array = objectOrArray;
|
1632
1634
|
|
1633
1635
|
for (var i = 0; i < array.length; i++) {
|
1634
|
-
var
|
1636
|
+
var value = array[i];
|
1635
1637
|
var substr = void 0;
|
1636
1638
|
|
1637
|
-
if (typeof
|
1638
|
-
substr =
|
1639
|
-
} else if (typeof
|
1639
|
+
if (typeof value === 'string') {
|
1640
|
+
substr = value;
|
1641
|
+
} else if (typeof value === 'object' && value !== null) {
|
1640
1642
|
// $FlowFixMe[incompatible-call] found when upgrading Flow
|
1641
|
-
substr = '{' + describeObjectForErrorMessage(
|
1643
|
+
substr = '{' + describeObjectForErrorMessage(value) + '}';
|
1642
1644
|
} else {
|
1643
|
-
substr = '{' + describeValueForErrorMessage(
|
1645
|
+
substr = '{' + describeValueForErrorMessage(value) + '}';
|
1644
1646
|
}
|
1645
1647
|
|
1646
1648
|
if ('' + i === expandedName) {
|
@@ -1665,15 +1667,15 @@
|
|
1665
1667
|
str += ', ';
|
1666
1668
|
}
|
1667
1669
|
|
1668
|
-
var
|
1670
|
+
var _value = _array[_i];
|
1669
1671
|
|
1670
1672
|
var _substr = void 0;
|
1671
1673
|
|
1672
|
-
if (typeof
|
1674
|
+
if (typeof _value === 'object' && _value !== null) {
|
1673
1675
|
// $FlowFixMe[incompatible-call] found when upgrading Flow
|
1674
|
-
_substr = describeObjectForErrorMessage(
|
1676
|
+
_substr = describeObjectForErrorMessage(_value);
|
1675
1677
|
} else {
|
1676
|
-
_substr = describeValueForErrorMessage(
|
1678
|
+
_substr = describeValueForErrorMessage(_value);
|
1677
1679
|
}
|
1678
1680
|
|
1679
1681
|
if ('' + _i === expandedName) {
|
@@ -1704,18 +1706,18 @@
|
|
1704
1706
|
str += ' ';
|
1705
1707
|
var name = names[_i2];
|
1706
1708
|
str += describeKeyForErrorMessage(name) + '=';
|
1707
|
-
var
|
1709
|
+
var _value2 = object[name];
|
1708
1710
|
|
1709
1711
|
var _substr2 = void 0;
|
1710
1712
|
|
1711
|
-
if (name === expandedName && typeof
|
1713
|
+
if (name === expandedName && typeof _value2 === 'object' && _value2 !== null) {
|
1712
1714
|
// $FlowFixMe[incompatible-call] found when upgrading Flow
|
1713
|
-
_substr2 = describeObjectForErrorMessage(
|
1715
|
+
_substr2 = describeObjectForErrorMessage(_value2);
|
1714
1716
|
} else {
|
1715
|
-
_substr2 = describeValueForErrorMessage(
|
1717
|
+
_substr2 = describeValueForErrorMessage(_value2);
|
1716
1718
|
}
|
1717
1719
|
|
1718
|
-
if (typeof
|
1720
|
+
if (typeof _value2 !== 'string') {
|
1719
1721
|
_substr2 = '{' + _substr2 + '}';
|
1720
1722
|
}
|
1721
1723
|
|
@@ -1745,15 +1747,15 @@
|
|
1745
1747
|
|
1746
1748
|
var _name = _names[_i3];
|
1747
1749
|
str += describeKeyForErrorMessage(_name) + ': ';
|
1748
|
-
var
|
1750
|
+
var _value3 = _object[_name];
|
1749
1751
|
|
1750
1752
|
var _substr3 = void 0;
|
1751
1753
|
|
1752
|
-
if (typeof
|
1754
|
+
if (typeof _value3 === 'object' && _value3 !== null) {
|
1753
1755
|
// $FlowFixMe[incompatible-call] found when upgrading Flow
|
1754
|
-
_substr3 = describeObjectForErrorMessage(
|
1756
|
+
_substr3 = describeObjectForErrorMessage(_value3);
|
1755
1757
|
} else {
|
1756
|
-
_substr3 = describeValueForErrorMessage(
|
1758
|
+
_substr3 = describeValueForErrorMessage(_value3);
|
1757
1759
|
}
|
1758
1760
|
|
1759
1761
|
if (_name === expandedName) {
|
@@ -2070,34 +2072,34 @@
|
|
2070
2072
|
switchContext(task.context);
|
2071
2073
|
|
2072
2074
|
try {
|
2073
|
-
var
|
2075
|
+
var value = task.model;
|
2074
2076
|
|
2075
|
-
if (typeof
|
2077
|
+
if (typeof value === 'object' && value !== null && value.$$typeof === REACT_ELEMENT_TYPE) {
|
2076
2078
|
// TODO: Concatenate keys of parents onto children.
|
2077
|
-
var element =
|
2079
|
+
var element = value; // When retrying a component, reuse the thenableState from the
|
2078
2080
|
// previous attempt.
|
2079
2081
|
|
2080
2082
|
var prevThenableState = task.thenableState; // Attempt to render the Server Component.
|
2081
2083
|
// Doing this here lets us reuse this same task if the next component
|
2082
2084
|
// also suspends.
|
2083
2085
|
|
2084
|
-
task.model =
|
2085
|
-
|
2086
|
+
task.model = value;
|
2087
|
+
value = attemptResolveElement(element.type, element.key, element.ref, element.props, prevThenableState); // Successfully finished this component. We're going to keep rendering
|
2086
2088
|
// using the same task, but we reset its thenable state before continuing.
|
2087
2089
|
|
2088
2090
|
task.thenableState = null; // Keep rendering and reuse the same task. This inner loop is separate
|
2089
2091
|
// from the render above because we don't need to reset the thenable state
|
2090
2092
|
// until the next time something suspends and retries.
|
2091
2093
|
|
2092
|
-
while (typeof
|
2094
|
+
while (typeof value === 'object' && value !== null && value.$$typeof === REACT_ELEMENT_TYPE) {
|
2093
2095
|
// TODO: Concatenate keys of parents onto children.
|
2094
|
-
var nextElement =
|
2095
|
-
task.model =
|
2096
|
-
|
2096
|
+
var nextElement = value;
|
2097
|
+
task.model = value;
|
2098
|
+
value = attemptResolveElement(nextElement.type, nextElement.key, nextElement.ref, nextElement.props, null);
|
2097
2099
|
}
|
2098
2100
|
}
|
2099
2101
|
|
2100
|
-
var processedChunk = processModelChunk(request, task.id,
|
2102
|
+
var processedChunk = processModelChunk(request, task.id, value);
|
2101
2103
|
request.completedJSONChunks.push(processedChunk);
|
2102
2104
|
request.abortableTasks.delete(task);
|
2103
2105
|
task.status = COMPLETED;
|
@@ -2283,14 +2285,13 @@
|
|
2283
2285
|
if (abortableTasks.size > 0) {
|
2284
2286
|
// We have tasks to abort. We'll emit one error row and then emit a reference
|
2285
2287
|
// to that row from every row that's still remaining.
|
2286
|
-
var
|
2287
|
-
|
2288
|
-
var digest = logRecoverableError(request, _error);
|
2288
|
+
var error = reason === undefined ? new Error('The render was aborted by the server without a reason.') : reason;
|
2289
|
+
var digest = logRecoverableError(request, error);
|
2289
2290
|
request.pendingChunks++;
|
2290
2291
|
var errorId = request.nextChunkId++;
|
2291
2292
|
|
2292
2293
|
if (true) {
|
2293
|
-
var _getErrorMessageAndSt4 = getErrorMessageAndStackDev(
|
2294
|
+
var _getErrorMessageAndSt4 = getErrorMessageAndStackDev(error),
|
2294
2295
|
message = _getErrorMessageAndSt4.message,
|
2295
2296
|
stack = _getErrorMessageAndSt4.stack;
|
2296
2297
|
|
@@ -2322,9 +2323,9 @@
|
|
2322
2323
|
for (var i = 0; i < contexts.length; i++) {
|
2323
2324
|
var _contexts$i = contexts[i],
|
2324
2325
|
name = _contexts$i[0],
|
2325
|
-
|
2326
|
+
value = _contexts$i[1];
|
2326
2327
|
var context = getOrCreateServerContext(name);
|
2327
|
-
pushProvider(context,
|
2328
|
+
pushProvider(context, value);
|
2328
2329
|
}
|
2329
2330
|
|
2330
2331
|
var importedContext = getActiveContext();
|