react-server-dom-webpack 19.0.0-rc-20b6f4c0e8-20240607 → 19.0.0-rc-34d0c5e357-20240607
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 +30 -61
- package/cjs/react-server-dom-webpack-client.edge.development.js +30 -61
- package/cjs/react-server-dom-webpack-client.node.development.js +31 -62
- package/cjs/react-server-dom-webpack-client.node.unbundled.development.js +31 -62
- package/cjs/react-server-dom-webpack-server.browser.development.js +47 -241
- package/cjs/react-server-dom-webpack-server.browser.production.js +78 -161
- package/cjs/react-server-dom-webpack-server.edge.development.js +46 -227
- package/cjs/react-server-dom-webpack-server.edge.production.js +79 -143
- package/cjs/react-server-dom-webpack-server.node.development.js +47 -219
- package/cjs/react-server-dom-webpack-server.node.production.js +85 -138
- package/cjs/react-server-dom-webpack-server.node.unbundled.development.js +47 -219
- package/cjs/react-server-dom-webpack-server.node.unbundled.production.js +85 -138
- package/package.json +3 -3
@@ -39,9 +39,6 @@ if (!ReactSharedInternalsServer) {
|
|
39
39
|
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.');
|
40
40
|
}
|
41
41
|
|
42
|
-
// -----------------------------------------------------------------------------
|
43
|
-
var enablePostpone = false;
|
44
|
-
|
45
42
|
function error(format) {
|
46
43
|
{
|
47
44
|
{
|
@@ -49,77 +46,41 @@ function error(format) {
|
|
49
46
|
args[_key2 - 1] = arguments[_key2];
|
50
47
|
}
|
51
48
|
|
52
|
-
printWarning('error', format, args
|
49
|
+
printWarning('error', format, args);
|
53
50
|
}
|
54
51
|
}
|
55
|
-
}
|
52
|
+
}
|
56
53
|
|
57
|
-
function printWarning(level, format, args
|
54
|
+
function printWarning(level, format, args) {
|
58
55
|
// When changing this logic, you might want to also
|
59
56
|
// update consoleWithStackDev.www.js as well.
|
60
57
|
{
|
61
|
-
var
|
58
|
+
var stack = ReactSharedInternalsServer.getStackAddendum();
|
62
59
|
|
63
|
-
if (
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
var stack = ReactSharedInternalsServer.getCurrentStack(currentStack);
|
60
|
+
if (stack !== '') {
|
61
|
+
format += '%s';
|
62
|
+
args = args.concat([stack]);
|
63
|
+
} // eslint-disable-next-line react-internal/safe-string-coercion
|
68
64
|
|
69
|
-
if (stack !== '') {
|
70
|
-
format += '%s';
|
71
|
-
args = args.concat([stack]);
|
72
|
-
}
|
73
|
-
}
|
74
65
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
// TODO: Remove this prefix and stop toStringing in the wrapper and
|
81
|
-
// instead do it at each callsite as needed.
|
82
|
-
// Careful: RN currently depends on this prefix
|
83
|
-
// eslint-disable-next-line react-internal/safe-string-coercion
|
84
|
-
args = args.map(function (item) {
|
85
|
-
return String(item);
|
86
|
-
});
|
87
|
-
args.unshift('Warning: ' + format);
|
88
|
-
} // We intentionally don't use spread (or .apply) directly because it
|
66
|
+
var argsWithFormat = args.map(function (item) {
|
67
|
+
return String(item);
|
68
|
+
}); // Careful: RN currently depends on this prefix
|
69
|
+
|
70
|
+
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
|
89
71
|
// breaks IE9: https://github.com/facebook/react/issues/13610
|
90
72
|
// eslint-disable-next-line react-internal/no-production-logging
|
91
73
|
|
92
|
-
|
93
|
-
Function.prototype.apply.call(console[level], console, args);
|
74
|
+
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
94
75
|
}
|
95
76
|
}
|
96
77
|
|
97
|
-
|
98
|
-
var
|
99
|
-
|
100
|
-
channel.port1.onmessage = function () {
|
101
|
-
var task = taskQueue.shift();
|
102
|
-
|
103
|
-
if (task) {
|
104
|
-
task();
|
105
|
-
}
|
106
|
-
};
|
78
|
+
// -----------------------------------------------------------------------------
|
79
|
+
var enablePostpone = false;
|
107
80
|
|
108
81
|
function scheduleWork(callback) {
|
109
|
-
|
110
|
-
channel.port2.postMessage(null);
|
82
|
+
callback();
|
111
83
|
}
|
112
|
-
|
113
|
-
function handleErrorInNextTick(error) {
|
114
|
-
setTimeout(function () {
|
115
|
-
throw error;
|
116
|
-
});
|
117
|
-
}
|
118
|
-
|
119
|
-
var LocalPromise = Promise;
|
120
|
-
var scheduleMicrotask = typeof queueMicrotask === 'function' ? queueMicrotask : function (callback) {
|
121
|
-
LocalPromise.resolve(null).then(callback).catch(handleErrorInNextTick);
|
122
|
-
};
|
123
84
|
var VIEW_SIZE = 2048;
|
124
85
|
var currentView = null;
|
125
86
|
var writtenBytes = 0;
|
@@ -1549,37 +1510,6 @@ function describeObjectForErrorMessage(objectOrArray, expandedName) {
|
|
1549
1510
|
|
1550
1511
|
var ReactSharedInternals = ReactSharedInternalsServer;
|
1551
1512
|
|
1552
|
-
function prepareStackTrace(error, structuredStackTrace) {
|
1553
|
-
var name = error.name || 'Error';
|
1554
|
-
var message = error.message || '';
|
1555
|
-
var stack = name + ': ' + message;
|
1556
|
-
|
1557
|
-
for (var i = 0; i < structuredStackTrace.length; i++) {
|
1558
|
-
stack += '\n at ' + structuredStackTrace[i].toString();
|
1559
|
-
}
|
1560
|
-
|
1561
|
-
return stack;
|
1562
|
-
}
|
1563
|
-
|
1564
|
-
function getStack(error) {
|
1565
|
-
// We override Error.prepareStackTrace with our own version that normalizes
|
1566
|
-
// the stack to V8 formatting even if the server uses other formatting.
|
1567
|
-
// It also ensures that source maps are NOT applied to this since that can
|
1568
|
-
// be slow we're better off doing that lazily from the client instead of
|
1569
|
-
// eagerly on the server. If the stack has already been read, then we might
|
1570
|
-
// not get a normalized stack and it might still have been source mapped.
|
1571
|
-
// So the client still needs to be resilient to this.
|
1572
|
-
var previousPrepare = Error.prepareStackTrace;
|
1573
|
-
Error.prepareStackTrace = prepareStackTrace;
|
1574
|
-
|
1575
|
-
try {
|
1576
|
-
// eslint-disable-next-line react-internal/safe-string-coercion
|
1577
|
-
return String(error.stack);
|
1578
|
-
} finally {
|
1579
|
-
Error.prepareStackTrace = previousPrepare;
|
1580
|
-
}
|
1581
|
-
}
|
1582
|
-
|
1583
1513
|
var ObjectPrototype = Object.prototype;
|
1584
1514
|
var stringify = JSON.stringify; // Serializable values
|
1585
1515
|
// Thenable<ReactClientValue>
|
@@ -1589,8 +1519,6 @@ var PENDING$1 = 0;
|
|
1589
1519
|
var COMPLETED = 1;
|
1590
1520
|
var ABORTED = 3;
|
1591
1521
|
var ERRORED$1 = 4;
|
1592
|
-
var RENDERING = 5;
|
1593
|
-
var AbortSigil = {};
|
1594
1522
|
|
1595
1523
|
function defaultErrorHandler(error) {
|
1596
1524
|
console['error'](error); // Don't transform to our wrapper
|
@@ -1600,9 +1528,8 @@ function defaultPostponeHandler(reason) {// Noop
|
|
1600
1528
|
}
|
1601
1529
|
|
1602
1530
|
var OPEN = 0;
|
1603
|
-
var
|
1604
|
-
var
|
1605
|
-
var CLOSED = 3;
|
1531
|
+
var CLOSING = 1;
|
1532
|
+
var CLOSED = 2;
|
1606
1533
|
function createRequest(model, bundlerConfig, onError, identifierPrefix, onPostpone, environmentName, temporaryReferences) {
|
1607
1534
|
if (ReactSharedInternals.A !== null && ReactSharedInternals.A !== DefaultAsyncDispatcher) {
|
1608
1535
|
throw new Error('Currently React only supports one RSC renderer at a time.');
|
@@ -1645,7 +1572,6 @@ function createRequest(model, bundlerConfig, onError, identifierPrefix, onPostpo
|
|
1645
1572
|
|
1646
1573
|
{
|
1647
1574
|
request.environmentName = environmentName === undefined ? 'Server' : environmentName;
|
1648
|
-
request.didWarnForKey = null;
|
1649
1575
|
}
|
1650
1576
|
|
1651
1577
|
var rootTask = createTask(request, model, null, false, abortSet);
|
@@ -1695,16 +1621,6 @@ function serializeThenable(request, task, thenable) {
|
|
1695
1621
|
|
1696
1622
|
default:
|
1697
1623
|
{
|
1698
|
-
if (request.status === ABORTING) {
|
1699
|
-
// We can no longer accept any resolved values
|
1700
|
-
newTask.status = ABORTED;
|
1701
|
-
var errorId = request.fatalError;
|
1702
|
-
var model = stringify(serializeByValueID(errorId));
|
1703
|
-
emitModelChunk(request, newTask.id, model);
|
1704
|
-
request.abortableTasks.delete(newTask);
|
1705
|
-
return newTask.id;
|
1706
|
-
}
|
1707
|
-
|
1708
1624
|
if (typeof thenable.status === 'string') {
|
1709
1625
|
// Only instrument the thenable if the status if not defined. If
|
1710
1626
|
// it's defined, but an unknown value, assume it's been instrumented by
|
@@ -2035,8 +1951,7 @@ function callLazyInitInDEV(lazy) {
|
|
2035
1951
|
}
|
2036
1952
|
|
2037
1953
|
function renderFunctionComponent(request, task, key, Component, props, owner, // DEV-only
|
2038
|
-
stack
|
2039
|
-
validated) // DEV-only
|
1954
|
+
stack) // DEV-only
|
2040
1955
|
{
|
2041
1956
|
// Reset the task's thenable state before continuing, so that if a later
|
2042
1957
|
// component suspends we can reuse the same task object. If the same
|
@@ -2078,30 +1993,12 @@ validated) // DEV-only
|
|
2078
1993
|
result = callComponentInDEV(Component, props, componentDebugInfo);
|
2079
1994
|
}
|
2080
1995
|
|
2081
|
-
if (
|
2082
|
-
// If we aborted during rendering we should interrupt the render but
|
2083
|
-
// we don't need to provide an error because the renderer will encode
|
2084
|
-
// the abort error as the reason.
|
2085
|
-
throw AbortSigil;
|
2086
|
-
}
|
2087
|
-
|
2088
|
-
if (typeof result === 'object' && result !== null && !isClientReference(result)) {
|
1996
|
+
if (typeof result === 'object' && result !== null) {
|
2089
1997
|
if (typeof result.then === 'function') {
|
2090
1998
|
// When the return value is in children position we can resolve it immediately,
|
2091
1999
|
// to its value without a wrapper if it's synchronously available.
|
2092
2000
|
var thenable = result;
|
2093
2001
|
|
2094
|
-
{
|
2095
|
-
// If the thenable resolves to an element, then it was in a static position,
|
2096
|
-
// the return value of a Server Component. That doesn't need further validation
|
2097
|
-
// of keys. The Server Component itself would have had a key.
|
2098
|
-
thenable.then(function (resolvedValue) {
|
2099
|
-
if (typeof resolvedValue === 'object' && resolvedValue !== null && resolvedValue.$$typeof === REACT_ELEMENT_TYPE) {
|
2100
|
-
resolvedValue._store.validated = 1;
|
2101
|
-
}
|
2102
|
-
}, function () {});
|
2103
|
-
}
|
2104
|
-
|
2105
2002
|
if (thenable.status === 'fulfilled') {
|
2106
2003
|
return thenable.value;
|
2107
2004
|
} // TODO: Once we accept Promises as children on the client, we can just return
|
@@ -2172,11 +2069,6 @@ validated) // DEV-only
|
|
2172
2069
|
{
|
2173
2070
|
result._debugInfo = _iterableChild._debugInfo;
|
2174
2071
|
}
|
2175
|
-
} else if (result.$$typeof === REACT_ELEMENT_TYPE) {
|
2176
|
-
// If the server component renders to an element, then it was in a static position.
|
2177
|
-
// That doesn't need further validation of keys. The Server Component itself would
|
2178
|
-
// have had a key.
|
2179
|
-
result._store.validated = 1;
|
2180
2072
|
}
|
2181
2073
|
} // Track this element's key on the Server Component on the keyPath context..
|
2182
2074
|
|
@@ -2203,26 +2095,12 @@ validated) // DEV-only
|
|
2203
2095
|
}
|
2204
2096
|
|
2205
2097
|
function renderFragment(request, task, children) {
|
2206
|
-
{
|
2207
|
-
for (var i = 0; i < children.length; i++) {
|
2208
|
-
var child = children[i];
|
2209
|
-
|
2210
|
-
if (child !== null && typeof child === 'object' && child.$$typeof === REACT_ELEMENT_TYPE) {
|
2211
|
-
var element = child;
|
2212
|
-
|
2213
|
-
if (element.key === null && !element._store.validated) {
|
2214
|
-
element._store.validated = 2;
|
2215
|
-
}
|
2216
|
-
}
|
2217
|
-
}
|
2218
|
-
}
|
2219
|
-
|
2220
2098
|
if (task.keyPath !== null) {
|
2221
2099
|
// We have a Server Component that specifies a key but we're now splitting
|
2222
2100
|
// the tree using a fragment.
|
2223
2101
|
var fragment = [REACT_ELEMENT_TYPE, REACT_FRAGMENT_TYPE, task.keyPath, {
|
2224
2102
|
children: children
|
2225
|
-
}
|
2103
|
+
}];
|
2226
2104
|
|
2227
2105
|
if (!task.implicitSlot) {
|
2228
2106
|
// If this was keyed inside a set. I.e. the outer Server Component was keyed
|
@@ -2279,7 +2157,7 @@ function renderAsyncFragment(request, task, children, getAsyncIterator) {
|
|
2279
2157
|
// the tree using a fragment.
|
2280
2158
|
var fragment = [REACT_ELEMENT_TYPE, REACT_FRAGMENT_TYPE, task.keyPath, {
|
2281
2159
|
children: children
|
2282
|
-
}
|
2160
|
+
}];
|
2283
2161
|
|
2284
2162
|
if (!task.implicitSlot) {
|
2285
2163
|
// If this was keyed inside a set. I.e. the outer Server Component was keyed
|
@@ -2310,8 +2188,7 @@ function renderAsyncFragment(request, task, children, getAsyncIterator) {
|
|
2310
2188
|
}
|
2311
2189
|
|
2312
2190
|
function renderClientElement(task, type, key, props, owner, // DEV-only
|
2313
|
-
stack
|
2314
|
-
validated) // DEV-only
|
2191
|
+
stack) // DEV-only
|
2315
2192
|
{
|
2316
2193
|
// We prepend the terminal client element that actually gets serialized with
|
2317
2194
|
// the keys of any Server Components which are not serialized.
|
@@ -2362,8 +2239,7 @@ function outlineTask(request, task) {
|
|
2362
2239
|
}
|
2363
2240
|
|
2364
2241
|
function renderElement(request, task, type, key, ref, props, owner, // DEV only
|
2365
|
-
stack
|
2366
|
-
validated) // DEV only
|
2242
|
+
stack) // DEV only
|
2367
2243
|
{
|
2368
2244
|
if (ref !== null && ref !== undefined) {
|
2369
2245
|
// When the ref moves to the regular props object this will implicitly
|
@@ -2426,13 +2302,6 @@ validated) // DEV only
|
|
2426
2302
|
wrappedType = callLazyInitInDEV(type);
|
2427
2303
|
}
|
2428
2304
|
|
2429
|
-
if (request.status === ABORTING) {
|
2430
|
-
// lazy initializers are user code and could abort during render
|
2431
|
-
// we don't wan to return any value resolved from the lazy initializer
|
2432
|
-
// if it aborts so we interrupt rendering here
|
2433
|
-
throw AbortSigil;
|
2434
|
-
}
|
2435
|
-
|
2436
2305
|
return renderElement(request, task, wrappedType, key, ref, props, owner);
|
2437
2306
|
}
|
2438
2307
|
|
@@ -2457,7 +2326,7 @@ function pingTask(request, task) {
|
|
2457
2326
|
|
2458
2327
|
if (pingedTasks.length === 1) {
|
2459
2328
|
request.flushScheduled = request.destination !== null;
|
2460
|
-
|
2329
|
+
scheduleWork(function () {
|
2461
2330
|
return performWork(request);
|
2462
2331
|
});
|
2463
2332
|
}
|
@@ -2755,32 +2624,21 @@ function renderModel(request, task, parent, key, value) {
|
|
2755
2624
|
try {
|
2756
2625
|
return renderModelDestructive(request, task, parent, key, value);
|
2757
2626
|
} catch (thrownValue) {
|
2758
|
-
// If the suspended/errored value was an element or lazy it can be reduced
|
2759
|
-
// to a lazy reference, so that it doesn't error the parent.
|
2760
|
-
var model = task.model;
|
2761
|
-
var wasReactNode = typeof model === 'object' && model !== null && (model.$$typeof === REACT_ELEMENT_TYPE || model.$$typeof === REACT_LAZY_TYPE);
|
2762
2627
|
var x = thrownValue === SuspenseException ? // This is a special type of exception used for Suspense. For historical
|
2763
2628
|
// reasons, the rest of the Suspense implementation expects the thrown
|
2764
2629
|
// value to be a thenable, because before `use` existed that was the
|
2765
2630
|
// (unstable) API for suspending. This implementation detail can change
|
2766
2631
|
// later, once we deprecate the old API in favor of `use`.
|
2767
|
-
getSuspendedThenable() : thrownValue;
|
2632
|
+
getSuspendedThenable() : thrownValue; // If the suspended/errored value was an element or lazy it can be reduced
|
2633
|
+
// to a lazy reference, so that it doesn't error the parent.
|
2634
|
+
|
2635
|
+
var model = task.model;
|
2636
|
+
var wasReactNode = typeof model === 'object' && model !== null && (model.$$typeof === REACT_ELEMENT_TYPE || model.$$typeof === REACT_LAZY_TYPE);
|
2768
2637
|
|
2769
2638
|
if (typeof x === 'object' && x !== null) {
|
2770
2639
|
// $FlowFixMe[method-unbinding]
|
2771
2640
|
if (typeof x.then === 'function') {
|
2772
|
-
|
2773
|
-
task.status = ABORTED;
|
2774
|
-
var errorId = request.fatalError;
|
2775
|
-
|
2776
|
-
if (wasReactNode) {
|
2777
|
-
return serializeLazyID(errorId);
|
2778
|
-
}
|
2779
|
-
|
2780
|
-
return serializeByValueID(errorId);
|
2781
|
-
} // Something suspended, we'll need to create a new task and resolve it later.
|
2782
|
-
|
2783
|
-
|
2641
|
+
// Something suspended, we'll need to create a new task and resolve it later.
|
2784
2642
|
var newTask = createTask(request, task.model, task.keyPath, task.implicitSlot, request.abortableTasks);
|
2785
2643
|
var ping = newTask.ping;
|
2786
2644
|
x.then(ping, ping);
|
@@ -2796,17 +2654,6 @@ function renderModel(request, task, parent, key, value) {
|
|
2796
2654
|
|
2797
2655
|
return serializeByValueID(newTask.id);
|
2798
2656
|
}
|
2799
|
-
}
|
2800
|
-
|
2801
|
-
if (thrownValue === AbortSigil) {
|
2802
|
-
task.status = ABORTED;
|
2803
|
-
var _errorId = request.fatalError;
|
2804
|
-
|
2805
|
-
if (wasReactNode) {
|
2806
|
-
return serializeLazyID(_errorId);
|
2807
|
-
}
|
2808
|
-
|
2809
|
-
return serializeByValueID(_errorId);
|
2810
2657
|
} // Restore the context. We assume that this will be restored by the inner
|
2811
2658
|
// functions in case nothing throws so we don't use "finally" here.
|
2812
2659
|
|
@@ -2819,12 +2666,10 @@ function renderModel(request, task, parent, key, value) {
|
|
2819
2666
|
// We'll replace this element with a lazy reference that throws on the client
|
2820
2667
|
// once it gets rendered.
|
2821
2668
|
request.pendingChunks++;
|
2822
|
-
|
2823
|
-
var _errorId2 = request.nextChunkId++;
|
2824
|
-
|
2669
|
+
var errorId = request.nextChunkId++;
|
2825
2670
|
var digest = logRecoverableError(request, x);
|
2826
|
-
emitErrorChunk(request,
|
2827
|
-
return serializeLazyID(
|
2671
|
+
emitErrorChunk(request, errorId, digest, x);
|
2672
|
+
return serializeLazyID(errorId);
|
2828
2673
|
} // Something errored but it was not in a React Node. There's no need to serialize
|
2829
2674
|
// it by value because it'll just error the whole parent row anyway so we can
|
2830
2675
|
// just stop any siblings and error the whole parent row.
|
@@ -2928,13 +2773,6 @@ function renderModelDestructive(request, task, parent, parentPropertyName, value
|
|
2928
2773
|
resolvedModel = callLazyInitInDEV(lazy);
|
2929
2774
|
}
|
2930
2775
|
|
2931
|
-
if (request.status === ABORTING) {
|
2932
|
-
// lazy initializers are user code and could abort during render
|
2933
|
-
// we don't wan to return any value resolved from the lazy initializer
|
2934
|
-
// if it aborts so we interrupt rendering here
|
2935
|
-
throw AbortSigil;
|
2936
|
-
}
|
2937
|
-
|
2938
2776
|
{
|
2939
2777
|
var _debugInfo = lazy._debugInfo;
|
2940
2778
|
|
@@ -3341,8 +3179,9 @@ function emitPostponeChunk(request, id, postponeInstance) {
|
|
3341
3179
|
|
3342
3180
|
try {
|
3343
3181
|
// eslint-disable-next-line react-internal/safe-string-coercion
|
3344
|
-
reason = String(postponeInstance.message);
|
3345
|
-
|
3182
|
+
reason = String(postponeInstance.message); // eslint-disable-next-line react-internal/safe-string-coercion
|
3183
|
+
|
3184
|
+
stack = String(postponeInstance.stack);
|
3346
3185
|
} catch (x) {}
|
3347
3186
|
|
3348
3187
|
row = serializeRowHeader('P', id) + stringify({
|
@@ -3365,8 +3204,9 @@ function emitErrorChunk(request, id, digest, error) {
|
|
3365
3204
|
try {
|
3366
3205
|
if (error instanceof Error) {
|
3367
3206
|
// eslint-disable-next-line react-internal/safe-string-coercion
|
3368
|
-
message = String(error.message);
|
3369
|
-
|
3207
|
+
message = String(error.message); // eslint-disable-next-line react-internal/safe-string-coercion
|
3208
|
+
|
3209
|
+
stack = String(error.stack);
|
3370
3210
|
} else if (typeof error === 'object' && error !== null) {
|
3371
3211
|
message = describeObjectForErrorMessage(error);
|
3372
3212
|
} else {
|
@@ -3843,7 +3683,6 @@ function retryTask(request, task) {
|
|
3843
3683
|
}
|
3844
3684
|
|
3845
3685
|
var prevDebugID = debugID;
|
3846
|
-
task.status = RENDERING;
|
3847
3686
|
|
3848
3687
|
try {
|
3849
3688
|
// Track the root so we know that we have to emit this object even though it
|
@@ -3900,35 +3739,14 @@ function retryTask(request, task) {
|
|
3900
3739
|
if (typeof x === 'object' && x !== null) {
|
3901
3740
|
// $FlowFixMe[method-unbinding]
|
3902
3741
|
if (typeof x.then === 'function') {
|
3903
|
-
|
3904
|
-
request.abortableTasks.delete(task);
|
3905
|
-
task.status = ABORTED;
|
3906
|
-
var errorId = request.fatalError;
|
3907
|
-
var model = stringify(serializeByValueID(errorId));
|
3908
|
-
emitModelChunk(request, task.id, model);
|
3909
|
-
return;
|
3910
|
-
} // Something suspended again, let's pick it back up later.
|
3911
|
-
|
3912
|
-
|
3913
|
-
task.status = PENDING$1;
|
3914
|
-
task.thenableState = getThenableStateAfterSuspending();
|
3742
|
+
// Something suspended again, let's pick it back up later.
|
3915
3743
|
var ping = task.ping;
|
3916
3744
|
x.then(ping, ping);
|
3745
|
+
task.thenableState = getThenableStateAfterSuspending();
|
3917
3746
|
return;
|
3918
3747
|
}
|
3919
3748
|
}
|
3920
3749
|
|
3921
|
-
if (x === AbortSigil) {
|
3922
|
-
request.abortableTasks.delete(task);
|
3923
|
-
task.status = ABORTED;
|
3924
|
-
var _errorId3 = request.fatalError;
|
3925
|
-
|
3926
|
-
var _model = stringify(serializeByValueID(_errorId3));
|
3927
|
-
|
3928
|
-
emitModelChunk(request, task.id, _model);
|
3929
|
-
return;
|
3930
|
-
}
|
3931
|
-
|
3932
3750
|
request.abortableTasks.delete(task);
|
3933
3751
|
task.status = ERRORED$1;
|
3934
3752
|
var digest = logRecoverableError(request, x);
|
@@ -3990,11 +3808,6 @@ function performWork(request) {
|
|
3990
3808
|
}
|
3991
3809
|
|
3992
3810
|
function abortTask(task, request, errorId) {
|
3993
|
-
if (task.status === RENDERING) {
|
3994
|
-
// This task will be aborted by the render
|
3995
|
-
return;
|
3996
|
-
}
|
3997
|
-
|
3998
3811
|
task.status = ABORTED; // Instead of emitting an error per task.id, we emit a model that only
|
3999
3812
|
// has a single value referencing the error.
|
4000
3813
|
|
@@ -4087,7 +3900,6 @@ function flushCompletedChunks(request, destination) {
|
|
4087
3900
|
|
4088
3901
|
if (request.pendingChunks === 0) {
|
4089
3902
|
|
4090
|
-
request.status = CLOSED;
|
4091
3903
|
close$1(destination);
|
4092
3904
|
request.destination = null;
|
4093
3905
|
}
|
@@ -4108,14 +3920,10 @@ function enqueueFlush(request) {
|
|
4108
3920
|
request.pingedTasks.length === 0 && // If there is no destination there is nothing we can flush to. A flush will
|
4109
3921
|
// happen when we start flowing again
|
4110
3922
|
request.destination !== null) {
|
3923
|
+
var destination = request.destination;
|
4111
3924
|
request.flushScheduled = true;
|
4112
3925
|
scheduleWork(function () {
|
4113
|
-
request
|
4114
|
-
var destination = request.destination;
|
4115
|
-
|
4116
|
-
if (destination) {
|
4117
|
-
flushCompletedChunks(request, destination);
|
4118
|
-
}
|
3926
|
+
return flushCompletedChunks(request, destination);
|
4119
3927
|
});
|
4120
3928
|
}
|
4121
3929
|
}
|
@@ -4151,17 +3959,15 @@ function stopFlowing(request) {
|
|
4151
3959
|
|
4152
3960
|
function abort(request, reason) {
|
4153
3961
|
try {
|
4154
|
-
request.status = ABORTING;
|
4155
3962
|
var abortableTasks = request.abortableTasks; // We have tasks to abort. We'll emit one error row and then emit a reference
|
4156
3963
|
// to that row from every row that's still remaining.
|
4157
3964
|
|
4158
3965
|
if (abortableTasks.size > 0) {
|
4159
3966
|
request.pendingChunks++;
|
4160
3967
|
var errorId = request.nextChunkId++;
|
4161
|
-
request.fatalError = errorId;
|
4162
3968
|
|
4163
3969
|
var postponeInstance; if (enablePostpone && typeof reason === 'object' && reason !== null && reason.$$typeof === REACT_POSTPONE_TYPE) ; else {
|
4164
|
-
var error = reason === undefined ? new Error('The render was aborted by the server without a reason.') :
|
3970
|
+
var error = reason === undefined ? new Error('The render was aborted by the server without a reason.') : reason;
|
4165
3971
|
var digest = logRecoverableError(request, error);
|
4166
3972
|
emitErrorChunk(request, errorId, digest, error);
|
4167
3973
|
}
|
@@ -4178,7 +3984,7 @@ function abort(request, reason) {
|
|
4178
3984
|
var _error;
|
4179
3985
|
|
4180
3986
|
if (enablePostpone && typeof reason === 'object' && reason !== null && reason.$$typeof === REACT_POSTPONE_TYPE) ; else {
|
4181
|
-
_error = reason === undefined ? new Error('The render was aborted by the server without a reason.') :
|
3987
|
+
_error = reason === undefined ? new Error('The render was aborted by the server without a reason.') : reason;
|
4182
3988
|
}
|
4183
3989
|
|
4184
3990
|
abortListeners.forEach(function (callback) {
|