react-server-dom-webpack 19.0.0-rc-99da76f23a-20240606 → 19.0.0-rc-827cbea417-20240606
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-server.browser.development.js +134 -19
- package/cjs/react-server-dom-webpack-server.browser.production.js +156 -77
- package/cjs/react-server-dom-webpack-server.edge.development.js +120 -18
- package/cjs/react-server-dom-webpack-server.edge.production.js +138 -78
- package/cjs/react-server-dom-webpack-server.node.development.js +111 -18
- package/cjs/react-server-dom-webpack-server.node.production.js +133 -84
- package/cjs/react-server-dom-webpack-server.node.unbundled.development.js +111 -18
- package/cjs/react-server-dom-webpack-server.node.unbundled.production.js +133 -84
- package/package.json +3 -3
@@ -100,6 +100,7 @@ function printWarning(level, format, args, currentStack) {
|
|
100
100
|
function scheduleWork(callback) {
|
101
101
|
setImmediate(callback);
|
102
102
|
}
|
103
|
+
var scheduleMicrotask = queueMicrotask;
|
103
104
|
function flushBuffered(destination) {
|
104
105
|
// If we don't have any more data to send right now.
|
105
106
|
// Flush whatever is in the buffer to the wire.
|
@@ -1632,6 +1633,8 @@ var PENDING$1 = 0;
|
|
1632
1633
|
var COMPLETED = 1;
|
1633
1634
|
var ABORTED = 3;
|
1634
1635
|
var ERRORED$1 = 4;
|
1636
|
+
var RENDERING = 5;
|
1637
|
+
var AbortSigil = {};
|
1635
1638
|
|
1636
1639
|
function defaultErrorHandler(error) {
|
1637
1640
|
console['error'](error); // Don't transform to our wrapper
|
@@ -1641,8 +1644,9 @@ function defaultPostponeHandler(reason) {// Noop
|
|
1641
1644
|
}
|
1642
1645
|
|
1643
1646
|
var OPEN = 0;
|
1644
|
-
var
|
1645
|
-
var
|
1647
|
+
var ABORTING = 1;
|
1648
|
+
var CLOSING = 2;
|
1649
|
+
var CLOSED = 3;
|
1646
1650
|
function createRequest(model, bundlerConfig, onError, identifierPrefix, onPostpone, environmentName, temporaryReferences) {
|
1647
1651
|
if (ReactSharedInternals.A !== null && ReactSharedInternals.A !== DefaultAsyncDispatcher) {
|
1648
1652
|
throw new Error('Currently React only supports one RSC renderer at a time.');
|
@@ -1740,6 +1744,16 @@ function serializeThenable(request, task, thenable) {
|
|
1740
1744
|
|
1741
1745
|
default:
|
1742
1746
|
{
|
1747
|
+
if (request.status === ABORTING) {
|
1748
|
+
// We can no longer accept any resolved values
|
1749
|
+
newTask.status = ABORTED;
|
1750
|
+
var errorId = request.fatalError;
|
1751
|
+
var model = stringify(serializeByValueID(errorId));
|
1752
|
+
emitModelChunk(request, newTask.id, model);
|
1753
|
+
request.abortableTasks.delete(newTask);
|
1754
|
+
return newTask.id;
|
1755
|
+
}
|
1756
|
+
|
1743
1757
|
if (typeof thenable.status === 'string') {
|
1744
1758
|
// Only instrument the thenable if the status if not defined. If
|
1745
1759
|
// it's defined, but an unknown value, assume it's been instrumented by
|
@@ -2114,6 +2128,13 @@ validated) // DEV-only
|
|
2114
2128
|
result = callComponentInDEV(Component, props, componentDebugInfo);
|
2115
2129
|
}
|
2116
2130
|
|
2131
|
+
if (request.status === ABORTING) {
|
2132
|
+
// If we aborted during rendering we should interrupt the render but
|
2133
|
+
// we don't need to provide an error because the renderer will encode
|
2134
|
+
// the abort error as the reason.
|
2135
|
+
throw AbortSigil;
|
2136
|
+
}
|
2137
|
+
|
2117
2138
|
if (typeof result === 'object' && result !== null && !isClientReference(result)) {
|
2118
2139
|
if (typeof result.then === 'function') {
|
2119
2140
|
// When the return value is in children position we can resolve it immediately,
|
@@ -2455,6 +2476,13 @@ validated) // DEV only
|
|
2455
2476
|
wrappedType = callLazyInitInDEV(type);
|
2456
2477
|
}
|
2457
2478
|
|
2479
|
+
if (request.status === ABORTING) {
|
2480
|
+
// lazy initializers are user code and could abort during render
|
2481
|
+
// we don't wan to return any value resolved from the lazy initializer
|
2482
|
+
// if it aborts so we interrupt rendering here
|
2483
|
+
throw AbortSigil;
|
2484
|
+
}
|
2485
|
+
|
2458
2486
|
return renderElement(request, task, wrappedType, key, ref, props, owner);
|
2459
2487
|
}
|
2460
2488
|
|
@@ -2479,7 +2507,7 @@ function pingTask(request, task) {
|
|
2479
2507
|
|
2480
2508
|
if (pingedTasks.length === 1) {
|
2481
2509
|
request.flushScheduled = request.destination !== null;
|
2482
|
-
|
2510
|
+
scheduleMicrotask(function () {
|
2483
2511
|
return performWork(request);
|
2484
2512
|
});
|
2485
2513
|
}
|
@@ -2777,21 +2805,32 @@ function renderModel(request, task, parent, key, value) {
|
|
2777
2805
|
try {
|
2778
2806
|
return renderModelDestructive(request, task, parent, key, value);
|
2779
2807
|
} catch (thrownValue) {
|
2808
|
+
// If the suspended/errored value was an element or lazy it can be reduced
|
2809
|
+
// to a lazy reference, so that it doesn't error the parent.
|
2810
|
+
var model = task.model;
|
2811
|
+
var wasReactNode = typeof model === 'object' && model !== null && (model.$$typeof === REACT_ELEMENT_TYPE || model.$$typeof === REACT_LAZY_TYPE);
|
2780
2812
|
var x = thrownValue === SuspenseException ? // This is a special type of exception used for Suspense. For historical
|
2781
2813
|
// reasons, the rest of the Suspense implementation expects the thrown
|
2782
2814
|
// value to be a thenable, because before `use` existed that was the
|
2783
2815
|
// (unstable) API for suspending. This implementation detail can change
|
2784
2816
|
// later, once we deprecate the old API in favor of `use`.
|
2785
|
-
getSuspendedThenable() : thrownValue;
|
2786
|
-
// to a lazy reference, so that it doesn't error the parent.
|
2787
|
-
|
2788
|
-
var model = task.model;
|
2789
|
-
var wasReactNode = typeof model === 'object' && model !== null && (model.$$typeof === REACT_ELEMENT_TYPE || model.$$typeof === REACT_LAZY_TYPE);
|
2817
|
+
getSuspendedThenable() : thrownValue;
|
2790
2818
|
|
2791
2819
|
if (typeof x === 'object' && x !== null) {
|
2792
2820
|
// $FlowFixMe[method-unbinding]
|
2793
2821
|
if (typeof x.then === 'function') {
|
2794
|
-
|
2822
|
+
if (request.status === ABORTING) {
|
2823
|
+
task.status = ABORTED;
|
2824
|
+
var errorId = request.fatalError;
|
2825
|
+
|
2826
|
+
if (wasReactNode) {
|
2827
|
+
return serializeLazyID(errorId);
|
2828
|
+
}
|
2829
|
+
|
2830
|
+
return serializeByValueID(errorId);
|
2831
|
+
} // Something suspended, we'll need to create a new task and resolve it later.
|
2832
|
+
|
2833
|
+
|
2795
2834
|
var newTask = createTask(request, task.model, task.keyPath, task.implicitSlot, request.abortableTasks);
|
2796
2835
|
var ping = newTask.ping;
|
2797
2836
|
x.then(ping, ping);
|
@@ -2807,6 +2846,17 @@ function renderModel(request, task, parent, key, value) {
|
|
2807
2846
|
|
2808
2847
|
return serializeByValueID(newTask.id);
|
2809
2848
|
}
|
2849
|
+
}
|
2850
|
+
|
2851
|
+
if (thrownValue === AbortSigil) {
|
2852
|
+
task.status = ABORTED;
|
2853
|
+
var _errorId = request.fatalError;
|
2854
|
+
|
2855
|
+
if (wasReactNode) {
|
2856
|
+
return serializeLazyID(_errorId);
|
2857
|
+
}
|
2858
|
+
|
2859
|
+
return serializeByValueID(_errorId);
|
2810
2860
|
} // Restore the context. We assume that this will be restored by the inner
|
2811
2861
|
// functions in case nothing throws so we don't use "finally" here.
|
2812
2862
|
|
@@ -2819,10 +2869,12 @@ function renderModel(request, task, parent, key, value) {
|
|
2819
2869
|
// We'll replace this element with a lazy reference that throws on the client
|
2820
2870
|
// once it gets rendered.
|
2821
2871
|
request.pendingChunks++;
|
2822
|
-
|
2872
|
+
|
2873
|
+
var _errorId2 = request.nextChunkId++;
|
2874
|
+
|
2823
2875
|
var digest = logRecoverableError(request, x);
|
2824
|
-
emitErrorChunk(request,
|
2825
|
-
return serializeLazyID(
|
2876
|
+
emitErrorChunk(request, _errorId2, digest, x);
|
2877
|
+
return serializeLazyID(_errorId2);
|
2826
2878
|
} // Something errored but it was not in a React Node. There's no need to serialize
|
2827
2879
|
// it by value because it'll just error the whole parent row anyway so we can
|
2828
2880
|
// just stop any siblings and error the whole parent row.
|
@@ -2926,6 +2978,13 @@ function renderModelDestructive(request, task, parent, parentPropertyName, value
|
|
2926
2978
|
resolvedModel = callLazyInitInDEV(lazy);
|
2927
2979
|
}
|
2928
2980
|
|
2981
|
+
if (request.status === ABORTING) {
|
2982
|
+
// lazy initializers are user code and could abort during render
|
2983
|
+
// we don't wan to return any value resolved from the lazy initializer
|
2984
|
+
// if it aborts so we interrupt rendering here
|
2985
|
+
throw AbortSigil;
|
2986
|
+
}
|
2987
|
+
|
2929
2988
|
{
|
2930
2989
|
var _debugInfo = lazy._debugInfo;
|
2931
2990
|
|
@@ -3836,6 +3895,7 @@ function retryTask(request, task) {
|
|
3836
3895
|
}
|
3837
3896
|
|
3838
3897
|
var prevDebugID = debugID;
|
3898
|
+
task.status = RENDERING;
|
3839
3899
|
|
3840
3900
|
try {
|
3841
3901
|
// Track the root so we know that we have to emit this object even though it
|
@@ -3892,14 +3952,35 @@ function retryTask(request, task) {
|
|
3892
3952
|
if (typeof x === 'object' && x !== null) {
|
3893
3953
|
// $FlowFixMe[method-unbinding]
|
3894
3954
|
if (typeof x.then === 'function') {
|
3895
|
-
|
3955
|
+
if (request.status === ABORTING) {
|
3956
|
+
request.abortableTasks.delete(task);
|
3957
|
+
task.status = ABORTED;
|
3958
|
+
var errorId = request.fatalError;
|
3959
|
+
var model = stringify(serializeByValueID(errorId));
|
3960
|
+
emitModelChunk(request, task.id, model);
|
3961
|
+
return;
|
3962
|
+
} // Something suspended again, let's pick it back up later.
|
3963
|
+
|
3964
|
+
|
3965
|
+
task.status = PENDING$1;
|
3966
|
+
task.thenableState = getThenableStateAfterSuspending();
|
3896
3967
|
var ping = task.ping;
|
3897
3968
|
x.then(ping, ping);
|
3898
|
-
task.thenableState = getThenableStateAfterSuspending();
|
3899
3969
|
return;
|
3900
3970
|
}
|
3901
3971
|
}
|
3902
3972
|
|
3973
|
+
if (x === AbortSigil) {
|
3974
|
+
request.abortableTasks.delete(task);
|
3975
|
+
task.status = ABORTED;
|
3976
|
+
var _errorId3 = request.fatalError;
|
3977
|
+
|
3978
|
+
var _model = stringify(serializeByValueID(_errorId3));
|
3979
|
+
|
3980
|
+
emitModelChunk(request, task.id, _model);
|
3981
|
+
return;
|
3982
|
+
}
|
3983
|
+
|
3903
3984
|
request.abortableTasks.delete(task);
|
3904
3985
|
task.status = ERRORED$1;
|
3905
3986
|
var digest = logRecoverableError(request, x);
|
@@ -3961,6 +4042,11 @@ function performWork(request) {
|
|
3961
4042
|
}
|
3962
4043
|
|
3963
4044
|
function abortTask(task, request, errorId) {
|
4045
|
+
if (task.status === RENDERING) {
|
4046
|
+
// This task will be aborted by the render
|
4047
|
+
return;
|
4048
|
+
}
|
4049
|
+
|
3964
4050
|
task.status = ABORTED; // Instead of emitting an error per task.id, we emit a model that only
|
3965
4051
|
// has a single value referencing the error.
|
3966
4052
|
|
@@ -4055,6 +4141,7 @@ function flushCompletedChunks(request, destination) {
|
|
4055
4141
|
|
4056
4142
|
if (request.pendingChunks === 0) {
|
4057
4143
|
|
4144
|
+
request.status = CLOSED;
|
4058
4145
|
close$1(destination);
|
4059
4146
|
request.destination = null;
|
4060
4147
|
}
|
@@ -4075,10 +4162,14 @@ function enqueueFlush(request) {
|
|
4075
4162
|
request.pingedTasks.length === 0 && // If there is no destination there is nothing we can flush to. A flush will
|
4076
4163
|
// happen when we start flowing again
|
4077
4164
|
request.destination !== null) {
|
4078
|
-
var destination = request.destination;
|
4079
4165
|
request.flushScheduled = true;
|
4080
4166
|
scheduleWork(function () {
|
4081
|
-
|
4167
|
+
request.flushScheduled = false;
|
4168
|
+
var destination = request.destination;
|
4169
|
+
|
4170
|
+
if (destination) {
|
4171
|
+
flushCompletedChunks(request, destination);
|
4172
|
+
}
|
4082
4173
|
});
|
4083
4174
|
}
|
4084
4175
|
}
|
@@ -4114,15 +4205,17 @@ function stopFlowing(request) {
|
|
4114
4205
|
|
4115
4206
|
function abort(request, reason) {
|
4116
4207
|
try {
|
4208
|
+
request.status = ABORTING;
|
4117
4209
|
var abortableTasks = request.abortableTasks; // We have tasks to abort. We'll emit one error row and then emit a reference
|
4118
4210
|
// to that row from every row that's still remaining.
|
4119
4211
|
|
4120
4212
|
if (abortableTasks.size > 0) {
|
4121
4213
|
request.pendingChunks++;
|
4122
4214
|
var errorId = request.nextChunkId++;
|
4215
|
+
request.fatalError = errorId;
|
4123
4216
|
|
4124
4217
|
var postponeInstance; if (enablePostpone && typeof reason === 'object' && reason !== null && reason.$$typeof === REACT_POSTPONE_TYPE) ; else {
|
4125
|
-
var error = reason === undefined ? new Error('The render was aborted by the server without a reason.') : reason;
|
4218
|
+
var error = reason === undefined ? new Error('The render was aborted by the server without a reason.') : typeof reason === 'object' && reason !== null && typeof reason.then === 'function' ? new Error('The render was aborted by the server with a promise.') : reason;
|
4126
4219
|
var digest = logRecoverableError(request, error);
|
4127
4220
|
emitErrorChunk(request, errorId, digest, error);
|
4128
4221
|
}
|
@@ -4139,7 +4232,7 @@ function abort(request, reason) {
|
|
4139
4232
|
var _error;
|
4140
4233
|
|
4141
4234
|
if (enablePostpone && typeof reason === 'object' && reason !== null && reason.$$typeof === REACT_POSTPONE_TYPE) ; else {
|
4142
|
-
_error = reason === undefined ? new Error('The render was aborted by the server without a reason.') : reason;
|
4235
|
+
_error = reason === undefined ? new Error('The render was aborted by the server without a reason.') : typeof reason === 'object' && reason !== null && typeof reason.then === 'function' ? new Error('The render was aborted by the server with a promise.') : reason;
|
4143
4236
|
}
|
4144
4237
|
|
4145
4238
|
abortListeners.forEach(function (callback) {
|
@@ -14,6 +14,7 @@ require("crypto");
|
|
14
14
|
var async_hooks = require("async_hooks"),
|
15
15
|
ReactDOM = require("react-dom"),
|
16
16
|
React = require("react"),
|
17
|
+
scheduleMicrotask = queueMicrotask,
|
17
18
|
currentView = null,
|
18
19
|
writtenBytes = 0,
|
19
20
|
destinationHasCapacity = !0;
|
@@ -707,7 +708,8 @@ if (!ReactSharedInternalsServer)
|
|
707
708
|
'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.'
|
708
709
|
);
|
709
710
|
var ObjectPrototype = Object.prototype,
|
710
|
-
stringify = JSON.stringify
|
711
|
+
stringify = JSON.stringify,
|
712
|
+
AbortSigil = {};
|
711
713
|
function defaultErrorHandler(error) {
|
712
714
|
console.error(error);
|
713
715
|
}
|
@@ -788,6 +790,14 @@ function serializeThenable(request, task, thenable) {
|
|
788
790
|
newTask.id
|
789
791
|
);
|
790
792
|
default:
|
793
|
+
if (1 === request.status)
|
794
|
+
return (
|
795
|
+
(newTask.status = 3),
|
796
|
+
(task = stringify(serializeByValueID(request.fatalError))),
|
797
|
+
emitModelChunk(request, newTask.id, task),
|
798
|
+
request.abortableTasks.delete(newTask),
|
799
|
+
newTask.id
|
800
|
+
);
|
791
801
|
"string" !== typeof thenable.status &&
|
792
802
|
((thenable.status = "pending"),
|
793
803
|
thenable.then(
|
@@ -973,6 +983,7 @@ function renderFunctionComponent(request, task, key, Component, props) {
|
|
973
983
|
thenableIndexCounter = 0;
|
974
984
|
thenableState = prevThenableState;
|
975
985
|
Component = Component(props, void 0);
|
986
|
+
if (1 === request.status) throw AbortSigil;
|
976
987
|
if (
|
977
988
|
"object" === typeof Component &&
|
978
989
|
null !== Component &&
|
@@ -1070,6 +1081,7 @@ function renderElement(request, task, type, key, ref, props) {
|
|
1070
1081
|
case REACT_LAZY_TYPE:
|
1071
1082
|
var init = type._init;
|
1072
1083
|
type = init(type._payload);
|
1084
|
+
if (1 === request.status) throw AbortSigil;
|
1073
1085
|
return renderElement(request, task, type, key, ref, props);
|
1074
1086
|
case REACT_FORWARD_REF_TYPE:
|
1075
1087
|
return renderFunctionComponent(request, task, key, type.render, props);
|
@@ -1086,7 +1098,7 @@ function pingTask(request, task) {
|
|
1086
1098
|
pingedTasks.push(task);
|
1087
1099
|
1 === pingedTasks.length &&
|
1088
1100
|
((request.flushScheduled = null !== request.destination),
|
1089
|
-
|
1101
|
+
scheduleMicrotask(function () {
|
1090
1102
|
return performWork(request);
|
1091
1103
|
}));
|
1092
1104
|
}
|
@@ -1120,50 +1132,61 @@ function createTask(request, model, keyPath, implicitSlot, abortSet) {
|
|
1120
1132
|
);
|
1121
1133
|
} catch (thrownValue) {
|
1122
1134
|
if (
|
1123
|
-
((parentPropertyName =
|
1135
|
+
((parentPropertyName = task.model),
|
1136
|
+
(parentPropertyName =
|
1137
|
+
"object" === typeof parentPropertyName &&
|
1138
|
+
null !== parentPropertyName &&
|
1139
|
+
(parentPropertyName.$$typeof === REACT_ELEMENT_TYPE ||
|
1140
|
+
parentPropertyName.$$typeof === REACT_LAZY_TYPE)),
|
1141
|
+
(value =
|
1124
1142
|
thrownValue === SuspenseException
|
1125
1143
|
? getSuspendedThenable()
|
1126
1144
|
: thrownValue),
|
1127
|
-
|
1128
|
-
(value =
|
1129
|
-
"object" === typeof value &&
|
1145
|
+
"object" === typeof value &&
|
1130
1146
|
null !== value &&
|
1131
|
-
|
1132
|
-
|
1133
|
-
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1139
|
-
|
1140
|
-
|
1141
|
-
|
1142
|
-
|
1143
|
-
|
1144
|
-
|
1145
|
-
|
1146
|
-
|
1147
|
-
|
1148
|
-
|
1149
|
-
|
1150
|
-
|
1151
|
-
|
1152
|
-
|
1153
|
-
|
1147
|
+
"function" === typeof value.then)
|
1148
|
+
)
|
1149
|
+
if (1 === request.status)
|
1150
|
+
(task.status = 3),
|
1151
|
+
(prevKeyPath = request.fatalError),
|
1152
|
+
(JSCompiler_inline_result = parentPropertyName
|
1153
|
+
? "$L" + prevKeyPath.toString(16)
|
1154
|
+
: serializeByValueID(prevKeyPath));
|
1155
|
+
else {
|
1156
|
+
JSCompiler_inline_result = createTask(
|
1157
|
+
request,
|
1158
|
+
task.model,
|
1159
|
+
task.keyPath,
|
1160
|
+
task.implicitSlot,
|
1161
|
+
request.abortableTasks
|
1162
|
+
);
|
1163
|
+
var ping = JSCompiler_inline_result.ping;
|
1164
|
+
value.then(ping, ping);
|
1165
|
+
JSCompiler_inline_result.thenableState =
|
1166
|
+
getThenableStateAfterSuspending();
|
1167
|
+
task.keyPath = prevKeyPath;
|
1168
|
+
task.implicitSlot = prevImplicitSlot;
|
1169
|
+
JSCompiler_inline_result = parentPropertyName
|
1170
|
+
? "$L" + JSCompiler_inline_result.id.toString(16)
|
1171
|
+
: serializeByValueID(JSCompiler_inline_result.id);
|
1172
|
+
}
|
1173
|
+
else if (thrownValue === AbortSigil)
|
1174
|
+
(task.status = 3),
|
1175
|
+
(prevKeyPath = request.fatalError),
|
1176
|
+
(JSCompiler_inline_result = parentPropertyName
|
1177
|
+
? "$L" + prevKeyPath.toString(16)
|
1178
|
+
: serializeByValueID(prevKeyPath));
|
1179
|
+
else if (
|
1154
1180
|
((task.keyPath = prevKeyPath),
|
1155
1181
|
(task.implicitSlot = prevImplicitSlot),
|
1156
|
-
|
1182
|
+
parentPropertyName)
|
1157
1183
|
)
|
1158
1184
|
request.pendingChunks++,
|
1159
1185
|
(prevKeyPath = request.nextChunkId++),
|
1160
|
-
(prevImplicitSlot = logRecoverableError(
|
1161
|
-
request,
|
1162
|
-
parentPropertyName
|
1163
|
-
)),
|
1186
|
+
(prevImplicitSlot = logRecoverableError(request, value)),
|
1164
1187
|
emitErrorChunk(request, prevKeyPath, prevImplicitSlot),
|
1165
1188
|
(JSCompiler_inline_result = "$L" + prevKeyPath.toString(16));
|
1166
|
-
else throw
|
1189
|
+
else throw value;
|
1167
1190
|
}
|
1168
1191
|
return JSCompiler_inline_result;
|
1169
1192
|
},
|
@@ -1314,12 +1337,11 @@ function renderModelDestructive(
|
|
1314
1337
|
parentPropertyName
|
1315
1338
|
);
|
1316
1339
|
case REACT_LAZY_TYPE:
|
1317
|
-
|
1318
|
-
|
1319
|
-
|
1320
|
-
|
1321
|
-
|
1322
|
-
);
|
1340
|
+
task.thenableState = null;
|
1341
|
+
parentPropertyName = value._init;
|
1342
|
+
value = parentPropertyName(value._payload);
|
1343
|
+
if (1 === request.status) throw AbortSigil;
|
1344
|
+
return renderModelDestructive(request, task, emptyRoot, "", value);
|
1323
1345
|
case REACT_LEGACY_ELEMENT_TYPE:
|
1324
1346
|
throw Error(
|
1325
1347
|
'A React Element from an older version of React was rendered. This is not supported. It can happen if:\n- Multiple copies of the "react" package is used.\n- A library pre-bundled an old copy of "react" or "react/jsx-runtime".\n- A compiler tries to "inline" JSX instead of using the runtime.'
|
@@ -1579,14 +1601,18 @@ function logRecoverableError(request, error) {
|
|
1579
1601
|
}
|
1580
1602
|
function fatalError(request, error) {
|
1581
1603
|
null !== request.destination
|
1582
|
-
? ((request.status =
|
1583
|
-
: ((request.status =
|
1604
|
+
? ((request.status = 3), request.destination.destroy(error))
|
1605
|
+
: ((request.status = 2), (request.fatalError = error));
|
1584
1606
|
}
|
1585
1607
|
function emitErrorChunk(request, id, digest) {
|
1586
1608
|
digest = { digest: digest };
|
1587
1609
|
id = id.toString(16) + ":E" + stringify(digest) + "\n";
|
1588
1610
|
request.completedErrorChunks.push(id);
|
1589
1611
|
}
|
1612
|
+
function emitModelChunk(request, id, json) {
|
1613
|
+
id = id.toString(16) + ":" + json + "\n";
|
1614
|
+
request.completedRegularChunks.push(id);
|
1615
|
+
}
|
1590
1616
|
function emitTypedArrayChunk(request, id, tag, typedArray) {
|
1591
1617
|
request.pendingChunks++;
|
1592
1618
|
typedArray = new Uint8Array(
|
@@ -1638,12 +1664,12 @@ function emitChunk(request, task, value) {
|
|
1638
1664
|
: value instanceof DataView
|
1639
1665
|
? emitTypedArrayChunk(request, id, "V", value)
|
1640
1666
|
: ((value = stringify(value, task.toJSON)),
|
1641
|
-
(
|
1642
|
-
request.completedRegularChunks.push(task));
|
1667
|
+
emitModelChunk(request, task.id, value));
|
1643
1668
|
}
|
1644
1669
|
var emptyRoot = {};
|
1645
1670
|
function retryTask(request, task) {
|
1646
|
-
if (0 === task.status)
|
1671
|
+
if (0 === task.status) {
|
1672
|
+
task.status = 5;
|
1647
1673
|
try {
|
1648
1674
|
modelRoot = task.model;
|
1649
1675
|
var resolvedModel = renderModelDestructive(
|
@@ -1660,9 +1686,8 @@ function retryTask(request, task) {
|
|
1660
1686
|
request.writtenObjects.set(resolvedModel, serializeByValueID(task.id)),
|
1661
1687
|
emitChunk(request, task, resolvedModel);
|
1662
1688
|
else {
|
1663
|
-
var json = stringify(resolvedModel)
|
1664
|
-
|
1665
|
-
request.completedRegularChunks.push(processedChunk);
|
1689
|
+
var json = stringify(resolvedModel);
|
1690
|
+
emitModelChunk(request, task.id, json);
|
1666
1691
|
}
|
1667
1692
|
request.abortableTasks.delete(task);
|
1668
1693
|
task.status = 1;
|
@@ -1671,10 +1696,23 @@ function retryTask(request, task) {
|
|
1671
1696
|
thrownValue === SuspenseException
|
1672
1697
|
? getSuspendedThenable()
|
1673
1698
|
: thrownValue;
|
1674
|
-
if ("object" === typeof x && null !== x && "function" === typeof x.then)
|
1675
|
-
|
1676
|
-
|
1677
|
-
|
1699
|
+
if ("object" === typeof x && null !== x && "function" === typeof x.then)
|
1700
|
+
if (1 === request.status) {
|
1701
|
+
request.abortableTasks.delete(task);
|
1702
|
+
task.status = 3;
|
1703
|
+
var model = stringify(serializeByValueID(request.fatalError));
|
1704
|
+
emitModelChunk(request, task.id, model);
|
1705
|
+
} else {
|
1706
|
+
task.status = 0;
|
1707
|
+
task.thenableState = getThenableStateAfterSuspending();
|
1708
|
+
var ping = task.ping;
|
1709
|
+
x.then(ping, ping);
|
1710
|
+
}
|
1711
|
+
else if (x === AbortSigil) {
|
1712
|
+
request.abortableTasks.delete(task);
|
1713
|
+
task.status = 3;
|
1714
|
+
var model$19 = stringify(serializeByValueID(request.fatalError));
|
1715
|
+
emitModelChunk(request, task.id, model$19);
|
1678
1716
|
} else {
|
1679
1717
|
request.abortableTasks.delete(task);
|
1680
1718
|
task.status = 4;
|
@@ -1683,6 +1721,7 @@ function retryTask(request, task) {
|
|
1683
1721
|
}
|
1684
1722
|
} finally {
|
1685
1723
|
}
|
1724
|
+
}
|
1686
1725
|
}
|
1687
1726
|
function performWork(request) {
|
1688
1727
|
var prevDispatcher = ReactSharedInternalsServer.H;
|
@@ -1764,7 +1803,7 @@ function flushCompletedChunks(request, destination) {
|
|
1764
1803
|
}
|
1765
1804
|
"function" === typeof destination.flush && destination.flush();
|
1766
1805
|
0 === request.pendingChunks &&
|
1767
|
-
(destination.end(), (request.destination = null));
|
1806
|
+
((request.status = 3), destination.end(), (request.destination = null));
|
1768
1807
|
}
|
1769
1808
|
function startWork(request) {
|
1770
1809
|
request.flushScheduled = null !== request.destination;
|
@@ -1773,22 +1812,20 @@ function startWork(request) {
|
|
1773
1812
|
});
|
1774
1813
|
}
|
1775
1814
|
function enqueueFlush(request) {
|
1776
|
-
|
1777
|
-
!1 === request.flushScheduled &&
|
1815
|
+
!1 === request.flushScheduled &&
|
1778
1816
|
0 === request.pingedTasks.length &&
|
1779
|
-
null !== request.destination
|
1780
|
-
|
1781
|
-
var destination = request.destination;
|
1782
|
-
request.flushScheduled = !0;
|
1817
|
+
null !== request.destination &&
|
1818
|
+
((request.flushScheduled = !0),
|
1783
1819
|
setImmediate(function () {
|
1784
|
-
|
1785
|
-
|
1786
|
-
|
1820
|
+
request.flushScheduled = !1;
|
1821
|
+
var destination = request.destination;
|
1822
|
+
destination && flushCompletedChunks(request, destination);
|
1823
|
+
}));
|
1787
1824
|
}
|
1788
1825
|
function startFlowing(request, destination) {
|
1789
|
-
if (
|
1790
|
-
(request.status =
|
1791
|
-
else if (
|
1826
|
+
if (2 === request.status)
|
1827
|
+
(request.status = 3), destination.destroy(request.fatalError);
|
1828
|
+
else if (3 !== request.status && null === request.destination) {
|
1792
1829
|
request.destination = destination;
|
1793
1830
|
try {
|
1794
1831
|
flushCompletedChunks(request, destination);
|
@@ -1799,39 +1836,51 @@ function startFlowing(request, destination) {
|
|
1799
1836
|
}
|
1800
1837
|
function abort(request, reason) {
|
1801
1838
|
try {
|
1839
|
+
request.status = 1;
|
1802
1840
|
var abortableTasks = request.abortableTasks;
|
1803
1841
|
if (0 < abortableTasks.size) {
|
1804
1842
|
request.pendingChunks++;
|
1805
|
-
var errorId = request.nextChunkId
|
1806
|
-
|
1843
|
+
var errorId = request.nextChunkId++;
|
1844
|
+
request.fatalError = errorId;
|
1845
|
+
var error =
|
1807
1846
|
void 0 === reason
|
1808
1847
|
? Error("The render was aborted by the server without a reason.")
|
1848
|
+
: "object" === typeof reason &&
|
1849
|
+
null !== reason &&
|
1850
|
+
"function" === typeof reason.then
|
1851
|
+
? Error("The render was aborted by the server with a promise.")
|
1809
1852
|
: reason,
|
1810
1853
|
digest = logRecoverableError(request, error);
|
1811
1854
|
emitErrorChunk(request, errorId, digest, error);
|
1812
1855
|
abortableTasks.forEach(function (task) {
|
1813
|
-
task.status
|
1814
|
-
|
1815
|
-
|
1816
|
-
|
1856
|
+
if (5 !== task.status) {
|
1857
|
+
task.status = 3;
|
1858
|
+
var ref = serializeByValueID(errorId);
|
1859
|
+
task = encodeReferenceChunk(request, task.id, ref);
|
1860
|
+
request.completedErrorChunks.push(task);
|
1861
|
+
}
|
1817
1862
|
});
|
1818
1863
|
abortableTasks.clear();
|
1819
1864
|
}
|
1820
1865
|
var abortListeners = request.abortListeners;
|
1821
1866
|
if (0 < abortListeners.size) {
|
1822
|
-
var error$
|
1867
|
+
var error$26 =
|
1823
1868
|
void 0 === reason
|
1824
1869
|
? Error("The render was aborted by the server without a reason.")
|
1870
|
+
: "object" === typeof reason &&
|
1871
|
+
null !== reason &&
|
1872
|
+
"function" === typeof reason.then
|
1873
|
+
? Error("The render was aborted by the server with a promise.")
|
1825
1874
|
: reason;
|
1826
1875
|
abortListeners.forEach(function (callback) {
|
1827
|
-
return callback(error$
|
1876
|
+
return callback(error$26);
|
1828
1877
|
});
|
1829
1878
|
abortListeners.clear();
|
1830
1879
|
}
|
1831
1880
|
null !== request.destination &&
|
1832
1881
|
flushCompletedChunks(request, request.destination);
|
1833
|
-
} catch (error$
|
1834
|
-
logRecoverableError(request, error$
|
1882
|
+
} catch (error$27) {
|
1883
|
+
logRecoverableError(request, error$27), fatalError(request, error$27);
|
1835
1884
|
}
|
1836
1885
|
}
|
1837
1886
|
function resolveServerReference(bundlerConfig, id) {
|
@@ -2274,8 +2323,8 @@ function parseReadableStream(response, reference, type) {
|
|
2274
2323
|
(previousBlockedChunk = chunk));
|
2275
2324
|
} else {
|
2276
2325
|
chunk = previousBlockedChunk;
|
2277
|
-
var chunk$
|
2278
|
-
chunk$
|
2326
|
+
var chunk$30 = createPendingChunk(response);
|
2327
|
+
chunk$30.then(
|
2279
2328
|
function (v) {
|
2280
2329
|
return controller.enqueue(v);
|
2281
2330
|
},
|
@@ -2283,10 +2332,10 @@ function parseReadableStream(response, reference, type) {
|
|
2283
2332
|
return controller.error(e);
|
2284
2333
|
}
|
2285
2334
|
);
|
2286
|
-
previousBlockedChunk = chunk$
|
2335
|
+
previousBlockedChunk = chunk$30;
|
2287
2336
|
chunk.then(function () {
|
2288
|
-
previousBlockedChunk === chunk$
|
2289
|
-
resolveModelChunk(chunk$
|
2337
|
+
previousBlockedChunk === chunk$30 && (previousBlockedChunk = null);
|
2338
|
+
resolveModelChunk(chunk$30, json, -1);
|
2290
2339
|
});
|
2291
2340
|
}
|
2292
2341
|
},
|
@@ -2644,12 +2693,12 @@ exports.decodeReplyFromBusboy = function (busboyStream, webpackMap, options) {
|
|
2644
2693
|
"React doesn't accept base64 encoded file uploads because we don't expect form data passed from a browser to ever encode data that way. If that's the wrong assumption, we can easily fix it."
|
2645
2694
|
);
|
2646
2695
|
pendingFiles++;
|
2647
|
-
var
|
2696
|
+
var JSCompiler_object_inline_chunks_201 = [];
|
2648
2697
|
value.on("data", function (chunk) {
|
2649
|
-
|
2698
|
+
JSCompiler_object_inline_chunks_201.push(chunk);
|
2650
2699
|
});
|
2651
2700
|
value.on("end", function () {
|
2652
|
-
var blob = new Blob(
|
2701
|
+
var blob = new Blob(JSCompiler_object_inline_chunks_201, {
|
2653
2702
|
type: mimeType
|
2654
2703
|
});
|
2655
2704
|
response._formData.append(name, blob, filename);
|