@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
|
@@ -212,11 +212,11 @@ function processReply(
|
|
|
212
212
|
0 === pendingParts && resolve(data);
|
|
213
213
|
} else
|
|
214
214
|
try {
|
|
215
|
-
var partJSON$
|
|
216
|
-
data.append(formFieldPrefix + streamId, partJSON$
|
|
215
|
+
var partJSON$21 = JSON.stringify(entry.value, resolveToJSON);
|
|
216
|
+
data.append(formFieldPrefix + streamId, partJSON$21);
|
|
217
217
|
iterator.next().then(progress, reject);
|
|
218
|
-
} catch (x$
|
|
219
|
-
reject(x$
|
|
218
|
+
} catch (x$22) {
|
|
219
|
+
reject(x$22);
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
222
|
null === formData && (formData = new FormData());
|
|
@@ -261,20 +261,20 @@ function processReply(
|
|
|
261
261
|
"function" === typeof x.then
|
|
262
262
|
) {
|
|
263
263
|
pendingParts++;
|
|
264
|
-
var lazyId$
|
|
264
|
+
var lazyId$23 = nextPartId++;
|
|
265
265
|
parentReference = function () {
|
|
266
266
|
try {
|
|
267
|
-
var partJSON$
|
|
268
|
-
data$
|
|
269
|
-
data$
|
|
267
|
+
var partJSON$24 = serializeModel(value, lazyId$23),
|
|
268
|
+
data$25 = formData;
|
|
269
|
+
data$25.append(formFieldPrefix + lazyId$23, partJSON$24);
|
|
270
270
|
pendingParts--;
|
|
271
|
-
0 === pendingParts && resolve(data$
|
|
271
|
+
0 === pendingParts && resolve(data$25);
|
|
272
272
|
} catch (reason) {
|
|
273
273
|
reject(reason);
|
|
274
274
|
}
|
|
275
275
|
};
|
|
276
276
|
x.then(parentReference, parentReference);
|
|
277
|
-
return "$" + lazyId$
|
|
277
|
+
return "$" + lazyId$23.toString(16);
|
|
278
278
|
}
|
|
279
279
|
reject(x);
|
|
280
280
|
return null;
|
|
@@ -288,9 +288,9 @@ function processReply(
|
|
|
288
288
|
var promiseId = nextPartId++;
|
|
289
289
|
value.then(function (partValue) {
|
|
290
290
|
try {
|
|
291
|
-
var partJSON$
|
|
291
|
+
var partJSON$27 = serializeModel(partValue, promiseId);
|
|
292
292
|
partValue = formData;
|
|
293
|
-
partValue.append(formFieldPrefix + promiseId, partJSON$
|
|
293
|
+
partValue.append(formFieldPrefix + promiseId, partJSON$27);
|
|
294
294
|
pendingParts--;
|
|
295
295
|
0 === pendingParts && resolve(partValue);
|
|
296
296
|
} catch (reason) {
|
|
@@ -314,11 +314,11 @@ function processReply(
|
|
|
314
314
|
if (isArrayImpl(value)) return value;
|
|
315
315
|
if (value instanceof FormData) {
|
|
316
316
|
null === formData && (formData = new FormData());
|
|
317
|
-
var data$
|
|
317
|
+
var data$31 = formData;
|
|
318
318
|
key = nextPartId++;
|
|
319
319
|
var prefix = formFieldPrefix + key + "_";
|
|
320
320
|
value.forEach(function (originalValue, originalKey) {
|
|
321
|
-
data$
|
|
321
|
+
data$31.append(prefix + originalKey, originalValue);
|
|
322
322
|
});
|
|
323
323
|
return "$K" + key.toString(16);
|
|
324
324
|
}
|
|
@@ -657,11 +657,10 @@ function createServerReference$1(id, callServer, encodeFormAction) {
|
|
|
657
657
|
registerBoundServerReference(action, id, null, encodeFormAction);
|
|
658
658
|
return action;
|
|
659
659
|
}
|
|
660
|
-
function ReactPromise(status, value, reason
|
|
660
|
+
function ReactPromise(status, value, reason) {
|
|
661
661
|
this.status = status;
|
|
662
662
|
this.value = value;
|
|
663
663
|
this.reason = reason;
|
|
664
|
-
this._response = response;
|
|
665
664
|
}
|
|
666
665
|
ReactPromise.prototype = Object.create(Promise.prototype);
|
|
667
666
|
ReactPromise.prototype.then = function (resolve, reject) {
|
|
@@ -674,17 +673,19 @@ ReactPromise.prototype.then = function (resolve, reject) {
|
|
|
674
673
|
}
|
|
675
674
|
switch (this.status) {
|
|
676
675
|
case "fulfilled":
|
|
677
|
-
resolve(this.value);
|
|
676
|
+
"function" === typeof resolve && resolve(this.value);
|
|
678
677
|
break;
|
|
679
678
|
case "pending":
|
|
680
679
|
case "blocked":
|
|
681
|
-
resolve &&
|
|
680
|
+
"function" === typeof resolve &&
|
|
682
681
|
(null === this.value && (this.value = []), this.value.push(resolve));
|
|
683
|
-
reject &&
|
|
682
|
+
"function" === typeof reject &&
|
|
684
683
|
(null === this.reason && (this.reason = []), this.reason.push(reject));
|
|
685
684
|
break;
|
|
685
|
+
case "halted":
|
|
686
|
+
break;
|
|
686
687
|
default:
|
|
687
|
-
reject && reject(this.reason);
|
|
688
|
+
"function" === typeof reject && reject(this.reason);
|
|
688
689
|
}
|
|
689
690
|
};
|
|
690
691
|
function readChunk(chunk) {
|
|
@@ -700,26 +701,71 @@ function readChunk(chunk) {
|
|
|
700
701
|
return chunk.value;
|
|
701
702
|
case "pending":
|
|
702
703
|
case "blocked":
|
|
704
|
+
case "halted":
|
|
703
705
|
throw chunk;
|
|
704
706
|
default:
|
|
705
707
|
throw chunk.reason;
|
|
706
708
|
}
|
|
707
709
|
}
|
|
708
|
-
function createPendingChunk(response) {
|
|
709
|
-
return new ReactPromise("pending", null, null, response);
|
|
710
|
-
}
|
|
711
710
|
function wakeChunk(listeners, value) {
|
|
712
|
-
for (var i = 0; i < listeners.length; i++)
|
|
711
|
+
for (var i = 0; i < listeners.length; i++) {
|
|
712
|
+
var listener = listeners[i];
|
|
713
|
+
"function" === typeof listener
|
|
714
|
+
? listener(value)
|
|
715
|
+
: fulfillReference(listener, value);
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
function rejectChunk(listeners, error) {
|
|
719
|
+
for (var i = 0; i < listeners.length; i++) {
|
|
720
|
+
var listener = listeners[i];
|
|
721
|
+
"function" === typeof listener
|
|
722
|
+
? listener(error)
|
|
723
|
+
: rejectReference(listener, error);
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
function resolveBlockedCycle(resolvedChunk, reference) {
|
|
727
|
+
var referencedChunk = reference.handler.chunk;
|
|
728
|
+
if (null === referencedChunk) return null;
|
|
729
|
+
if (referencedChunk === resolvedChunk) return reference.handler;
|
|
730
|
+
reference = referencedChunk.value;
|
|
731
|
+
if (null !== reference)
|
|
732
|
+
for (
|
|
733
|
+
referencedChunk = 0;
|
|
734
|
+
referencedChunk < reference.length;
|
|
735
|
+
referencedChunk++
|
|
736
|
+
) {
|
|
737
|
+
var listener = reference[referencedChunk];
|
|
738
|
+
if (
|
|
739
|
+
"function" !== typeof listener &&
|
|
740
|
+
((listener = resolveBlockedCycle(resolvedChunk, listener)),
|
|
741
|
+
null !== listener)
|
|
742
|
+
)
|
|
743
|
+
return listener;
|
|
744
|
+
}
|
|
745
|
+
return null;
|
|
713
746
|
}
|
|
714
747
|
function wakeChunkIfInitialized(chunk, resolveListeners, rejectListeners) {
|
|
715
748
|
switch (chunk.status) {
|
|
716
749
|
case "fulfilled":
|
|
717
750
|
wakeChunk(resolveListeners, chunk.value);
|
|
718
751
|
break;
|
|
719
|
-
case "pending":
|
|
720
752
|
case "blocked":
|
|
753
|
+
for (var i = 0; i < resolveListeners.length; i++) {
|
|
754
|
+
var listener = resolveListeners[i];
|
|
755
|
+
if ("function" !== typeof listener) {
|
|
756
|
+
var cyclicHandler = resolveBlockedCycle(chunk, listener);
|
|
757
|
+
null !== cyclicHandler &&
|
|
758
|
+
(fulfillReference(listener, cyclicHandler.value),
|
|
759
|
+
resolveListeners.splice(i, 1),
|
|
760
|
+
i--,
|
|
761
|
+
null !== rejectListeners &&
|
|
762
|
+
((listener = rejectListeners.indexOf(listener)),
|
|
763
|
+
-1 !== listener && rejectListeners.splice(listener, 1)));
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
case "pending":
|
|
721
767
|
if (chunk.value)
|
|
722
|
-
for (
|
|
768
|
+
for (i = 0; i < resolveListeners.length; i++)
|
|
723
769
|
chunk.value.push(resolveListeners[i]);
|
|
724
770
|
else chunk.value = resolveListeners;
|
|
725
771
|
if (chunk.reason) {
|
|
@@ -733,73 +779,80 @@ function wakeChunkIfInitialized(chunk, resolveListeners, rejectListeners) {
|
|
|
733
779
|
} else chunk.reason = rejectListeners;
|
|
734
780
|
break;
|
|
735
781
|
case "rejected":
|
|
736
|
-
rejectListeners &&
|
|
782
|
+
rejectListeners && rejectChunk(rejectListeners, chunk.reason);
|
|
737
783
|
}
|
|
738
784
|
}
|
|
739
|
-
function triggerErrorOnChunk(chunk, error) {
|
|
740
|
-
|
|
741
|
-
chunk.reason.error(error)
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
null !== listeners && wakeChunk(listeners, error);
|
|
747
|
-
}
|
|
785
|
+
function triggerErrorOnChunk(response, chunk, error) {
|
|
786
|
+
"pending" !== chunk.status && "blocked" !== chunk.status
|
|
787
|
+
? chunk.reason.error(error)
|
|
788
|
+
: ((response = chunk.reason),
|
|
789
|
+
(chunk.status = "rejected"),
|
|
790
|
+
(chunk.reason = error),
|
|
791
|
+
null !== response && rejectChunk(response, error));
|
|
748
792
|
}
|
|
749
793
|
function createResolvedIteratorResultChunk(response, value, done) {
|
|
750
794
|
return new ReactPromise(
|
|
751
795
|
"resolved_model",
|
|
752
796
|
(done ? '{"done":true,"value":' : '{"done":false,"value":') + value + "}",
|
|
753
|
-
null,
|
|
754
797
|
response
|
|
755
798
|
);
|
|
756
799
|
}
|
|
757
|
-
function resolveIteratorResultChunk(chunk, value, done) {
|
|
800
|
+
function resolveIteratorResultChunk(response, chunk, value, done) {
|
|
758
801
|
resolveModelChunk(
|
|
802
|
+
response,
|
|
759
803
|
chunk,
|
|
760
804
|
(done ? '{"done":true,"value":' : '{"done":false,"value":') + value + "}"
|
|
761
805
|
);
|
|
762
806
|
}
|
|
763
|
-
function resolveModelChunk(chunk, value) {
|
|
807
|
+
function resolveModelChunk(response, chunk, value) {
|
|
764
808
|
if ("pending" !== chunk.status) chunk.reason.enqueueModel(value);
|
|
765
809
|
else {
|
|
766
810
|
var resolveListeners = chunk.value,
|
|
767
811
|
rejectListeners = chunk.reason;
|
|
768
812
|
chunk.status = "resolved_model";
|
|
769
813
|
chunk.value = value;
|
|
814
|
+
chunk.reason = response;
|
|
770
815
|
null !== resolveListeners &&
|
|
771
816
|
(initializeModelChunk(chunk),
|
|
772
817
|
wakeChunkIfInitialized(chunk, resolveListeners, rejectListeners));
|
|
773
818
|
}
|
|
774
819
|
}
|
|
775
|
-
function resolveModuleChunk(chunk, value) {
|
|
820
|
+
function resolveModuleChunk(response, chunk, value) {
|
|
776
821
|
if ("pending" === chunk.status || "blocked" === chunk.status) {
|
|
777
|
-
|
|
778
|
-
|
|
822
|
+
response = chunk.value;
|
|
823
|
+
var rejectListeners = chunk.reason;
|
|
779
824
|
chunk.status = "resolved_module";
|
|
780
825
|
chunk.value = value;
|
|
781
|
-
null !==
|
|
826
|
+
null !== response &&
|
|
782
827
|
(initializeModuleChunk(chunk),
|
|
783
|
-
wakeChunkIfInitialized(chunk,
|
|
828
|
+
wakeChunkIfInitialized(chunk, response, rejectListeners));
|
|
784
829
|
}
|
|
785
830
|
}
|
|
786
831
|
var initializingHandler = null;
|
|
787
832
|
function initializeModelChunk(chunk) {
|
|
788
833
|
var prevHandler = initializingHandler;
|
|
789
834
|
initializingHandler = null;
|
|
790
|
-
var resolvedModel = chunk.value
|
|
835
|
+
var resolvedModel = chunk.value,
|
|
836
|
+
response = chunk.reason;
|
|
791
837
|
chunk.status = "blocked";
|
|
792
838
|
chunk.value = null;
|
|
793
839
|
chunk.reason = null;
|
|
794
840
|
try {
|
|
795
|
-
var value = JSON.parse(resolvedModel,
|
|
841
|
+
var value = JSON.parse(resolvedModel, response._fromJSON),
|
|
796
842
|
resolveListeners = chunk.value;
|
|
797
|
-
null !== resolveListeners
|
|
798
|
-
(
|
|
799
|
-
|
|
800
|
-
|
|
843
|
+
if (null !== resolveListeners)
|
|
844
|
+
for (
|
|
845
|
+
chunk.value = null, chunk.reason = null, resolvedModel = 0;
|
|
846
|
+
resolvedModel < resolveListeners.length;
|
|
847
|
+
resolvedModel++
|
|
848
|
+
) {
|
|
849
|
+
var listener = resolveListeners[resolvedModel];
|
|
850
|
+
"function" === typeof listener
|
|
851
|
+
? listener(value)
|
|
852
|
+
: fulfillReference(listener, value, chunk);
|
|
853
|
+
}
|
|
801
854
|
if (null !== initializingHandler) {
|
|
802
|
-
if (initializingHandler.errored) throw initializingHandler.
|
|
855
|
+
if (initializingHandler.errored) throw initializingHandler.reason;
|
|
803
856
|
if (0 < initializingHandler.deps) {
|
|
804
857
|
initializingHandler.value = value;
|
|
805
858
|
initializingHandler.chunk = chunk;
|
|
@@ -823,11 +876,12 @@ function initializeModuleChunk(chunk) {
|
|
|
823
876
|
(chunk.status = "rejected"), (chunk.reason = error);
|
|
824
877
|
}
|
|
825
878
|
}
|
|
826
|
-
function reportGlobalError(
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
"pending" === chunk.status &&
|
|
879
|
+
function reportGlobalError(weakResponse, error) {
|
|
880
|
+
weakResponse._closed = !0;
|
|
881
|
+
weakResponse._closedReason = error;
|
|
882
|
+
weakResponse._chunks.forEach(function (chunk) {
|
|
883
|
+
"pending" === chunk.status &&
|
|
884
|
+
triggerErrorOnChunk(weakResponse, chunk, error);
|
|
831
885
|
});
|
|
832
886
|
}
|
|
833
887
|
function createLazyChunkWrapper(chunk) {
|
|
@@ -838,11 +892,128 @@ function getChunk(response, id) {
|
|
|
838
892
|
chunk = chunks.get(id);
|
|
839
893
|
chunk ||
|
|
840
894
|
((chunk = response._closed
|
|
841
|
-
? new ReactPromise("rejected", null, response._closedReason
|
|
842
|
-
:
|
|
895
|
+
? new ReactPromise("rejected", null, response._closedReason)
|
|
896
|
+
: new ReactPromise("pending", null, null)),
|
|
843
897
|
chunks.set(id, chunk));
|
|
844
898
|
return chunk;
|
|
845
899
|
}
|
|
900
|
+
function fulfillReference(reference, value) {
|
|
901
|
+
for (
|
|
902
|
+
var response = reference.response,
|
|
903
|
+
handler = reference.handler,
|
|
904
|
+
parentObject = reference.parentObject,
|
|
905
|
+
key = reference.key,
|
|
906
|
+
map = reference.map,
|
|
907
|
+
path = reference.path,
|
|
908
|
+
i = 1;
|
|
909
|
+
i < path.length;
|
|
910
|
+
i++
|
|
911
|
+
) {
|
|
912
|
+
for (
|
|
913
|
+
;
|
|
914
|
+
"object" === typeof value &&
|
|
915
|
+
null !== value &&
|
|
916
|
+
value.$$typeof === REACT_LAZY_TYPE;
|
|
917
|
+
|
|
918
|
+
)
|
|
919
|
+
if (((value = value._payload), value === handler.chunk))
|
|
920
|
+
value = handler.value;
|
|
921
|
+
else {
|
|
922
|
+
switch (value.status) {
|
|
923
|
+
case "resolved_model":
|
|
924
|
+
initializeModelChunk(value);
|
|
925
|
+
break;
|
|
926
|
+
case "resolved_module":
|
|
927
|
+
initializeModuleChunk(value);
|
|
928
|
+
}
|
|
929
|
+
switch (value.status) {
|
|
930
|
+
case "fulfilled":
|
|
931
|
+
value = value.value;
|
|
932
|
+
continue;
|
|
933
|
+
case "blocked":
|
|
934
|
+
var cyclicHandler = resolveBlockedCycle(value, reference);
|
|
935
|
+
if (null !== cyclicHandler) {
|
|
936
|
+
value = cyclicHandler.value;
|
|
937
|
+
continue;
|
|
938
|
+
}
|
|
939
|
+
case "pending":
|
|
940
|
+
path.splice(0, i - 1);
|
|
941
|
+
null === value.value
|
|
942
|
+
? (value.value = [reference])
|
|
943
|
+
: value.value.push(reference);
|
|
944
|
+
null === value.reason
|
|
945
|
+
? (value.reason = [reference])
|
|
946
|
+
: value.reason.push(reference);
|
|
947
|
+
return;
|
|
948
|
+
case "halted":
|
|
949
|
+
return;
|
|
950
|
+
default:
|
|
951
|
+
rejectReference(reference, value.reason);
|
|
952
|
+
return;
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
value = value[path[i]];
|
|
956
|
+
}
|
|
957
|
+
for (
|
|
958
|
+
;
|
|
959
|
+
"object" === typeof value &&
|
|
960
|
+
null !== value &&
|
|
961
|
+
value.$$typeof === REACT_LAZY_TYPE;
|
|
962
|
+
|
|
963
|
+
)
|
|
964
|
+
if (((reference = value._payload), reference === handler.chunk))
|
|
965
|
+
value = handler.value;
|
|
966
|
+
else {
|
|
967
|
+
switch (reference.status) {
|
|
968
|
+
case "resolved_model":
|
|
969
|
+
initializeModelChunk(reference);
|
|
970
|
+
break;
|
|
971
|
+
case "resolved_module":
|
|
972
|
+
initializeModuleChunk(reference);
|
|
973
|
+
}
|
|
974
|
+
switch (reference.status) {
|
|
975
|
+
case "fulfilled":
|
|
976
|
+
value = reference.value;
|
|
977
|
+
continue;
|
|
978
|
+
}
|
|
979
|
+
break;
|
|
980
|
+
}
|
|
981
|
+
response = map(response, value, parentObject, key);
|
|
982
|
+
parentObject[key] = response;
|
|
983
|
+
"" === key && null === handler.value && (handler.value = response);
|
|
984
|
+
if (
|
|
985
|
+
parentObject[0] === REACT_ELEMENT_TYPE &&
|
|
986
|
+
"object" === typeof handler.value &&
|
|
987
|
+
null !== handler.value &&
|
|
988
|
+
handler.value.$$typeof === REACT_ELEMENT_TYPE
|
|
989
|
+
)
|
|
990
|
+
switch (((parentObject = handler.value), key)) {
|
|
991
|
+
case "3":
|
|
992
|
+
parentObject.props = response;
|
|
993
|
+
}
|
|
994
|
+
handler.deps--;
|
|
995
|
+
0 === handler.deps &&
|
|
996
|
+
((key = handler.chunk),
|
|
997
|
+
null !== key &&
|
|
998
|
+
"blocked" === key.status &&
|
|
999
|
+
((parentObject = key.value),
|
|
1000
|
+
(key.status = "fulfilled"),
|
|
1001
|
+
(key.value = handler.value),
|
|
1002
|
+
(key.reason = handler.reason),
|
|
1003
|
+
null !== parentObject && wakeChunk(parentObject, handler.value)));
|
|
1004
|
+
}
|
|
1005
|
+
function rejectReference(reference, error) {
|
|
1006
|
+
var handler = reference.handler;
|
|
1007
|
+
reference = reference.response;
|
|
1008
|
+
handler.errored ||
|
|
1009
|
+
((handler.errored = !0),
|
|
1010
|
+
(handler.value = null),
|
|
1011
|
+
(handler.reason = error),
|
|
1012
|
+
(handler = handler.chunk),
|
|
1013
|
+
null !== handler &&
|
|
1014
|
+
"blocked" === handler.status &&
|
|
1015
|
+
triggerErrorOnChunk(reference, handler, error));
|
|
1016
|
+
}
|
|
846
1017
|
function waitForReference(
|
|
847
1018
|
referencedChunk,
|
|
848
1019
|
parentObject,
|
|
@@ -851,52 +1022,6 @@ function waitForReference(
|
|
|
851
1022
|
map,
|
|
852
1023
|
path
|
|
853
1024
|
) {
|
|
854
|
-
function fulfill(value) {
|
|
855
|
-
for (var i = 1; i < path.length; i++) {
|
|
856
|
-
for (; value.$$typeof === REACT_LAZY_TYPE; )
|
|
857
|
-
if (((value = value._payload), value === handler.chunk))
|
|
858
|
-
value = handler.value;
|
|
859
|
-
else if ("fulfilled" === value.status) value = value.value;
|
|
860
|
-
else {
|
|
861
|
-
path.splice(0, i - 1);
|
|
862
|
-
value.then(fulfill, reject);
|
|
863
|
-
return;
|
|
864
|
-
}
|
|
865
|
-
value = value[path[i]];
|
|
866
|
-
}
|
|
867
|
-
i = map(response, value, parentObject, key);
|
|
868
|
-
parentObject[key] = i;
|
|
869
|
-
"" === key && null === handler.value && (handler.value = i);
|
|
870
|
-
if (
|
|
871
|
-
parentObject[0] === REACT_ELEMENT_TYPE &&
|
|
872
|
-
"object" === typeof handler.value &&
|
|
873
|
-
null !== handler.value &&
|
|
874
|
-
handler.value.$$typeof === REACT_ELEMENT_TYPE
|
|
875
|
-
)
|
|
876
|
-
switch (((value = handler.value), key)) {
|
|
877
|
-
case "3":
|
|
878
|
-
value.props = i;
|
|
879
|
-
}
|
|
880
|
-
handler.deps--;
|
|
881
|
-
0 === handler.deps &&
|
|
882
|
-
((i = handler.chunk),
|
|
883
|
-
null !== i &&
|
|
884
|
-
"blocked" === i.status &&
|
|
885
|
-
((value = i.value),
|
|
886
|
-
(i.status = "fulfilled"),
|
|
887
|
-
(i.value = handler.value),
|
|
888
|
-
null !== value && wakeChunk(value, handler.value)));
|
|
889
|
-
}
|
|
890
|
-
function reject(error) {
|
|
891
|
-
if (!handler.errored) {
|
|
892
|
-
handler.errored = !0;
|
|
893
|
-
handler.value = error;
|
|
894
|
-
var chunk = handler.chunk;
|
|
895
|
-
null !== chunk &&
|
|
896
|
-
"blocked" === chunk.status &&
|
|
897
|
-
triggerErrorOnChunk(chunk, error);
|
|
898
|
-
}
|
|
899
|
-
}
|
|
900
1025
|
if (initializingHandler) {
|
|
901
1026
|
var handler = initializingHandler;
|
|
902
1027
|
handler.deps++;
|
|
@@ -905,10 +1030,24 @@ function waitForReference(
|
|
|
905
1030
|
parent: null,
|
|
906
1031
|
chunk: null,
|
|
907
1032
|
value: null,
|
|
1033
|
+
reason: null,
|
|
908
1034
|
deps: 1,
|
|
909
1035
|
errored: !1
|
|
910
1036
|
};
|
|
911
|
-
|
|
1037
|
+
parentObject = {
|
|
1038
|
+
response: response,
|
|
1039
|
+
handler: handler,
|
|
1040
|
+
parentObject: parentObject,
|
|
1041
|
+
key: key,
|
|
1042
|
+
map: map,
|
|
1043
|
+
path: path
|
|
1044
|
+
};
|
|
1045
|
+
null === referencedChunk.value
|
|
1046
|
+
? (referencedChunk.value = [parentObject])
|
|
1047
|
+
: referencedChunk.value.push(parentObject);
|
|
1048
|
+
null === referencedChunk.reason
|
|
1049
|
+
? (referencedChunk.reason = [parentObject])
|
|
1050
|
+
: referencedChunk.reason.push(parentObject);
|
|
912
1051
|
return null;
|
|
913
1052
|
}
|
|
914
1053
|
function loadServerReference(response, metaData, parentObject, key) {
|
|
@@ -945,6 +1084,7 @@ function loadServerReference(response, metaData, parentObject, key) {
|
|
|
945
1084
|
parent: null,
|
|
946
1085
|
chunk: null,
|
|
947
1086
|
value: null,
|
|
1087
|
+
reason: null,
|
|
948
1088
|
deps: 1,
|
|
949
1089
|
errored: !1
|
|
950
1090
|
};
|
|
@@ -987,11 +1127,12 @@ function loadServerReference(response, metaData, parentObject, key) {
|
|
|
987
1127
|
function (error) {
|
|
988
1128
|
if (!handler.errored) {
|
|
989
1129
|
handler.errored = !0;
|
|
990
|
-
handler.value =
|
|
1130
|
+
handler.value = null;
|
|
1131
|
+
handler.reason = error;
|
|
991
1132
|
var chunk = handler.chunk;
|
|
992
1133
|
null !== chunk &&
|
|
993
1134
|
"blocked" === chunk.status &&
|
|
994
|
-
triggerErrorOnChunk(chunk, error);
|
|
1135
|
+
triggerErrorOnChunk(response, chunk, error);
|
|
995
1136
|
}
|
|
996
1137
|
}
|
|
997
1138
|
);
|
|
@@ -1010,35 +1151,122 @@ function getOutlinedModel(response, reference, parentObject, key, map) {
|
|
|
1010
1151
|
}
|
|
1011
1152
|
switch (id.status) {
|
|
1012
1153
|
case "fulfilled":
|
|
1013
|
-
|
|
1014
|
-
for (
|
|
1015
|
-
for (
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1154
|
+
id = id.value;
|
|
1155
|
+
for (var i = 1; i < reference.length; i++) {
|
|
1156
|
+
for (
|
|
1157
|
+
;
|
|
1158
|
+
"object" === typeof id &&
|
|
1159
|
+
null !== id &&
|
|
1160
|
+
id.$$typeof === REACT_LAZY_TYPE;
|
|
1161
|
+
|
|
1162
|
+
) {
|
|
1163
|
+
id = id._payload;
|
|
1164
|
+
switch (id.status) {
|
|
1165
|
+
case "resolved_model":
|
|
1166
|
+
initializeModelChunk(id);
|
|
1167
|
+
break;
|
|
1168
|
+
case "resolved_module":
|
|
1169
|
+
initializeModuleChunk(id);
|
|
1170
|
+
}
|
|
1171
|
+
switch (id.status) {
|
|
1172
|
+
case "fulfilled":
|
|
1173
|
+
id = id.value;
|
|
1174
|
+
break;
|
|
1175
|
+
case "blocked":
|
|
1176
|
+
case "pending":
|
|
1177
|
+
return waitForReference(
|
|
1178
|
+
id,
|
|
1179
|
+
parentObject,
|
|
1180
|
+
key,
|
|
1181
|
+
response,
|
|
1182
|
+
map,
|
|
1183
|
+
reference.slice(i - 1)
|
|
1184
|
+
);
|
|
1185
|
+
case "halted":
|
|
1186
|
+
return (
|
|
1187
|
+
initializingHandler
|
|
1188
|
+
? ((response = initializingHandler), response.deps++)
|
|
1189
|
+
: (initializingHandler = {
|
|
1190
|
+
parent: null,
|
|
1191
|
+
chunk: null,
|
|
1192
|
+
value: null,
|
|
1193
|
+
reason: null,
|
|
1194
|
+
deps: 1,
|
|
1195
|
+
errored: !1
|
|
1196
|
+
}),
|
|
1197
|
+
null
|
|
1198
|
+
);
|
|
1199
|
+
default:
|
|
1200
|
+
return (
|
|
1201
|
+
initializingHandler
|
|
1202
|
+
? ((initializingHandler.errored = !0),
|
|
1203
|
+
(initializingHandler.value = null),
|
|
1204
|
+
(initializingHandler.reason = id.reason))
|
|
1205
|
+
: (initializingHandler = {
|
|
1206
|
+
parent: null,
|
|
1207
|
+
chunk: null,
|
|
1208
|
+
value: null,
|
|
1209
|
+
reason: id.reason,
|
|
1210
|
+
deps: 0,
|
|
1211
|
+
errored: !0
|
|
1212
|
+
}),
|
|
1213
|
+
null
|
|
1214
|
+
);
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
id = id[reference[i]];
|
|
1028
1218
|
}
|
|
1029
|
-
|
|
1219
|
+
for (
|
|
1220
|
+
;
|
|
1221
|
+
"object" === typeof id &&
|
|
1222
|
+
null !== id &&
|
|
1223
|
+
id.$$typeof === REACT_LAZY_TYPE;
|
|
1224
|
+
|
|
1225
|
+
) {
|
|
1226
|
+
reference = id._payload;
|
|
1227
|
+
switch (reference.status) {
|
|
1228
|
+
case "resolved_model":
|
|
1229
|
+
initializeModelChunk(reference);
|
|
1230
|
+
break;
|
|
1231
|
+
case "resolved_module":
|
|
1232
|
+
initializeModuleChunk(reference);
|
|
1233
|
+
}
|
|
1234
|
+
switch (reference.status) {
|
|
1235
|
+
case "fulfilled":
|
|
1236
|
+
id = reference.value;
|
|
1237
|
+
continue;
|
|
1238
|
+
}
|
|
1239
|
+
break;
|
|
1240
|
+
}
|
|
1241
|
+
return map(response, id, parentObject, key);
|
|
1030
1242
|
case "pending":
|
|
1031
1243
|
case "blocked":
|
|
1032
1244
|
return waitForReference(id, parentObject, key, response, map, reference);
|
|
1245
|
+
case "halted":
|
|
1246
|
+
return (
|
|
1247
|
+
initializingHandler
|
|
1248
|
+
? ((response = initializingHandler), response.deps++)
|
|
1249
|
+
: (initializingHandler = {
|
|
1250
|
+
parent: null,
|
|
1251
|
+
chunk: null,
|
|
1252
|
+
value: null,
|
|
1253
|
+
reason: null,
|
|
1254
|
+
deps: 1,
|
|
1255
|
+
errored: !1
|
|
1256
|
+
}),
|
|
1257
|
+
null
|
|
1258
|
+
);
|
|
1033
1259
|
default:
|
|
1034
1260
|
return (
|
|
1035
1261
|
initializingHandler
|
|
1036
1262
|
? ((initializingHandler.errored = !0),
|
|
1037
|
-
(initializingHandler.value =
|
|
1263
|
+
(initializingHandler.value = null),
|
|
1264
|
+
(initializingHandler.reason = id.reason))
|
|
1038
1265
|
: (initializingHandler = {
|
|
1039
1266
|
parent: null,
|
|
1040
1267
|
chunk: null,
|
|
1041
|
-
value:
|
|
1268
|
+
value: null,
|
|
1269
|
+
reason: id.reason,
|
|
1042
1270
|
deps: 0,
|
|
1043
1271
|
errored: !0
|
|
1044
1272
|
}),
|
|
@@ -1077,6 +1305,7 @@ function parseModelString(response, parentObject, key, value) {
|
|
|
1077
1305
|
parent: initializingHandler,
|
|
1078
1306
|
chunk: null,
|
|
1079
1307
|
value: null,
|
|
1308
|
+
reason: null,
|
|
1080
1309
|
deps: 0,
|
|
1081
1310
|
errored: !1
|
|
1082
1311
|
}),
|
|
@@ -1092,9 +1321,10 @@ function parseModelString(response, parentObject, key, value) {
|
|
|
1092
1321
|
createLazyChunkWrapper(response)
|
|
1093
1322
|
);
|
|
1094
1323
|
case "@":
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1324
|
+
return (
|
|
1325
|
+
(parentObject = parseInt(value.slice(2), 16)),
|
|
1326
|
+
getChunk(response, parentObject)
|
|
1327
|
+
);
|
|
1098
1328
|
case "S":
|
|
1099
1329
|
return Symbol.for(value.slice(2));
|
|
1100
1330
|
case "F":
|
|
@@ -1188,19 +1418,21 @@ function ResponseInstance(
|
|
|
1188
1418
|
this._chunks = chunks;
|
|
1189
1419
|
this._stringDecoder = new util.TextDecoder();
|
|
1190
1420
|
this._fromJSON = null;
|
|
1191
|
-
this._rowLength = this._rowTag = this._rowID = this._rowState = 0;
|
|
1192
|
-
this._buffer = [];
|
|
1193
1421
|
this._closed = !1;
|
|
1194
1422
|
this._closedReason = null;
|
|
1195
1423
|
this._tempRefs = temporaryReferences;
|
|
1196
1424
|
this._fromJSON = createFromJSONCallback(this);
|
|
1197
1425
|
}
|
|
1426
|
+
function createStreamState() {
|
|
1427
|
+
return { _rowState: 0, _rowID: 0, _rowTag: 0, _rowLength: 0, _buffer: [] };
|
|
1428
|
+
}
|
|
1198
1429
|
function resolveBuffer(response, id, buffer) {
|
|
1199
|
-
|
|
1200
|
-
|
|
1430
|
+
response = response._chunks;
|
|
1431
|
+
var chunk = response.get(id);
|
|
1201
1432
|
chunk && "pending" !== chunk.status
|
|
1202
1433
|
? chunk.reason.enqueueValue(buffer)
|
|
1203
|
-
:
|
|
1434
|
+
: ((buffer = new ReactPromise("fulfilled", buffer, null)),
|
|
1435
|
+
response.set(id, buffer));
|
|
1204
1436
|
}
|
|
1205
1437
|
function resolveModule(response, id, model) {
|
|
1206
1438
|
var chunks = response._chunks,
|
|
@@ -1217,38 +1449,34 @@ function resolveModule(response, id, model) {
|
|
|
1217
1449
|
var blockedChunk = chunk;
|
|
1218
1450
|
blockedChunk.status = "blocked";
|
|
1219
1451
|
} else
|
|
1220
|
-
(blockedChunk = new ReactPromise("blocked", null, null
|
|
1452
|
+
(blockedChunk = new ReactPromise("blocked", null, null)),
|
|
1221
1453
|
chunks.set(id, blockedChunk);
|
|
1222
1454
|
model.then(
|
|
1223
1455
|
function () {
|
|
1224
|
-
return resolveModuleChunk(blockedChunk, clientReference);
|
|
1456
|
+
return resolveModuleChunk(response, blockedChunk, clientReference);
|
|
1225
1457
|
},
|
|
1226
1458
|
function (error) {
|
|
1227
|
-
return triggerErrorOnChunk(blockedChunk, error);
|
|
1459
|
+
return triggerErrorOnChunk(response, blockedChunk, error);
|
|
1228
1460
|
}
|
|
1229
1461
|
);
|
|
1230
1462
|
} else
|
|
1231
1463
|
chunk
|
|
1232
|
-
? resolveModuleChunk(chunk, clientReference)
|
|
1233
|
-
:
|
|
1234
|
-
|
|
1235
|
-
new ReactPromise("resolved_module", clientReference, null, response)
|
|
1236
|
-
);
|
|
1464
|
+
? resolveModuleChunk(response, chunk, clientReference)
|
|
1465
|
+
: ((chunk = new ReactPromise("resolved_module", clientReference, null)),
|
|
1466
|
+
chunks.set(id, chunk));
|
|
1237
1467
|
}
|
|
1238
1468
|
function resolveStream(response, id, stream, controller) {
|
|
1239
|
-
|
|
1240
|
-
|
|
1469
|
+
response = response._chunks;
|
|
1470
|
+
var chunk = response.get(id);
|
|
1241
1471
|
chunk
|
|
1242
1472
|
? "pending" === chunk.status &&
|
|
1243
|
-
((
|
|
1473
|
+
((id = chunk.value),
|
|
1244
1474
|
(chunk.status = "fulfilled"),
|
|
1245
1475
|
(chunk.value = stream),
|
|
1246
1476
|
(chunk.reason = controller),
|
|
1247
|
-
null !==
|
|
1248
|
-
:
|
|
1249
|
-
|
|
1250
|
-
new ReactPromise("fulfilled", stream, controller, response)
|
|
1251
|
-
);
|
|
1477
|
+
null !== id && wakeChunk(id, chunk.value))
|
|
1478
|
+
: ((stream = new ReactPromise("fulfilled", stream, controller)),
|
|
1479
|
+
response.set(id, stream));
|
|
1252
1480
|
}
|
|
1253
1481
|
function startReadableStream(response, id, type) {
|
|
1254
1482
|
var controller = null;
|
|
@@ -1269,7 +1497,7 @@ function startReadableStream(response, id, type) {
|
|
|
1269
1497
|
},
|
|
1270
1498
|
enqueueModel: function (json) {
|
|
1271
1499
|
if (null === previousBlockedChunk) {
|
|
1272
|
-
var chunk = new ReactPromise("resolved_model", json,
|
|
1500
|
+
var chunk = new ReactPromise("resolved_model", json, response);
|
|
1273
1501
|
initializeModelChunk(chunk);
|
|
1274
1502
|
"fulfilled" === chunk.status
|
|
1275
1503
|
? controller.enqueue(chunk.value)
|
|
@@ -1284,8 +1512,8 @@ function startReadableStream(response, id, type) {
|
|
|
1284
1512
|
(previousBlockedChunk = chunk));
|
|
1285
1513
|
} else {
|
|
1286
1514
|
chunk = previousBlockedChunk;
|
|
1287
|
-
var chunk$
|
|
1288
|
-
chunk$
|
|
1515
|
+
var chunk$54 = new ReactPromise("pending", null, null);
|
|
1516
|
+
chunk$54.then(
|
|
1289
1517
|
function (v) {
|
|
1290
1518
|
return controller.enqueue(v);
|
|
1291
1519
|
},
|
|
@@ -1293,10 +1521,10 @@ function startReadableStream(response, id, type) {
|
|
|
1293
1521
|
return controller.error(e);
|
|
1294
1522
|
}
|
|
1295
1523
|
);
|
|
1296
|
-
previousBlockedChunk = chunk$
|
|
1524
|
+
previousBlockedChunk = chunk$54;
|
|
1297
1525
|
chunk.then(function () {
|
|
1298
|
-
previousBlockedChunk === chunk$
|
|
1299
|
-
resolveModelChunk(chunk$
|
|
1526
|
+
previousBlockedChunk === chunk$54 && (previousBlockedChunk = null);
|
|
1527
|
+
resolveModelChunk(response, chunk$54, json);
|
|
1300
1528
|
});
|
|
1301
1529
|
}
|
|
1302
1530
|
},
|
|
@@ -1334,41 +1562,37 @@ function startAsyncIterable(response, id, iterator) {
|
|
|
1334
1562
|
var buffer = [],
|
|
1335
1563
|
closed = !1,
|
|
1336
1564
|
nextWriteIndex = 0,
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1565
|
+
iterable = {};
|
|
1566
|
+
iterable[ASYNC_ITERATOR] = function () {
|
|
1567
|
+
var nextReadIndex = 0;
|
|
1568
|
+
return createIterator(function (arg) {
|
|
1569
|
+
if (void 0 !== arg)
|
|
1570
|
+
throw Error(
|
|
1571
|
+
"Values cannot be passed to next() of AsyncIterables passed to Client Components."
|
|
1572
|
+
);
|
|
1573
|
+
if (nextReadIndex === buffer.length) {
|
|
1574
|
+
if (closed)
|
|
1575
|
+
return new ReactPromise(
|
|
1576
|
+
"fulfilled",
|
|
1577
|
+
{ done: !0, value: void 0 },
|
|
1578
|
+
null
|
|
1345
1579
|
);
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
null,
|
|
1352
|
-
response
|
|
1353
|
-
);
|
|
1354
|
-
buffer[nextReadIndex] = createPendingChunk(response);
|
|
1355
|
-
}
|
|
1356
|
-
return buffer[nextReadIndex++];
|
|
1357
|
-
});
|
|
1358
|
-
}),
|
|
1359
|
-
$jscomp$compprop0);
|
|
1580
|
+
buffer[nextReadIndex] = new ReactPromise("pending", null, null);
|
|
1581
|
+
}
|
|
1582
|
+
return buffer[nextReadIndex++];
|
|
1583
|
+
});
|
|
1584
|
+
};
|
|
1360
1585
|
resolveStream(
|
|
1361
1586
|
response,
|
|
1362
1587
|
id,
|
|
1363
|
-
iterator ?
|
|
1588
|
+
iterator ? iterable[ASYNC_ITERATOR]() : iterable,
|
|
1364
1589
|
{
|
|
1365
1590
|
enqueueValue: function (value) {
|
|
1366
1591
|
if (nextWriteIndex === buffer.length)
|
|
1367
1592
|
buffer[nextWriteIndex] = new ReactPromise(
|
|
1368
1593
|
"fulfilled",
|
|
1369
1594
|
{ done: !1, value: value },
|
|
1370
|
-
null
|
|
1371
|
-
response
|
|
1595
|
+
null
|
|
1372
1596
|
);
|
|
1373
1597
|
else {
|
|
1374
1598
|
var chunk = buffer[nextWriteIndex],
|
|
@@ -1388,7 +1612,12 @@ function startAsyncIterable(response, id, iterator) {
|
|
|
1388
1612
|
value,
|
|
1389
1613
|
!1
|
|
1390
1614
|
))
|
|
1391
|
-
: resolveIteratorResultChunk(
|
|
1615
|
+
: resolveIteratorResultChunk(
|
|
1616
|
+
response,
|
|
1617
|
+
buffer[nextWriteIndex],
|
|
1618
|
+
value,
|
|
1619
|
+
!1
|
|
1620
|
+
);
|
|
1392
1621
|
nextWriteIndex++;
|
|
1393
1622
|
},
|
|
1394
1623
|
close: function (value) {
|
|
@@ -1399,9 +1628,15 @@ function startAsyncIterable(response, id, iterator) {
|
|
|
1399
1628
|
value,
|
|
1400
1629
|
!0
|
|
1401
1630
|
))
|
|
1402
|
-
: resolveIteratorResultChunk(
|
|
1631
|
+
: resolveIteratorResultChunk(
|
|
1632
|
+
response,
|
|
1633
|
+
buffer[nextWriteIndex],
|
|
1634
|
+
value,
|
|
1635
|
+
!0
|
|
1636
|
+
);
|
|
1403
1637
|
for (nextWriteIndex++; nextWriteIndex < buffer.length; )
|
|
1404
1638
|
resolveIteratorResultChunk(
|
|
1639
|
+
response,
|
|
1405
1640
|
buffer[nextWriteIndex++],
|
|
1406
1641
|
'"$undefined"',
|
|
1407
1642
|
!0
|
|
@@ -1411,11 +1646,11 @@ function startAsyncIterable(response, id, iterator) {
|
|
|
1411
1646
|
closed = !0;
|
|
1412
1647
|
for (
|
|
1413
1648
|
nextWriteIndex === buffer.length &&
|
|
1414
|
-
(buffer[nextWriteIndex] =
|
|
1649
|
+
(buffer[nextWriteIndex] = new ReactPromise("pending", null, null));
|
|
1415
1650
|
nextWriteIndex < buffer.length;
|
|
1416
1651
|
|
|
1417
1652
|
)
|
|
1418
|
-
triggerErrorOnChunk(buffer[nextWriteIndex++], error);
|
|
1653
|
+
triggerErrorOnChunk(response, buffer[nextWriteIndex++], error);
|
|
1419
1654
|
}
|
|
1420
1655
|
}
|
|
1421
1656
|
);
|
|
@@ -1431,8 +1666,8 @@ function mergeBuffer(buffer, lastChunk) {
|
|
|
1431
1666
|
for (var l = buffer.length, byteLength = lastChunk.length, i = 0; i < l; i++)
|
|
1432
1667
|
byteLength += buffer[i].byteLength;
|
|
1433
1668
|
byteLength = new Uint8Array(byteLength);
|
|
1434
|
-
for (var i$
|
|
1435
|
-
var chunk = buffer[i$
|
|
1669
|
+
for (var i$55 = (i = 0); i$55 < l; i$55++) {
|
|
1670
|
+
var chunk = buffer[i$55];
|
|
1436
1671
|
byteLength.set(chunk, i);
|
|
1437
1672
|
i += chunk.byteLength;
|
|
1438
1673
|
}
|
|
@@ -1458,7 +1693,7 @@ function resolveTypedArray(
|
|
|
1458
1693
|
);
|
|
1459
1694
|
resolveBuffer(response, id, constructor);
|
|
1460
1695
|
}
|
|
1461
|
-
function processFullBinaryRow(response, id, tag, buffer, chunk) {
|
|
1696
|
+
function processFullBinaryRow(response, streamState, id, tag, buffer, chunk) {
|
|
1462
1697
|
switch (tag) {
|
|
1463
1698
|
case 65:
|
|
1464
1699
|
resolveBuffer(response, id, mergeBuffer(buffer, chunk).buffer);
|
|
@@ -1511,9 +1746,9 @@ function processFullBinaryRow(response, id, tag, buffer, chunk) {
|
|
|
1511
1746
|
)
|
|
1512
1747
|
row += stringDecoder.decode(buffer[i], decoderOptions);
|
|
1513
1748
|
row += stringDecoder.decode(chunk);
|
|
1514
|
-
processFullStringRow(response, id, tag, row);
|
|
1749
|
+
processFullStringRow(response, streamState, id, tag, row);
|
|
1515
1750
|
}
|
|
1516
|
-
function processFullStringRow(response, id, tag, row) {
|
|
1751
|
+
function processFullStringRow(response, streamState, id, tag, row) {
|
|
1517
1752
|
switch (tag) {
|
|
1518
1753
|
case 73:
|
|
1519
1754
|
resolveModule(response, id, row);
|
|
@@ -1534,8 +1769,10 @@ function processFullStringRow(response, id, tag, row) {
|
|
|
1534
1769
|
break;
|
|
1535
1770
|
case "L":
|
|
1536
1771
|
id = response[0];
|
|
1537
|
-
|
|
1538
|
-
3 === response.length
|
|
1772
|
+
streamState = response[1];
|
|
1773
|
+
3 === response.length
|
|
1774
|
+
? row.L(id, streamState, response[2])
|
|
1775
|
+
: row.L(id, streamState);
|
|
1539
1776
|
break;
|
|
1540
1777
|
case "m":
|
|
1541
1778
|
"string" === typeof response
|
|
@@ -1563,23 +1800,26 @@ function processFullStringRow(response, id, tag, row) {
|
|
|
1563
1800
|
}
|
|
1564
1801
|
break;
|
|
1565
1802
|
case 69:
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
row
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
? triggerErrorOnChunk(
|
|
1573
|
-
:
|
|
1803
|
+
streamState = response._chunks;
|
|
1804
|
+
tag = streamState.get(id);
|
|
1805
|
+
row = JSON.parse(row);
|
|
1806
|
+
var error = resolveErrorProd();
|
|
1807
|
+
error.digest = row.digest;
|
|
1808
|
+
tag
|
|
1809
|
+
? triggerErrorOnChunk(response, tag, error)
|
|
1810
|
+
: ((response = new ReactPromise("rejected", null, error)),
|
|
1811
|
+
streamState.set(id, response));
|
|
1574
1812
|
break;
|
|
1575
1813
|
case 84:
|
|
1576
|
-
|
|
1577
|
-
(
|
|
1578
|
-
?
|
|
1579
|
-
:
|
|
1814
|
+
response = response._chunks;
|
|
1815
|
+
(streamState = response.get(id)) && "pending" !== streamState.status
|
|
1816
|
+
? streamState.reason.enqueueValue(row)
|
|
1817
|
+
: ((row = new ReactPromise("fulfilled", row, null)),
|
|
1818
|
+
response.set(id, row));
|
|
1580
1819
|
break;
|
|
1581
1820
|
case 78:
|
|
1582
1821
|
case 68:
|
|
1822
|
+
case 74:
|
|
1583
1823
|
case 87:
|
|
1584
1824
|
throw Error(
|
|
1585
1825
|
"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."
|
|
@@ -1597,20 +1837,103 @@ function processFullStringRow(response, id, tag, row) {
|
|
|
1597
1837
|
startAsyncIterable(response, id, !0);
|
|
1598
1838
|
break;
|
|
1599
1839
|
case 67:
|
|
1600
|
-
(
|
|
1601
|
-
"fulfilled" ===
|
|
1602
|
-
|
|
1840
|
+
(id = response._chunks.get(id)) &&
|
|
1841
|
+
"fulfilled" === id.status &&
|
|
1842
|
+
id.reason.close("" === row ? '"$undefined"' : row);
|
|
1603
1843
|
break;
|
|
1604
1844
|
default:
|
|
1605
|
-
(
|
|
1606
|
-
(
|
|
1607
|
-
? resolveModelChunk(
|
|
1608
|
-
:
|
|
1609
|
-
|
|
1610
|
-
new ReactPromise("resolved_model", row, null, response)
|
|
1611
|
-
);
|
|
1845
|
+
(streamState = response._chunks),
|
|
1846
|
+
(tag = streamState.get(id))
|
|
1847
|
+
? resolveModelChunk(response, tag, row)
|
|
1848
|
+
: ((response = new ReactPromise("resolved_model", row, response)),
|
|
1849
|
+
streamState.set(id, response));
|
|
1612
1850
|
}
|
|
1613
1851
|
}
|
|
1852
|
+
function processBinaryChunk(weakResponse, streamState, chunk) {
|
|
1853
|
+
for (
|
|
1854
|
+
var i = 0,
|
|
1855
|
+
rowState = streamState._rowState,
|
|
1856
|
+
rowID = streamState._rowID,
|
|
1857
|
+
rowTag = streamState._rowTag,
|
|
1858
|
+
rowLength = streamState._rowLength,
|
|
1859
|
+
buffer = streamState._buffer,
|
|
1860
|
+
chunkLength = chunk.length;
|
|
1861
|
+
i < chunkLength;
|
|
1862
|
+
|
|
1863
|
+
) {
|
|
1864
|
+
var lastIdx = -1;
|
|
1865
|
+
switch (rowState) {
|
|
1866
|
+
case 0:
|
|
1867
|
+
lastIdx = chunk[i++];
|
|
1868
|
+
58 === lastIdx
|
|
1869
|
+
? (rowState = 1)
|
|
1870
|
+
: (rowID =
|
|
1871
|
+
(rowID << 4) | (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
|
|
1872
|
+
continue;
|
|
1873
|
+
case 1:
|
|
1874
|
+
rowState = chunk[i];
|
|
1875
|
+
84 === rowState ||
|
|
1876
|
+
65 === rowState ||
|
|
1877
|
+
79 === rowState ||
|
|
1878
|
+
111 === rowState ||
|
|
1879
|
+
85 === rowState ||
|
|
1880
|
+
83 === rowState ||
|
|
1881
|
+
115 === rowState ||
|
|
1882
|
+
76 === rowState ||
|
|
1883
|
+
108 === rowState ||
|
|
1884
|
+
71 === rowState ||
|
|
1885
|
+
103 === rowState ||
|
|
1886
|
+
77 === rowState ||
|
|
1887
|
+
109 === rowState ||
|
|
1888
|
+
86 === rowState
|
|
1889
|
+
? ((rowTag = rowState), (rowState = 2), i++)
|
|
1890
|
+
: (64 < rowState && 91 > rowState) ||
|
|
1891
|
+
35 === rowState ||
|
|
1892
|
+
114 === rowState ||
|
|
1893
|
+
120 === rowState
|
|
1894
|
+
? ((rowTag = rowState), (rowState = 3), i++)
|
|
1895
|
+
: ((rowTag = 0), (rowState = 3));
|
|
1896
|
+
continue;
|
|
1897
|
+
case 2:
|
|
1898
|
+
lastIdx = chunk[i++];
|
|
1899
|
+
44 === lastIdx
|
|
1900
|
+
? (rowState = 4)
|
|
1901
|
+
: (rowLength =
|
|
1902
|
+
(rowLength << 4) | (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
|
|
1903
|
+
continue;
|
|
1904
|
+
case 3:
|
|
1905
|
+
lastIdx = chunk.indexOf(10, i);
|
|
1906
|
+
break;
|
|
1907
|
+
case 4:
|
|
1908
|
+
(lastIdx = i + rowLength), lastIdx > chunk.length && (lastIdx = -1);
|
|
1909
|
+
}
|
|
1910
|
+
var offset = chunk.byteOffset + i;
|
|
1911
|
+
if (-1 < lastIdx)
|
|
1912
|
+
(rowLength = new Uint8Array(chunk.buffer, offset, lastIdx - i)),
|
|
1913
|
+
processFullBinaryRow(
|
|
1914
|
+
weakResponse,
|
|
1915
|
+
streamState,
|
|
1916
|
+
rowID,
|
|
1917
|
+
rowTag,
|
|
1918
|
+
buffer,
|
|
1919
|
+
rowLength
|
|
1920
|
+
),
|
|
1921
|
+
(i = lastIdx),
|
|
1922
|
+
3 === rowState && i++,
|
|
1923
|
+
(rowLength = rowID = rowTag = rowState = 0),
|
|
1924
|
+
(buffer.length = 0);
|
|
1925
|
+
else {
|
|
1926
|
+
weakResponse = new Uint8Array(chunk.buffer, offset, chunk.byteLength - i);
|
|
1927
|
+
buffer.push(weakResponse);
|
|
1928
|
+
rowLength -= weakResponse.byteLength;
|
|
1929
|
+
break;
|
|
1930
|
+
}
|
|
1931
|
+
}
|
|
1932
|
+
streamState._rowState = rowState;
|
|
1933
|
+
streamState._rowID = rowID;
|
|
1934
|
+
streamState._rowTag = rowTag;
|
|
1935
|
+
streamState._rowLength = rowLength;
|
|
1936
|
+
}
|
|
1614
1937
|
function createFromJSONCallback(response) {
|
|
1615
1938
|
return function (key, value) {
|
|
1616
1939
|
if ("string" === typeof value)
|
|
@@ -1632,15 +1955,10 @@ function createFromJSONCallback(response) {
|
|
|
1632
1955
|
(initializingHandler = value.parent),
|
|
1633
1956
|
value.errored)
|
|
1634
1957
|
)
|
|
1635
|
-
(key = new ReactPromise("rejected", null, value.
|
|
1958
|
+
(key = new ReactPromise("rejected", null, value.reason)),
|
|
1636
1959
|
(key = createLazyChunkWrapper(key));
|
|
1637
1960
|
else if (0 < value.deps) {
|
|
1638
|
-
var blockedChunk = new ReactPromise(
|
|
1639
|
-
"blocked",
|
|
1640
|
-
null,
|
|
1641
|
-
null,
|
|
1642
|
-
response
|
|
1643
|
-
);
|
|
1961
|
+
var blockedChunk = new ReactPromise("blocked", null, null);
|
|
1644
1962
|
value.value = key;
|
|
1645
1963
|
value.chunk = blockedChunk;
|
|
1646
1964
|
key = createLazyChunkWrapper(blockedChunk);
|
|
@@ -1651,34 +1969,57 @@ function createFromJSONCallback(response) {
|
|
|
1651
1969
|
return value;
|
|
1652
1970
|
};
|
|
1653
1971
|
}
|
|
1654
|
-
function
|
|
1972
|
+
function close(weakResponse) {
|
|
1973
|
+
reportGlobalError(weakResponse, Error("Connection closed."));
|
|
1974
|
+
}
|
|
1975
|
+
function noServerCall$1() {
|
|
1655
1976
|
throw Error(
|
|
1656
1977
|
"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."
|
|
1657
1978
|
);
|
|
1658
1979
|
}
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1980
|
+
function createResponseFromOptions(options) {
|
|
1981
|
+
return new ResponseInstance(
|
|
1982
|
+
options.serverConsumerManifest.moduleMap,
|
|
1983
|
+
options.serverConsumerManifest.serverModuleMap,
|
|
1984
|
+
options.serverConsumerManifest.moduleLoading,
|
|
1985
|
+
noServerCall$1,
|
|
1986
|
+
options.encodeFormAction,
|
|
1987
|
+
"string" === typeof options.nonce ? options.nonce : void 0,
|
|
1988
|
+
options && options.temporaryReferences
|
|
1989
|
+
? options.temporaryReferences
|
|
1990
|
+
: void 0
|
|
1991
|
+
);
|
|
1992
|
+
}
|
|
1993
|
+
function startReadingFromStream$1(response, stream, onDone) {
|
|
1994
|
+
function progress(_ref) {
|
|
1995
|
+
var value = _ref.value;
|
|
1996
|
+
if (_ref.done) return onDone();
|
|
1997
|
+
processBinaryChunk(response, streamState, value);
|
|
1998
|
+
return reader.read().then(progress).catch(error);
|
|
1999
|
+
}
|
|
2000
|
+
function error(e) {
|
|
2001
|
+
reportGlobalError(response, e);
|
|
2002
|
+
}
|
|
2003
|
+
var streamState = createStreamState(),
|
|
2004
|
+
reader = stream.getReader();
|
|
2005
|
+
reader.read().then(progress).catch(error);
|
|
2006
|
+
}
|
|
2007
|
+
function noServerCall() {
|
|
2008
|
+
throw Error(
|
|
2009
|
+
"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."
|
|
1672
2010
|
);
|
|
2011
|
+
}
|
|
2012
|
+
function startReadingFromStream(response, stream, onEnd) {
|
|
2013
|
+
var streamState = createStreamState();
|
|
1673
2014
|
stream.on("data", function (chunk) {
|
|
1674
2015
|
if ("string" === typeof chunk) {
|
|
1675
2016
|
for (
|
|
1676
2017
|
var i = 0,
|
|
1677
|
-
rowState =
|
|
1678
|
-
rowID =
|
|
1679
|
-
rowTag =
|
|
1680
|
-
rowLength =
|
|
1681
|
-
buffer =
|
|
2018
|
+
rowState = streamState._rowState,
|
|
2019
|
+
rowID = streamState._rowID,
|
|
2020
|
+
rowTag = streamState._rowTag,
|
|
2021
|
+
rowLength = streamState._rowLength,
|
|
2022
|
+
buffer = streamState._buffer,
|
|
1682
2023
|
chunkLength = chunk.length;
|
|
1683
2024
|
i < chunkLength;
|
|
1684
2025
|
|
|
@@ -1743,7 +2084,7 @@ exports.createFromNodeStream = function (
|
|
|
1743
2084
|
"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."
|
|
1744
2085
|
);
|
|
1745
2086
|
i = chunk.slice(i, lastIdx);
|
|
1746
|
-
processFullStringRow(response, rowID, rowTag, i);
|
|
2087
|
+
processFullStringRow(response, streamState, rowID, rowTag, i);
|
|
1747
2088
|
i = lastIdx;
|
|
1748
2089
|
3 === rowState && i++;
|
|
1749
2090
|
rowLength = rowID = rowTag = rowState = 0;
|
|
@@ -1753,105 +2094,84 @@ exports.createFromNodeStream = function (
|
|
|
1753
2094
|
"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."
|
|
1754
2095
|
);
|
|
1755
2096
|
}
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
} else
|
|
1761
|
-
rowLength = 0;
|
|
1762
|
-
chunkLength = response._rowState;
|
|
1763
|
-
rowID = response._rowID;
|
|
1764
|
-
i = response._rowTag;
|
|
1765
|
-
rowState = response._rowLength;
|
|
1766
|
-
buffer = response._buffer;
|
|
1767
|
-
for (rowTag = chunk.length; rowLength < rowTag; ) {
|
|
1768
|
-
lastIdx = -1;
|
|
1769
|
-
switch (chunkLength) {
|
|
1770
|
-
case 0:
|
|
1771
|
-
lastIdx = chunk[rowLength++];
|
|
1772
|
-
58 === lastIdx
|
|
1773
|
-
? (chunkLength = 1)
|
|
1774
|
-
: (rowID =
|
|
1775
|
-
(rowID << 4) | (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
|
|
1776
|
-
continue;
|
|
1777
|
-
case 1:
|
|
1778
|
-
chunkLength = chunk[rowLength];
|
|
1779
|
-
84 === chunkLength ||
|
|
1780
|
-
65 === chunkLength ||
|
|
1781
|
-
79 === chunkLength ||
|
|
1782
|
-
111 === chunkLength ||
|
|
1783
|
-
85 === chunkLength ||
|
|
1784
|
-
83 === chunkLength ||
|
|
1785
|
-
115 === chunkLength ||
|
|
1786
|
-
76 === chunkLength ||
|
|
1787
|
-
108 === chunkLength ||
|
|
1788
|
-
71 === chunkLength ||
|
|
1789
|
-
103 === chunkLength ||
|
|
1790
|
-
77 === chunkLength ||
|
|
1791
|
-
109 === chunkLength ||
|
|
1792
|
-
86 === chunkLength
|
|
1793
|
-
? ((i = chunkLength), (chunkLength = 2), rowLength++)
|
|
1794
|
-
: (64 < chunkLength && 91 > chunkLength) ||
|
|
1795
|
-
35 === chunkLength ||
|
|
1796
|
-
114 === chunkLength ||
|
|
1797
|
-
120 === chunkLength
|
|
1798
|
-
? ((i = chunkLength), (chunkLength = 3), rowLength++)
|
|
1799
|
-
: ((i = 0), (chunkLength = 3));
|
|
1800
|
-
continue;
|
|
1801
|
-
case 2:
|
|
1802
|
-
lastIdx = chunk[rowLength++];
|
|
1803
|
-
44 === lastIdx
|
|
1804
|
-
? (chunkLength = 4)
|
|
1805
|
-
: (rowState =
|
|
1806
|
-
(rowState << 4) |
|
|
1807
|
-
(96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
|
|
1808
|
-
continue;
|
|
1809
|
-
case 3:
|
|
1810
|
-
lastIdx = chunk.indexOf(10, rowLength);
|
|
1811
|
-
break;
|
|
1812
|
-
case 4:
|
|
1813
|
-
(lastIdx = rowLength + rowState),
|
|
1814
|
-
lastIdx > chunk.length && (lastIdx = -1);
|
|
1815
|
-
}
|
|
1816
|
-
var offset = chunk.byteOffset + rowLength;
|
|
1817
|
-
if (-1 < lastIdx)
|
|
1818
|
-
(rowState = new Uint8Array(
|
|
1819
|
-
chunk.buffer,
|
|
1820
|
-
offset,
|
|
1821
|
-
lastIdx - rowLength
|
|
1822
|
-
)),
|
|
1823
|
-
processFullBinaryRow(response, rowID, i, buffer, rowState),
|
|
1824
|
-
(rowLength = lastIdx),
|
|
1825
|
-
3 === chunkLength && rowLength++,
|
|
1826
|
-
(rowState = rowID = i = chunkLength = 0),
|
|
1827
|
-
(buffer.length = 0);
|
|
1828
|
-
else {
|
|
1829
|
-
chunk = new Uint8Array(
|
|
1830
|
-
chunk.buffer,
|
|
1831
|
-
offset,
|
|
1832
|
-
chunk.byteLength - rowLength
|
|
1833
|
-
);
|
|
1834
|
-
buffer.push(chunk);
|
|
1835
|
-
rowState -= chunk.byteLength;
|
|
1836
|
-
break;
|
|
1837
|
-
}
|
|
1838
|
-
}
|
|
1839
|
-
response._rowState = chunkLength;
|
|
1840
|
-
response._rowID = rowID;
|
|
1841
|
-
response._rowTag = i;
|
|
1842
|
-
response._rowLength = rowState;
|
|
1843
|
-
}
|
|
2097
|
+
streamState._rowState = rowState;
|
|
2098
|
+
streamState._rowID = rowID;
|
|
2099
|
+
streamState._rowTag = rowTag;
|
|
2100
|
+
streamState._rowLength = rowLength;
|
|
2101
|
+
} else processBinaryChunk(response, streamState, chunk);
|
|
1844
2102
|
});
|
|
1845
2103
|
stream.on("error", function (error) {
|
|
1846
2104
|
reportGlobalError(response, error);
|
|
1847
2105
|
});
|
|
1848
|
-
stream.on("end",
|
|
1849
|
-
|
|
1850
|
-
|
|
2106
|
+
stream.on("end", onEnd);
|
|
2107
|
+
}
|
|
2108
|
+
exports.createFromFetch = function (promiseForResponse, options) {
|
|
2109
|
+
var response = createResponseFromOptions(options);
|
|
2110
|
+
promiseForResponse.then(
|
|
2111
|
+
function (r) {
|
|
2112
|
+
startReadingFromStream$1(response, r.body, close.bind(null, response));
|
|
2113
|
+
},
|
|
2114
|
+
function (e) {
|
|
2115
|
+
reportGlobalError(response, e);
|
|
2116
|
+
}
|
|
2117
|
+
);
|
|
1851
2118
|
return getChunk(response, 0);
|
|
1852
2119
|
};
|
|
2120
|
+
exports.createFromNodeStream = function (
|
|
2121
|
+
stream,
|
|
2122
|
+
serverConsumerManifest,
|
|
2123
|
+
options
|
|
2124
|
+
) {
|
|
2125
|
+
serverConsumerManifest = new ResponseInstance(
|
|
2126
|
+
serverConsumerManifest.moduleMap,
|
|
2127
|
+
serverConsumerManifest.serverModuleMap,
|
|
2128
|
+
serverConsumerManifest.moduleLoading,
|
|
2129
|
+
noServerCall,
|
|
2130
|
+
options ? options.encodeFormAction : void 0,
|
|
2131
|
+
options && "string" === typeof options.nonce ? options.nonce : void 0,
|
|
2132
|
+
void 0
|
|
2133
|
+
);
|
|
2134
|
+
startReadingFromStream(
|
|
2135
|
+
serverConsumerManifest,
|
|
2136
|
+
stream,
|
|
2137
|
+
close.bind(null, serverConsumerManifest)
|
|
2138
|
+
);
|
|
2139
|
+
return getChunk(serverConsumerManifest, 0);
|
|
2140
|
+
};
|
|
2141
|
+
exports.createFromReadableStream = function (stream, options) {
|
|
2142
|
+
options = createResponseFromOptions(options);
|
|
2143
|
+
startReadingFromStream$1(options, stream, close.bind(null, options));
|
|
2144
|
+
return getChunk(options, 0);
|
|
2145
|
+
};
|
|
1853
2146
|
exports.createServerReference = function (id) {
|
|
1854
|
-
return createServerReference$1(id, noServerCall);
|
|
2147
|
+
return createServerReference$1(id, noServerCall$1);
|
|
2148
|
+
};
|
|
2149
|
+
exports.createTemporaryReferenceSet = function () {
|
|
2150
|
+
return new Map();
|
|
2151
|
+
};
|
|
2152
|
+
exports.encodeReply = function (value, options) {
|
|
2153
|
+
return new Promise(function (resolve, reject) {
|
|
2154
|
+
var abort = processReply(
|
|
2155
|
+
value,
|
|
2156
|
+
"",
|
|
2157
|
+
options && options.temporaryReferences
|
|
2158
|
+
? options.temporaryReferences
|
|
2159
|
+
: void 0,
|
|
2160
|
+
resolve,
|
|
2161
|
+
reject
|
|
2162
|
+
);
|
|
2163
|
+
if (options && options.signal) {
|
|
2164
|
+
var signal = options.signal;
|
|
2165
|
+
if (signal.aborted) abort(signal.reason);
|
|
2166
|
+
else {
|
|
2167
|
+
var listener = function () {
|
|
2168
|
+
abort(signal.reason);
|
|
2169
|
+
signal.removeEventListener("abort", listener);
|
|
2170
|
+
};
|
|
2171
|
+
signal.addEventListener("abort", listener);
|
|
2172
|
+
}
|
|
2173
|
+
}
|
|
2174
|
+
});
|
|
1855
2175
|
};
|
|
1856
2176
|
exports.registerServerReference = function (reference, id, encodeFormAction) {
|
|
1857
2177
|
registerBoundServerReference(reference, id, null, encodeFormAction);
|