@vitejs/plugin-rsc 0.4.33 → 0.5.0
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/README.md +4 -0
- package/dist/{browser-CQv7Z3J4.d.ts → browser-STIFJSFF.d.ts} +1 -1
- package/dist/browser.d.ts +3 -3
- package/dist/browser.js +19 -1
- package/dist/{cjs-BamOAUgw.js → cjs-C5-IrxV9.js} +1 -1
- package/dist/core/browser.d.ts +1 -1
- package/dist/core/plugin.js +1 -1
- package/dist/core/rsc.d.ts +2 -2
- package/dist/core/rsc.js +1 -1
- package/dist/core/ssr.d.ts +2 -2
- package/dist/core/ssr.js +1 -1
- package/dist/{encryption-runtime-DT6dtlC5.js → encryption-runtime-FhNKiASK.js} +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +7 -7
- package/dist/{plugin-BDLEZ1UW.js → plugin-CrduXSyi.js} +35 -24
- package/dist/{plugin-DCLI7Wh8.d.ts → plugin-DGhnAIi6.d.ts} +1 -5
- package/dist/plugin.d.ts +2 -2
- package/dist/plugin.js +7 -7
- package/dist/plugins/cjs.js +2 -2
- package/dist/react/browser.d.ts +3 -3
- package/dist/react/rsc.d.ts +3 -3
- package/dist/react/rsc.js +2 -2
- package/dist/react/ssr.d.ts +3 -3
- package/dist/react/ssr.js +2 -2
- package/dist/{rsc-3bkzqdsJ.d.ts → rsc-Cg31p8XR.d.ts} +1 -1
- package/dist/{rsc-BdCB3621.js → rsc-DdBcg-Lb.js} +1 -1
- package/dist/rsc.d.ts +4 -4
- package/dist/rsc.js +22 -5
- package/dist/{ssr-CMjeQ9AS.d.ts → ssr-00tY_Tdf.d.ts} +1 -1
- package/dist/{ssr-Cd4SbAaO.js → ssr-CE8X2HyS.js} +1 -1
- package/dist/ssr.d.ts +3 -3
- package/dist/ssr.js +52 -4
- package/dist/transforms/index.d.ts +1 -1
- package/dist/transforms/index.js +1 -1
- package/dist/utils/encryption-runtime.d.ts +1 -1
- package/dist/utils/encryption-runtime.js +4 -4
- package/dist/utils/rpc.js +1 -1
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.browser.development.js +2964 -774
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.browser.production.js +554 -312
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.edge.development.js +2721 -724
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.edge.production.js +541 -300
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.node.development.js +2955 -858
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.node.production.js +652 -332
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.node.unbundled.development.js +2956 -861
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.node.unbundled.production.js +652 -332
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-plugin.js +6 -2
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.browser.development.js +1931 -713
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.browser.production.js +544 -295
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.edge.development.js +1926 -715
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.edge.production.js +542 -299
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.node.development.js +2719 -743
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.node.production.js +725 -338
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.node.unbundled.development.js +2703 -727
- package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.node.unbundled.production.js +725 -338
- package/dist/vendor/react-server-dom/package.json +3 -3
- package/dist/vendor/react-server-dom/server.node.js +3 -1
- package/dist/vendor/react-server-dom/server.node.unbundled.js +3 -1
- package/dist/vendor/react-server-dom/static.browser.js +1 -3
- package/dist/vendor/react-server-dom/static.edge.js +1 -3
- package/dist/vendor/react-server-dom/static.node.js +2 -3
- package/dist/vendor/react-server-dom/static.node.unbundled.js +1 -3
- package/package.json +12 -7
- package/types/index.d.ts +0 -4
- package/dist/browser--ZREVnM9.js +0 -22
- package/dist/client-C7Eok9hc.js +0 -23
- package/dist/extra/browser.d.ts +0 -14
- package/dist/extra/browser.js +0 -88
- package/dist/extra/rsc.d.ts +0 -2
- package/dist/extra/rsc.js +0 -56
- package/dist/extra/ssr.d.ts +0 -14
- package/dist/extra/ssr.js +0 -37
- package/dist/rsc-CiAoLCx8.js +0 -21
- package/dist/rsc-c22DF1A7.d.ts +0 -16
- package/dist/rsc-html-stream/browser.d.ts +0 -5
- package/dist/rsc-html-stream/browser.js +0 -8
- package/dist/rsc-html-stream/ssr.d.ts +0 -7
- package/dist/rsc-html-stream/ssr.js +0 -8
- package/dist/server-DMhFuTz_.js +0 -72
- package/dist/ssr-BQwZitKq.js +0 -53
- package/types/virtual.d.ts +0 -5
- /package/dist/{browser-DwWQeoll.d.ts → browser-CXHICuDc.d.ts} +0 -0
- /package/dist/{encryption-runtime-B8xcnJoN.d.ts → encryption-runtime-DwihLkYv.d.ts} +0 -0
- /package/dist/{encryption-utils-BDwwcMVT.js → encryption-utils-CoE0gWjC.js} +0 -0
- /package/dist/{index-B04iFwO5.d.ts → index-DYBWAuKP.d.ts} +0 -0
- /package/dist/{index-CPkExgij.d.ts → index-kBz3NvVt.d.ts} +0 -0
- /package/dist/{plugin-CZbI4rhS.js → plugin-BwI7mYXI.js} +0 -0
- /package/dist/{rpc-CUvSZurk.js → rpc-D7cb_Wd5.js} +0 -0
- /package/dist/{rsc-JJjz3Z0i.d.ts → rsc-Fgmk6j0z.d.ts} +0 -0
- /package/dist/{rsc-GFzFWyhT.js → rsc-cp4EenMG.js} +0 -0
- /package/dist/{shared-n-ykEs15.js → shared-CceFFukJ.js} +0 -0
- /package/dist/{ssr-BrSGyrxe.d.ts → ssr-BnYZ8xo9.d.ts} +0 -0
- /package/dist/{ssr-Cm2FP2zD.js → ssr-C468YlFl.js} +0 -0
- /package/dist/{transforms-CpF3zNE0.js → transforms-wFF-pWF7.js} +0 -0
|
@@ -247,11 +247,11 @@ function processReply(
|
|
|
247
247
|
0 === pendingParts && resolve(data);
|
|
248
248
|
} else
|
|
249
249
|
try {
|
|
250
|
-
var partJSON$
|
|
251
|
-
data.append(formFieldPrefix + streamId, partJSON$
|
|
250
|
+
var partJSON$21 = JSON.stringify(entry.value, resolveToJSON);
|
|
251
|
+
data.append(formFieldPrefix + streamId, partJSON$21);
|
|
252
252
|
iterator.next().then(progress, reject);
|
|
253
|
-
} catch (x$
|
|
254
|
-
reject(x$
|
|
253
|
+
} catch (x$22) {
|
|
254
|
+
reject(x$22);
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
257
|
null === formData && (formData = new FormData());
|
|
@@ -296,20 +296,20 @@ function processReply(
|
|
|
296
296
|
"function" === typeof x.then
|
|
297
297
|
) {
|
|
298
298
|
pendingParts++;
|
|
299
|
-
var lazyId$
|
|
299
|
+
var lazyId$23 = nextPartId++;
|
|
300
300
|
parentReference = function () {
|
|
301
301
|
try {
|
|
302
|
-
var partJSON$
|
|
303
|
-
data$
|
|
304
|
-
data$
|
|
302
|
+
var partJSON$24 = serializeModel(value, lazyId$23),
|
|
303
|
+
data$25 = formData;
|
|
304
|
+
data$25.append(formFieldPrefix + lazyId$23, partJSON$24);
|
|
305
305
|
pendingParts--;
|
|
306
|
-
0 === pendingParts && resolve(data$
|
|
306
|
+
0 === pendingParts && resolve(data$25);
|
|
307
307
|
} catch (reason) {
|
|
308
308
|
reject(reason);
|
|
309
309
|
}
|
|
310
310
|
};
|
|
311
311
|
x.then(parentReference, parentReference);
|
|
312
|
-
return "$" + lazyId$
|
|
312
|
+
return "$" + lazyId$23.toString(16);
|
|
313
313
|
}
|
|
314
314
|
reject(x);
|
|
315
315
|
return null;
|
|
@@ -323,9 +323,9 @@ function processReply(
|
|
|
323
323
|
var promiseId = nextPartId++;
|
|
324
324
|
value.then(function (partValue) {
|
|
325
325
|
try {
|
|
326
|
-
var partJSON$
|
|
326
|
+
var partJSON$27 = serializeModel(partValue, promiseId);
|
|
327
327
|
partValue = formData;
|
|
328
|
-
partValue.append(formFieldPrefix + promiseId, partJSON$
|
|
328
|
+
partValue.append(formFieldPrefix + promiseId, partJSON$27);
|
|
329
329
|
pendingParts--;
|
|
330
330
|
0 === pendingParts && resolve(partValue);
|
|
331
331
|
} catch (reason) {
|
|
@@ -349,11 +349,11 @@ function processReply(
|
|
|
349
349
|
if (isArrayImpl(value)) return value;
|
|
350
350
|
if (value instanceof FormData) {
|
|
351
351
|
null === formData && (formData = new FormData());
|
|
352
|
-
var data$
|
|
352
|
+
var data$31 = formData;
|
|
353
353
|
key = nextPartId++;
|
|
354
354
|
var prefix = formFieldPrefix + key + "_";
|
|
355
355
|
value.forEach(function (originalValue, originalKey) {
|
|
356
|
-
data$
|
|
356
|
+
data$31.append(prefix + originalKey, originalValue);
|
|
357
357
|
});
|
|
358
358
|
return "$K" + key.toString(16);
|
|
359
359
|
}
|
|
@@ -692,11 +692,10 @@ function createServerReference$1(id, callServer, encodeFormAction) {
|
|
|
692
692
|
registerBoundServerReference(action, id, null, encodeFormAction);
|
|
693
693
|
return action;
|
|
694
694
|
}
|
|
695
|
-
function ReactPromise(status, value, reason
|
|
695
|
+
function ReactPromise(status, value, reason) {
|
|
696
696
|
this.status = status;
|
|
697
697
|
this.value = value;
|
|
698
698
|
this.reason = reason;
|
|
699
|
-
this._response = response;
|
|
700
699
|
}
|
|
701
700
|
ReactPromise.prototype = Object.create(Promise.prototype);
|
|
702
701
|
ReactPromise.prototype.then = function (resolve, reject) {
|
|
@@ -709,17 +708,19 @@ ReactPromise.prototype.then = function (resolve, reject) {
|
|
|
709
708
|
}
|
|
710
709
|
switch (this.status) {
|
|
711
710
|
case "fulfilled":
|
|
712
|
-
resolve(this.value);
|
|
711
|
+
"function" === typeof resolve && resolve(this.value);
|
|
713
712
|
break;
|
|
714
713
|
case "pending":
|
|
715
714
|
case "blocked":
|
|
716
|
-
resolve &&
|
|
715
|
+
"function" === typeof resolve &&
|
|
717
716
|
(null === this.value && (this.value = []), this.value.push(resolve));
|
|
718
|
-
reject &&
|
|
717
|
+
"function" === typeof reject &&
|
|
719
718
|
(null === this.reason && (this.reason = []), this.reason.push(reject));
|
|
720
719
|
break;
|
|
720
|
+
case "halted":
|
|
721
|
+
break;
|
|
721
722
|
default:
|
|
722
|
-
reject && reject(this.reason);
|
|
723
|
+
"function" === typeof reject && reject(this.reason);
|
|
723
724
|
}
|
|
724
725
|
};
|
|
725
726
|
function readChunk(chunk) {
|
|
@@ -735,26 +736,71 @@ function readChunk(chunk) {
|
|
|
735
736
|
return chunk.value;
|
|
736
737
|
case "pending":
|
|
737
738
|
case "blocked":
|
|
739
|
+
case "halted":
|
|
738
740
|
throw chunk;
|
|
739
741
|
default:
|
|
740
742
|
throw chunk.reason;
|
|
741
743
|
}
|
|
742
744
|
}
|
|
743
|
-
function createPendingChunk(response) {
|
|
744
|
-
return new ReactPromise("pending", null, null, response);
|
|
745
|
-
}
|
|
746
745
|
function wakeChunk(listeners, value) {
|
|
747
|
-
for (var i = 0; i < listeners.length; i++)
|
|
746
|
+
for (var i = 0; i < listeners.length; i++) {
|
|
747
|
+
var listener = listeners[i];
|
|
748
|
+
"function" === typeof listener
|
|
749
|
+
? listener(value)
|
|
750
|
+
: fulfillReference(listener, value);
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
function rejectChunk(listeners, error) {
|
|
754
|
+
for (var i = 0; i < listeners.length; i++) {
|
|
755
|
+
var listener = listeners[i];
|
|
756
|
+
"function" === typeof listener
|
|
757
|
+
? listener(error)
|
|
758
|
+
: rejectReference(listener, error);
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
function resolveBlockedCycle(resolvedChunk, reference) {
|
|
762
|
+
var referencedChunk = reference.handler.chunk;
|
|
763
|
+
if (null === referencedChunk) return null;
|
|
764
|
+
if (referencedChunk === resolvedChunk) return reference.handler;
|
|
765
|
+
reference = referencedChunk.value;
|
|
766
|
+
if (null !== reference)
|
|
767
|
+
for (
|
|
768
|
+
referencedChunk = 0;
|
|
769
|
+
referencedChunk < reference.length;
|
|
770
|
+
referencedChunk++
|
|
771
|
+
) {
|
|
772
|
+
var listener = reference[referencedChunk];
|
|
773
|
+
if (
|
|
774
|
+
"function" !== typeof listener &&
|
|
775
|
+
((listener = resolveBlockedCycle(resolvedChunk, listener)),
|
|
776
|
+
null !== listener)
|
|
777
|
+
)
|
|
778
|
+
return listener;
|
|
779
|
+
}
|
|
780
|
+
return null;
|
|
748
781
|
}
|
|
749
782
|
function wakeChunkIfInitialized(chunk, resolveListeners, rejectListeners) {
|
|
750
783
|
switch (chunk.status) {
|
|
751
784
|
case "fulfilled":
|
|
752
785
|
wakeChunk(resolveListeners, chunk.value);
|
|
753
786
|
break;
|
|
754
|
-
case "pending":
|
|
755
787
|
case "blocked":
|
|
788
|
+
for (var i = 0; i < resolveListeners.length; i++) {
|
|
789
|
+
var listener = resolveListeners[i];
|
|
790
|
+
if ("function" !== typeof listener) {
|
|
791
|
+
var cyclicHandler = resolveBlockedCycle(chunk, listener);
|
|
792
|
+
null !== cyclicHandler &&
|
|
793
|
+
(fulfillReference(listener, cyclicHandler.value),
|
|
794
|
+
resolveListeners.splice(i, 1),
|
|
795
|
+
i--,
|
|
796
|
+
null !== rejectListeners &&
|
|
797
|
+
((listener = rejectListeners.indexOf(listener)),
|
|
798
|
+
-1 !== listener && rejectListeners.splice(listener, 1)));
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
case "pending":
|
|
756
802
|
if (chunk.value)
|
|
757
|
-
for (
|
|
803
|
+
for (i = 0; i < resolveListeners.length; i++)
|
|
758
804
|
chunk.value.push(resolveListeners[i]);
|
|
759
805
|
else chunk.value = resolveListeners;
|
|
760
806
|
if (chunk.reason) {
|
|
@@ -768,73 +814,80 @@ function wakeChunkIfInitialized(chunk, resolveListeners, rejectListeners) {
|
|
|
768
814
|
} else chunk.reason = rejectListeners;
|
|
769
815
|
break;
|
|
770
816
|
case "rejected":
|
|
771
|
-
rejectListeners &&
|
|
817
|
+
rejectListeners && rejectChunk(rejectListeners, chunk.reason);
|
|
772
818
|
}
|
|
773
819
|
}
|
|
774
|
-
function triggerErrorOnChunk(chunk, error) {
|
|
775
|
-
|
|
776
|
-
chunk.reason.error(error)
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
null !== listeners && wakeChunk(listeners, error);
|
|
782
|
-
}
|
|
820
|
+
function triggerErrorOnChunk(response, chunk, error) {
|
|
821
|
+
"pending" !== chunk.status && "blocked" !== chunk.status
|
|
822
|
+
? chunk.reason.error(error)
|
|
823
|
+
: ((response = chunk.reason),
|
|
824
|
+
(chunk.status = "rejected"),
|
|
825
|
+
(chunk.reason = error),
|
|
826
|
+
null !== response && rejectChunk(response, error));
|
|
783
827
|
}
|
|
784
828
|
function createResolvedIteratorResultChunk(response, value, done) {
|
|
785
829
|
return new ReactPromise(
|
|
786
830
|
"resolved_model",
|
|
787
831
|
(done ? '{"done":true,"value":' : '{"done":false,"value":') + value + "}",
|
|
788
|
-
null,
|
|
789
832
|
response
|
|
790
833
|
);
|
|
791
834
|
}
|
|
792
|
-
function resolveIteratorResultChunk(chunk, value, done) {
|
|
835
|
+
function resolveIteratorResultChunk(response, chunk, value, done) {
|
|
793
836
|
resolveModelChunk(
|
|
837
|
+
response,
|
|
794
838
|
chunk,
|
|
795
839
|
(done ? '{"done":true,"value":' : '{"done":false,"value":') + value + "}"
|
|
796
840
|
);
|
|
797
841
|
}
|
|
798
|
-
function resolveModelChunk(chunk, value) {
|
|
842
|
+
function resolveModelChunk(response, chunk, value) {
|
|
799
843
|
if ("pending" !== chunk.status) chunk.reason.enqueueModel(value);
|
|
800
844
|
else {
|
|
801
845
|
var resolveListeners = chunk.value,
|
|
802
846
|
rejectListeners = chunk.reason;
|
|
803
847
|
chunk.status = "resolved_model";
|
|
804
848
|
chunk.value = value;
|
|
849
|
+
chunk.reason = response;
|
|
805
850
|
null !== resolveListeners &&
|
|
806
851
|
(initializeModelChunk(chunk),
|
|
807
852
|
wakeChunkIfInitialized(chunk, resolveListeners, rejectListeners));
|
|
808
853
|
}
|
|
809
854
|
}
|
|
810
|
-
function resolveModuleChunk(chunk, value) {
|
|
855
|
+
function resolveModuleChunk(response, chunk, value) {
|
|
811
856
|
if ("pending" === chunk.status || "blocked" === chunk.status) {
|
|
812
|
-
|
|
813
|
-
|
|
857
|
+
response = chunk.value;
|
|
858
|
+
var rejectListeners = chunk.reason;
|
|
814
859
|
chunk.status = "resolved_module";
|
|
815
860
|
chunk.value = value;
|
|
816
|
-
null !==
|
|
861
|
+
null !== response &&
|
|
817
862
|
(initializeModuleChunk(chunk),
|
|
818
|
-
wakeChunkIfInitialized(chunk,
|
|
863
|
+
wakeChunkIfInitialized(chunk, response, rejectListeners));
|
|
819
864
|
}
|
|
820
865
|
}
|
|
821
866
|
var initializingHandler = null;
|
|
822
867
|
function initializeModelChunk(chunk) {
|
|
823
868
|
var prevHandler = initializingHandler;
|
|
824
869
|
initializingHandler = null;
|
|
825
|
-
var resolvedModel = chunk.value
|
|
870
|
+
var resolvedModel = chunk.value,
|
|
871
|
+
response = chunk.reason;
|
|
826
872
|
chunk.status = "blocked";
|
|
827
873
|
chunk.value = null;
|
|
828
874
|
chunk.reason = null;
|
|
829
875
|
try {
|
|
830
|
-
var value = JSON.parse(resolvedModel,
|
|
876
|
+
var value = JSON.parse(resolvedModel, response._fromJSON),
|
|
831
877
|
resolveListeners = chunk.value;
|
|
832
|
-
null !== resolveListeners
|
|
833
|
-
(
|
|
834
|
-
|
|
835
|
-
|
|
878
|
+
if (null !== resolveListeners)
|
|
879
|
+
for (
|
|
880
|
+
chunk.value = null, chunk.reason = null, resolvedModel = 0;
|
|
881
|
+
resolvedModel < resolveListeners.length;
|
|
882
|
+
resolvedModel++
|
|
883
|
+
) {
|
|
884
|
+
var listener = resolveListeners[resolvedModel];
|
|
885
|
+
"function" === typeof listener
|
|
886
|
+
? listener(value)
|
|
887
|
+
: fulfillReference(listener, value, chunk);
|
|
888
|
+
}
|
|
836
889
|
if (null !== initializingHandler) {
|
|
837
|
-
if (initializingHandler.errored) throw initializingHandler.
|
|
890
|
+
if (initializingHandler.errored) throw initializingHandler.reason;
|
|
838
891
|
if (0 < initializingHandler.deps) {
|
|
839
892
|
initializingHandler.value = value;
|
|
840
893
|
initializingHandler.chunk = chunk;
|
|
@@ -858,11 +911,12 @@ function initializeModuleChunk(chunk) {
|
|
|
858
911
|
(chunk.status = "rejected"), (chunk.reason = error);
|
|
859
912
|
}
|
|
860
913
|
}
|
|
861
|
-
function reportGlobalError(
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
"pending" === chunk.status &&
|
|
914
|
+
function reportGlobalError(weakResponse, error) {
|
|
915
|
+
weakResponse._closed = !0;
|
|
916
|
+
weakResponse._closedReason = error;
|
|
917
|
+
weakResponse._chunks.forEach(function (chunk) {
|
|
918
|
+
"pending" === chunk.status &&
|
|
919
|
+
triggerErrorOnChunk(weakResponse, chunk, error);
|
|
866
920
|
});
|
|
867
921
|
}
|
|
868
922
|
function createLazyChunkWrapper(chunk) {
|
|
@@ -873,11 +927,128 @@ function getChunk(response, id) {
|
|
|
873
927
|
chunk = chunks.get(id);
|
|
874
928
|
chunk ||
|
|
875
929
|
((chunk = response._closed
|
|
876
|
-
? new ReactPromise("rejected", null, response._closedReason
|
|
877
|
-
:
|
|
930
|
+
? new ReactPromise("rejected", null, response._closedReason)
|
|
931
|
+
: new ReactPromise("pending", null, null)),
|
|
878
932
|
chunks.set(id, chunk));
|
|
879
933
|
return chunk;
|
|
880
934
|
}
|
|
935
|
+
function fulfillReference(reference, value) {
|
|
936
|
+
for (
|
|
937
|
+
var response = reference.response,
|
|
938
|
+
handler = reference.handler,
|
|
939
|
+
parentObject = reference.parentObject,
|
|
940
|
+
key = reference.key,
|
|
941
|
+
map = reference.map,
|
|
942
|
+
path = reference.path,
|
|
943
|
+
i = 1;
|
|
944
|
+
i < path.length;
|
|
945
|
+
i++
|
|
946
|
+
) {
|
|
947
|
+
for (
|
|
948
|
+
;
|
|
949
|
+
"object" === typeof value &&
|
|
950
|
+
null !== value &&
|
|
951
|
+
value.$$typeof === REACT_LAZY_TYPE;
|
|
952
|
+
|
|
953
|
+
)
|
|
954
|
+
if (((value = value._payload), value === handler.chunk))
|
|
955
|
+
value = handler.value;
|
|
956
|
+
else {
|
|
957
|
+
switch (value.status) {
|
|
958
|
+
case "resolved_model":
|
|
959
|
+
initializeModelChunk(value);
|
|
960
|
+
break;
|
|
961
|
+
case "resolved_module":
|
|
962
|
+
initializeModuleChunk(value);
|
|
963
|
+
}
|
|
964
|
+
switch (value.status) {
|
|
965
|
+
case "fulfilled":
|
|
966
|
+
value = value.value;
|
|
967
|
+
continue;
|
|
968
|
+
case "blocked":
|
|
969
|
+
var cyclicHandler = resolveBlockedCycle(value, reference);
|
|
970
|
+
if (null !== cyclicHandler) {
|
|
971
|
+
value = cyclicHandler.value;
|
|
972
|
+
continue;
|
|
973
|
+
}
|
|
974
|
+
case "pending":
|
|
975
|
+
path.splice(0, i - 1);
|
|
976
|
+
null === value.value
|
|
977
|
+
? (value.value = [reference])
|
|
978
|
+
: value.value.push(reference);
|
|
979
|
+
null === value.reason
|
|
980
|
+
? (value.reason = [reference])
|
|
981
|
+
: value.reason.push(reference);
|
|
982
|
+
return;
|
|
983
|
+
case "halted":
|
|
984
|
+
return;
|
|
985
|
+
default:
|
|
986
|
+
rejectReference(reference, value.reason);
|
|
987
|
+
return;
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
value = value[path[i]];
|
|
991
|
+
}
|
|
992
|
+
for (
|
|
993
|
+
;
|
|
994
|
+
"object" === typeof value &&
|
|
995
|
+
null !== value &&
|
|
996
|
+
value.$$typeof === REACT_LAZY_TYPE;
|
|
997
|
+
|
|
998
|
+
)
|
|
999
|
+
if (((reference = value._payload), reference === handler.chunk))
|
|
1000
|
+
value = handler.value;
|
|
1001
|
+
else {
|
|
1002
|
+
switch (reference.status) {
|
|
1003
|
+
case "resolved_model":
|
|
1004
|
+
initializeModelChunk(reference);
|
|
1005
|
+
break;
|
|
1006
|
+
case "resolved_module":
|
|
1007
|
+
initializeModuleChunk(reference);
|
|
1008
|
+
}
|
|
1009
|
+
switch (reference.status) {
|
|
1010
|
+
case "fulfilled":
|
|
1011
|
+
value = reference.value;
|
|
1012
|
+
continue;
|
|
1013
|
+
}
|
|
1014
|
+
break;
|
|
1015
|
+
}
|
|
1016
|
+
response = map(response, value, parentObject, key);
|
|
1017
|
+
parentObject[key] = response;
|
|
1018
|
+
"" === key && null === handler.value && (handler.value = response);
|
|
1019
|
+
if (
|
|
1020
|
+
parentObject[0] === REACT_ELEMENT_TYPE &&
|
|
1021
|
+
"object" === typeof handler.value &&
|
|
1022
|
+
null !== handler.value &&
|
|
1023
|
+
handler.value.$$typeof === REACT_ELEMENT_TYPE
|
|
1024
|
+
)
|
|
1025
|
+
switch (((parentObject = handler.value), key)) {
|
|
1026
|
+
case "3":
|
|
1027
|
+
parentObject.props = response;
|
|
1028
|
+
}
|
|
1029
|
+
handler.deps--;
|
|
1030
|
+
0 === handler.deps &&
|
|
1031
|
+
((key = handler.chunk),
|
|
1032
|
+
null !== key &&
|
|
1033
|
+
"blocked" === key.status &&
|
|
1034
|
+
((parentObject = key.value),
|
|
1035
|
+
(key.status = "fulfilled"),
|
|
1036
|
+
(key.value = handler.value),
|
|
1037
|
+
(key.reason = handler.reason),
|
|
1038
|
+
null !== parentObject && wakeChunk(parentObject, handler.value)));
|
|
1039
|
+
}
|
|
1040
|
+
function rejectReference(reference, error) {
|
|
1041
|
+
var handler = reference.handler;
|
|
1042
|
+
reference = reference.response;
|
|
1043
|
+
handler.errored ||
|
|
1044
|
+
((handler.errored = !0),
|
|
1045
|
+
(handler.value = null),
|
|
1046
|
+
(handler.reason = error),
|
|
1047
|
+
(handler = handler.chunk),
|
|
1048
|
+
null !== handler &&
|
|
1049
|
+
"blocked" === handler.status &&
|
|
1050
|
+
triggerErrorOnChunk(reference, handler, error));
|
|
1051
|
+
}
|
|
881
1052
|
function waitForReference(
|
|
882
1053
|
referencedChunk,
|
|
883
1054
|
parentObject,
|
|
@@ -886,52 +1057,6 @@ function waitForReference(
|
|
|
886
1057
|
map,
|
|
887
1058
|
path
|
|
888
1059
|
) {
|
|
889
|
-
function fulfill(value) {
|
|
890
|
-
for (var i = 1; i < path.length; i++) {
|
|
891
|
-
for (; value.$$typeof === REACT_LAZY_TYPE; )
|
|
892
|
-
if (((value = value._payload), value === handler.chunk))
|
|
893
|
-
value = handler.value;
|
|
894
|
-
else if ("fulfilled" === value.status) value = value.value;
|
|
895
|
-
else {
|
|
896
|
-
path.splice(0, i - 1);
|
|
897
|
-
value.then(fulfill, reject);
|
|
898
|
-
return;
|
|
899
|
-
}
|
|
900
|
-
value = value[path[i]];
|
|
901
|
-
}
|
|
902
|
-
i = map(response, value, parentObject, key);
|
|
903
|
-
parentObject[key] = i;
|
|
904
|
-
"" === key && null === handler.value && (handler.value = i);
|
|
905
|
-
if (
|
|
906
|
-
parentObject[0] === REACT_ELEMENT_TYPE &&
|
|
907
|
-
"object" === typeof handler.value &&
|
|
908
|
-
null !== handler.value &&
|
|
909
|
-
handler.value.$$typeof === REACT_ELEMENT_TYPE
|
|
910
|
-
)
|
|
911
|
-
switch (((value = handler.value), key)) {
|
|
912
|
-
case "3":
|
|
913
|
-
value.props = i;
|
|
914
|
-
}
|
|
915
|
-
handler.deps--;
|
|
916
|
-
0 === handler.deps &&
|
|
917
|
-
((i = handler.chunk),
|
|
918
|
-
null !== i &&
|
|
919
|
-
"blocked" === i.status &&
|
|
920
|
-
((value = i.value),
|
|
921
|
-
(i.status = "fulfilled"),
|
|
922
|
-
(i.value = handler.value),
|
|
923
|
-
null !== value && wakeChunk(value, handler.value)));
|
|
924
|
-
}
|
|
925
|
-
function reject(error) {
|
|
926
|
-
if (!handler.errored) {
|
|
927
|
-
handler.errored = !0;
|
|
928
|
-
handler.value = error;
|
|
929
|
-
var chunk = handler.chunk;
|
|
930
|
-
null !== chunk &&
|
|
931
|
-
"blocked" === chunk.status &&
|
|
932
|
-
triggerErrorOnChunk(chunk, error);
|
|
933
|
-
}
|
|
934
|
-
}
|
|
935
1060
|
if (initializingHandler) {
|
|
936
1061
|
var handler = initializingHandler;
|
|
937
1062
|
handler.deps++;
|
|
@@ -940,10 +1065,24 @@ function waitForReference(
|
|
|
940
1065
|
parent: null,
|
|
941
1066
|
chunk: null,
|
|
942
1067
|
value: null,
|
|
1068
|
+
reason: null,
|
|
943
1069
|
deps: 1,
|
|
944
1070
|
errored: !1
|
|
945
1071
|
};
|
|
946
|
-
|
|
1072
|
+
parentObject = {
|
|
1073
|
+
response: response,
|
|
1074
|
+
handler: handler,
|
|
1075
|
+
parentObject: parentObject,
|
|
1076
|
+
key: key,
|
|
1077
|
+
map: map,
|
|
1078
|
+
path: path
|
|
1079
|
+
};
|
|
1080
|
+
null === referencedChunk.value
|
|
1081
|
+
? (referencedChunk.value = [parentObject])
|
|
1082
|
+
: referencedChunk.value.push(parentObject);
|
|
1083
|
+
null === referencedChunk.reason
|
|
1084
|
+
? (referencedChunk.reason = [parentObject])
|
|
1085
|
+
: referencedChunk.reason.push(parentObject);
|
|
947
1086
|
return null;
|
|
948
1087
|
}
|
|
949
1088
|
function loadServerReference(response, metaData, parentObject, key) {
|
|
@@ -980,6 +1119,7 @@ function loadServerReference(response, metaData, parentObject, key) {
|
|
|
980
1119
|
parent: null,
|
|
981
1120
|
chunk: null,
|
|
982
1121
|
value: null,
|
|
1122
|
+
reason: null,
|
|
983
1123
|
deps: 1,
|
|
984
1124
|
errored: !1
|
|
985
1125
|
};
|
|
@@ -1022,11 +1162,12 @@ function loadServerReference(response, metaData, parentObject, key) {
|
|
|
1022
1162
|
function (error) {
|
|
1023
1163
|
if (!handler.errored) {
|
|
1024
1164
|
handler.errored = !0;
|
|
1025
|
-
handler.value =
|
|
1165
|
+
handler.value = null;
|
|
1166
|
+
handler.reason = error;
|
|
1026
1167
|
var chunk = handler.chunk;
|
|
1027
1168
|
null !== chunk &&
|
|
1028
1169
|
"blocked" === chunk.status &&
|
|
1029
|
-
triggerErrorOnChunk(chunk, error);
|
|
1170
|
+
triggerErrorOnChunk(response, chunk, error);
|
|
1030
1171
|
}
|
|
1031
1172
|
}
|
|
1032
1173
|
);
|
|
@@ -1045,35 +1186,122 @@ function getOutlinedModel(response, reference, parentObject, key, map) {
|
|
|
1045
1186
|
}
|
|
1046
1187
|
switch (id.status) {
|
|
1047
1188
|
case "fulfilled":
|
|
1048
|
-
|
|
1049
|
-
for (
|
|
1050
|
-
for (
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1189
|
+
id = id.value;
|
|
1190
|
+
for (var i = 1; i < reference.length; i++) {
|
|
1191
|
+
for (
|
|
1192
|
+
;
|
|
1193
|
+
"object" === typeof id &&
|
|
1194
|
+
null !== id &&
|
|
1195
|
+
id.$$typeof === REACT_LAZY_TYPE;
|
|
1196
|
+
|
|
1197
|
+
) {
|
|
1198
|
+
id = id._payload;
|
|
1199
|
+
switch (id.status) {
|
|
1200
|
+
case "resolved_model":
|
|
1201
|
+
initializeModelChunk(id);
|
|
1202
|
+
break;
|
|
1203
|
+
case "resolved_module":
|
|
1204
|
+
initializeModuleChunk(id);
|
|
1205
|
+
}
|
|
1206
|
+
switch (id.status) {
|
|
1207
|
+
case "fulfilled":
|
|
1208
|
+
id = id.value;
|
|
1209
|
+
break;
|
|
1210
|
+
case "blocked":
|
|
1211
|
+
case "pending":
|
|
1212
|
+
return waitForReference(
|
|
1213
|
+
id,
|
|
1214
|
+
parentObject,
|
|
1215
|
+
key,
|
|
1216
|
+
response,
|
|
1217
|
+
map,
|
|
1218
|
+
reference.slice(i - 1)
|
|
1219
|
+
);
|
|
1220
|
+
case "halted":
|
|
1221
|
+
return (
|
|
1222
|
+
initializingHandler
|
|
1223
|
+
? ((response = initializingHandler), response.deps++)
|
|
1224
|
+
: (initializingHandler = {
|
|
1225
|
+
parent: null,
|
|
1226
|
+
chunk: null,
|
|
1227
|
+
value: null,
|
|
1228
|
+
reason: null,
|
|
1229
|
+
deps: 1,
|
|
1230
|
+
errored: !1
|
|
1231
|
+
}),
|
|
1232
|
+
null
|
|
1233
|
+
);
|
|
1234
|
+
default:
|
|
1235
|
+
return (
|
|
1236
|
+
initializingHandler
|
|
1237
|
+
? ((initializingHandler.errored = !0),
|
|
1238
|
+
(initializingHandler.value = null),
|
|
1239
|
+
(initializingHandler.reason = id.reason))
|
|
1240
|
+
: (initializingHandler = {
|
|
1241
|
+
parent: null,
|
|
1242
|
+
chunk: null,
|
|
1243
|
+
value: null,
|
|
1244
|
+
reason: id.reason,
|
|
1245
|
+
deps: 0,
|
|
1246
|
+
errored: !0
|
|
1247
|
+
}),
|
|
1248
|
+
null
|
|
1249
|
+
);
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
id = id[reference[i]];
|
|
1253
|
+
}
|
|
1254
|
+
for (
|
|
1255
|
+
;
|
|
1256
|
+
"object" === typeof id &&
|
|
1257
|
+
null !== id &&
|
|
1258
|
+
id.$$typeof === REACT_LAZY_TYPE;
|
|
1259
|
+
|
|
1260
|
+
) {
|
|
1261
|
+
reference = id._payload;
|
|
1262
|
+
switch (reference.status) {
|
|
1263
|
+
case "resolved_model":
|
|
1264
|
+
initializeModelChunk(reference);
|
|
1265
|
+
break;
|
|
1266
|
+
case "resolved_module":
|
|
1267
|
+
initializeModuleChunk(reference);
|
|
1268
|
+
}
|
|
1269
|
+
switch (reference.status) {
|
|
1270
|
+
case "fulfilled":
|
|
1271
|
+
id = reference.value;
|
|
1272
|
+
continue;
|
|
1273
|
+
}
|
|
1274
|
+
break;
|
|
1063
1275
|
}
|
|
1064
|
-
return map(response,
|
|
1276
|
+
return map(response, id, parentObject, key);
|
|
1065
1277
|
case "pending":
|
|
1066
1278
|
case "blocked":
|
|
1067
1279
|
return waitForReference(id, parentObject, key, response, map, reference);
|
|
1280
|
+
case "halted":
|
|
1281
|
+
return (
|
|
1282
|
+
initializingHandler
|
|
1283
|
+
? ((response = initializingHandler), response.deps++)
|
|
1284
|
+
: (initializingHandler = {
|
|
1285
|
+
parent: null,
|
|
1286
|
+
chunk: null,
|
|
1287
|
+
value: null,
|
|
1288
|
+
reason: null,
|
|
1289
|
+
deps: 1,
|
|
1290
|
+
errored: !1
|
|
1291
|
+
}),
|
|
1292
|
+
null
|
|
1293
|
+
);
|
|
1068
1294
|
default:
|
|
1069
1295
|
return (
|
|
1070
1296
|
initializingHandler
|
|
1071
1297
|
? ((initializingHandler.errored = !0),
|
|
1072
|
-
(initializingHandler.value =
|
|
1298
|
+
(initializingHandler.value = null),
|
|
1299
|
+
(initializingHandler.reason = id.reason))
|
|
1073
1300
|
: (initializingHandler = {
|
|
1074
1301
|
parent: null,
|
|
1075
1302
|
chunk: null,
|
|
1076
|
-
value:
|
|
1303
|
+
value: null,
|
|
1304
|
+
reason: id.reason,
|
|
1077
1305
|
deps: 0,
|
|
1078
1306
|
errored: !0
|
|
1079
1307
|
}),
|
|
@@ -1112,6 +1340,7 @@ function parseModelString(response, parentObject, key, value) {
|
|
|
1112
1340
|
parent: initializingHandler,
|
|
1113
1341
|
chunk: null,
|
|
1114
1342
|
value: null,
|
|
1343
|
+
reason: null,
|
|
1115
1344
|
deps: 0,
|
|
1116
1345
|
errored: !1
|
|
1117
1346
|
}),
|
|
@@ -1127,9 +1356,10 @@ function parseModelString(response, parentObject, key, value) {
|
|
|
1127
1356
|
createLazyChunkWrapper(response)
|
|
1128
1357
|
);
|
|
1129
1358
|
case "@":
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1359
|
+
return (
|
|
1360
|
+
(parentObject = parseInt(value.slice(2), 16)),
|
|
1361
|
+
getChunk(response, parentObject)
|
|
1362
|
+
);
|
|
1133
1363
|
case "S":
|
|
1134
1364
|
return Symbol.for(value.slice(2));
|
|
1135
1365
|
case "F":
|
|
@@ -1223,19 +1453,21 @@ function ResponseInstance(
|
|
|
1223
1453
|
this._chunks = chunks;
|
|
1224
1454
|
this._stringDecoder = new util.TextDecoder();
|
|
1225
1455
|
this._fromJSON = null;
|
|
1226
|
-
this._rowLength = this._rowTag = this._rowID = this._rowState = 0;
|
|
1227
|
-
this._buffer = [];
|
|
1228
1456
|
this._closed = !1;
|
|
1229
1457
|
this._closedReason = null;
|
|
1230
1458
|
this._tempRefs = temporaryReferences;
|
|
1231
1459
|
this._fromJSON = createFromJSONCallback(this);
|
|
1232
1460
|
}
|
|
1461
|
+
function createStreamState() {
|
|
1462
|
+
return { _rowState: 0, _rowID: 0, _rowTag: 0, _rowLength: 0, _buffer: [] };
|
|
1463
|
+
}
|
|
1233
1464
|
function resolveBuffer(response, id, buffer) {
|
|
1234
|
-
|
|
1235
|
-
|
|
1465
|
+
response = response._chunks;
|
|
1466
|
+
var chunk = response.get(id);
|
|
1236
1467
|
chunk && "pending" !== chunk.status
|
|
1237
1468
|
? chunk.reason.enqueueValue(buffer)
|
|
1238
|
-
:
|
|
1469
|
+
: ((buffer = new ReactPromise("fulfilled", buffer, null)),
|
|
1470
|
+
response.set(id, buffer));
|
|
1239
1471
|
}
|
|
1240
1472
|
function resolveModule(response, id, model) {
|
|
1241
1473
|
var chunks = response._chunks,
|
|
@@ -1252,38 +1484,34 @@ function resolveModule(response, id, model) {
|
|
|
1252
1484
|
var blockedChunk = chunk;
|
|
1253
1485
|
blockedChunk.status = "blocked";
|
|
1254
1486
|
} else
|
|
1255
|
-
(blockedChunk = new ReactPromise("blocked", null, null
|
|
1487
|
+
(blockedChunk = new ReactPromise("blocked", null, null)),
|
|
1256
1488
|
chunks.set(id, blockedChunk);
|
|
1257
1489
|
model.then(
|
|
1258
1490
|
function () {
|
|
1259
|
-
return resolveModuleChunk(blockedChunk, clientReference);
|
|
1491
|
+
return resolveModuleChunk(response, blockedChunk, clientReference);
|
|
1260
1492
|
},
|
|
1261
1493
|
function (error) {
|
|
1262
|
-
return triggerErrorOnChunk(blockedChunk, error);
|
|
1494
|
+
return triggerErrorOnChunk(response, blockedChunk, error);
|
|
1263
1495
|
}
|
|
1264
1496
|
);
|
|
1265
1497
|
} else
|
|
1266
1498
|
chunk
|
|
1267
|
-
? resolveModuleChunk(chunk, clientReference)
|
|
1268
|
-
:
|
|
1269
|
-
|
|
1270
|
-
new ReactPromise("resolved_module", clientReference, null, response)
|
|
1271
|
-
);
|
|
1499
|
+
? resolveModuleChunk(response, chunk, clientReference)
|
|
1500
|
+
: ((chunk = new ReactPromise("resolved_module", clientReference, null)),
|
|
1501
|
+
chunks.set(id, chunk));
|
|
1272
1502
|
}
|
|
1273
1503
|
function resolveStream(response, id, stream, controller) {
|
|
1274
|
-
|
|
1275
|
-
|
|
1504
|
+
response = response._chunks;
|
|
1505
|
+
var chunk = response.get(id);
|
|
1276
1506
|
chunk
|
|
1277
1507
|
? "pending" === chunk.status &&
|
|
1278
|
-
((
|
|
1508
|
+
((id = chunk.value),
|
|
1279
1509
|
(chunk.status = "fulfilled"),
|
|
1280
1510
|
(chunk.value = stream),
|
|
1281
1511
|
(chunk.reason = controller),
|
|
1282
|
-
null !==
|
|
1283
|
-
:
|
|
1284
|
-
|
|
1285
|
-
new ReactPromise("fulfilled", stream, controller, response)
|
|
1286
|
-
);
|
|
1512
|
+
null !== id && wakeChunk(id, chunk.value))
|
|
1513
|
+
: ((stream = new ReactPromise("fulfilled", stream, controller)),
|
|
1514
|
+
response.set(id, stream));
|
|
1287
1515
|
}
|
|
1288
1516
|
function startReadableStream(response, id, type) {
|
|
1289
1517
|
var controller = null;
|
|
@@ -1304,7 +1532,7 @@ function startReadableStream(response, id, type) {
|
|
|
1304
1532
|
},
|
|
1305
1533
|
enqueueModel: function (json) {
|
|
1306
1534
|
if (null === previousBlockedChunk) {
|
|
1307
|
-
var chunk = new ReactPromise("resolved_model", json,
|
|
1535
|
+
var chunk = new ReactPromise("resolved_model", json, response);
|
|
1308
1536
|
initializeModelChunk(chunk);
|
|
1309
1537
|
"fulfilled" === chunk.status
|
|
1310
1538
|
? controller.enqueue(chunk.value)
|
|
@@ -1319,8 +1547,8 @@ function startReadableStream(response, id, type) {
|
|
|
1319
1547
|
(previousBlockedChunk = chunk));
|
|
1320
1548
|
} else {
|
|
1321
1549
|
chunk = previousBlockedChunk;
|
|
1322
|
-
var chunk$
|
|
1323
|
-
chunk$
|
|
1550
|
+
var chunk$54 = new ReactPromise("pending", null, null);
|
|
1551
|
+
chunk$54.then(
|
|
1324
1552
|
function (v) {
|
|
1325
1553
|
return controller.enqueue(v);
|
|
1326
1554
|
},
|
|
@@ -1328,10 +1556,10 @@ function startReadableStream(response, id, type) {
|
|
|
1328
1556
|
return controller.error(e);
|
|
1329
1557
|
}
|
|
1330
1558
|
);
|
|
1331
|
-
previousBlockedChunk = chunk$
|
|
1559
|
+
previousBlockedChunk = chunk$54;
|
|
1332
1560
|
chunk.then(function () {
|
|
1333
|
-
previousBlockedChunk === chunk$
|
|
1334
|
-
resolveModelChunk(chunk$
|
|
1561
|
+
previousBlockedChunk === chunk$54 && (previousBlockedChunk = null);
|
|
1562
|
+
resolveModelChunk(response, chunk$54, json);
|
|
1335
1563
|
});
|
|
1336
1564
|
}
|
|
1337
1565
|
},
|
|
@@ -1369,41 +1597,37 @@ function startAsyncIterable(response, id, iterator) {
|
|
|
1369
1597
|
var buffer = [],
|
|
1370
1598
|
closed = !1,
|
|
1371
1599
|
nextWriteIndex = 0,
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1600
|
+
iterable = {};
|
|
1601
|
+
iterable[ASYNC_ITERATOR] = function () {
|
|
1602
|
+
var nextReadIndex = 0;
|
|
1603
|
+
return createIterator(function (arg) {
|
|
1604
|
+
if (void 0 !== arg)
|
|
1605
|
+
throw Error(
|
|
1606
|
+
"Values cannot be passed to next() of AsyncIterables passed to Client Components."
|
|
1607
|
+
);
|
|
1608
|
+
if (nextReadIndex === buffer.length) {
|
|
1609
|
+
if (closed)
|
|
1610
|
+
return new ReactPromise(
|
|
1611
|
+
"fulfilled",
|
|
1612
|
+
{ done: !0, value: void 0 },
|
|
1613
|
+
null
|
|
1380
1614
|
);
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
null,
|
|
1387
|
-
response
|
|
1388
|
-
);
|
|
1389
|
-
buffer[nextReadIndex] = createPendingChunk(response);
|
|
1390
|
-
}
|
|
1391
|
-
return buffer[nextReadIndex++];
|
|
1392
|
-
});
|
|
1393
|
-
}),
|
|
1394
|
-
$jscomp$compprop0);
|
|
1615
|
+
buffer[nextReadIndex] = new ReactPromise("pending", null, null);
|
|
1616
|
+
}
|
|
1617
|
+
return buffer[nextReadIndex++];
|
|
1618
|
+
});
|
|
1619
|
+
};
|
|
1395
1620
|
resolveStream(
|
|
1396
1621
|
response,
|
|
1397
1622
|
id,
|
|
1398
|
-
iterator ?
|
|
1623
|
+
iterator ? iterable[ASYNC_ITERATOR]() : iterable,
|
|
1399
1624
|
{
|
|
1400
1625
|
enqueueValue: function (value) {
|
|
1401
1626
|
if (nextWriteIndex === buffer.length)
|
|
1402
1627
|
buffer[nextWriteIndex] = new ReactPromise(
|
|
1403
1628
|
"fulfilled",
|
|
1404
1629
|
{ done: !1, value: value },
|
|
1405
|
-
null
|
|
1406
|
-
response
|
|
1630
|
+
null
|
|
1407
1631
|
);
|
|
1408
1632
|
else {
|
|
1409
1633
|
var chunk = buffer[nextWriteIndex],
|
|
@@ -1423,7 +1647,12 @@ function startAsyncIterable(response, id, iterator) {
|
|
|
1423
1647
|
value,
|
|
1424
1648
|
!1
|
|
1425
1649
|
))
|
|
1426
|
-
: resolveIteratorResultChunk(
|
|
1650
|
+
: resolveIteratorResultChunk(
|
|
1651
|
+
response,
|
|
1652
|
+
buffer[nextWriteIndex],
|
|
1653
|
+
value,
|
|
1654
|
+
!1
|
|
1655
|
+
);
|
|
1427
1656
|
nextWriteIndex++;
|
|
1428
1657
|
},
|
|
1429
1658
|
close: function (value) {
|
|
@@ -1434,9 +1663,15 @@ function startAsyncIterable(response, id, iterator) {
|
|
|
1434
1663
|
value,
|
|
1435
1664
|
!0
|
|
1436
1665
|
))
|
|
1437
|
-
: resolveIteratorResultChunk(
|
|
1666
|
+
: resolveIteratorResultChunk(
|
|
1667
|
+
response,
|
|
1668
|
+
buffer[nextWriteIndex],
|
|
1669
|
+
value,
|
|
1670
|
+
!0
|
|
1671
|
+
);
|
|
1438
1672
|
for (nextWriteIndex++; nextWriteIndex < buffer.length; )
|
|
1439
1673
|
resolveIteratorResultChunk(
|
|
1674
|
+
response,
|
|
1440
1675
|
buffer[nextWriteIndex++],
|
|
1441
1676
|
'"$undefined"',
|
|
1442
1677
|
!0
|
|
@@ -1446,11 +1681,11 @@ function startAsyncIterable(response, id, iterator) {
|
|
|
1446
1681
|
closed = !0;
|
|
1447
1682
|
for (
|
|
1448
1683
|
nextWriteIndex === buffer.length &&
|
|
1449
|
-
(buffer[nextWriteIndex] =
|
|
1684
|
+
(buffer[nextWriteIndex] = new ReactPromise("pending", null, null));
|
|
1450
1685
|
nextWriteIndex < buffer.length;
|
|
1451
1686
|
|
|
1452
1687
|
)
|
|
1453
|
-
triggerErrorOnChunk(buffer[nextWriteIndex++], error);
|
|
1688
|
+
triggerErrorOnChunk(response, buffer[nextWriteIndex++], error);
|
|
1454
1689
|
}
|
|
1455
1690
|
}
|
|
1456
1691
|
);
|
|
@@ -1466,8 +1701,8 @@ function mergeBuffer(buffer, lastChunk) {
|
|
|
1466
1701
|
for (var l = buffer.length, byteLength = lastChunk.length, i = 0; i < l; i++)
|
|
1467
1702
|
byteLength += buffer[i].byteLength;
|
|
1468
1703
|
byteLength = new Uint8Array(byteLength);
|
|
1469
|
-
for (var i$
|
|
1470
|
-
var chunk = buffer[i$
|
|
1704
|
+
for (var i$55 = (i = 0); i$55 < l; i$55++) {
|
|
1705
|
+
var chunk = buffer[i$55];
|
|
1471
1706
|
byteLength.set(chunk, i);
|
|
1472
1707
|
i += chunk.byteLength;
|
|
1473
1708
|
}
|
|
@@ -1493,7 +1728,7 @@ function resolveTypedArray(
|
|
|
1493
1728
|
);
|
|
1494
1729
|
resolveBuffer(response, id, constructor);
|
|
1495
1730
|
}
|
|
1496
|
-
function processFullBinaryRow(response, id, tag, buffer, chunk) {
|
|
1731
|
+
function processFullBinaryRow(response, streamState, id, tag, buffer, chunk) {
|
|
1497
1732
|
switch (tag) {
|
|
1498
1733
|
case 65:
|
|
1499
1734
|
resolveBuffer(response, id, mergeBuffer(buffer, chunk).buffer);
|
|
@@ -1546,9 +1781,9 @@ function processFullBinaryRow(response, id, tag, buffer, chunk) {
|
|
|
1546
1781
|
)
|
|
1547
1782
|
row += stringDecoder.decode(buffer[i], decoderOptions);
|
|
1548
1783
|
row += stringDecoder.decode(chunk);
|
|
1549
|
-
processFullStringRow(response, id, tag, row);
|
|
1784
|
+
processFullStringRow(response, streamState, id, tag, row);
|
|
1550
1785
|
}
|
|
1551
|
-
function processFullStringRow(response, id, tag, row) {
|
|
1786
|
+
function processFullStringRow(response, streamState, id, tag, row) {
|
|
1552
1787
|
switch (tag) {
|
|
1553
1788
|
case 73:
|
|
1554
1789
|
resolveModule(response, id, row);
|
|
@@ -1569,8 +1804,10 @@ function processFullStringRow(response, id, tag, row) {
|
|
|
1569
1804
|
break;
|
|
1570
1805
|
case "L":
|
|
1571
1806
|
id = response[0];
|
|
1572
|
-
|
|
1573
|
-
3 === response.length
|
|
1807
|
+
streamState = response[1];
|
|
1808
|
+
3 === response.length
|
|
1809
|
+
? row.L(id, streamState, response[2])
|
|
1810
|
+
: row.L(id, streamState);
|
|
1574
1811
|
break;
|
|
1575
1812
|
case "m":
|
|
1576
1813
|
"string" === typeof response
|
|
@@ -1598,23 +1835,26 @@ function processFullStringRow(response, id, tag, row) {
|
|
|
1598
1835
|
}
|
|
1599
1836
|
break;
|
|
1600
1837
|
case 69:
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
row
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
? triggerErrorOnChunk(
|
|
1608
|
-
:
|
|
1838
|
+
streamState = response._chunks;
|
|
1839
|
+
tag = streamState.get(id);
|
|
1840
|
+
row = JSON.parse(row);
|
|
1841
|
+
var error = resolveErrorProd();
|
|
1842
|
+
error.digest = row.digest;
|
|
1843
|
+
tag
|
|
1844
|
+
? triggerErrorOnChunk(response, tag, error)
|
|
1845
|
+
: ((response = new ReactPromise("rejected", null, error)),
|
|
1846
|
+
streamState.set(id, response));
|
|
1609
1847
|
break;
|
|
1610
1848
|
case 84:
|
|
1611
|
-
|
|
1612
|
-
(
|
|
1613
|
-
?
|
|
1614
|
-
:
|
|
1849
|
+
response = response._chunks;
|
|
1850
|
+
(streamState = response.get(id)) && "pending" !== streamState.status
|
|
1851
|
+
? streamState.reason.enqueueValue(row)
|
|
1852
|
+
: ((row = new ReactPromise("fulfilled", row, null)),
|
|
1853
|
+
response.set(id, row));
|
|
1615
1854
|
break;
|
|
1616
1855
|
case 78:
|
|
1617
1856
|
case 68:
|
|
1857
|
+
case 74:
|
|
1618
1858
|
case 87:
|
|
1619
1859
|
throw Error(
|
|
1620
1860
|
"Failed to read a RSC payload created by a development version of React on the server while using a production version on the client. Always use matching versions on the server and the client."
|
|
@@ -1632,19 +1872,102 @@ function processFullStringRow(response, id, tag, row) {
|
|
|
1632
1872
|
startAsyncIterable(response, id, !0);
|
|
1633
1873
|
break;
|
|
1634
1874
|
case 67:
|
|
1635
|
-
(
|
|
1636
|
-
"fulfilled" ===
|
|
1637
|
-
|
|
1875
|
+
(id = response._chunks.get(id)) &&
|
|
1876
|
+
"fulfilled" === id.status &&
|
|
1877
|
+
id.reason.close("" === row ? '"$undefined"' : row);
|
|
1638
1878
|
break;
|
|
1639
1879
|
default:
|
|
1640
|
-
(
|
|
1641
|
-
(
|
|
1642
|
-
? resolveModelChunk(
|
|
1643
|
-
:
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1880
|
+
(streamState = response._chunks),
|
|
1881
|
+
(tag = streamState.get(id))
|
|
1882
|
+
? resolveModelChunk(response, tag, row)
|
|
1883
|
+
: ((response = new ReactPromise("resolved_model", row, response)),
|
|
1884
|
+
streamState.set(id, response));
|
|
1885
|
+
}
|
|
1886
|
+
}
|
|
1887
|
+
function processBinaryChunk(weakResponse, streamState, chunk) {
|
|
1888
|
+
for (
|
|
1889
|
+
var i = 0,
|
|
1890
|
+
rowState = streamState._rowState,
|
|
1891
|
+
rowID = streamState._rowID,
|
|
1892
|
+
rowTag = streamState._rowTag,
|
|
1893
|
+
rowLength = streamState._rowLength,
|
|
1894
|
+
buffer = streamState._buffer,
|
|
1895
|
+
chunkLength = chunk.length;
|
|
1896
|
+
i < chunkLength;
|
|
1897
|
+
|
|
1898
|
+
) {
|
|
1899
|
+
var lastIdx = -1;
|
|
1900
|
+
switch (rowState) {
|
|
1901
|
+
case 0:
|
|
1902
|
+
lastIdx = chunk[i++];
|
|
1903
|
+
58 === lastIdx
|
|
1904
|
+
? (rowState = 1)
|
|
1905
|
+
: (rowID =
|
|
1906
|
+
(rowID << 4) | (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
|
|
1907
|
+
continue;
|
|
1908
|
+
case 1:
|
|
1909
|
+
rowState = chunk[i];
|
|
1910
|
+
84 === rowState ||
|
|
1911
|
+
65 === rowState ||
|
|
1912
|
+
79 === rowState ||
|
|
1913
|
+
111 === rowState ||
|
|
1914
|
+
85 === rowState ||
|
|
1915
|
+
83 === rowState ||
|
|
1916
|
+
115 === rowState ||
|
|
1917
|
+
76 === rowState ||
|
|
1918
|
+
108 === rowState ||
|
|
1919
|
+
71 === rowState ||
|
|
1920
|
+
103 === rowState ||
|
|
1921
|
+
77 === rowState ||
|
|
1922
|
+
109 === rowState ||
|
|
1923
|
+
86 === rowState
|
|
1924
|
+
? ((rowTag = rowState), (rowState = 2), i++)
|
|
1925
|
+
: (64 < rowState && 91 > rowState) ||
|
|
1926
|
+
35 === rowState ||
|
|
1927
|
+
114 === rowState ||
|
|
1928
|
+
120 === rowState
|
|
1929
|
+
? ((rowTag = rowState), (rowState = 3), i++)
|
|
1930
|
+
: ((rowTag = 0), (rowState = 3));
|
|
1931
|
+
continue;
|
|
1932
|
+
case 2:
|
|
1933
|
+
lastIdx = chunk[i++];
|
|
1934
|
+
44 === lastIdx
|
|
1935
|
+
? (rowState = 4)
|
|
1936
|
+
: (rowLength =
|
|
1937
|
+
(rowLength << 4) | (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
|
|
1938
|
+
continue;
|
|
1939
|
+
case 3:
|
|
1940
|
+
lastIdx = chunk.indexOf(10, i);
|
|
1941
|
+
break;
|
|
1942
|
+
case 4:
|
|
1943
|
+
(lastIdx = i + rowLength), lastIdx > chunk.length && (lastIdx = -1);
|
|
1944
|
+
}
|
|
1945
|
+
var offset = chunk.byteOffset + i;
|
|
1946
|
+
if (-1 < lastIdx)
|
|
1947
|
+
(rowLength = new Uint8Array(chunk.buffer, offset, lastIdx - i)),
|
|
1948
|
+
processFullBinaryRow(
|
|
1949
|
+
weakResponse,
|
|
1950
|
+
streamState,
|
|
1951
|
+
rowID,
|
|
1952
|
+
rowTag,
|
|
1953
|
+
buffer,
|
|
1954
|
+
rowLength
|
|
1955
|
+
),
|
|
1956
|
+
(i = lastIdx),
|
|
1957
|
+
3 === rowState && i++,
|
|
1958
|
+
(rowLength = rowID = rowTag = rowState = 0),
|
|
1959
|
+
(buffer.length = 0);
|
|
1960
|
+
else {
|
|
1961
|
+
weakResponse = new Uint8Array(chunk.buffer, offset, chunk.byteLength - i);
|
|
1962
|
+
buffer.push(weakResponse);
|
|
1963
|
+
rowLength -= weakResponse.byteLength;
|
|
1964
|
+
break;
|
|
1965
|
+
}
|
|
1647
1966
|
}
|
|
1967
|
+
streamState._rowState = rowState;
|
|
1968
|
+
streamState._rowID = rowID;
|
|
1969
|
+
streamState._rowTag = rowTag;
|
|
1970
|
+
streamState._rowLength = rowLength;
|
|
1648
1971
|
}
|
|
1649
1972
|
function createFromJSONCallback(response) {
|
|
1650
1973
|
return function (key, value) {
|
|
@@ -1667,15 +1990,10 @@ function createFromJSONCallback(response) {
|
|
|
1667
1990
|
(initializingHandler = value.parent),
|
|
1668
1991
|
value.errored)
|
|
1669
1992
|
)
|
|
1670
|
-
(key = new ReactPromise("rejected", null, value.
|
|
1993
|
+
(key = new ReactPromise("rejected", null, value.reason)),
|
|
1671
1994
|
(key = createLazyChunkWrapper(key));
|
|
1672
1995
|
else if (0 < value.deps) {
|
|
1673
|
-
var blockedChunk = new ReactPromise(
|
|
1674
|
-
"blocked",
|
|
1675
|
-
null,
|
|
1676
|
-
null,
|
|
1677
|
-
response
|
|
1678
|
-
);
|
|
1996
|
+
var blockedChunk = new ReactPromise("blocked", null, null);
|
|
1679
1997
|
value.value = key;
|
|
1680
1998
|
value.chunk = blockedChunk;
|
|
1681
1999
|
key = createLazyChunkWrapper(blockedChunk);
|
|
@@ -1686,34 +2004,57 @@ function createFromJSONCallback(response) {
|
|
|
1686
2004
|
return value;
|
|
1687
2005
|
};
|
|
1688
2006
|
}
|
|
1689
|
-
function
|
|
2007
|
+
function close(weakResponse) {
|
|
2008
|
+
reportGlobalError(weakResponse, Error("Connection closed."));
|
|
2009
|
+
}
|
|
2010
|
+
function noServerCall$1() {
|
|
1690
2011
|
throw Error(
|
|
1691
2012
|
"Server Functions cannot be called during initial render. This would create a fetch waterfall. Try to use a Server Component to pass data to Client Components instead."
|
|
1692
2013
|
);
|
|
1693
2014
|
}
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
options && "string" === typeof options.nonce ? options.nonce : void 0,
|
|
1706
|
-
void 0
|
|
2015
|
+
function createResponseFromOptions(options) {
|
|
2016
|
+
return new ResponseInstance(
|
|
2017
|
+
options.serverConsumerManifest.moduleMap,
|
|
2018
|
+
options.serverConsumerManifest.serverModuleMap,
|
|
2019
|
+
options.serverConsumerManifest.moduleLoading,
|
|
2020
|
+
noServerCall$1,
|
|
2021
|
+
options.encodeFormAction,
|
|
2022
|
+
"string" === typeof options.nonce ? options.nonce : void 0,
|
|
2023
|
+
options && options.temporaryReferences
|
|
2024
|
+
? options.temporaryReferences
|
|
2025
|
+
: void 0
|
|
1707
2026
|
);
|
|
2027
|
+
}
|
|
2028
|
+
function startReadingFromStream$1(response, stream, onDone) {
|
|
2029
|
+
function progress(_ref) {
|
|
2030
|
+
var value = _ref.value;
|
|
2031
|
+
if (_ref.done) return onDone();
|
|
2032
|
+
processBinaryChunk(response, streamState, value);
|
|
2033
|
+
return reader.read().then(progress).catch(error);
|
|
2034
|
+
}
|
|
2035
|
+
function error(e) {
|
|
2036
|
+
reportGlobalError(response, e);
|
|
2037
|
+
}
|
|
2038
|
+
var streamState = createStreamState(),
|
|
2039
|
+
reader = stream.getReader();
|
|
2040
|
+
reader.read().then(progress).catch(error);
|
|
2041
|
+
}
|
|
2042
|
+
function noServerCall() {
|
|
2043
|
+
throw Error(
|
|
2044
|
+
"Server Functions cannot be called during initial render. This would create a fetch waterfall. Try to use a Server Component to pass data to Client Components instead."
|
|
2045
|
+
);
|
|
2046
|
+
}
|
|
2047
|
+
function startReadingFromStream(response, stream, onEnd) {
|
|
2048
|
+
var streamState = createStreamState();
|
|
1708
2049
|
stream.on("data", function (chunk) {
|
|
1709
2050
|
if ("string" === typeof chunk) {
|
|
1710
2051
|
for (
|
|
1711
2052
|
var i = 0,
|
|
1712
|
-
rowState =
|
|
1713
|
-
rowID =
|
|
1714
|
-
rowTag =
|
|
1715
|
-
rowLength =
|
|
1716
|
-
buffer =
|
|
2053
|
+
rowState = streamState._rowState,
|
|
2054
|
+
rowID = streamState._rowID,
|
|
2055
|
+
rowTag = streamState._rowTag,
|
|
2056
|
+
rowLength = streamState._rowLength,
|
|
2057
|
+
buffer = streamState._buffer,
|
|
1717
2058
|
chunkLength = chunk.length;
|
|
1718
2059
|
i < chunkLength;
|
|
1719
2060
|
|
|
@@ -1778,7 +2119,7 @@ exports.createFromNodeStream = function (
|
|
|
1778
2119
|
"String chunks need to be passed in their original shape. Not split into smaller string chunks. This is a bug in the wiring of the React streams."
|
|
1779
2120
|
);
|
|
1780
2121
|
i = chunk.slice(i, lastIdx);
|
|
1781
|
-
processFullStringRow(response, rowID, rowTag, i);
|
|
2122
|
+
processFullStringRow(response, streamState, rowID, rowTag, i);
|
|
1782
2123
|
i = lastIdx;
|
|
1783
2124
|
3 === rowState && i++;
|
|
1784
2125
|
rowLength = rowID = rowTag = rowState = 0;
|
|
@@ -1788,105 +2129,84 @@ exports.createFromNodeStream = function (
|
|
|
1788
2129
|
"String chunks need to be passed in their original shape. Not split into smaller string chunks. This is a bug in the wiring of the React streams."
|
|
1789
2130
|
);
|
|
1790
2131
|
}
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
} else
|
|
1796
|
-
rowLength = 0;
|
|
1797
|
-
chunkLength = response._rowState;
|
|
1798
|
-
rowID = response._rowID;
|
|
1799
|
-
i = response._rowTag;
|
|
1800
|
-
rowState = response._rowLength;
|
|
1801
|
-
buffer = response._buffer;
|
|
1802
|
-
for (rowTag = chunk.length; rowLength < rowTag; ) {
|
|
1803
|
-
lastIdx = -1;
|
|
1804
|
-
switch (chunkLength) {
|
|
1805
|
-
case 0:
|
|
1806
|
-
lastIdx = chunk[rowLength++];
|
|
1807
|
-
58 === lastIdx
|
|
1808
|
-
? (chunkLength = 1)
|
|
1809
|
-
: (rowID =
|
|
1810
|
-
(rowID << 4) | (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
|
|
1811
|
-
continue;
|
|
1812
|
-
case 1:
|
|
1813
|
-
chunkLength = chunk[rowLength];
|
|
1814
|
-
84 === chunkLength ||
|
|
1815
|
-
65 === chunkLength ||
|
|
1816
|
-
79 === chunkLength ||
|
|
1817
|
-
111 === chunkLength ||
|
|
1818
|
-
85 === chunkLength ||
|
|
1819
|
-
83 === chunkLength ||
|
|
1820
|
-
115 === chunkLength ||
|
|
1821
|
-
76 === chunkLength ||
|
|
1822
|
-
108 === chunkLength ||
|
|
1823
|
-
71 === chunkLength ||
|
|
1824
|
-
103 === chunkLength ||
|
|
1825
|
-
77 === chunkLength ||
|
|
1826
|
-
109 === chunkLength ||
|
|
1827
|
-
86 === chunkLength
|
|
1828
|
-
? ((i = chunkLength), (chunkLength = 2), rowLength++)
|
|
1829
|
-
: (64 < chunkLength && 91 > chunkLength) ||
|
|
1830
|
-
35 === chunkLength ||
|
|
1831
|
-
114 === chunkLength ||
|
|
1832
|
-
120 === chunkLength
|
|
1833
|
-
? ((i = chunkLength), (chunkLength = 3), rowLength++)
|
|
1834
|
-
: ((i = 0), (chunkLength = 3));
|
|
1835
|
-
continue;
|
|
1836
|
-
case 2:
|
|
1837
|
-
lastIdx = chunk[rowLength++];
|
|
1838
|
-
44 === lastIdx
|
|
1839
|
-
? (chunkLength = 4)
|
|
1840
|
-
: (rowState =
|
|
1841
|
-
(rowState << 4) |
|
|
1842
|
-
(96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
|
|
1843
|
-
continue;
|
|
1844
|
-
case 3:
|
|
1845
|
-
lastIdx = chunk.indexOf(10, rowLength);
|
|
1846
|
-
break;
|
|
1847
|
-
case 4:
|
|
1848
|
-
(lastIdx = rowLength + rowState),
|
|
1849
|
-
lastIdx > chunk.length && (lastIdx = -1);
|
|
1850
|
-
}
|
|
1851
|
-
var offset = chunk.byteOffset + rowLength;
|
|
1852
|
-
if (-1 < lastIdx)
|
|
1853
|
-
(rowState = new Uint8Array(
|
|
1854
|
-
chunk.buffer,
|
|
1855
|
-
offset,
|
|
1856
|
-
lastIdx - rowLength
|
|
1857
|
-
)),
|
|
1858
|
-
processFullBinaryRow(response, rowID, i, buffer, rowState),
|
|
1859
|
-
(rowLength = lastIdx),
|
|
1860
|
-
3 === chunkLength && rowLength++,
|
|
1861
|
-
(rowState = rowID = i = chunkLength = 0),
|
|
1862
|
-
(buffer.length = 0);
|
|
1863
|
-
else {
|
|
1864
|
-
chunk = new Uint8Array(
|
|
1865
|
-
chunk.buffer,
|
|
1866
|
-
offset,
|
|
1867
|
-
chunk.byteLength - rowLength
|
|
1868
|
-
);
|
|
1869
|
-
buffer.push(chunk);
|
|
1870
|
-
rowState -= chunk.byteLength;
|
|
1871
|
-
break;
|
|
1872
|
-
}
|
|
1873
|
-
}
|
|
1874
|
-
response._rowState = chunkLength;
|
|
1875
|
-
response._rowID = rowID;
|
|
1876
|
-
response._rowTag = i;
|
|
1877
|
-
response._rowLength = rowState;
|
|
1878
|
-
}
|
|
2132
|
+
streamState._rowState = rowState;
|
|
2133
|
+
streamState._rowID = rowID;
|
|
2134
|
+
streamState._rowTag = rowTag;
|
|
2135
|
+
streamState._rowLength = rowLength;
|
|
2136
|
+
} else processBinaryChunk(response, streamState, chunk);
|
|
1879
2137
|
});
|
|
1880
2138
|
stream.on("error", function (error) {
|
|
1881
2139
|
reportGlobalError(response, error);
|
|
1882
2140
|
});
|
|
1883
|
-
stream.on("end",
|
|
1884
|
-
|
|
1885
|
-
|
|
2141
|
+
stream.on("end", onEnd);
|
|
2142
|
+
}
|
|
2143
|
+
exports.createFromFetch = function (promiseForResponse, options) {
|
|
2144
|
+
var response = createResponseFromOptions(options);
|
|
2145
|
+
promiseForResponse.then(
|
|
2146
|
+
function (r) {
|
|
2147
|
+
startReadingFromStream$1(response, r.body, close.bind(null, response));
|
|
2148
|
+
},
|
|
2149
|
+
function (e) {
|
|
2150
|
+
reportGlobalError(response, e);
|
|
2151
|
+
}
|
|
2152
|
+
);
|
|
1886
2153
|
return getChunk(response, 0);
|
|
1887
2154
|
};
|
|
2155
|
+
exports.createFromNodeStream = function (
|
|
2156
|
+
stream,
|
|
2157
|
+
serverConsumerManifest,
|
|
2158
|
+
options
|
|
2159
|
+
) {
|
|
2160
|
+
serverConsumerManifest = new ResponseInstance(
|
|
2161
|
+
serverConsumerManifest.moduleMap,
|
|
2162
|
+
serverConsumerManifest.serverModuleMap,
|
|
2163
|
+
serverConsumerManifest.moduleLoading,
|
|
2164
|
+
noServerCall,
|
|
2165
|
+
options ? options.encodeFormAction : void 0,
|
|
2166
|
+
options && "string" === typeof options.nonce ? options.nonce : void 0,
|
|
2167
|
+
void 0
|
|
2168
|
+
);
|
|
2169
|
+
startReadingFromStream(
|
|
2170
|
+
serverConsumerManifest,
|
|
2171
|
+
stream,
|
|
2172
|
+
close.bind(null, serverConsumerManifest)
|
|
2173
|
+
);
|
|
2174
|
+
return getChunk(serverConsumerManifest, 0);
|
|
2175
|
+
};
|
|
2176
|
+
exports.createFromReadableStream = function (stream, options) {
|
|
2177
|
+
options = createResponseFromOptions(options);
|
|
2178
|
+
startReadingFromStream$1(options, stream, close.bind(null, options));
|
|
2179
|
+
return getChunk(options, 0);
|
|
2180
|
+
};
|
|
1888
2181
|
exports.createServerReference = function (id) {
|
|
1889
|
-
return createServerReference$1(id, noServerCall);
|
|
2182
|
+
return createServerReference$1(id, noServerCall$1);
|
|
2183
|
+
};
|
|
2184
|
+
exports.createTemporaryReferenceSet = function () {
|
|
2185
|
+
return new Map();
|
|
2186
|
+
};
|
|
2187
|
+
exports.encodeReply = function (value, options) {
|
|
2188
|
+
return new Promise(function (resolve, reject) {
|
|
2189
|
+
var abort = processReply(
|
|
2190
|
+
value,
|
|
2191
|
+
"",
|
|
2192
|
+
options && options.temporaryReferences
|
|
2193
|
+
? options.temporaryReferences
|
|
2194
|
+
: void 0,
|
|
2195
|
+
resolve,
|
|
2196
|
+
reject
|
|
2197
|
+
);
|
|
2198
|
+
if (options && options.signal) {
|
|
2199
|
+
var signal = options.signal;
|
|
2200
|
+
if (signal.aborted) abort(signal.reason);
|
|
2201
|
+
else {
|
|
2202
|
+
var listener = function () {
|
|
2203
|
+
abort(signal.reason);
|
|
2204
|
+
signal.removeEventListener("abort", listener);
|
|
2205
|
+
};
|
|
2206
|
+
signal.addEventListener("abort", listener);
|
|
2207
|
+
}
|
|
2208
|
+
}
|
|
2209
|
+
});
|
|
1890
2210
|
};
|
|
1891
2211
|
exports.registerServerReference = function (reference, id, encodeFormAction) {
|
|
1892
2212
|
registerBoundServerReference(reference, id, null, encodeFormAction);
|