react-server-dom-webpack 18.3.0-next-594093496-20230209 → 18.3.0-next-55542bc73-20230210
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.development.js +96 -39
- package/cjs/react-server-dom-webpack-client.production.min.js +11 -9
- package/cjs/react-server-dom-webpack-node-register.js +9 -273
- package/cjs/react-server-dom-webpack-plugin.js +8 -247
- package/cjs/react-server-dom-webpack-server.browser.development.js +69 -29
- package/cjs/react-server-dom-webpack-server.browser.production.min.js +42 -40
- package/cjs/react-server-dom-webpack-server.edge.development.js +69 -29
- package/cjs/react-server-dom-webpack-server.edge.production.min.js +44 -43
- package/cjs/react-server-dom-webpack-server.node.development.js +69 -29
- package/cjs/react-server-dom-webpack-server.node.production.min.js +46 -45
- package/esm/react-server-dom-webpack-node-loader.js +195 -116
- package/package.json +3 -3
- package/umd/react-server-dom-webpack-client.development.js +96 -39
- package/umd/react-server-dom-webpack-client.production.min.js +13 -12
- package/umd/react-server-dom-webpack-server.browser.development.js +69 -29
- package/umd/react-server-dom-webpack-server.browser.production.min.js +40 -39
@@ -7,53 +7,55 @@
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
9
9
|
*/
|
10
|
-
'use strict';var aa=require("react");var e=null,m=0;function n(a,b){if(0!==b.length)if(512<b.length)0<m&&(a.enqueue(new Uint8Array(e.buffer,0,m)),e=new Uint8Array(512),m=0),a.enqueue(b);else{var c=e.length-m;c<b.length&&(0===c?a.enqueue(e):(e.set(b.subarray(0,c),m),a.enqueue(e),b=b.subarray(c)),e=new Uint8Array(512),m=0);e.set(b,m);m+=b.length}return!0}var p=new TextEncoder;function q(a){return p.encode(a)}function
|
11
|
-
var r=JSON.stringify;function
|
12
|
-
|
13
|
-
|
14
|
-
"
|
15
|
-
|
16
|
-
"
|
17
|
-
|
18
|
-
new
|
19
|
-
|
20
|
-
|
10
|
+
'use strict';var aa=require("react");var e=null,m=0;function n(a,b){if(0!==b.length)if(512<b.length)0<m&&(a.enqueue(new Uint8Array(e.buffer,0,m)),e=new Uint8Array(512),m=0),a.enqueue(b);else{var c=e.length-m;c<b.length&&(0===c?a.enqueue(e):(e.set(b.subarray(0,c),m),a.enqueue(e),b=b.subarray(c)),e=new Uint8Array(512),m=0);e.set(b,m);m+=b.length}return!0}var p=new TextEncoder;function q(a){return p.encode(a)}function ba(a,b){"function"===typeof a.error?a.error(b):a.close()}
|
11
|
+
var r=JSON.stringify;function ea(a,b,c){a=r(c,a.toJSON);b=b.toString(16)+":"+a+"\n";return p.encode(b)}function t(a,b,c){a=r(c);b=b.toString(16)+":"+a+"\n";return p.encode(b)}
|
12
|
+
var u=Symbol.for("react.client.reference"),fa=Symbol.for("react.server.reference"),v=Symbol.for("react.element"),ha=Symbol.for("react.fragment"),ia=Symbol.for("react.provider"),ja=Symbol.for("react.server_context"),ka=Symbol.for("react.forward_ref"),la=Symbol.for("react.suspense"),ma=Symbol.for("react.suspense_list"),na=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),oa=Symbol.for("react.default_value"),pa=Symbol.for("react.memo_cache_sentinel");
|
13
|
+
function y(a,b,c,d,f,g,h){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=f;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=g;this.removeEmptyString=h}"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){new y(a,0,!1,a,null,!1,!1)});
|
14
|
+
[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){new y(a[0],1,!1,a[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){new y(a,2,!1,a.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){new y(a,2,!1,a,null,!1,!1)});
|
15
|
+
"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){new y(a,3,!1,a.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(a){new y(a,3,!0,a,null,!1,!1)});["capture","download"].forEach(function(a){new y(a,4,!1,a,null,!1,!1)});
|
16
|
+
["cols","rows","size","span"].forEach(function(a){new y(a,6,!1,a,null,!1,!1)});["rowSpan","start"].forEach(function(a){new y(a,5,!1,a.toLowerCase(),null,!1,!1)});var A=/[\-:]([a-z])/g;function B(a){return a[1].toUpperCase()}
|
17
|
+
"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering transform-origin underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var b=a.replace(A,
|
18
|
+
B);new y(b,1,!1,a,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var b=a.replace(A,B);new y(b,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(A,B);new y(b,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(a){new y(a,1,!1,a.toLowerCase(),null,!1,!1)});
|
19
|
+
new y("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(a){new y(a,1,!1,a.toLowerCase(),null,!0,!0)});
|
20
|
+
var C={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,
|
21
|
+
fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qa=["Webkit","ms","Moz","O"];Object.keys(C).forEach(function(a){qa.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);C[b]=C[a]})});var ra=Array.isArray;q('"></template>');q("<script>");q("\x3c/script>");q('<script src="');q('<script type="module" src="');q('" integrity="');q('" async="">\x3c/script>');q("\x3c!-- --\x3e");q(' style="');q(":");q(";");
|
21
22
|
q(" ");q('="');q('"');q('=""');q(">");q("/>");q(' selected=""');q("\n");q("<!DOCTYPE html>");q("</");q(">");q('<template id="');q('"></template>');q("\x3c!--$--\x3e");q('\x3c!--$?--\x3e<template id="');q('"></template>');q("\x3c!--$!--\x3e");q("\x3c!--/$--\x3e");q("<template");q('"');q(' data-dgst="');q(' data-msg="');q(' data-stck="');q("></template>");q('<div hidden id="');q('">');q("</div>");q('<svg aria-hidden="true" style="display:none" id="');q('">');q("</svg>");q('<math aria-hidden="true" style="display:none" id="');
|
22
23
|
q('">');q("</math>");q('<table hidden id="');q('">');q("</table>");q('<table hidden><tbody id="');q('">');q("</tbody></table>");q('<table hidden><tr id="');q('">');q("</tr></table>");q('<table hidden><colgroup id="');q('">');q("</colgroup></table>");q('$RS=function(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};;$RS("');q('$RS("');q('","');q('")\x3c/script>');q('<template data-rsi="" data-sid="');
|
23
|
-
q('" data-pid="');q('$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}}
|
24
|
-
q('$RC("');q('$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}}
|
25
|
-
q('$RM=new Map;\n$RR=function(p,q,
|
26
|
-
q('$RR("');q('","');q('",');q('"');q(")\x3c/script>");q('<template data-rci="" data-bid="');q('<template data-rri="" data-bid="');q('" data-sid="');q('" data-sty="');q('$RX=function(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};;$RX("');q('$RX("');q('"');q(",");q(")\x3c/script>");q('<template data-rxi="" data-bid="');q('" data-dgst="');q('" data-msg="');q('" data-stck="');q('<
|
27
|
-
q('"></style>');q("[");q(",[");q(",");q("]");var
|
28
|
-
function ta(a){var b=a.parent;null!==b&&ta(b);a.context._currentValue=a.value}function ua(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?
|
29
|
-
function va(a,b){var c=b.parent;if(null===c)throw Error("The depth must equal at least at zero before reaching the root. This is a bug in React.");a.depth===c.depth?
|
24
|
+
q('" data-pid="');q('$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};$RC("');
|
25
|
+
q('$RC("');q('$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};$RM=new Map;\n$RR=function(p,q,w){function r(l){this.s=l}for(var t=$RC,m=$RM,u=new Map,n=new Map,g=document,h,e,f=g.querySelectorAll("template[data-precedence]"),c=0;e=f[c++];){for(var b=e.content.firstChild;b;b=b.nextSibling)u.set(b.getAttribute("data-href"),b);e.parentNode.removeChild(e)}f=g.querySelectorAll("link[data-precedence],style[data-precedence]");for(c=0;e=f[c++];)m.set(e.getAttribute("STYLE"===e.nodeName?"data-href":"href"),e),n.set(e.dataset.precedence,h=e);e=0;f=[];for(var d,\nv,a;d=w[e++];){var k=0;b=d[k++];if(!(a=m.get(b))){if(a=u.get(b))c=a.getAttribute("data-precedence");else{a=g.createElement("link");a.href=b;a.rel="stylesheet";for(a.dataset.precedence=c=d[k++];v=d[k++];)a.setAttribute(v,d[k++]);d=a._p=new Promise(function(l,x){a.onload=l;a.onerror=x});d.then(r.bind(d,"l"),r.bind(d,"e"))}m.set(b,a);b=n.get(c)||h;b===h&&(h=a);n.set(c,a);b?b.parentNode.insertBefore(a,b.nextSibling):(c=g.head,c.insertBefore(a,c.firstChild))}d=a._p;c=a.getAttribute("media");!d||"l"===\nd.s||c&&!matchMedia(c).matches||f.push(d)}Promise.all(f).then(t.bind(null,p,q,""),t.bind(null,p,q,"Resource failed to load"))};$RR("');
|
26
|
+
q('$RM=new Map;\n$RR=function(p,q,w){function r(l){this.s=l}for(var t=$RC,m=$RM,u=new Map,n=new Map,g=document,h,e,f=g.querySelectorAll("template[data-precedence]"),c=0;e=f[c++];){for(var b=e.content.firstChild;b;b=b.nextSibling)u.set(b.getAttribute("data-href"),b);e.parentNode.removeChild(e)}f=g.querySelectorAll("link[data-precedence],style[data-precedence]");for(c=0;e=f[c++];)m.set(e.getAttribute("STYLE"===e.nodeName?"data-href":"href"),e),n.set(e.dataset.precedence,h=e);e=0;f=[];for(var d,\nv,a;d=w[e++];){var k=0;b=d[k++];if(!(a=m.get(b))){if(a=u.get(b))c=a.getAttribute("data-precedence");else{a=g.createElement("link");a.href=b;a.rel="stylesheet";for(a.dataset.precedence=c=d[k++];v=d[k++];)a.setAttribute(v,d[k++]);d=a._p=new Promise(function(l,x){a.onload=l;a.onerror=x});d.then(r.bind(d,"l"),r.bind(d,"e"))}m.set(b,a);b=n.get(c)||h;b===h&&(h=a);n.set(c,a);b?b.parentNode.insertBefore(a,b.nextSibling):(c=g.head,c.insertBefore(a,c.firstChild))}d=a._p;c=a.getAttribute("media");!d||"l"===\nd.s||c&&!matchMedia(c).matches||f.push(d)}Promise.all(f).then(t.bind(null,p,q,""),t.bind(null,p,q,"Resource failed to load"))};$RR("');
|
27
|
+
q('$RR("');q('","');q('",');q('"');q(")\x3c/script>");q('<template data-rci="" data-bid="');q('<template data-rri="" data-bid="');q('" data-sid="');q('" data-sty="');q('$RX=function(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};;$RX("');q('$RX("');q('"');q(",");q(")\x3c/script>");q('<template data-rxi="" data-bid="');q('" data-dgst="');q('" data-msg="');q('" data-stck="');q('<template data-precedence="">');
|
28
|
+
q("</template>");q('<style data-precedence="');q('"></style>');q("[");q(",[");q(",");q("]");var D=null;function E(a,b){if(a!==b){a.context._currentValue=a.parentValue;a=a.parent;var c=b.parent;if(null===a){if(null!==c)throw Error("The stacks must reach the root at the same time. This is a bug in React.");}else{if(null===c)throw Error("The stacks must reach the root at the same time. This is a bug in React.");E(a,c);b.context._currentValue=b.value}}}
|
29
|
+
function sa(a){a.context._currentValue=a.parentValue;a=a.parent;null!==a&&sa(a)}function ta(a){var b=a.parent;null!==b&&ta(b);a.context._currentValue=a.value}function ua(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):ua(a,b)}
|
30
|
+
function va(a,b){var c=b.parent;if(null===c)throw Error("The depth must equal at least at zero before reaching the root. This is a bug in React.");a.depth===c.depth?E(a,c):va(a,c);b.context._currentValue=b.value}function G(a){var b=D;b!==a&&(null===b?ta(a):null===a?sa(b):b.depth===a.depth?E(b,a):b.depth>a.depth?ua(b,a):va(b,a),D=a)}function wa(a,b){var c=a._currentValue;a._currentValue=b;var d=D;return D=a={parent:d,depth:null===d?0:d.depth+1,context:a,parentValue:c,value:b}}var H=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`");
|
30
31
|
function xa(){}function ya(a,b,c){c=a[c];void 0===c?a.push(b):c!==b&&(b.then(xa,xa),b=c);switch(b.status){case "fulfilled":return b.value;case "rejected":throw b.reason;default:if("string"!==typeof b.status)switch(a=b,a.status="pending",a.then(function(a){if("pending"===b.status){var c=b;c.status="fulfilled";c.value=a}},function(a){if("pending"===b.status){var c=b;c.status="rejected";c.reason=a}}),b.status){case "fulfilled":return b.value;case "rejected":throw b.reason;}I=b;throw H;}}var I=null;
|
31
|
-
function za(){if(null===I)throw Error("Expected a suspended thenable. This is a bug in React. Please file an issue.");var a=I;I=null;return a}var J=null,K=0,
|
32
|
-
var
|
33
|
-
function
|
34
|
-
function
|
35
|
-
var
|
36
|
-
function
|
37
|
-
c?
|
38
|
-
function
|
32
|
+
function za(){if(null===I)throw Error("Expected a suspended thenable. This is a bug in React. Please file an issue.");var a=I;I=null;return a}var J=null,K=0,M=null;function Aa(){var a=M;M=null;return a}function Ba(a){return a._currentValue}
|
33
|
+
var Fa={useMemo:function(a){return a()},useCallback:function(a){return a},useDebugValue:function(){},useDeferredValue:N,useTransition:N,readContext:Ba,useContext:Ba,useReducer:N,useRef:N,useState:N,useInsertionEffect:N,useLayoutEffect:N,useImperativeHandle:N,useEffect:N,useId:Ca,useMutableSource:N,useSyncExternalStore:N,useCacheRefresh:function(){return Da},useMemoCache:function(a){for(var b=Array(a),c=0;c<a;c++)b[c]=pa;return b},use:Ea};
|
34
|
+
function N(){throw Error("This Hook is not supported in Server Components.");}function Da(){throw Error("Refreshing the cache is not supported in Server Components.");}function Ca(){if(null===J)throw Error("useId can only be used while React is rendering");var a=J.identifierCount++;return":"+J.identifierPrefix+"S"+a.toString(32)+":"}
|
35
|
+
function Ea(a){if(null!==a&&"object"===typeof a||"function"===typeof a){if("function"===typeof a.then){var b=K;K+=1;null===M&&(M=[]);return ya(M,a,b)}if(a.$$typeof===ja)return a._currentValue}throw Error("An unsupported type was passed to use(): "+String(a));}function O(){return(new AbortController).signal}
|
36
|
+
var Ga={getCacheSignal:function(){var a=P?P:new Map,b=a.get(O);void 0===b&&(b=O(),a.set(O,b));return b},getCacheForType:function(a){var b=P?P:new Map,c=b.get(a);void 0===c&&(c=a(),b.set(a,c));return c}},P=null,Q=aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,R=Q.ContextRegistry,S=Q.ReactCurrentDispatcher,T=Q.ReactCurrentCache;function Ha(a){console.error(a)}
|
37
|
+
function Ia(a,b,c,d,f){if(null!==T.current&&T.current!==Ga)throw Error("Currently React only supports one RSC renderer at a time.");T.current=Ga;var g=new Set,h=[],k={status:0,fatalError:null,destination:null,bundlerConfig:b,cache:new Map,nextChunkId:0,pendingChunks:0,abortableTasks:g,pingedTasks:h,completedImportChunks:[],completedJSONChunks:[],completedErrorChunks:[],writtenSymbols:new Map,writtenClientReferences:new Map,writtenServerReferences:new Map,writtenProviders:new Map,identifierPrefix:f||
|
38
|
+
"",identifierCount:1,onError:void 0===c?Ha:c,toJSON:function(a,b){return Ja(k,this,a,b)}};k.pendingChunks++;b=Ka(d);a=U(k,a,b,g);h.push(a);return k}var La={};
|
39
|
+
function Ma(a,b){a.pendingChunks++;var c=U(a,null,D,a.abortableTasks);switch(b.status){case "fulfilled":return c.model=b.value,Na(a,c),c.id;case "rejected":var d=V(a,b.reason);W(a,c.id,d);return c.id;default:"string"!==typeof b.status&&(b.status="pending",b.then(function(a){"pending"===b.status&&(b.status="fulfilled",b.value=a)},function(a){"pending"===b.status&&(b.status="rejected",b.reason=a)}))}b.then(function(b){c.model=b;Na(a,c)},function(b){b=V(a,b);W(a,c.id,b)});return c.id}
|
39
40
|
function Oa(a){if("fulfilled"===a.status)return a.value;if("rejected"===a.status)throw a.reason;throw a;}function Pa(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:w,_payload:a,_init:Oa}}
|
40
|
-
function X(a,b,c,d,f,g){if(null!==d&&void 0!==d)throw Error("Refs cannot be used in Server Components, nor passed to Client Components.");if("function"===typeof b){if(b.$$typeof===u)return[v,b,c,f];K=0;
|
41
|
-
b._init;b=h(b._payload);return X(a,b,c,d,f,g);case ka:return a=b.render,K=0,
|
42
|
-
function Sa(a,b,c,d){var f=d.filepath+"#"+d.name+(d.async?"#async":""),g=a.
|
43
|
-
b=a.nextChunkId++,c=V(a,
|
41
|
+
function X(a,b,c,d,f,g){if(null!==d&&void 0!==d)throw Error("Refs cannot be used in Server Components, nor passed to Client Components.");if("function"===typeof b){if(b.$$typeof===u)return[v,b,c,f];K=0;M=g;f=b(f);return"object"===typeof f&&null!==f&&"function"===typeof f.then?"fulfilled"===f.status?f.value:Pa(f):f}if("string"===typeof b)return[v,b,c,f];if("symbol"===typeof b)return b===ha?f.children:[v,b,c,f];if(null!=b&&"object"===typeof b){if(b.$$typeof===u)return[v,b,c,f];switch(b.$$typeof){case w:var h=
|
42
|
+
b._init;b=h(b._payload);return X(a,b,c,d,f,g);case ka:return a=b.render,K=0,M=g,a(f,void 0);case na:return X(a,b.type,c,d,f,g);case ia:return wa(b._context,f.value),[v,b,c,{value:f.value,children:f.children,__pop:La}]}}throw Error("Unsupported Server Component type: "+Qa(b));}function Na(a,b){var c=a.pingedTasks;c.push(b);1===c.length&&Ra(a)}function U(a,b,c,d){var f={id:a.nextChunkId++,status:0,model:b,context:c,ping:function(){return Na(a,f)},thenableState:null};d.add(f);return f}
|
43
|
+
function Sa(a,b,c,d){var f=d.filepath+"#"+d.name+(d.async?"#async":""),g=a.writtenClientReferences,h=g.get(f);if(void 0!==h)return b[0]===v&&"1"===c?"$L"+h.toString(16):"$"+h.toString(16);try{var k=a.bundlerConfig[d.filepath][d.name];var l=d.async?{id:k.id,chunks:k.chunks,name:k.name,async:!0}:k;a.pendingChunks++;var z=a.nextChunkId++,ca=r(l),x=z.toString(16)+":I"+ca+"\n";var L=p.encode(x);a.completedImportChunks.push(L);g.set(f,z);return b[0]===v&&"1"===c?"$L"+z.toString(16):"$"+z.toString(16)}catch(da){return a.pendingChunks++,
|
44
|
+
b=a.nextChunkId++,c=V(a,da),W(a,b,c),"$"+b.toString(16)}}function Ta(a){return Object.prototype.toString.call(a).replace(/^\[object (.*)\]$/,function(a,c){return c})}function Qa(a){switch(typeof a){case "string":return JSON.stringify(10>=a.length?a:a.substr(0,10)+"...");case "object":if(ra(a))return"[...]";a=Ta(a);return"Object"===a?"{...}":a;case "function":return"function";default:return String(a)}}
|
44
45
|
function Y(a){if("string"===typeof a)return a;switch(a){case la:return"Suspense";case ma:return"SuspenseList"}if("object"===typeof a)switch(a.$$typeof){case ka:return Y(a.render);case na:return Y(a.type);case w:var b=a._payload;a=a._init;try{return Y(a(b))}catch(c){}}return""}
|
45
46
|
function Z(a,b){var c=Ta(a);if("Object"!==c&&"Array"!==c)return c;c=-1;var d=0;if(ra(a)){var f="[";for(var g=0;g<a.length;g++){0<g&&(f+=", ");var h=a[g];h="object"===typeof h&&null!==h?Z(h):Qa(h);""+g===b?(c=f.length,d=h.length,f+=h):f=10>h.length&&40>f.length+h.length?f+h:f+"..."}f+="]"}else if(a.$$typeof===v)f="<"+Y(a.type)+"/>";else{f="{";g=Object.keys(a);for(h=0;h<g.length;h++){0<h&&(f+=", ");var k=g[h],l=JSON.stringify(k);f+=('"'+k+'"'===l?k:l)+": ";l=a[k];l="object"===typeof l&&null!==l?Z(l):
|
46
47
|
Qa(l);k===b?(c=f.length,d=l.length,f+=l):f=10>l.length&&40>f.length+l.length?f+l:f+"..."}f+="}"}return void 0===b?f:-1<c&&0<d?(a=" ".repeat(c)+"^".repeat(d),"\n "+f+"\n "+a):"\n "+f}
|
47
|
-
function
|
48
|
-
d.toString(16)}if(null===d)return null;if("object"===typeof d){if(d.$$typeof===u)return Sa(a,b,c,d);if("function"===typeof d.then)return"$@"+
|
49
|
-
d===oa?a.context._defaultValue:d;
|
50
|
-
Z(b,c));}if("symbol"===typeof d){f=a.writtenSymbols;g=f.get(d);if(void 0!==g)return"$"+g.toString(16);g=d.description;if(Symbol.for(g)!==d)throw Error("Only global symbols received from Symbol.for(...) can be passed to Client Components. The symbol Symbol.for("+
|
51
|
-
|
48
|
+
function Ja(a,b,c,d){switch(d){case v:return"$"}for(;"object"===typeof d&&null!==d&&(d.$$typeof===v||d.$$typeof===w);)try{switch(d.$$typeof){case v:var f=d;d=X(a,f.type,f.key,f.ref,f.props,null);break;case w:var g=d._init;d=g(d._payload)}}catch(h){c=h===H?za():h;if("object"===typeof c&&null!==c&&"function"===typeof c.then)return a.pendingChunks++,a=U(a,d,D,a.abortableTasks),d=a.ping,c.then(d,d),a.thenableState=Aa(),"$L"+a.id.toString(16);a.pendingChunks++;d=a.nextChunkId++;c=V(a,c);W(a,d,c);return"$L"+
|
49
|
+
d.toString(16)}if(null===d)return null;if("object"===typeof d){if(d.$$typeof===u)return Sa(a,b,c,d);if("function"===typeof d.then)return"$@"+Ma(a,d).toString(16);if(d.$$typeof===ia)return d=d._context._globalName,b=a.writtenProviders,c=b.get(c),void 0===c&&(a.pendingChunks++,c=a.nextChunkId++,b.set(d,c),d=t(a,c,"$P"+d),a.completedJSONChunks.push(d)),"$"+c.toString(16);if(d===La){a=D;if(null===a)throw Error("Tried to pop a Context at the root of the app. This is a bug in React.");d=a.parentValue;a.context._currentValue=
|
50
|
+
d===oa?a.context._defaultValue:d;D=a.parent;return}return d}if("string"===typeof d)return a="$"===d[0]?"$"+d:d,a;if("boolean"===typeof d||"number"===typeof d||"undefined"===typeof d)return d;if("function"===typeof d){if(d.$$typeof===u)return Sa(a,b,c,d);if(d.$$typeof===fa)return c=a.writtenServerReferences,b=c.get(d),void 0!==b?a="$F"+b.toString(16):(f={id:d.$$filepath,name:d.$$name,bound:Promise.resolve(d.$$bound)},a.pendingChunks++,b=a.nextChunkId++,f=ea(a,b,f),a.completedJSONChunks.push(f),c.set(d,
|
51
|
+
b),a="$F"+b.toString(16)),a;if(/^on[A-Z]/.test(c))throw Error("Event handlers cannot be passed to Client Component props."+Z(b,c)+"\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".'+Z(b,c));}if("symbol"===typeof d){f=a.writtenSymbols;g=f.get(d);if(void 0!==g)return"$"+g.toString(16);g=d.description;if(Symbol.for(g)!==d)throw Error("Only global symbols received from Symbol.for(...) can be passed to Client Components. The symbol Symbol.for("+
|
52
|
+
(d.description+") cannot be found among global symbols.")+Z(b,c));a.pendingChunks++;c=a.nextChunkId++;b=t(a,c,"$S"+g);a.completedImportChunks.push(b);f.set(d,c);return"$"+c.toString(16)}if("bigint"===typeof d)throw Error("BigInt ("+d+") is not yet supported in Client Component props."+Z(b,c));throw Error("Type "+typeof d+" is not supported in Client Component props."+Z(b,c));}
|
53
|
+
function V(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 Ua(a,b){null!==a.destination?(a.status=2,ba(a.destination,b)):(a.status=1,a.fatalError=b)}
|
52
54
|
function W(a,b,c){c={digest:c};b=b.toString(16)+":E"+r(c)+"\n";b=p.encode(b);a.completedErrorChunks.push(b)}
|
53
|
-
function Ra(a){var b=
|
54
|
-
|
55
|
-
function Va(a,b){e=new Uint8Array(512);m=0;try{for(var c=a.
|
55
|
+
function Ra(a){var b=S.current,c=P;S.current=Fa;P=a.cache;J=a;try{var d=a.pingedTasks;a.pingedTasks=[];for(var f=0;f<d.length;f++){var g=d[f];var h=a;if(0===g.status){G(g.context);try{var k=g.model;if("object"===typeof k&&null!==k&&k.$$typeof===v){var l=k,z=g.thenableState;g.model=k;k=X(h,l.type,l.key,l.ref,l.props,z);for(g.thenableState=null;"object"===typeof k&&null!==k&&k.$$typeof===v;)l=k,g.model=k,k=X(h,l.type,l.key,l.ref,l.props,null)}var ca=ea(h,g.id,k);h.completedJSONChunks.push(ca);h.abortableTasks.delete(g);
|
56
|
+
g.status=1}catch(F){var x=F===H?za():F;if("object"===typeof x&&null!==x&&"function"===typeof x.then){var L=g.ping;x.then(L,L);g.thenableState=Aa()}else{h.abortableTasks.delete(g);g.status=4;var da=V(h,x);W(h,g.id,da)}}}}null!==a.destination&&Va(a,a.destination)}catch(F){V(a,F),Ua(a,F)}finally{S.current=b,P=c,J=null}}
|
57
|
+
function Va(a,b){e=new Uint8Array(512);m=0;try{for(var c=a.completedImportChunks,d=0;d<c.length;d++)if(a.pendingChunks--,!n(b,c[d])){a.destination=null;d++;break}c.splice(0,d);var f=a.completedJSONChunks;for(d=0;d<f.length;d++)if(a.pendingChunks--,!n(b,f[d])){a.destination=null;d++;break}f.splice(0,d);var g=a.completedErrorChunks;for(d=0;d<g.length;d++)if(a.pendingChunks--,!n(b,g[d])){a.destination=null;d++;break}g.splice(0,d)}finally{e&&0<m&&(b.enqueue(new Uint8Array(e.buffer,0,m)),e=null,m=0)}0===
|
56
58
|
a.pendingChunks&&b.close()}function Wa(a,b){try{var c=a.abortableTasks;if(0<c.size){var d=V(a,void 0===b?Error("The render was aborted by the server without a reason."):b);a.pendingChunks++;var f=a.nextChunkId++;W(a,f,d);c.forEach(function(b){b.status=3;var c="$"+f.toString(16);b=t(a,b.id,c);a.completedErrorChunks.push(b)});c.clear()}null!==a.destination&&Va(a,a.destination)}catch(g){V(a,g),Ua(a,g)}}
|
57
|
-
function
|
58
|
-
exports.renderToReadableStream=function(a,b,c){var d=
|
59
|
+
function Ka(a){if(a){var b=D;G(null);for(var c=0;c<a.length;c++){var d=a[c],f=d[0];d=d[1];R[f]||(R[f]=aa.createServerContext(f,oa));wa(R[f],d)}a=D;G(b);return a}return null}
|
60
|
+
exports.renderToReadableStream=function(a,b,c){var d=Ia(a,b,c?c.onError:void 0,c?c.context:void 0,c?c.identifierPrefix:void 0);if(c&&c.signal){var f=c.signal;if(f.aborted)Wa(d,f.reason);else{var g=function(){Wa(d,f.reason);f.removeEventListener("abort",g)};f.addEventListener("abort",g)}}return new ReadableStream({type:"bytes",start:function(){Ra(d)},pull:function(a){if(1===d.status)d.status=2,ba(a,d.fatalError);else if(2!==d.status&&null===d.destination){d.destination=a;try{Va(d,a)}catch(k){V(d,k),
|
59
61
|
Ua(d,k)}}},cancel:function(){}},{highWaterMark:0})};
|
@@ -203,21 +203,25 @@ function processReferenceChunk(request, id, reference) {
|
|
203
203
|
var row = id.toString(16) + ':' + json + '\n';
|
204
204
|
return stringToChunk(row);
|
205
205
|
}
|
206
|
-
function
|
207
|
-
var json = stringify(
|
206
|
+
function processImportChunk(request, id, clientReferenceMetadata) {
|
207
|
+
var json = stringify(clientReferenceMetadata);
|
208
208
|
var row = serializeRowHeader('I', id) + json + '\n';
|
209
209
|
return stringToChunk(row);
|
210
210
|
}
|
211
211
|
|
212
212
|
// eslint-disable-next-line no-unused-vars
|
213
213
|
var CLIENT_REFERENCE_TAG = Symbol.for('react.client.reference');
|
214
|
+
var SERVER_REFERENCE_TAG = Symbol.for('react.server.reference');
|
214
215
|
function getClientReferenceKey(reference) {
|
215
216
|
return reference.filepath + '#' + reference.name + (reference.async ? '#async' : '');
|
216
217
|
}
|
217
218
|
function isClientReference(reference) {
|
218
219
|
return reference.$$typeof === CLIENT_REFERENCE_TAG;
|
219
220
|
}
|
220
|
-
function
|
221
|
+
function isServerReference(reference) {
|
222
|
+
return reference.$$typeof === SERVER_REFERENCE_TAG;
|
223
|
+
}
|
224
|
+
function resolveClientReferenceMetadata(config, clientReference) {
|
221
225
|
var resolvedModuleData = config[clientReference.filepath][clientReference.name];
|
222
226
|
|
223
227
|
if (clientReference.async) {
|
@@ -231,6 +235,13 @@ function resolveModuleMetaData(config, clientReference) {
|
|
231
235
|
return resolvedModuleData;
|
232
236
|
}
|
233
237
|
}
|
238
|
+
function resolveServerReferenceMetadata(config, serverReference) {
|
239
|
+
return {
|
240
|
+
id: serverReference.$$filepath,
|
241
|
+
name: serverReference.$$name,
|
242
|
+
bound: Promise.resolve(serverReference.$$bound)
|
243
|
+
};
|
244
|
+
}
|
234
245
|
|
235
246
|
// ATTENTION
|
236
247
|
// When adding new symbols to this file,
|
@@ -555,7 +566,7 @@ function isArray(a) {
|
|
555
566
|
// Run `yarn generate-inline-fizz-runtime` to generate.
|
556
567
|
var clientRenderBoundary = '$RX=function(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};';
|
557
568
|
var completeBoundary = '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};';
|
558
|
-
var completeBoundaryWithStyles = '$RM=new Map;\n$RR=function(p,q,
|
569
|
+
var completeBoundaryWithStyles = '$RM=new Map;\n$RR=function(p,q,w){function r(l){this.s=l}for(var t=$RC,m=$RM,u=new Map,n=new Map,g=document,h,e,f=g.querySelectorAll("template[data-precedence]"),c=0;e=f[c++];){for(var b=e.content.firstChild;b;b=b.nextSibling)u.set(b.getAttribute("data-href"),b);e.parentNode.removeChild(e)}f=g.querySelectorAll("link[data-precedence],style[data-precedence]");for(c=0;e=f[c++];)m.set(e.getAttribute("STYLE"===e.nodeName?"data-href":"href"),e),n.set(e.dataset.precedence,h=e);e=0;f=[];for(var d,\nv,a;d=w[e++];){var k=0;b=d[k++];if(!(a=m.get(b))){if(a=u.get(b))c=a.getAttribute("data-precedence");else{a=g.createElement("link");a.href=b;a.rel="stylesheet";for(a.dataset.precedence=c=d[k++];v=d[k++];)a.setAttribute(v,d[k++]);d=a._p=new Promise(function(l,x){a.onload=l;a.onerror=x});d.then(r.bind(d,"l"),r.bind(d,"e"))}m.set(b,a);b=n.get(c)||h;b===h&&(h=a);n.set(c,a);b?b.parentNode.insertBefore(a,b.nextSibling):(c=g.head,c.insertBefore(a,c.firstChild))}d=a._p;c=a.getAttribute("media");!d||"l"===\nd.s||c&&!matchMedia(c).matches||f.push(d)}Promise.all(f).then(t.bind(null,p,q,""),t.bind(null,p,q,"Resource failed to load"))};';
|
559
570
|
var completeSegment = '$RS=function(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};';
|
560
571
|
|
561
572
|
var ReactDOMSharedInternals = ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
@@ -636,10 +647,10 @@ var completeSegmentScript2 = stringToPrecomputedChunk('","');
|
|
636
647
|
var completeSegmentScriptEnd = stringToPrecomputedChunk('")</script>');
|
637
648
|
var completeSegmentData1 = stringToPrecomputedChunk('<template data-rsi="" data-sid="');
|
638
649
|
var completeSegmentData2 = stringToPrecomputedChunk('" data-pid="');
|
639
|
-
var completeBoundaryScript1Full = stringToPrecomputedChunk(completeBoundary + '
|
650
|
+
var completeBoundaryScript1Full = stringToPrecomputedChunk(completeBoundary + '$RC("');
|
640
651
|
var completeBoundaryScript1Partial = stringToPrecomputedChunk('$RC("');
|
641
|
-
var completeBoundaryWithStylesScript1FullBoth = stringToPrecomputedChunk(completeBoundary +
|
642
|
-
var completeBoundaryWithStylesScript1FullPartial = stringToPrecomputedChunk(completeBoundaryWithStyles + '
|
652
|
+
var completeBoundaryWithStylesScript1FullBoth = stringToPrecomputedChunk(completeBoundary + completeBoundaryWithStyles + '$RR("');
|
653
|
+
var completeBoundaryWithStylesScript1FullPartial = stringToPrecomputedChunk(completeBoundaryWithStyles + '$RR("');
|
643
654
|
var completeBoundaryWithStylesScript1Partial = stringToPrecomputedChunk('$RR("');
|
644
655
|
var completeBoundaryScript2 = stringToPrecomputedChunk('","');
|
645
656
|
var completeBoundaryScript3a = stringToPrecomputedChunk('",');
|
@@ -659,6 +670,8 @@ var clientRenderData2 = stringToPrecomputedChunk('" data-dgst="');
|
|
659
670
|
var clientRenderData3 = stringToPrecomputedChunk('" data-msg="');
|
660
671
|
var clientRenderData4 = stringToPrecomputedChunk('" data-stck="');
|
661
672
|
|
673
|
+
var styleTagTemplateOpen = stringToPrecomputedChunk('<template data-precedence="">');
|
674
|
+
var styleTagTemplateClose = stringToPrecomputedChunk('</template>'); // Tracks whether we wrote any late style tags. We use this to determine
|
662
675
|
var precedencePlaceholderStart = stringToPrecomputedChunk('<style data-precedence="');
|
663
676
|
var precedencePlaceholderEnd = stringToPrecomputedChunk('"></style>');
|
664
677
|
|
@@ -1190,11 +1203,12 @@ function createRequest(model, bundlerConfig, onError, context, identifierPrefix)
|
|
1190
1203
|
pendingChunks: 0,
|
1191
1204
|
abortableTasks: abortSet,
|
1192
1205
|
pingedTasks: pingedTasks,
|
1193
|
-
|
1206
|
+
completedImportChunks: [],
|
1194
1207
|
completedJSONChunks: [],
|
1195
1208
|
completedErrorChunks: [],
|
1196
1209
|
writtenSymbols: new Map(),
|
1197
|
-
|
1210
|
+
writtenClientReferences: new Map(),
|
1211
|
+
writtenServerReferences: new Map(),
|
1198
1212
|
writtenProviders: new Map(),
|
1199
1213
|
identifierPrefix: identifierPrefix || '',
|
1200
1214
|
identifierCount: 1,
|
@@ -1505,6 +1519,10 @@ function serializePromiseID(id) {
|
|
1505
1519
|
return '$@' + id.toString(16);
|
1506
1520
|
}
|
1507
1521
|
|
1522
|
+
function serializeServerReferenceID(id) {
|
1523
|
+
return '$F' + id.toString(16);
|
1524
|
+
}
|
1525
|
+
|
1508
1526
|
function serializeSymbolReference(name) {
|
1509
1527
|
return '$S' + name;
|
1510
1528
|
}
|
@@ -1513,10 +1531,10 @@ function serializeProviderReference(name) {
|
|
1513
1531
|
return '$P' + name;
|
1514
1532
|
}
|
1515
1533
|
|
1516
|
-
function serializeClientReference(request, parent, key,
|
1517
|
-
var
|
1518
|
-
var
|
1519
|
-
var existingId =
|
1534
|
+
function serializeClientReference(request, parent, key, clientReference) {
|
1535
|
+
var clientReferenceKey = getClientReferenceKey(clientReference);
|
1536
|
+
var writtenClientReferences = request.writtenClientReferences;
|
1537
|
+
var existingId = writtenClientReferences.get(clientReferenceKey);
|
1520
1538
|
|
1521
1539
|
if (existingId !== undefined) {
|
1522
1540
|
if (parent[0] === REACT_ELEMENT_TYPE && key === '1') {
|
@@ -1532,11 +1550,11 @@ function serializeClientReference(request, parent, key, moduleReference) {
|
|
1532
1550
|
}
|
1533
1551
|
|
1534
1552
|
try {
|
1535
|
-
var
|
1553
|
+
var clientReferenceMetadata = resolveClientReferenceMetadata(request.bundlerConfig, clientReference);
|
1536
1554
|
request.pendingChunks++;
|
1537
|
-
var
|
1538
|
-
|
1539
|
-
|
1555
|
+
var importId = request.nextChunkId++;
|
1556
|
+
emitImportChunk(request, importId, clientReferenceMetadata);
|
1557
|
+
writtenClientReferences.set(clientReferenceKey, importId);
|
1540
1558
|
|
1541
1559
|
if (parent[0] === REACT_ELEMENT_TYPE && key === '1') {
|
1542
1560
|
// If we're encoding the "type" of an element, we can refer
|
@@ -1544,10 +1562,10 @@ function serializeClientReference(request, parent, key, moduleReference) {
|
|
1544
1562
|
// knows how to deal with lazy values. This lets us suspend
|
1545
1563
|
// on this component rather than its parent until the code has
|
1546
1564
|
// loaded.
|
1547
|
-
return serializeLazyID(
|
1565
|
+
return serializeLazyID(importId);
|
1548
1566
|
}
|
1549
1567
|
|
1550
|
-
return serializeByValueID(
|
1568
|
+
return serializeByValueID(importId);
|
1551
1569
|
} catch (x) {
|
1552
1570
|
request.pendingChunks++;
|
1553
1571
|
var errorId = request.nextChunkId++;
|
@@ -1565,6 +1583,24 @@ function serializeClientReference(request, parent, key, moduleReference) {
|
|
1565
1583
|
}
|
1566
1584
|
}
|
1567
1585
|
|
1586
|
+
function serializeServerReference(request, parent, key, serverReference) {
|
1587
|
+
var writtenServerReferences = request.writtenServerReferences;
|
1588
|
+
var existingId = writtenServerReferences.get(serverReference);
|
1589
|
+
|
1590
|
+
if (existingId !== undefined) {
|
1591
|
+
return serializeServerReferenceID(existingId);
|
1592
|
+
}
|
1593
|
+
|
1594
|
+
var serverReferenceMetadata = resolveServerReferenceMetadata(request.bundlerConfig, serverReference);
|
1595
|
+
request.pendingChunks++;
|
1596
|
+
var metadataId = request.nextChunkId++; // We assume that this object doesn't suspend.
|
1597
|
+
|
1598
|
+
var processedChunk = processModelChunk(request, metadataId, serverReferenceMetadata);
|
1599
|
+
request.completedJSONChunks.push(processedChunk);
|
1600
|
+
writtenServerReferences.set(serverReference, metadataId);
|
1601
|
+
return serializeServerReferenceID(metadataId);
|
1602
|
+
}
|
1603
|
+
|
1568
1604
|
function escapeStringValue(value) {
|
1569
1605
|
if (value[0] === '$') {
|
1570
1606
|
// We need to escape $ or @ prefixed strings since we use those to encode
|
@@ -1993,7 +2029,7 @@ function resolveModelToJSON(request, parent, key, value) {
|
|
1993
2029
|
|
1994
2030
|
if (typeof value === 'object') {
|
1995
2031
|
if (isClientReference(value)) {
|
1996
|
-
return serializeClientReference(request, parent, key, value);
|
2032
|
+
return serializeClientReference(request, parent, key, value); // $FlowFixMe[method-unbinding]
|
1997
2033
|
} else if (typeof value.then === 'function') {
|
1998
2034
|
// We assume that any object with a .then property is a "Thenable" type,
|
1999
2035
|
// or a Promise type. Either of which can be represented by a Promise.
|
@@ -2057,10 +2093,14 @@ function resolveModelToJSON(request, parent, key, value) {
|
|
2057
2093
|
return serializeClientReference(request, parent, key, value);
|
2058
2094
|
}
|
2059
2095
|
|
2096
|
+
if (isServerReference(value)) {
|
2097
|
+
return serializeServerReference(request, parent, key, value);
|
2098
|
+
}
|
2099
|
+
|
2060
2100
|
if (/^on[A-Z]/.test(key)) {
|
2061
2101
|
throw new Error('Event handlers cannot be passed to Client Component props.' + describeObjectForErrorMessage(parent, key) + '\nIf you need interactivity, consider converting part of this to a Client Component.');
|
2062
2102
|
} else {
|
2063
|
-
throw new Error('Functions cannot be passed directly to Client Components ' +
|
2103
|
+
throw new Error('Functions cannot be passed directly to Client Components ' + 'unless you explicitly expose it by marking it with "use server".' + describeObjectForErrorMessage(parent, key));
|
2064
2104
|
}
|
2065
2105
|
}
|
2066
2106
|
|
@@ -2152,15 +2192,15 @@ function emitErrorChunkDev(request, id, digest, message, stack) {
|
|
2152
2192
|
request.completedErrorChunks.push(processedChunk);
|
2153
2193
|
}
|
2154
2194
|
|
2155
|
-
function
|
2156
|
-
var processedChunk =
|
2157
|
-
request.
|
2195
|
+
function emitImportChunk(request, id, clientReferenceMetadata) {
|
2196
|
+
var processedChunk = processImportChunk(request, id, clientReferenceMetadata);
|
2197
|
+
request.completedImportChunks.push(processedChunk);
|
2158
2198
|
}
|
2159
2199
|
|
2160
2200
|
function emitSymbolChunk(request, id, name) {
|
2161
2201
|
var symbolReference = serializeSymbolReference(name);
|
2162
2202
|
var processedChunk = processReferenceChunk(request, id, symbolReference);
|
2163
|
-
request.
|
2203
|
+
request.completedImportChunks.push(processedChunk);
|
2164
2204
|
}
|
2165
2205
|
|
2166
2206
|
function emitProviderChunk(request, id, contextName) {
|
@@ -2283,12 +2323,12 @@ function flushCompletedChunks(request, destination) {
|
|
2283
2323
|
try {
|
2284
2324
|
// We emit module chunks first in the stream so that
|
2285
2325
|
// they can be preloaded as early as possible.
|
2286
|
-
var
|
2326
|
+
var importsChunks = request.completedImportChunks;
|
2287
2327
|
var i = 0;
|
2288
2328
|
|
2289
|
-
for (; i <
|
2329
|
+
for (; i < importsChunks.length; i++) {
|
2290
2330
|
request.pendingChunks--;
|
2291
|
-
var chunk =
|
2331
|
+
var chunk = importsChunks[i];
|
2292
2332
|
var keepWriting = writeChunkAndReturn(destination, chunk);
|
2293
2333
|
|
2294
2334
|
if (!keepWriting) {
|
@@ -2298,7 +2338,7 @@ function flushCompletedChunks(request, destination) {
|
|
2298
2338
|
}
|
2299
2339
|
}
|
2300
2340
|
|
2301
|
-
|
2341
|
+
importsChunks.splice(0, i); // Next comes model data.
|
2302
2342
|
|
2303
2343
|
var jsonChunks = request.completedJSONChunks;
|
2304
2344
|
i = 0;
|