react-server-dom-webpack 18.3.0-canary-ce6842d8f-20230610 → 18.3.0-canary-88df88f94-20230613
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/react-server-dom-webpack-client.browser.development.js +176 -29
- package/cjs/react-server-dom-webpack-client.browser.production.min.js +24 -24
- package/cjs/react-server-dom-webpack-client.edge.development.js +176 -29
- package/cjs/react-server-dom-webpack-client.edge.production.min.js +23 -23
- package/cjs/react-server-dom-webpack-client.node.development.js +176 -29
- package/cjs/react-server-dom-webpack-client.node.production.min.js +25 -24
- package/cjs/react-server-dom-webpack-client.node.unbundled.development.js +176 -29
- package/cjs/react-server-dom-webpack-client.node.unbundled.production.min.js +24 -23
- package/cjs/react-server-dom-webpack-server.browser.development.js +32 -8
- package/cjs/react-server-dom-webpack-server.browser.production.min.js +46 -46
- package/cjs/react-server-dom-webpack-server.edge.development.js +32 -8
- package/cjs/react-server-dom-webpack-server.edge.production.min.js +49 -49
- package/cjs/react-server-dom-webpack-server.node.development.js +32 -8
- package/cjs/react-server-dom-webpack-server.node.production.min.js +37 -37
- package/cjs/react-server-dom-webpack-server.node.unbundled.development.js +32 -8
- package/cjs/react-server-dom-webpack-server.node.unbundled.production.min.js +56 -56
- package/package.json +3 -3
- package/umd/react-server-dom-webpack-client.browser.development.js +176 -29
- package/umd/react-server-dom-webpack-client.browser.production.min.js +21 -20
- package/umd/react-server-dom-webpack-server.browser.development.js +32 -8
- package/umd/react-server-dom-webpack-server.browser.production.min.js +43 -42
@@ -213,6 +213,9 @@ function stringToChunk(content) {
|
|
213
213
|
return content;
|
214
214
|
}
|
215
215
|
var precomputedChunkSet = new Set() ;
|
216
|
+
function byteLengthOfChunk(chunk) {
|
217
|
+
return typeof chunk === 'string' ? Buffer.byteLength(chunk, 'utf8') : chunk.byteLength;
|
218
|
+
}
|
216
219
|
function closeWithError(destination, error) {
|
217
220
|
// $FlowFixMe[incompatible-call]: This is an Error object or the destination accepts other types.
|
218
221
|
destination.destroy(error);
|
@@ -1250,7 +1253,7 @@ function createRequest(model, bundlerConfig, onError, context, identifierPrefix)
|
|
1250
1253
|
pingedTasks: pingedTasks,
|
1251
1254
|
completedImportChunks: [],
|
1252
1255
|
completedHintChunks: [],
|
1253
|
-
|
1256
|
+
completedRegularChunks: [],
|
1254
1257
|
completedErrorChunks: [],
|
1255
1258
|
writtenSymbols: new Map(),
|
1256
1259
|
writtenClientReferences: new Map(),
|
@@ -1702,11 +1705,20 @@ function serializeServerReference(request, parent, key, serverReference) {
|
|
1702
1705
|
var metadataId = request.nextChunkId++; // We assume that this object doesn't suspend.
|
1703
1706
|
|
1704
1707
|
var processedChunk = processModelChunk(request, metadataId, serverReferenceMetadata);
|
1705
|
-
request.
|
1708
|
+
request.completedRegularChunks.push(processedChunk);
|
1706
1709
|
writtenServerReferences.set(serverReference, metadataId);
|
1707
1710
|
return serializeServerReferenceID(metadataId);
|
1708
1711
|
}
|
1709
1712
|
|
1713
|
+
function serializeLargeTextString(request, text) {
|
1714
|
+
request.pendingChunks += 2;
|
1715
|
+
var textId = request.nextChunkId++;
|
1716
|
+
var textChunk = stringToChunk(text);
|
1717
|
+
var headerChunk = processTextHeader(request, textId, text, byteLengthOfChunk(textChunk));
|
1718
|
+
request.completedRegularChunks.push(headerChunk, textChunk);
|
1719
|
+
return serializeByValueID(textId);
|
1720
|
+
}
|
1721
|
+
|
1710
1722
|
function escapeStringValue(value) {
|
1711
1723
|
if (value[0] === '$') {
|
1712
1724
|
// We need to escape $ prefixed strings since we use those to encode
|
@@ -1898,6 +1910,13 @@ function resolveModelToJSON(request, parent, key, value) {
|
|
1898
1910
|
}
|
1899
1911
|
}
|
1900
1912
|
|
1913
|
+
if (value.length >= 1024) {
|
1914
|
+
// For large strings, we encode them outside the JSON payload so that we
|
1915
|
+
// don't have to double encode and double parse the strings. This can also
|
1916
|
+
// be more compact in case the string has a lot of escaped characters.
|
1917
|
+
return serializeLargeTextString(request, value);
|
1918
|
+
}
|
1919
|
+
|
1901
1920
|
return escapeStringValue(value);
|
1902
1921
|
}
|
1903
1922
|
|
@@ -2036,7 +2055,7 @@ function emitSymbolChunk(request, id, name) {
|
|
2036
2055
|
function emitProviderChunk(request, id, contextName) {
|
2037
2056
|
var contextReference = serializeProviderReference(contextName);
|
2038
2057
|
var processedChunk = processReferenceChunk(request, id, contextReference);
|
2039
|
-
request.
|
2058
|
+
request.completedRegularChunks.push(processedChunk);
|
2040
2059
|
}
|
2041
2060
|
|
2042
2061
|
function retryTask(request, task) {
|
@@ -2076,7 +2095,7 @@ function retryTask(request, task) {
|
|
2076
2095
|
}
|
2077
2096
|
|
2078
2097
|
var processedChunk = processModelChunk(request, task.id, value);
|
2079
|
-
request.
|
2098
|
+
request.completedRegularChunks.push(processedChunk);
|
2080
2099
|
request.abortableTasks.delete(task);
|
2081
2100
|
task.status = COMPLETED;
|
2082
2101
|
} catch (thrownValue) {
|
@@ -2187,12 +2206,12 @@ function flushCompletedChunks(request, destination) {
|
|
2187
2206
|
|
2188
2207
|
hintChunks.splice(0, i); // Next comes model data.
|
2189
2208
|
|
2190
|
-
var
|
2209
|
+
var regularChunks = request.completedRegularChunks;
|
2191
2210
|
i = 0;
|
2192
2211
|
|
2193
|
-
for (; i <
|
2212
|
+
for (; i < regularChunks.length; i++) {
|
2194
2213
|
request.pendingChunks--;
|
2195
|
-
var _chunk2 =
|
2214
|
+
var _chunk2 = regularChunks[i];
|
2196
2215
|
|
2197
2216
|
var _keepWriting2 = writeChunkAndReturn(destination, _chunk2);
|
2198
2217
|
|
@@ -2203,7 +2222,7 @@ function flushCompletedChunks(request, destination) {
|
|
2203
2222
|
}
|
2204
2223
|
}
|
2205
2224
|
|
2206
|
-
|
2225
|
+
regularChunks.splice(0, i); // Finally, errors are sent. The idea is that it's ok to delay
|
2207
2226
|
// any error messages and prioritize display of other parts of
|
2208
2227
|
// the page.
|
2209
2228
|
|
@@ -2391,6 +2410,11 @@ function processHintChunk(request, id, code, model) {
|
|
2391
2410
|
return stringToChunk(row);
|
2392
2411
|
}
|
2393
2412
|
|
2413
|
+
function processTextHeader(request, id, text, binaryLength) {
|
2414
|
+
var row = id.toString(16) + ':T' + binaryLength.toString(16) + ',';
|
2415
|
+
return stringToChunk(row);
|
2416
|
+
}
|
2417
|
+
|
2394
2418
|
// eslint-disable-next-line no-unused-vars
|
2395
2419
|
function resolveServerReference(bundlerConfig, id) {
|
2396
2420
|
var name = '';
|
@@ -12,7 +12,7 @@ function t(a,b){if("string"===typeof b){if(0!==b.length)if(2048<3*b.length)0<m&&
|
|
12
12
|
(0===d?r(a,l):(l.set(b.subarray(0,d),m),m+=d,r(a,l),b=b.subarray(d)),l=new Uint8Array(2048),m=0),l.set(b,m),m+=b.byteLength,2048===m&&(r(a,l),l=new Uint8Array(2048),m=0)));return p}var ea=new aa.TextEncoder,v=Symbol.for("react.client.reference"),fa=Symbol.for("react.server.reference"),la={prefetchDNS:ha,preconnect:ia,preload:ja,preinit:ka};function ha(a,b){if("string"===typeof a){var d=w();if(d){var c=d.hints,e="D"+a;c.has(e)||(c.add(e),b?x(d,"D",[a,b]):x(d,"D",a),y(d))}}}
|
13
13
|
function ia(a,b){if("string"===typeof a){var d=w();if(d){var c=d.hints,e=null==b||"string"!==typeof b.crossOrigin?null:"use-credentials"===b.crossOrigin?"use-credentials":"";e="C"+(null===e?"null":e)+"|"+a;c.has(e)||(c.add(e),b?x(d,"C",[a,b]):x(d,"C",a),y(d))}}}function ja(a,b){if("string"===typeof a){var d=w();if(d){var c=d.hints,e="L"+a;c.has(e)||(c.add(e),x(d,"L",[a,b]),y(d))}}}
|
14
14
|
function ka(a,b){if("string"===typeof a){var d=w();if(d){var c=d.hints,e="I"+a;c.has(e)||(c.add(e),x(d,"I",[a,b]),y(d))}}}
|
15
|
-
var ma=da.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Dispatcher,
|
15
|
+
var ma=da.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Dispatcher,na=new ba.AsyncLocalStorage,z=Symbol.for("react.element"),pa=Symbol.for("react.fragment"),qa=Symbol.for("react.provider"),ra=Symbol.for("react.server_context"),sa=Symbol.for("react.forward_ref"),ta=Symbol.for("react.suspense"),ua=Symbol.for("react.suspense_list"),va=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),wa=Symbol.for("react.default_value"),xa=Symbol.for("react.memo_cache_sentinel"),ya=Symbol.iterator,D=null;
|
16
16
|
function E(a,b){if(a!==b){a.context._currentValue=a.parentValue;a=a.parent;var d=b.parent;if(null===a){if(null!==d)throw Error("The stacks must reach the root at the same time. This is a bug in React.");}else{if(null===d)throw Error("The stacks must reach the root at the same time. This is a bug in React.");E(a,d);b.context._currentValue=b.value}}}function za(a){a.context._currentValue=a.parentValue;a=a.parent;null!==a&&za(a)}
|
17
17
|
function Aa(a){var b=a.parent;null!==b&&Aa(b);a.context._currentValue=a.value}function Ba(a,b){a.context._currentValue=a.parentValue;a=a.parent;if(null===a)throw Error("The depth must equal at least at zero before reaching the root. This is a bug in React.");a.depth===b.depth?E(a,b):Ba(a,b)}
|
18
18
|
function Ca(a,b){var d=b.parent;if(null===d)throw Error("The depth must equal at least at zero before reaching the root. This is a bug in React.");a.depth===d.depth?E(a,d):Ca(a,d);b.context._currentValue=b.value}function Da(a){var b=D;b!==a&&(null===b?Aa(a):null===a?za(b):b.depth===a.depth?E(b,a):b.depth>a.depth?Ba(b,a):Ca(b,a),D=a)}function Ea(a,b){var d=a._currentValue;a._currentValue=b;var c=D;return D=a={parent:c,depth:null===c?0:c.depth+1,context:a,parentValue:d,value:b}}var Fa=Error("Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`");
|
@@ -24,46 +24,46 @@ function Na(a){if(null!==a&&"object"===typeof a||"function"===typeof a){if("func
|
|
24
24
|
var Ra={getCacheSignal:function(){var a=Qa(),b=a.get(Pa);void 0===b&&(b=Pa(),a.set(Pa,b));return b},getCacheForType:function(a){var b=Qa(),d=b.get(a);void 0===d&&(d=a(),b.set(a,d));return d}},Sa=Array.isArray;function Ta(a){return Object.prototype.toString.call(a).replace(/^\[object (.*)\]$/,function(b,d){return d})}
|
25
25
|
function Ua(a){switch(typeof a){case "string":return JSON.stringify(10>=a.length?a:a.slice(0,10)+"...");case "object":if(Sa(a))return"[...]";a=Ta(a);return"Object"===a?"{...}":a;case "function":return"function";default:return String(a)}}
|
26
26
|
function K(a){if("string"===typeof a)return a;switch(a){case ta:return"Suspense";case ua:return"SuspenseList"}if("object"===typeof a)switch(a.$$typeof){case sa:return K(a.render);case va:return K(a.type);case C:var b=a._payload;a=a._init;try{return K(a(b))}catch(d){}}return""}
|
27
|
-
function L(a,b){var d=Ta(a);if("Object"!==d&&"Array"!==d)return d;d=-1;var c=0;if(Sa(a)){var e="[";for(var f=0;f<a.length;f++){0<f&&(e+=", ");var g=a[f];g="object"===typeof g&&null!==g?L(g):Ua(g);""+f===b?(d=e.length,c=g.length,e+=g):e=10>g.length&&40>e.length+g.length?e+g:e+"..."}e+="]"}else if(a.$$typeof===
|
27
|
+
function L(a,b){var d=Ta(a);if("Object"!==d&&"Array"!==d)return d;d=-1;var c=0;if(Sa(a)){var e="[";for(var f=0;f<a.length;f++){0<f&&(e+=", ");var g=a[f];g="object"===typeof g&&null!==g?L(g):Ua(g);""+f===b?(d=e.length,c=g.length,e+=g):e=10>g.length&&40>e.length+g.length?e+g:e+"..."}e+="]"}else if(a.$$typeof===z)e="<"+K(a.type)+"/>";else{e="{";f=Object.keys(a);for(g=0;g<f.length;g++){0<g&&(e+=", ");var h=f[g],k=JSON.stringify(h);e+=('"'+h+'"'===k?h:k)+": ";k=a[h];k="object"===typeof k&&null!==k?L(k):
|
28
28
|
Ua(k);h===b?(d=e.length,c=k.length,e+=k):e=10>k.length&&40>e.length+k.length?e+k:e+"..."}e+="}"}return void 0===b?e:-1<d&&0<c?(a=" ".repeat(d)+"^".repeat(c),"\n "+e+"\n "+a):"\n "+e}var Va=ca.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Wa=Va.ContextRegistry,M=JSON.stringify,Xa=Va.ReactCurrentDispatcher,Ya=Va.ReactCurrentCache;function Za(a){console.error(a)}
|
29
|
-
function $a(a,b,d,c,e){if(null!==Ya.current&&Ya.current!==Ra)throw Error("Currently React only supports one RSC renderer at a time.");ma.current=la;Ya.current=Ra;var f=new Set,g=[],h=new Set,k={status:0,flushScheduled:!1,fatalError:null,destination:null,bundlerConfig:b,cache:new Map,nextChunkId:0,pendingChunks:0,hints:h,abortableTasks:f,pingedTasks:g,completedImportChunks:[],completedHintChunks:[],
|
30
|
-
writtenServerReferences:new Map,writtenProviders:new Map,identifierPrefix:e||"",identifierCount:1,onError:void 0===d?Za:d,toJSON:function(q,u){return ab(k,this,q,u)}};k.pendingChunks++;b=bb(c);a=cb(k,a,b,f);g.push(a);return k}var N=null;function w(){if(N)return N;var a=
|
29
|
+
function $a(a,b,d,c,e){if(null!==Ya.current&&Ya.current!==Ra)throw Error("Currently React only supports one RSC renderer at a time.");ma.current=la;Ya.current=Ra;var f=new Set,g=[],h=new Set,k={status:0,flushScheduled:!1,fatalError:null,destination:null,bundlerConfig:b,cache:new Map,nextChunkId:0,pendingChunks:0,hints:h,abortableTasks:f,pingedTasks:g,completedImportChunks:[],completedHintChunks:[],completedRegularChunks:[],completedErrorChunks:[],writtenSymbols:new Map,writtenClientReferences:new Map,
|
30
|
+
writtenServerReferences:new Map,writtenProviders:new Map,identifierPrefix:e||"",identifierCount:1,onError:void 0===d?Za:d,toJSON:function(q,u){return ab(k,this,q,u)}};k.pendingChunks++;b=bb(c);a=cb(k,a,b,f);g.push(a);return k}var N=null;function w(){if(N)return N;var a=na.getStore();return a?a:null}var db={};
|
31
31
|
function eb(a,b){a.pendingChunks++;var d=cb(a,null,D,a.abortableTasks);switch(b.status){case "fulfilled":return d.model=b.value,fb(a,d),d.id;case "rejected":var c=O(a,b.reason);P(a,d.id,c);return d.id;default:"string"!==typeof b.status&&(b.status="pending",b.then(function(e){"pending"===b.status&&(b.status="fulfilled",b.value=e)},function(e){"pending"===b.status&&(b.status="rejected",b.reason=e)}))}b.then(function(e){d.model=e;fb(a,d)},function(e){d.status=4;e=O(a,e);P(a,d.id,e);null!==a.destination&&
|
32
32
|
Q(a,a.destination)});return d.id}function gb(a){if("fulfilled"===a.status)return a.value;if("rejected"===a.status)throw a.reason;throw a;}function hb(a){switch(a.status){case "fulfilled":case "rejected":break;default:"string"!==typeof a.status&&(a.status="pending",a.then(function(b){"pending"===a.status&&(a.status="fulfilled",a.value=b)},function(b){"pending"===a.status&&(a.status="rejected",a.reason=b)}))}return{$$typeof:C,_payload:a,_init:gb}}
|
33
|
-
function R(a,b,d,c,e,f){if(null!==c&&void 0!==c)throw Error("Refs cannot be used in Server Components, nor passed to Client Components.");if("function"===typeof b){if(b.$$typeof===v)return[
|
34
|
-
b._init;b=g(b._payload);return R(a,b,d,c,e,f);case sa:return a=b.render,H=0,I=f,a(e,void 0);case va:return R(a,b.type,d,c,e,f);case qa:return Ea(b._context,e.value),[
|
35
|
-
function cb(a,b,d,c){var e={id:a.nextChunkId++,status:0,model:b,context:d,ping:function(){return fb(a,e)},thenableState:null};c.add(e);return e}
|
36
|
-
function jb(a,b,d,c){var e=c.$$async?c.$$id+"#async":c.$$id,f=a.writtenClientReferences,g=f.get(e);if(void 0!==g)return b[0]===
|
37
|
-
|
38
|
-
function ab(a,b,d,c){switch(c){case
|
39
|
-
c.toString(16)}if(null===c)return null;if("object"===typeof c){if(c.$$typeof===v)return jb(a,b,d,c);if("function"===typeof c.then)return"$@"+eb(a,c).toString(16);if(c.$$typeof===qa)return c=c._context._globalName,b=a.writtenProviders,d=b.get(d),void 0===d&&(a.pendingChunks++,d=a.nextChunkId++,b.set(c,d),c=kb(a,d,"$P"+c),a.
|
40
|
-
|
41
|
-
typeof c)return"$undefined";if("function"===typeof c){if(c.$$typeof===v)return jb(a,b,d,c);if(c.$$typeof===fa)return d=a.writtenServerReferences,b=d.get(c),void 0!==b?a="$F"+b.toString(16):(b=c.$$bound,e={id:c.$$id,bound:b?Promise.resolve(b):null},a.pendingChunks++,b=a.nextChunkId++,e=lb(a,b,e),a.
|
42
|
-
throw Error('Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server".'+L(b,d));}if("symbol"===typeof c){e=a.writtenSymbols;f=e.get(c);if(void 0!==f)return
|
43
|
-
kb(a,d,"$S"+f);a.completedImportChunks.push(b);e.set(c,d);return
|
33
|
+
function R(a,b,d,c,e,f){if(null!==c&&void 0!==c)throw Error("Refs cannot be used in Server Components, nor passed to Client Components.");if("function"===typeof b){if(b.$$typeof===v)return[z,b,d,e];H=0;I=f;e=b(e);return"object"===typeof e&&null!==e&&"function"===typeof e.then?"fulfilled"===e.status?e.value:hb(e):e}if("string"===typeof b)return[z,b,d,e];if("symbol"===typeof b)return b===pa?e.children:[z,b,d,e];if(null!=b&&"object"===typeof b){if(b.$$typeof===v)return[z,b,d,e];switch(b.$$typeof){case C:var g=
|
34
|
+
b._init;b=g(b._payload);return R(a,b,d,c,e,f);case sa:return a=b.render,H=0,I=f,a(e,void 0);case va:return R(a,b.type,d,c,e,f);case qa:return Ea(b._context,e.value),[z,b,d,{value:e.value,children:e.children,__pop:db}]}}throw Error("Unsupported Server Component type: "+Ua(b));}function fb(a,b){var d=a.pingedTasks;d.push(b);1===d.length&&(a.flushScheduled=null!==a.destination,setImmediate(function(){return ib(a)}))}
|
35
|
+
function cb(a,b,d,c){var e={id:a.nextChunkId++,status:0,model:b,context:d,ping:function(){return fb(a,e)},thenableState:null};c.add(e);return e}function S(a){return"$"+a.toString(16)}
|
36
|
+
function jb(a,b,d,c){var e=c.$$async?c.$$id+"#async":c.$$id,f=a.writtenClientReferences,g=f.get(e);if(void 0!==g)return b[0]===z&&"1"===d?"$L"+g.toString(16):S(g);try{var h=a.bundlerConfig,k=c.$$id;g="";var q=h[k];if(q)g=q.name;else{var u=k.lastIndexOf("#");-1!==u&&(g=k.slice(u+1),q=h[k.slice(0,u)]);if(!q)throw Error('Could not find the module "'+k+'" in the React Client Manifest. This is probably a bug in the React Server Components bundler.');}var n={id:q.id,chunks:q.chunks,name:g,async:!!c.$$async};
|
37
|
+
a.pendingChunks++;var A=a.nextChunkId++,oa=M(n);var B=A.toString(16)+":I"+oa+"\n";a.completedImportChunks.push(B);f.set(e,A);return b[0]===z&&"1"===d?"$L"+A.toString(16):S(A)}catch(Ab){return a.pendingChunks++,b=a.nextChunkId++,d=O(a,Ab),P(a,b,d),S(b)}}
|
38
|
+
function ab(a,b,d,c){switch(c){case z:return"$"}for(;"object"===typeof c&&null!==c&&(c.$$typeof===z||c.$$typeof===C);)try{switch(c.$$typeof){case z:var e=c;c=R(a,e.type,e.key,e.ref,e.props,null);break;case C:var f=c._init;c=f(c._payload)}}catch(g){d=g===Fa?Ia():g;if("object"===typeof d&&null!==d&&"function"===typeof d.then)return a.pendingChunks++,a=cb(a,c,D,a.abortableTasks),c=a.ping,d.then(c,c),a.thenableState=Ja(),"$L"+a.id.toString(16);a.pendingChunks++;c=a.nextChunkId++;d=O(a,d);P(a,c,d);return"$L"+
|
39
|
+
c.toString(16)}if(null===c)return null;if("object"===typeof c){if(c.$$typeof===v)return jb(a,b,d,c);if("function"===typeof c.then)return"$@"+eb(a,c).toString(16);if(c.$$typeof===qa)return c=c._context._globalName,b=a.writtenProviders,d=b.get(d),void 0===d&&(a.pendingChunks++,d=a.nextChunkId++,b.set(c,d),c=kb(a,d,"$P"+c),a.completedRegularChunks.push(c)),S(d);if(c===db){a=D;if(null===a)throw Error("Tried to pop a Context at the root of the app. This is a bug in React.");c=a.parentValue;a.context._currentValue=
|
40
|
+
c===wa?a.context._defaultValue:c;D=a.parent;return}return!Sa(c)&&(null===c||"object"!==typeof c?a=null:(a=ya&&c[ya]||c["@@iterator"],a="function"===typeof a?a:null),a)?Array.from(c):c}if("string"===typeof c){if("Z"===c[c.length-1]&&b[d]instanceof Date)return"$D"+c;if(1024<=c.length)return a.pendingChunks+=2,d=a.nextChunkId++,b="string"===typeof c?Buffer.byteLength(c,"utf8"):c.byteLength,b=d.toString(16)+":T"+b.toString(16)+",",a.completedRegularChunks.push(b,c),S(d);a="$"===c[0]?"$"+c:c;return a}if("boolean"===
|
41
|
+
typeof c)return c;if("number"===typeof c)return a=c,Number.isFinite(a)?0===a&&-Infinity===1/a?"$-0":a:Infinity===a?"$Infinity":-Infinity===a?"$-Infinity":"$NaN";if("undefined"===typeof c)return"$undefined";if("function"===typeof c){if(c.$$typeof===v)return jb(a,b,d,c);if(c.$$typeof===fa)return d=a.writtenServerReferences,b=d.get(c),void 0!==b?a="$F"+b.toString(16):(b=c.$$bound,e={id:c.$$id,bound:b?Promise.resolve(b):null},a.pendingChunks++,b=a.nextChunkId++,e=lb(a,b,e),a.completedRegularChunks.push(e),
|
42
|
+
d.set(c,b),a="$F"+b.toString(16)),a;if(/^on[A-Z]/.test(d))throw Error("Event handlers cannot be passed to Client Component props."+L(b,d)+"\nIf you need interactivity, consider converting part of this to a Client Component.");throw Error('Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server".'+L(b,d));}if("symbol"===typeof c){e=a.writtenSymbols;f=e.get(c);if(void 0!==f)return S(f);f=c.description;if(Symbol.for(f)!==c)throw Error("Only global symbols received from Symbol.for(...) can be passed to Client Components. The symbol Symbol.for("+
|
43
|
+
(c.description+") cannot be found among global symbols.")+L(b,d));a.pendingChunks++;d=a.nextChunkId++;b=kb(a,d,"$S"+f);a.completedImportChunks.push(b);e.set(c,d);return S(d)}if("bigint"===typeof c)return"$n"+c.toString(10);throw Error("Type "+typeof c+" is not supported in Client Component props."+L(b,d));}
|
44
44
|
function O(a,b){a=a.onError;b=a(b);if(null!=b&&"string"!==typeof b)throw Error('onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "'+typeof b+'" instead');return b||""}function mb(a,b){null!==a.destination?(a.status=2,a.destination.destroy(b)):(a.status=1,a.fatalError=b)}
|
45
45
|
function P(a,b,d){d={digest:d};b=b.toString(16)+":E"+M(d)+"\n";a.completedErrorChunks.push(b)}function x(a,b,d){var c=a.nextChunkId++;d=M(d);b="H"+b;c=c.toString(16)+":"+b;a.completedHintChunks.push(c+d+"\n")}
|
46
|
-
function ib(a){var b=Xa.current;Xa.current=Oa;var d=N;G=N=a;try{var c=a.pingedTasks;a.pingedTasks=[];for(var e=0;e<c.length;e++){var f=c[e];var g=a;if(0===f.status){Da(f.context);try{var h=f.model;if("object"===typeof h&&null!==h&&h.$$typeof===
|
47
|
-
f.status=1}catch(
|
48
|
-
function Q(a,b){l=new Uint8Array(2048);m=0;p=!0;try{for(var d=a.completedImportChunks,c=0;c<d.length;c++)if(a.pendingChunks--,!t(b,d[c])){a.destination=null;c++;break}d.splice(0,c);var e=a.completedHintChunks;for(c=0;c<e.length;c++)if(!t(b,e[c])){a.destination=null;c++;break}e.splice(0,c);var f=a.
|
49
|
-
null;c++;break}g.splice(0,c)}finally{a.flushScheduled=!1,l&&0<m&&b.write(l.subarray(0,m)),l=null,m=0,p=!0}"function"===typeof b.flush&&b.flush();0===a.pendingChunks&&b.end()}function nb(a){a.flushScheduled=null!==a.destination;setImmediate(function(){return
|
46
|
+
function ib(a){var b=Xa.current;Xa.current=Oa;var d=N;G=N=a;try{var c=a.pingedTasks;a.pingedTasks=[];for(var e=0;e<c.length;e++){var f=c[e];var g=a;if(0===f.status){Da(f.context);try{var h=f.model;if("object"===typeof h&&null!==h&&h.$$typeof===z){var k=h,q=f.thenableState;f.model=h;h=R(g,k.type,k.key,k.ref,k.props,q);for(f.thenableState=null;"object"===typeof h&&null!==h&&h.$$typeof===z;)k=h,f.model=h,h=R(g,k.type,k.key,k.ref,k.props,null)}var u=lb(g,f.id,h);g.completedRegularChunks.push(u);g.abortableTasks.delete(f);
|
47
|
+
f.status=1}catch(B){var n=B===Fa?Ia():B;if("object"===typeof n&&null!==n&&"function"===typeof n.then){var A=f.ping;n.then(A,A);f.thenableState=Ja()}else{g.abortableTasks.delete(f);f.status=4;var oa=O(g,n);P(g,f.id,oa)}}}}null!==a.destination&&Q(a,a.destination)}catch(B){O(a,B),mb(a,B)}finally{Xa.current=b,G=null,N=d}}
|
48
|
+
function Q(a,b){l=new Uint8Array(2048);m=0;p=!0;try{for(var d=a.completedImportChunks,c=0;c<d.length;c++)if(a.pendingChunks--,!t(b,d[c])){a.destination=null;c++;break}d.splice(0,c);var e=a.completedHintChunks;for(c=0;c<e.length;c++)if(!t(b,e[c])){a.destination=null;c++;break}e.splice(0,c);var f=a.completedRegularChunks;for(c=0;c<f.length;c++)if(a.pendingChunks--,!t(b,f[c])){a.destination=null;c++;break}f.splice(0,c);var g=a.completedErrorChunks;for(c=0;c<g.length;c++)if(a.pendingChunks--,!t(b,g[c])){a.destination=
|
49
|
+
null;c++;break}g.splice(0,c)}finally{a.flushScheduled=!1,l&&0<m&&b.write(l.subarray(0,m)),l=null,m=0,p=!0}"function"===typeof b.flush&&b.flush();0===a.pendingChunks&&b.end()}function nb(a){a.flushScheduled=null!==a.destination;setImmediate(function(){return na.run(a,ib,a)})}function y(a){if(!1===a.flushScheduled&&0===a.pingedTasks.length&&null!==a.destination){var b=a.destination;a.flushScheduled=!0;setImmediate(function(){return Q(a,b)})}}
|
50
50
|
function ob(a,b){if(1===a.status)a.status=2,b.destroy(a.fatalError);else if(2!==a.status&&null===a.destination){a.destination=b;try{Q(a,b)}catch(d){O(a,d),mb(a,d)}}}
|
51
|
-
function pb(a,b){try{var d=a.abortableTasks;if(0<d.size){var c=O(a,void 0===b?Error("The render was aborted by the server without a reason."):b);a.pendingChunks++;var e=a.nextChunkId++;P(a,e,c);d.forEach(function(f){f.status=3;var g=
|
51
|
+
function pb(a,b){try{var d=a.abortableTasks;if(0<d.size){var c=O(a,void 0===b?Error("The render was aborted by the server without a reason."):b);a.pendingChunks++;var e=a.nextChunkId++;P(a,e,c);d.forEach(function(f){f.status=3;var g=S(e);f=kb(a,f.id,g);a.completedErrorChunks.push(f)});d.clear()}null!==a.destination&&Q(a,a.destination)}catch(f){O(a,f),mb(a,f)}}
|
52
52
|
function bb(a){if(a){var b=D;Da(null);for(var d=0;d<a.length;d++){var c=a[d],e=c[0];c=c[1];Wa[e]||(Wa[e]=ca.createServerContext(e,wa));Ea(Wa[e],c)}a=D;Da(b);return a}return null}function lb(a,b,d){a=M(d,a.toJSON);return b.toString(16)+":"+a+"\n"}function kb(a,b,d){a=M(d);return b.toString(16)+":"+a+"\n"}
|
53
|
-
function qb(a,b){var d="",c=a[b];if(c)d=c.name;else{var e=b.lastIndexOf("#");-1!==e&&(d=b.slice(e+1),c=a[b.slice(0,e)]);if(!c)throw Error('Could not find the module "'+b+'" in the React Server Manifest. This is probably a bug in the React Server Components bundler.');}return{id:c.id,chunks:c.chunks,name:d,async:!1}}var
|
54
|
-
function tb(a){for(var b=a.chunks,d=[],c=0;c<b.length;c++){var e=b[c],f=
|
55
|
-
null}function
|
56
|
-
|
57
|
-
function
|
58
|
-
function
|
59
|
-
function Z(a,b){var d=a._chunks,c=d.get(b);c||(c=a._formData.get(a._prefix+b),c=null!=c?new
|
60
|
-
function
|
61
|
-
c?-0:-Infinity;case "N":return NaN;case "u":return;case "D":return new Date(Date.parse(c.slice(2)));case "n":return BigInt(c.slice(2));default:c=parseInt(c.slice(1),16);a=Z(a,c);switch(a.status){case "resolved_model":
|
62
|
-
function
|
63
|
-
function
|
64
|
-
function
|
65
|
-
exports.decodeAction=function(a,b){var d=new FormData,c=null;a.forEach(function(e,f){if(f.startsWith("$ACTION_"))if(f.startsWith("$ACTION_REF_")){e="$ACTION_"+f.slice(12)+":";e=
|
66
|
-
exports.decodeReply=function(a,b){if("string"===typeof a){var d=new FormData;d.append("0",a);a=d}a=
|
67
|
-
exports.decodeReplyFromBusboy=function(a,b){var d=
|
68
|
-
new Blob(u,{type:q});d._formData.append(f,n,k);c--;if(0===c){for(n=0;n<e.length;n+=2)
|
69
|
-
exports.renderToPipeableStream=function(a,b,d){var c=$a(a,b,d?d.onError:void 0,d?d.context:void 0,d?d.identifierPrefix:void 0),e=!1;nb(c);return{pipe:function(f){if(e)throw Error("React currently only supports piping to one writable stream.");e=!0;ob(c,f);f.on("drain",
|
53
|
+
function qb(a,b){var d="",c=a[b];if(c)d=c.name;else{var e=b.lastIndexOf("#");-1!==e&&(d=b.slice(e+1),c=a[b.slice(0,e)]);if(!c)throw Error('Could not find the module "'+b+'" in the React Server Manifest. This is probably a bug in the React Server Components bundler.');}return{id:c.id,chunks:c.chunks,name:d,async:!1}}var T=new Map,rb=new Map;function sb(){}
|
54
|
+
function tb(a){for(var b=a.chunks,d=[],c=0;c<b.length;c++){var e=b[c],f=T.get(e);if(void 0===f){f=__webpack_chunk_load__(e);d.push(f);var g=T.set.bind(T,e,null);f.then(g,sb);T.set(e,f)}else null!==f&&d.push(f)}if(a.async){if(b=rb.get(a.id))return"fulfilled"===b.status?null:b;var h=Promise.all(d).then(function(){return __webpack_require__(a.id)});h.then(function(k){h.status="fulfilled";h.value=k},function(k){h.status="rejected";h.reason=k});rb.set(a.id,h);return h}return 0<d.length?Promise.all(d):
|
55
|
+
null}function U(a){if(a.async){var b=rb.get(a.id);if("fulfilled"===b.status)b=b.value;else throw b.reason;}else b=__webpack_require__(a.id);return"*"===a.name?b:""===a.name?b.__esModule?b.default:b:b[a.name]}function V(a,b,d,c){this.status=a;this.value=b;this.reason=d;this._response=c}V.prototype=Object.create(Promise.prototype);
|
56
|
+
V.prototype.then=function(a,b){switch(this.status){case "resolved_model":W(this)}switch(this.status){case "fulfilled":a(this.value);break;case "pending":case "blocked":a&&(null===this.value&&(this.value=[]),this.value.push(a));b&&(null===this.reason&&(this.reason=[]),this.reason.push(b));break;default:b(this.reason)}};function ub(a,b){for(var d=0;d<a.length;d++)(0,a[d])(b)}
|
57
|
+
function vb(a,b){if("pending"===a.status||"blocked"===a.status){var d=a.reason;a.status="rejected";a.reason=b;null!==d&&ub(d,b)}}function wb(a,b,d,c,e,f){var g=qb(a._bundlerConfig,b);a=tb(g);if(d)d=Promise.all([d,a]).then(function(h){h=h[0];var k=U(g);return k.bind.apply(k,[null].concat(h))});else if(a)d=Promise.resolve(a).then(function(){return U(g)});else return U(g);d.then(xb(c,e,f),yb(c));return null}var X=null,Y=null;
|
58
|
+
function W(a){var b=X,d=Y;X=a;Y=null;try{var c=JSON.parse(a.value,a._response._fromJSON);null!==Y&&0<Y.deps?(Y.value=c,a.status="blocked",a.value=null,a.reason=null):(a.status="fulfilled",a.value=c)}catch(e){a.status="rejected",a.reason=e}finally{X=b,Y=d}}function zb(a,b){a._chunks.forEach(function(d){"pending"===d.status&&vb(d,b)})}
|
59
|
+
function Z(a,b){var d=a._chunks,c=d.get(b);c||(c=a._formData.get(a._prefix+b),c=null!=c?new V("resolved_model",c,null,a):new V("pending",null,null,a),d.set(b,c));return c}function xb(a,b,d){if(Y){var c=Y;c.deps++}else c=Y={deps:1,value:null};return function(e){b[d]=e;c.deps--;0===c.deps&&"blocked"===a.status&&(e=a.value,a.status="fulfilled",a.value=c.value,null!==e&&ub(e,c.value))}}function yb(a){return function(b){return vb(a,b)}}
|
60
|
+
function Bb(a,b,d,c){if("$"===c[0])switch(c[1]){case "$":return c.slice(1);case "@":return b=parseInt(c.slice(2),16),Z(a,b);case "S":return Symbol.for(c.slice(2));case "F":c=parseInt(c.slice(2),16);c=Z(a,c);"resolved_model"===c.status&&W(c);if("fulfilled"!==c.status)throw c.reason;c=c.value;return wb(a,c.id,c.bound,X,b,d);case "K":b=c.slice(2);var e=a._prefix+b+"_",f=new FormData;a._formData.forEach(function(g,h){h.startsWith(e)&&f.append(h.slice(e.length),g)});return f;case "I":return Infinity;case "-":return"$-0"===
|
61
|
+
c?-0:-Infinity;case "N":return NaN;case "u":return;case "D":return new Date(Date.parse(c.slice(2)));case "n":return BigInt(c.slice(2));default:c=parseInt(c.slice(1),16);a=Z(a,c);switch(a.status){case "resolved_model":W(a)}switch(a.status){case "fulfilled":return a.value;case "pending":case "blocked":return c=X,a.then(xb(c,b,d),yb(c)),null;default:throw a.reason;}}return c}
|
62
|
+
function Cb(a,b){var d=2<arguments.length&&void 0!==arguments[2]?arguments[2]:new FormData,c=new Map,e={_bundlerConfig:a,_prefix:b,_formData:d,_chunks:c,_fromJSON:function(f,g){return"string"===typeof g?Bb(e,this,f,g):g}};return e}
|
63
|
+
function Db(a,b,d){a._formData.append(b,d);var c=a._prefix;if(b.startsWith(c)&&(a=a._chunks,b=+b.slice(c.length),(b=a.get(b))&&"pending"===b.status&&(c=b.value,a=b.reason,b.status="resolved_model",b.value=d,null!==c)))switch(W(b),b.status){case "fulfilled":ub(c,b.value);break;case "pending":case "blocked":b.value=c;b.reason=a;break;case "rejected":a&&ub(a,b.reason)}}function Eb(a){zb(a,Error("Connection closed."))}
|
64
|
+
function Fb(a,b,d){var c=qb(a,b);a=tb(c);return d?Promise.all([d,a]).then(function(e){e=e[0];var f=U(c);return f.bind.apply(f,[null].concat(e))}):a?Promise.resolve(a).then(function(){return U(c)}):Promise.resolve(U(c))}function Gb(a,b){return function(){return ob(b,a)}}
|
65
|
+
exports.decodeAction=function(a,b){var d=new FormData,c=null;a.forEach(function(e,f){if(f.startsWith("$ACTION_"))if(f.startsWith("$ACTION_REF_")){e="$ACTION_"+f.slice(12)+":";e=Cb(b,e,a);Eb(e);e=Z(e,0);e.then(function(){});if("fulfilled"!==e.status)throw e.reason;e=e.value;c=Fb(b,e.id,e.bound)}else f.startsWith("$ACTION_ID_")&&(e=f.slice(11),c=Fb(b,e,null));else d.append(f,e)});return null===c?null:c.then(function(e){return e.bind(null,d)})};
|
66
|
+
exports.decodeReply=function(a,b){if("string"===typeof a){var d=new FormData;d.append("0",a);a=d}a=Cb(b,"",a);Eb(a);return Z(a,0)};
|
67
|
+
exports.decodeReplyFromBusboy=function(a,b){var d=Cb(b,""),c=0,e=[];a.on("field",function(f,g){0<c?e.push(f,g):Db(d,f,g)});a.on("file",function(f,g,h){var k=h.filename,q=h.mimeType;if("base64"===h.encoding.toLowerCase())throw Error("React doesn't accept base64 encoded file uploads because we don't expect form data passed from a browser to ever encode data that way. If that's the wrong assumption, we can easily fix it.");c++;var u=[];g.on("data",function(n){u.push(n)});g.on("end",function(){var n=
|
68
|
+
new Blob(u,{type:q});d._formData.append(f,n,k);c--;if(0===c){for(n=0;n<e.length;n+=2)Db(d,e[n],e[n+1]);e.length=0}})});a.on("finish",function(){Eb(d)});a.on("error",function(f){zb(d,f)});return Z(d,0)};
|
69
|
+
exports.renderToPipeableStream=function(a,b,d){var c=$a(a,b,d?d.onError:void 0,d?d.context:void 0,d?d.identifierPrefix:void 0),e=!1;nb(c);return{pipe:function(f){if(e)throw Error("React currently only supports piping to one writable stream.");e=!0;ob(c,f);f.on("drain",Gb(f,c));return f},abort:function(f){pb(c,f)}}};
|
@@ -213,6 +213,9 @@ function stringToChunk(content) {
|
|
213
213
|
return content;
|
214
214
|
}
|
215
215
|
var precomputedChunkSet = new Set() ;
|
216
|
+
function byteLengthOfChunk(chunk) {
|
217
|
+
return typeof chunk === 'string' ? Buffer.byteLength(chunk, 'utf8') : chunk.byteLength;
|
218
|
+
}
|
216
219
|
function closeWithError(destination, error) {
|
217
220
|
// $FlowFixMe[incompatible-call]: This is an Error object or the destination accepts other types.
|
218
221
|
destination.destroy(error);
|
@@ -1250,7 +1253,7 @@ function createRequest(model, bundlerConfig, onError, context, identifierPrefix)
|
|
1250
1253
|
pingedTasks: pingedTasks,
|
1251
1254
|
completedImportChunks: [],
|
1252
1255
|
completedHintChunks: [],
|
1253
|
-
|
1256
|
+
completedRegularChunks: [],
|
1254
1257
|
completedErrorChunks: [],
|
1255
1258
|
writtenSymbols: new Map(),
|
1256
1259
|
writtenClientReferences: new Map(),
|
@@ -1702,11 +1705,20 @@ function serializeServerReference(request, parent, key, serverReference) {
|
|
1702
1705
|
var metadataId = request.nextChunkId++; // We assume that this object doesn't suspend.
|
1703
1706
|
|
1704
1707
|
var processedChunk = processModelChunk(request, metadataId, serverReferenceMetadata);
|
1705
|
-
request.
|
1708
|
+
request.completedRegularChunks.push(processedChunk);
|
1706
1709
|
writtenServerReferences.set(serverReference, metadataId);
|
1707
1710
|
return serializeServerReferenceID(metadataId);
|
1708
1711
|
}
|
1709
1712
|
|
1713
|
+
function serializeLargeTextString(request, text) {
|
1714
|
+
request.pendingChunks += 2;
|
1715
|
+
var textId = request.nextChunkId++;
|
1716
|
+
var textChunk = stringToChunk(text);
|
1717
|
+
var headerChunk = processTextHeader(request, textId, text, byteLengthOfChunk(textChunk));
|
1718
|
+
request.completedRegularChunks.push(headerChunk, textChunk);
|
1719
|
+
return serializeByValueID(textId);
|
1720
|
+
}
|
1721
|
+
|
1710
1722
|
function escapeStringValue(value) {
|
1711
1723
|
if (value[0] === '$') {
|
1712
1724
|
// We need to escape $ prefixed strings since we use those to encode
|
@@ -1898,6 +1910,13 @@ function resolveModelToJSON(request, parent, key, value) {
|
|
1898
1910
|
}
|
1899
1911
|
}
|
1900
1912
|
|
1913
|
+
if (value.length >= 1024) {
|
1914
|
+
// For large strings, we encode them outside the JSON payload so that we
|
1915
|
+
// don't have to double encode and double parse the strings. This can also
|
1916
|
+
// be more compact in case the string has a lot of escaped characters.
|
1917
|
+
return serializeLargeTextString(request, value);
|
1918
|
+
}
|
1919
|
+
|
1901
1920
|
return escapeStringValue(value);
|
1902
1921
|
}
|
1903
1922
|
|
@@ -2036,7 +2055,7 @@ function emitSymbolChunk(request, id, name) {
|
|
2036
2055
|
function emitProviderChunk(request, id, contextName) {
|
2037
2056
|
var contextReference = serializeProviderReference(contextName);
|
2038
2057
|
var processedChunk = processReferenceChunk(request, id, contextReference);
|
2039
|
-
request.
|
2058
|
+
request.completedRegularChunks.push(processedChunk);
|
2040
2059
|
}
|
2041
2060
|
|
2042
2061
|
function retryTask(request, task) {
|
@@ -2076,7 +2095,7 @@ function retryTask(request, task) {
|
|
2076
2095
|
}
|
2077
2096
|
|
2078
2097
|
var processedChunk = processModelChunk(request, task.id, value);
|
2079
|
-
request.
|
2098
|
+
request.completedRegularChunks.push(processedChunk);
|
2080
2099
|
request.abortableTasks.delete(task);
|
2081
2100
|
task.status = COMPLETED;
|
2082
2101
|
} catch (thrownValue) {
|
@@ -2187,12 +2206,12 @@ function flushCompletedChunks(request, destination) {
|
|
2187
2206
|
|
2188
2207
|
hintChunks.splice(0, i); // Next comes model data.
|
2189
2208
|
|
2190
|
-
var
|
2209
|
+
var regularChunks = request.completedRegularChunks;
|
2191
2210
|
i = 0;
|
2192
2211
|
|
2193
|
-
for (; i <
|
2212
|
+
for (; i < regularChunks.length; i++) {
|
2194
2213
|
request.pendingChunks--;
|
2195
|
-
var _chunk2 =
|
2214
|
+
var _chunk2 = regularChunks[i];
|
2196
2215
|
|
2197
2216
|
var _keepWriting2 = writeChunkAndReturn(destination, _chunk2);
|
2198
2217
|
|
@@ -2203,7 +2222,7 @@ function flushCompletedChunks(request, destination) {
|
|
2203
2222
|
}
|
2204
2223
|
}
|
2205
2224
|
|
2206
|
-
|
2225
|
+
regularChunks.splice(0, i); // Finally, errors are sent. The idea is that it's ok to delay
|
2207
2226
|
// any error messages and prioritize display of other parts of
|
2208
2227
|
// the page.
|
2209
2228
|
|
@@ -2391,6 +2410,11 @@ function processHintChunk(request, id, code, model) {
|
|
2391
2410
|
return stringToChunk(row);
|
2392
2411
|
}
|
2393
2412
|
|
2413
|
+
function processTextHeader(request, id, text, binaryLength) {
|
2414
|
+
var row = id.toString(16) + ':T' + binaryLength.toString(16) + ',';
|
2415
|
+
return stringToChunk(row);
|
2416
|
+
}
|
2417
|
+
|
2394
2418
|
// eslint-disable-next-line no-unused-vars
|
2395
2419
|
function resolveServerReference(bundlerConfig, id) {
|
2396
2420
|
var idx = id.lastIndexOf('#');
|