react-dom 19.3.0-canary-408b38ef-20251023 → 19.3.0-canary-b4455a6e-20251027
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-dom-client.development.js +5 -5
- package/cjs/react-dom-client.production.js +5 -5
- package/cjs/react-dom-profiling.development.js +5 -5
- package/cjs/react-dom-profiling.profiling.js +5 -5
- package/cjs/react-dom-server-legacy.browser.development.js +1 -1
- package/cjs/react-dom-server-legacy.browser.production.js +1 -1
- package/cjs/react-dom-server-legacy.node.development.js +1 -1
- package/cjs/react-dom-server-legacy.node.production.js +1 -1
- package/cjs/react-dom-server.browser.development.js +3 -3
- package/cjs/react-dom-server.browser.production.js +3 -3
- package/cjs/react-dom-server.bun.development.js +713 -38
- package/cjs/react-dom-server.bun.production.js +739 -72
- package/cjs/react-dom-server.edge.development.js +3 -3
- package/cjs/react-dom-server.edge.production.js +3 -3
- package/cjs/react-dom-server.node.development.js +3 -3
- package/cjs/react-dom-server.node.production.js +3 -3
- package/cjs/react-dom.development.js +1 -1
- package/cjs/react-dom.production.js +1 -1
- package/cjs/react-dom.react-server.development.js +1 -1
- package/cjs/react-dom.react-server.production.js +1 -1
- package/package.json +3 -3
- package/server.bun.js +2 -0
|
@@ -11,6 +11,9 @@
|
|
|
11
11
|
"use strict";
|
|
12
12
|
var React = require("react"),
|
|
13
13
|
ReactDOM = require("react-dom"),
|
|
14
|
+
util = require("util");
|
|
15
|
+
require("crypto");
|
|
16
|
+
var stream = require("stream"),
|
|
14
17
|
REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
|
|
15
18
|
REACT_PORTAL_TYPE = Symbol.for("react.portal"),
|
|
16
19
|
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
|
|
@@ -212,7 +215,9 @@ function byteLengthOfChunk(chunk) {
|
|
|
212
215
|
function closeWithError(destination, error) {
|
|
213
216
|
"function" === typeof destination.error
|
|
214
217
|
? destination.error(error)
|
|
215
|
-
: destination.
|
|
218
|
+
: "function" === typeof destination.destroy
|
|
219
|
+
? destination.destroy(error)
|
|
220
|
+
: "function" === typeof destination.close && destination.close();
|
|
216
221
|
}
|
|
217
222
|
var assign = Object.assign;
|
|
218
223
|
function typeName(value) {
|
|
@@ -5740,6 +5745,12 @@ if ("object" === typeof performance && "function" === typeof performance.now) {
|
|
|
5740
5745
|
return localDate.now();
|
|
5741
5746
|
};
|
|
5742
5747
|
}
|
|
5748
|
+
function resetOwnerStackLimit() {
|
|
5749
|
+
var now = getCurrentTime();
|
|
5750
|
+
1e3 < now - lastResetTime &&
|
|
5751
|
+
((ReactSharedInternals.recentlyCreatedOwnerStacks = 0),
|
|
5752
|
+
(lastResetTime = now));
|
|
5753
|
+
}
|
|
5743
5754
|
var CLIENT_RENDERED = 4,
|
|
5744
5755
|
PENDING = 0,
|
|
5745
5756
|
COMPLETED = 1,
|
|
@@ -5840,10 +5851,7 @@ function createRequest(
|
|
|
5840
5851
|
onPostpone,
|
|
5841
5852
|
formState
|
|
5842
5853
|
) {
|
|
5843
|
-
|
|
5844
|
-
1e3 < now - lastResetTime &&
|
|
5845
|
-
((ReactSharedInternals.recentlyCreatedOwnerStacks = 0),
|
|
5846
|
-
(lastResetTime = now));
|
|
5854
|
+
resetOwnerStackLimit();
|
|
5847
5855
|
resumableState = new RequestInstance(
|
|
5848
5856
|
resumableState,
|
|
5849
5857
|
renderState,
|
|
@@ -5889,6 +5897,155 @@ function createRequest(
|
|
|
5889
5897
|
resumableState.pingedTasks.push(children);
|
|
5890
5898
|
return resumableState;
|
|
5891
5899
|
}
|
|
5900
|
+
function createPrerenderRequest(
|
|
5901
|
+
children,
|
|
5902
|
+
resumableState,
|
|
5903
|
+
renderState,
|
|
5904
|
+
rootFormatContext,
|
|
5905
|
+
progressiveChunkSize,
|
|
5906
|
+
onError,
|
|
5907
|
+
onAllReady,
|
|
5908
|
+
onShellReady,
|
|
5909
|
+
onShellError,
|
|
5910
|
+
onFatalError,
|
|
5911
|
+
onPostpone
|
|
5912
|
+
) {
|
|
5913
|
+
children = createRequest(
|
|
5914
|
+
children,
|
|
5915
|
+
resumableState,
|
|
5916
|
+
renderState,
|
|
5917
|
+
rootFormatContext,
|
|
5918
|
+
progressiveChunkSize,
|
|
5919
|
+
onError,
|
|
5920
|
+
onAllReady,
|
|
5921
|
+
onShellReady,
|
|
5922
|
+
onShellError,
|
|
5923
|
+
onFatalError,
|
|
5924
|
+
onPostpone,
|
|
5925
|
+
void 0
|
|
5926
|
+
);
|
|
5927
|
+
children.trackedPostpones = {
|
|
5928
|
+
workingMap: new Map(),
|
|
5929
|
+
rootNodes: [],
|
|
5930
|
+
rootSlots: null
|
|
5931
|
+
};
|
|
5932
|
+
return children;
|
|
5933
|
+
}
|
|
5934
|
+
function resumeRequest(
|
|
5935
|
+
children,
|
|
5936
|
+
postponedState,
|
|
5937
|
+
renderState,
|
|
5938
|
+
onError,
|
|
5939
|
+
onAllReady,
|
|
5940
|
+
onShellReady,
|
|
5941
|
+
onShellError,
|
|
5942
|
+
onFatalError,
|
|
5943
|
+
onPostpone
|
|
5944
|
+
) {
|
|
5945
|
+
resetOwnerStackLimit();
|
|
5946
|
+
renderState = new RequestInstance(
|
|
5947
|
+
postponedState.resumableState,
|
|
5948
|
+
renderState,
|
|
5949
|
+
postponedState.rootFormatContext,
|
|
5950
|
+
postponedState.progressiveChunkSize,
|
|
5951
|
+
onError,
|
|
5952
|
+
onAllReady,
|
|
5953
|
+
onShellReady,
|
|
5954
|
+
onShellError,
|
|
5955
|
+
onFatalError,
|
|
5956
|
+
onPostpone,
|
|
5957
|
+
null
|
|
5958
|
+
);
|
|
5959
|
+
renderState.nextSegmentId = postponedState.nextSegmentId;
|
|
5960
|
+
if ("number" === typeof postponedState.replaySlots)
|
|
5961
|
+
return (
|
|
5962
|
+
(onError = createPendingSegment(
|
|
5963
|
+
renderState,
|
|
5964
|
+
0,
|
|
5965
|
+
null,
|
|
5966
|
+
postponedState.rootFormatContext,
|
|
5967
|
+
!1,
|
|
5968
|
+
!1
|
|
5969
|
+
)),
|
|
5970
|
+
(onError.parentFlushed = !0),
|
|
5971
|
+
(children = createRenderTask(
|
|
5972
|
+
renderState,
|
|
5973
|
+
null,
|
|
5974
|
+
children,
|
|
5975
|
+
-1,
|
|
5976
|
+
null,
|
|
5977
|
+
onError,
|
|
5978
|
+
null,
|
|
5979
|
+
null,
|
|
5980
|
+
renderState.abortableTasks,
|
|
5981
|
+
null,
|
|
5982
|
+
postponedState.rootFormatContext,
|
|
5983
|
+
null,
|
|
5984
|
+
emptyTreeContext,
|
|
5985
|
+
null,
|
|
5986
|
+
null,
|
|
5987
|
+
emptyContextObject,
|
|
5988
|
+
null
|
|
5989
|
+
)),
|
|
5990
|
+
pushComponentStack(children),
|
|
5991
|
+
renderState.pingedTasks.push(children),
|
|
5992
|
+
renderState
|
|
5993
|
+
);
|
|
5994
|
+
children = createReplayTask(
|
|
5995
|
+
renderState,
|
|
5996
|
+
null,
|
|
5997
|
+
{
|
|
5998
|
+
nodes: postponedState.replayNodes,
|
|
5999
|
+
slots: postponedState.replaySlots,
|
|
6000
|
+
pendingTasks: 0
|
|
6001
|
+
},
|
|
6002
|
+
children,
|
|
6003
|
+
-1,
|
|
6004
|
+
null,
|
|
6005
|
+
null,
|
|
6006
|
+
renderState.abortableTasks,
|
|
6007
|
+
null,
|
|
6008
|
+
postponedState.rootFormatContext,
|
|
6009
|
+
null,
|
|
6010
|
+
emptyTreeContext,
|
|
6011
|
+
null,
|
|
6012
|
+
null,
|
|
6013
|
+
emptyContextObject,
|
|
6014
|
+
null
|
|
6015
|
+
);
|
|
6016
|
+
pushComponentStack(children);
|
|
6017
|
+
renderState.pingedTasks.push(children);
|
|
6018
|
+
return renderState;
|
|
6019
|
+
}
|
|
6020
|
+
function resumeAndPrerenderRequest(
|
|
6021
|
+
children,
|
|
6022
|
+
postponedState,
|
|
6023
|
+
renderState,
|
|
6024
|
+
onError,
|
|
6025
|
+
onAllReady,
|
|
6026
|
+
onShellReady,
|
|
6027
|
+
onShellError,
|
|
6028
|
+
onFatalError,
|
|
6029
|
+
onPostpone
|
|
6030
|
+
) {
|
|
6031
|
+
children = resumeRequest(
|
|
6032
|
+
children,
|
|
6033
|
+
postponedState,
|
|
6034
|
+
renderState,
|
|
6035
|
+
onError,
|
|
6036
|
+
onAllReady,
|
|
6037
|
+
onShellReady,
|
|
6038
|
+
onShellError,
|
|
6039
|
+
onFatalError,
|
|
6040
|
+
onPostpone
|
|
6041
|
+
);
|
|
6042
|
+
children.trackedPostpones = {
|
|
6043
|
+
workingMap: new Map(),
|
|
6044
|
+
rootNodes: [],
|
|
6045
|
+
rootSlots: null
|
|
6046
|
+
};
|
|
6047
|
+
return children;
|
|
6048
|
+
}
|
|
5892
6049
|
var currentRequest = null;
|
|
5893
6050
|
function pingTask(request, task) {
|
|
5894
6051
|
request.pingedTasks.push(task);
|
|
@@ -9631,6 +9788,20 @@ function enqueueFlush(request) {
|
|
|
9631
9788
|
: (request.flushScheduled = !1);
|
|
9632
9789
|
}, 0));
|
|
9633
9790
|
}
|
|
9791
|
+
function startFlowing(request, destination) {
|
|
9792
|
+
if (13 === request.status)
|
|
9793
|
+
(request.status = CLOSED), closeWithError(destination, request.fatalError);
|
|
9794
|
+
else if (request.status !== CLOSED && null === request.destination) {
|
|
9795
|
+
request.destination = destination;
|
|
9796
|
+
try {
|
|
9797
|
+
flushCompletedQueues(request, destination);
|
|
9798
|
+
} catch (error) {
|
|
9799
|
+
(destination = {}),
|
|
9800
|
+
logRecoverableError(request, error, destination, null),
|
|
9801
|
+
fatalError(request, error, destination, null);
|
|
9802
|
+
}
|
|
9803
|
+
}
|
|
9804
|
+
}
|
|
9634
9805
|
function abort(request, reason) {
|
|
9635
9806
|
if (11 === request.status || 10 === request.status) request.status = 12;
|
|
9636
9807
|
try {
|
|
@@ -9679,16 +9850,337 @@ function addToReplayParent(node, parentKeyPath, trackedPostpones) {
|
|
|
9679
9850
|
parentNode[2].push(node);
|
|
9680
9851
|
}
|
|
9681
9852
|
}
|
|
9682
|
-
|
|
9683
|
-
|
|
9684
|
-
|
|
9685
|
-
|
|
9686
|
-
|
|
9687
|
-
|
|
9688
|
-
|
|
9689
|
-
|
|
9690
|
-
|
|
9853
|
+
function getPostponedState(request) {
|
|
9854
|
+
var trackedPostpones = request.trackedPostpones;
|
|
9855
|
+
if (
|
|
9856
|
+
null === trackedPostpones ||
|
|
9857
|
+
(0 === trackedPostpones.rootNodes.length &&
|
|
9858
|
+
null === trackedPostpones.rootSlots)
|
|
9859
|
+
)
|
|
9860
|
+
return (request.trackedPostpones = null);
|
|
9861
|
+
if (
|
|
9862
|
+
null === request.completedRootSegment ||
|
|
9863
|
+
(request.completedRootSegment.status !== POSTPONED &&
|
|
9864
|
+
null !== request.completedPreambleSegments)
|
|
9865
|
+
) {
|
|
9866
|
+
var nextSegmentId = request.nextSegmentId;
|
|
9867
|
+
var replaySlots = trackedPostpones.rootSlots;
|
|
9868
|
+
var resumableState = request.resumableState;
|
|
9869
|
+
resumableState.bootstrapScriptContent = void 0;
|
|
9870
|
+
resumableState.bootstrapScripts = void 0;
|
|
9871
|
+
resumableState.bootstrapModules = void 0;
|
|
9872
|
+
} else {
|
|
9873
|
+
nextSegmentId = 0;
|
|
9874
|
+
replaySlots = -1;
|
|
9875
|
+
resumableState = request.resumableState;
|
|
9876
|
+
var renderState = request.renderState;
|
|
9877
|
+
resumableState.nextFormID = 0;
|
|
9878
|
+
resumableState.hasBody = !1;
|
|
9879
|
+
resumableState.hasHtml = !1;
|
|
9880
|
+
resumableState.unknownResources = { font: renderState.resets.font };
|
|
9881
|
+
resumableState.dnsResources = renderState.resets.dns;
|
|
9882
|
+
resumableState.connectResources = renderState.resets.connect;
|
|
9883
|
+
resumableState.imageResources = renderState.resets.image;
|
|
9884
|
+
resumableState.styleResources = renderState.resets.style;
|
|
9885
|
+
resumableState.scriptResources = {};
|
|
9886
|
+
resumableState.moduleUnknownResources = {};
|
|
9887
|
+
resumableState.moduleScriptResources = {};
|
|
9888
|
+
resumableState.instructions = NothingSent;
|
|
9889
|
+
}
|
|
9890
|
+
return {
|
|
9891
|
+
nextSegmentId: nextSegmentId,
|
|
9892
|
+
rootFormatContext: request.rootFormatContext,
|
|
9893
|
+
progressiveChunkSize: request.progressiveChunkSize,
|
|
9894
|
+
resumableState: request.resumableState,
|
|
9895
|
+
replayNodes: trackedPostpones.rootNodes,
|
|
9896
|
+
replaySlots: replaySlots
|
|
9897
|
+
};
|
|
9898
|
+
}
|
|
9899
|
+
function ensureCorrectIsomorphicReactVersion() {
|
|
9900
|
+
var isomorphicReactPackageVersion = React.version;
|
|
9901
|
+
if ("19.3.0-canary-b4455a6e-20251027" !== isomorphicReactPackageVersion)
|
|
9902
|
+
throw Error(
|
|
9903
|
+
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
|
|
9904
|
+
(isomorphicReactPackageVersion +
|
|
9905
|
+
"\n - react-dom: 19.3.0-canary-b4455a6e-20251027\nLearn more: https://react.dev/warnings/version-mismatch")
|
|
9906
|
+
);
|
|
9907
|
+
}
|
|
9908
|
+
ensureCorrectIsomorphicReactVersion();
|
|
9909
|
+
var textEncoder = new util.TextEncoder();
|
|
9910
|
+
ensureCorrectIsomorphicReactVersion();
|
|
9911
|
+
function createDrainHandler(destination, request) {
|
|
9912
|
+
return function () {
|
|
9913
|
+
return startFlowing(request, destination);
|
|
9914
|
+
};
|
|
9915
|
+
}
|
|
9916
|
+
function createCancelHandler(request, reason) {
|
|
9917
|
+
return function () {
|
|
9918
|
+
request.destination = null;
|
|
9919
|
+
abort(request, Error(reason));
|
|
9920
|
+
};
|
|
9921
|
+
}
|
|
9922
|
+
function createRequestImpl(children, options) {
|
|
9923
|
+
var resumableState = createResumableState(
|
|
9924
|
+
options ? options.identifierPrefix : void 0,
|
|
9925
|
+
options ? options.unstable_externalRuntimeSrc : void 0,
|
|
9926
|
+
options ? options.bootstrapScriptContent : void 0,
|
|
9927
|
+
options ? options.bootstrapScripts : void 0,
|
|
9928
|
+
options ? options.bootstrapModules : void 0
|
|
9691
9929
|
);
|
|
9930
|
+
return createRequest(
|
|
9931
|
+
children,
|
|
9932
|
+
resumableState,
|
|
9933
|
+
createRenderState(
|
|
9934
|
+
resumableState,
|
|
9935
|
+
options ? options.nonce : void 0,
|
|
9936
|
+
options ? options.unstable_externalRuntimeSrc : void 0,
|
|
9937
|
+
options ? options.importMap : void 0,
|
|
9938
|
+
options ? options.onHeaders : void 0,
|
|
9939
|
+
options ? options.maxHeadersLength : void 0
|
|
9940
|
+
),
|
|
9941
|
+
createRootFormatContext(options ? options.namespaceURI : void 0),
|
|
9942
|
+
options ? options.progressiveChunkSize : void 0,
|
|
9943
|
+
options ? options.onError : void 0,
|
|
9944
|
+
options ? options.onAllReady : void 0,
|
|
9945
|
+
options ? options.onShellReady : void 0,
|
|
9946
|
+
options ? options.onShellError : void 0,
|
|
9947
|
+
void 0,
|
|
9948
|
+
options ? options.onPostpone : void 0,
|
|
9949
|
+
options ? options.formState : void 0
|
|
9950
|
+
);
|
|
9951
|
+
}
|
|
9952
|
+
function createFakeWritableFromReadableStreamController$1(controller) {
|
|
9953
|
+
return {
|
|
9954
|
+
write: function (chunk) {
|
|
9955
|
+
"string" === typeof chunk && (chunk = textEncoder.encode(chunk));
|
|
9956
|
+
controller.enqueue(chunk);
|
|
9957
|
+
return !0;
|
|
9958
|
+
},
|
|
9959
|
+
end: function () {
|
|
9960
|
+
controller.close();
|
|
9961
|
+
},
|
|
9962
|
+
destroy: function (error) {
|
|
9963
|
+
"function" === typeof controller.error
|
|
9964
|
+
? controller.error(error)
|
|
9965
|
+
: controller.close();
|
|
9966
|
+
}
|
|
9967
|
+
};
|
|
9968
|
+
}
|
|
9969
|
+
function resumeRequestImpl(children, postponedState, options) {
|
|
9970
|
+
return resumeRequest(
|
|
9971
|
+
children,
|
|
9972
|
+
postponedState,
|
|
9973
|
+
createRenderState(
|
|
9974
|
+
postponedState.resumableState,
|
|
9975
|
+
options ? options.nonce : void 0,
|
|
9976
|
+
void 0,
|
|
9977
|
+
void 0,
|
|
9978
|
+
void 0,
|
|
9979
|
+
void 0
|
|
9980
|
+
),
|
|
9981
|
+
options ? options.onError : void 0,
|
|
9982
|
+
options ? options.onAllReady : void 0,
|
|
9983
|
+
options ? options.onShellReady : void 0,
|
|
9984
|
+
options ? options.onShellError : void 0,
|
|
9985
|
+
void 0,
|
|
9986
|
+
options ? options.onPostpone : void 0
|
|
9987
|
+
);
|
|
9988
|
+
}
|
|
9989
|
+
ensureCorrectIsomorphicReactVersion();
|
|
9990
|
+
function createFakeWritableFromReadableStreamController(controller) {
|
|
9991
|
+
return {
|
|
9992
|
+
write: function (chunk) {
|
|
9993
|
+
"string" === typeof chunk && (chunk = textEncoder.encode(chunk));
|
|
9994
|
+
controller.enqueue(chunk);
|
|
9995
|
+
return !0;
|
|
9996
|
+
},
|
|
9997
|
+
end: function () {
|
|
9998
|
+
controller.close();
|
|
9999
|
+
},
|
|
10000
|
+
destroy: function (error) {
|
|
10001
|
+
"function" === typeof controller.error
|
|
10002
|
+
? controller.error(error)
|
|
10003
|
+
: controller.close();
|
|
10004
|
+
}
|
|
10005
|
+
};
|
|
10006
|
+
}
|
|
10007
|
+
function createFakeWritableFromReadable(readable) {
|
|
10008
|
+
return {
|
|
10009
|
+
write: function (chunk) {
|
|
10010
|
+
return readable.push(chunk);
|
|
10011
|
+
},
|
|
10012
|
+
end: function () {
|
|
10013
|
+
readable.push(null);
|
|
10014
|
+
},
|
|
10015
|
+
destroy: function (error) {
|
|
10016
|
+
readable.destroy(error);
|
|
10017
|
+
}
|
|
10018
|
+
};
|
|
10019
|
+
}
|
|
10020
|
+
exports.prerender = function (children, options) {
|
|
10021
|
+
return new Promise(function (resolve, reject) {
|
|
10022
|
+
var onHeaders = options ? options.onHeaders : void 0,
|
|
10023
|
+
onHeadersImpl;
|
|
10024
|
+
onHeaders &&
|
|
10025
|
+
(onHeadersImpl = function (headersDescriptor) {
|
|
10026
|
+
onHeaders(new Headers(headersDescriptor));
|
|
10027
|
+
});
|
|
10028
|
+
var resources = createResumableState(
|
|
10029
|
+
options ? options.identifierPrefix : void 0,
|
|
10030
|
+
options ? options.unstable_externalRuntimeSrc : void 0,
|
|
10031
|
+
options ? options.bootstrapScriptContent : void 0,
|
|
10032
|
+
options ? options.bootstrapScripts : void 0,
|
|
10033
|
+
options ? options.bootstrapModules : void 0
|
|
10034
|
+
),
|
|
10035
|
+
request = createPrerenderRequest(
|
|
10036
|
+
children,
|
|
10037
|
+
resources,
|
|
10038
|
+
createRenderState(
|
|
10039
|
+
resources,
|
|
10040
|
+
void 0,
|
|
10041
|
+
options ? options.unstable_externalRuntimeSrc : void 0,
|
|
10042
|
+
options ? options.importMap : void 0,
|
|
10043
|
+
onHeadersImpl,
|
|
10044
|
+
options ? options.maxHeadersLength : void 0
|
|
10045
|
+
),
|
|
10046
|
+
createRootFormatContext(options ? options.namespaceURI : void 0),
|
|
10047
|
+
options ? options.progressiveChunkSize : void 0,
|
|
10048
|
+
options ? options.onError : void 0,
|
|
10049
|
+
function () {
|
|
10050
|
+
var writable,
|
|
10051
|
+
stream = new ReadableStream(
|
|
10052
|
+
{
|
|
10053
|
+
type: "bytes",
|
|
10054
|
+
start: function (controller) {
|
|
10055
|
+
writable =
|
|
10056
|
+
createFakeWritableFromReadableStreamController(controller);
|
|
10057
|
+
},
|
|
10058
|
+
pull: function () {
|
|
10059
|
+
startFlowing(request, writable);
|
|
10060
|
+
},
|
|
10061
|
+
cancel: function (reason) {
|
|
10062
|
+
request.destination = null;
|
|
10063
|
+
abort(request, reason);
|
|
10064
|
+
}
|
|
10065
|
+
},
|
|
10066
|
+
{ highWaterMark: 0 }
|
|
10067
|
+
);
|
|
10068
|
+
stream = { postponed: getPostponedState(request), prelude: stream };
|
|
10069
|
+
resolve(stream);
|
|
10070
|
+
},
|
|
10071
|
+
void 0,
|
|
10072
|
+
void 0,
|
|
10073
|
+
reject,
|
|
10074
|
+
options ? options.onPostpone : void 0
|
|
10075
|
+
);
|
|
10076
|
+
if (options && options.signal) {
|
|
10077
|
+
var signal = options.signal;
|
|
10078
|
+
if (signal.aborted) abort(request, signal.reason);
|
|
10079
|
+
else {
|
|
10080
|
+
var listener = function () {
|
|
10081
|
+
abort(request, signal.reason);
|
|
10082
|
+
signal.removeEventListener("abort", listener);
|
|
10083
|
+
};
|
|
10084
|
+
signal.addEventListener("abort", listener);
|
|
10085
|
+
}
|
|
10086
|
+
}
|
|
10087
|
+
startWork(request);
|
|
10088
|
+
});
|
|
10089
|
+
};
|
|
10090
|
+
exports.prerenderToNodeStream = function (children, options) {
|
|
10091
|
+
return new Promise(function (resolve, reject) {
|
|
10092
|
+
var resumableState = createResumableState(
|
|
10093
|
+
options ? options.identifierPrefix : void 0,
|
|
10094
|
+
options ? options.unstable_externalRuntimeSrc : void 0,
|
|
10095
|
+
options ? options.bootstrapScriptContent : void 0,
|
|
10096
|
+
options ? options.bootstrapScripts : void 0,
|
|
10097
|
+
options ? options.bootstrapModules : void 0
|
|
10098
|
+
),
|
|
10099
|
+
request = createPrerenderRequest(
|
|
10100
|
+
children,
|
|
10101
|
+
resumableState,
|
|
10102
|
+
createRenderState(
|
|
10103
|
+
resumableState,
|
|
10104
|
+
void 0,
|
|
10105
|
+
options ? options.unstable_externalRuntimeSrc : void 0,
|
|
10106
|
+
options ? options.importMap : void 0,
|
|
10107
|
+
options ? options.onHeaders : void 0,
|
|
10108
|
+
options ? options.maxHeadersLength : void 0
|
|
10109
|
+
),
|
|
10110
|
+
createRootFormatContext(options ? options.namespaceURI : void 0),
|
|
10111
|
+
options ? options.progressiveChunkSize : void 0,
|
|
10112
|
+
options ? options.onError : void 0,
|
|
10113
|
+
function () {
|
|
10114
|
+
var readable = new stream.Readable({
|
|
10115
|
+
read: function () {
|
|
10116
|
+
startFlowing(request, writable);
|
|
10117
|
+
}
|
|
10118
|
+
}),
|
|
10119
|
+
writable = createFakeWritableFromReadable(readable);
|
|
10120
|
+
readable = {
|
|
10121
|
+
postponed: getPostponedState(request),
|
|
10122
|
+
prelude: readable
|
|
10123
|
+
};
|
|
10124
|
+
resolve(readable);
|
|
10125
|
+
},
|
|
10126
|
+
void 0,
|
|
10127
|
+
void 0,
|
|
10128
|
+
reject,
|
|
10129
|
+
options ? options.onPostpone : void 0
|
|
10130
|
+
);
|
|
10131
|
+
if (options && options.signal) {
|
|
10132
|
+
var signal = options.signal;
|
|
10133
|
+
if (signal.aborted) abort(request, signal.reason);
|
|
10134
|
+
else {
|
|
10135
|
+
var listener = function () {
|
|
10136
|
+
abort(request, signal.reason);
|
|
10137
|
+
signal.removeEventListener("abort", listener);
|
|
10138
|
+
};
|
|
10139
|
+
signal.addEventListener("abort", listener);
|
|
10140
|
+
}
|
|
10141
|
+
}
|
|
10142
|
+
startWork(request);
|
|
10143
|
+
});
|
|
10144
|
+
};
|
|
10145
|
+
exports.renderToPipeableStream = function (children, options) {
|
|
10146
|
+
var request = createRequestImpl(children, options),
|
|
10147
|
+
hasStartedFlowing = !1;
|
|
10148
|
+
startWork(request);
|
|
10149
|
+
return {
|
|
10150
|
+
pipe: function (destination) {
|
|
10151
|
+
if (hasStartedFlowing)
|
|
10152
|
+
throw Error(
|
|
10153
|
+
"React currently only supports piping to one writable stream."
|
|
10154
|
+
);
|
|
10155
|
+
hasStartedFlowing = !0;
|
|
10156
|
+
safelyEmitEarlyPreloads(
|
|
10157
|
+
request,
|
|
10158
|
+
null === request.trackedPostpones
|
|
10159
|
+
? 0 === request.pendingRootTasks
|
|
10160
|
+
: null === request.completedRootSegment
|
|
10161
|
+
? 0 === request.pendingRootTasks
|
|
10162
|
+
: request.completedRootSegment.status !== POSTPONED
|
|
10163
|
+
);
|
|
10164
|
+
startFlowing(request, destination);
|
|
10165
|
+
destination.on("drain", createDrainHandler(destination, request));
|
|
10166
|
+
destination.on(
|
|
10167
|
+
"error",
|
|
10168
|
+
createCancelHandler(
|
|
10169
|
+
request,
|
|
10170
|
+
"The destination stream errored while writing data."
|
|
10171
|
+
)
|
|
10172
|
+
);
|
|
10173
|
+
destination.on(
|
|
10174
|
+
"close",
|
|
10175
|
+
createCancelHandler(request, "The destination stream closed early.")
|
|
10176
|
+
);
|
|
10177
|
+
return destination;
|
|
10178
|
+
},
|
|
10179
|
+
abort: function (reason) {
|
|
10180
|
+
abort(request, reason);
|
|
10181
|
+
}
|
|
10182
|
+
};
|
|
10183
|
+
};
|
|
9692
10184
|
exports.renderToReadableStream = function (children, options) {
|
|
9693
10185
|
return new Promise(function (resolve, reject) {
|
|
9694
10186
|
var onFatalError,
|
|
@@ -9710,7 +10202,7 @@ exports.renderToReadableStream = function (children, options) {
|
|
|
9710
10202
|
options ? options.bootstrapScripts : void 0,
|
|
9711
10203
|
options ? options.bootstrapModules : void 0
|
|
9712
10204
|
),
|
|
9713
|
-
request
|
|
10205
|
+
request = createRequest(
|
|
9714
10206
|
children,
|
|
9715
10207
|
resumableState,
|
|
9716
10208
|
createRenderState(
|
|
@@ -9730,27 +10222,11 @@ exports.renderToReadableStream = function (children, options) {
|
|
|
9730
10222
|
{
|
|
9731
10223
|
type: "direct",
|
|
9732
10224
|
pull: function (controller) {
|
|
9733
|
-
|
|
9734
|
-
if (13 === request.status)
|
|
9735
|
-
(request.status = CLOSED),
|
|
9736
|
-
closeWithError(controller, request.fatalError);
|
|
9737
|
-
else if (
|
|
9738
|
-
request.status !== CLOSED &&
|
|
9739
|
-
null === request.destination
|
|
9740
|
-
) {
|
|
9741
|
-
request.destination = controller;
|
|
9742
|
-
try {
|
|
9743
|
-
flushCompletedQueues(request, controller);
|
|
9744
|
-
} catch (error) {
|
|
9745
|
-
(controller = {}),
|
|
9746
|
-
logRecoverableError(request, error, controller, null),
|
|
9747
|
-
fatalError(request, error, controller, null);
|
|
9748
|
-
}
|
|
9749
|
-
}
|
|
10225
|
+
startFlowing(request, controller);
|
|
9750
10226
|
},
|
|
9751
10227
|
cancel: function (reason) {
|
|
9752
|
-
request
|
|
9753
|
-
abort(request
|
|
10228
|
+
request.destination = null;
|
|
10229
|
+
abort(request, reason);
|
|
9754
10230
|
}
|
|
9755
10231
|
},
|
|
9756
10232
|
{ highWaterMark: 2048 }
|
|
@@ -9768,16 +10244,215 @@ exports.renderToReadableStream = function (children, options) {
|
|
|
9768
10244
|
);
|
|
9769
10245
|
if (options && options.signal) {
|
|
9770
10246
|
var signal = options.signal;
|
|
9771
|
-
if (signal.aborted) abort(request
|
|
10247
|
+
if (signal.aborted) abort(request, signal.reason);
|
|
10248
|
+
else {
|
|
10249
|
+
var listener = function () {
|
|
10250
|
+
abort(request, signal.reason);
|
|
10251
|
+
signal.removeEventListener("abort", listener);
|
|
10252
|
+
};
|
|
10253
|
+
signal.addEventListener("abort", listener);
|
|
10254
|
+
}
|
|
10255
|
+
}
|
|
10256
|
+
startWork(request);
|
|
10257
|
+
});
|
|
10258
|
+
};
|
|
10259
|
+
exports.resume = function (children, postponedState, options) {
|
|
10260
|
+
return new Promise(function (resolve, reject) {
|
|
10261
|
+
var onFatalError,
|
|
10262
|
+
onAllReady,
|
|
10263
|
+
allReady = new Promise(function (res, rej) {
|
|
10264
|
+
onAllReady = res;
|
|
10265
|
+
onFatalError = rej;
|
|
10266
|
+
}),
|
|
10267
|
+
request = resumeRequest(
|
|
10268
|
+
children,
|
|
10269
|
+
postponedState,
|
|
10270
|
+
createRenderState(
|
|
10271
|
+
postponedState.resumableState,
|
|
10272
|
+
options ? options.nonce : void 0,
|
|
10273
|
+
void 0,
|
|
10274
|
+
void 0,
|
|
10275
|
+
void 0,
|
|
10276
|
+
void 0
|
|
10277
|
+
),
|
|
10278
|
+
options ? options.onError : void 0,
|
|
10279
|
+
onAllReady,
|
|
10280
|
+
function () {
|
|
10281
|
+
var writable,
|
|
10282
|
+
stream = new ReadableStream(
|
|
10283
|
+
{
|
|
10284
|
+
type: "bytes",
|
|
10285
|
+
start: function (controller) {
|
|
10286
|
+
writable =
|
|
10287
|
+
createFakeWritableFromReadableStreamController$1(
|
|
10288
|
+
controller
|
|
10289
|
+
);
|
|
10290
|
+
},
|
|
10291
|
+
pull: function () {
|
|
10292
|
+
startFlowing(request, writable);
|
|
10293
|
+
},
|
|
10294
|
+
cancel: function (reason) {
|
|
10295
|
+
request.destination = null;
|
|
10296
|
+
abort(request, reason);
|
|
10297
|
+
}
|
|
10298
|
+
},
|
|
10299
|
+
{ highWaterMark: 0 }
|
|
10300
|
+
);
|
|
10301
|
+
stream.allReady = allReady;
|
|
10302
|
+
resolve(stream);
|
|
10303
|
+
},
|
|
10304
|
+
function (error) {
|
|
10305
|
+
allReady.catch(function () {});
|
|
10306
|
+
reject(error);
|
|
10307
|
+
},
|
|
10308
|
+
onFatalError,
|
|
10309
|
+
options ? options.onPostpone : void 0
|
|
10310
|
+
);
|
|
10311
|
+
if (options && options.signal) {
|
|
10312
|
+
var signal = options.signal;
|
|
10313
|
+
if (signal.aborted) abort(request, signal.reason);
|
|
9772
10314
|
else {
|
|
9773
10315
|
var listener = function () {
|
|
9774
|
-
abort(request
|
|
10316
|
+
abort(request, signal.reason);
|
|
9775
10317
|
signal.removeEventListener("abort", listener);
|
|
9776
10318
|
};
|
|
9777
10319
|
signal.addEventListener("abort", listener);
|
|
9778
10320
|
}
|
|
9779
10321
|
}
|
|
9780
|
-
startWork(request
|
|
10322
|
+
startWork(request);
|
|
9781
10323
|
});
|
|
9782
10324
|
};
|
|
9783
|
-
exports.
|
|
10325
|
+
exports.resumeAndPrerender = function (children, postponedState, options) {
|
|
10326
|
+
return new Promise(function (resolve, reject) {
|
|
10327
|
+
var request = resumeAndPrerenderRequest(
|
|
10328
|
+
children,
|
|
10329
|
+
postponedState,
|
|
10330
|
+
createRenderState(
|
|
10331
|
+
postponedState.resumableState,
|
|
10332
|
+
void 0,
|
|
10333
|
+
void 0,
|
|
10334
|
+
void 0,
|
|
10335
|
+
void 0,
|
|
10336
|
+
void 0
|
|
10337
|
+
),
|
|
10338
|
+
options ? options.onError : void 0,
|
|
10339
|
+
function () {
|
|
10340
|
+
var writable,
|
|
10341
|
+
stream = new ReadableStream(
|
|
10342
|
+
{
|
|
10343
|
+
type: "bytes",
|
|
10344
|
+
start: function (controller) {
|
|
10345
|
+
writable =
|
|
10346
|
+
createFakeWritableFromReadableStreamController(controller);
|
|
10347
|
+
},
|
|
10348
|
+
pull: function () {
|
|
10349
|
+
startFlowing(request, writable);
|
|
10350
|
+
},
|
|
10351
|
+
cancel: function (reason) {
|
|
10352
|
+
request.destination = null;
|
|
10353
|
+
abort(request, reason);
|
|
10354
|
+
}
|
|
10355
|
+
},
|
|
10356
|
+
{ highWaterMark: 0 }
|
|
10357
|
+
);
|
|
10358
|
+
stream = { postponed: getPostponedState(request), prelude: stream };
|
|
10359
|
+
resolve(stream);
|
|
10360
|
+
},
|
|
10361
|
+
void 0,
|
|
10362
|
+
void 0,
|
|
10363
|
+
reject,
|
|
10364
|
+
options ? options.onPostpone : void 0
|
|
10365
|
+
);
|
|
10366
|
+
if (options && options.signal) {
|
|
10367
|
+
var signal = options.signal;
|
|
10368
|
+
if (signal.aborted) abort(request, signal.reason);
|
|
10369
|
+
else {
|
|
10370
|
+
var listener = function () {
|
|
10371
|
+
abort(request, signal.reason);
|
|
10372
|
+
signal.removeEventListener("abort", listener);
|
|
10373
|
+
};
|
|
10374
|
+
signal.addEventListener("abort", listener);
|
|
10375
|
+
}
|
|
10376
|
+
}
|
|
10377
|
+
startWork(request);
|
|
10378
|
+
});
|
|
10379
|
+
};
|
|
10380
|
+
exports.resumeAndPrerenderToNodeStream = function (
|
|
10381
|
+
children,
|
|
10382
|
+
postponedState,
|
|
10383
|
+
options
|
|
10384
|
+
) {
|
|
10385
|
+
return new Promise(function (resolve, reject) {
|
|
10386
|
+
var request = resumeAndPrerenderRequest(
|
|
10387
|
+
children,
|
|
10388
|
+
postponedState,
|
|
10389
|
+
createRenderState(
|
|
10390
|
+
postponedState.resumableState,
|
|
10391
|
+
void 0,
|
|
10392
|
+
void 0,
|
|
10393
|
+
void 0,
|
|
10394
|
+
void 0,
|
|
10395
|
+
void 0
|
|
10396
|
+
),
|
|
10397
|
+
options ? options.onError : void 0,
|
|
10398
|
+
function () {
|
|
10399
|
+
var readable = new stream.Readable({
|
|
10400
|
+
read: function () {
|
|
10401
|
+
startFlowing(request, writable);
|
|
10402
|
+
}
|
|
10403
|
+
}),
|
|
10404
|
+
writable = createFakeWritableFromReadable(readable);
|
|
10405
|
+
readable = { postponed: getPostponedState(request), prelude: readable };
|
|
10406
|
+
resolve(readable);
|
|
10407
|
+
},
|
|
10408
|
+
void 0,
|
|
10409
|
+
void 0,
|
|
10410
|
+
reject,
|
|
10411
|
+
options ? options.onPostpone : void 0
|
|
10412
|
+
);
|
|
10413
|
+
if (options && options.signal) {
|
|
10414
|
+
var signal = options.signal;
|
|
10415
|
+
if (signal.aborted) abort(request, signal.reason);
|
|
10416
|
+
else {
|
|
10417
|
+
var listener = function () {
|
|
10418
|
+
abort(request, signal.reason);
|
|
10419
|
+
signal.removeEventListener("abort", listener);
|
|
10420
|
+
};
|
|
10421
|
+
signal.addEventListener("abort", listener);
|
|
10422
|
+
}
|
|
10423
|
+
}
|
|
10424
|
+
startWork(request);
|
|
10425
|
+
});
|
|
10426
|
+
};
|
|
10427
|
+
exports.resumeToPipeableStream = function (children, postponedState, options) {
|
|
10428
|
+
var request = resumeRequestImpl(children, postponedState, options),
|
|
10429
|
+
hasStartedFlowing = !1;
|
|
10430
|
+
startWork(request);
|
|
10431
|
+
return {
|
|
10432
|
+
pipe: function (destination) {
|
|
10433
|
+
if (hasStartedFlowing)
|
|
10434
|
+
throw Error(
|
|
10435
|
+
"React currently only supports piping to one writable stream."
|
|
10436
|
+
);
|
|
10437
|
+
hasStartedFlowing = !0;
|
|
10438
|
+
startFlowing(request, destination);
|
|
10439
|
+
destination.on("drain", createDrainHandler(destination, request));
|
|
10440
|
+
destination.on(
|
|
10441
|
+
"error",
|
|
10442
|
+
createCancelHandler(
|
|
10443
|
+
request,
|
|
10444
|
+
"The destination stream errored while writing data."
|
|
10445
|
+
)
|
|
10446
|
+
);
|
|
10447
|
+
destination.on(
|
|
10448
|
+
"close",
|
|
10449
|
+
createCancelHandler(request, "The destination stream closed early.")
|
|
10450
|
+
);
|
|
10451
|
+
return destination;
|
|
10452
|
+
},
|
|
10453
|
+
abort: function (reason) {
|
|
10454
|
+
abort(request, reason);
|
|
10455
|
+
}
|
|
10456
|
+
};
|
|
10457
|
+
};
|
|
10458
|
+
exports.version = "19.3.0-canary-b4455a6e-20251027";
|