react-server-dom-webpack 18.3.0-next-b0671f9ea-20230130 → 18.3.0-next-0ba4698c7-20230201
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 +56 -70
- package/cjs/react-server-dom-webpack-client.production.min.js +16 -16
- package/cjs/react-server-dom-webpack-server.browser.development.js +21 -20
- package/cjs/react-server-dom-webpack-server.browser.production.min.js +43 -42
- package/cjs/react-server-dom-webpack-server.node.development.js +24 -23
- package/cjs/react-server-dom-webpack-server.node.production.min.js +43 -43
- package/package.json +3 -3
- package/umd/react-server-dom-webpack-client.development.js +56 -70
- package/umd/react-server-dom-webpack-client.production.min.js +13 -13
- package/umd/react-server-dom-webpack-server.browser.development.js +21 -20
- package/umd/react-server-dom-webpack-server.browser.production.min.js +34 -34
@@ -112,9 +112,9 @@ function writeStringChunk(destination, stringChunk) {
|
|
112
112
|
|
113
113
|
if (read < stringChunk.length) {
|
114
114
|
writeToDestination(destination, currentView);
|
115
|
-
currentView = new Uint8Array(VIEW_SIZE);
|
116
|
-
|
117
|
-
|
115
|
+
currentView = new Uint8Array(VIEW_SIZE);
|
116
|
+
writtenBytes = textEncoder.encodeInto(stringChunk.slice(read), // $FlowFixMe[incompatible-call] found when upgrading Flow
|
117
|
+
currentView).written;
|
118
118
|
}
|
119
119
|
|
120
120
|
if (writtenBytes === VIEW_SIZE) {
|
@@ -235,7 +235,7 @@ function closeWithError(destination, error) {
|
|
235
235
|
var stringify = JSON.stringify;
|
236
236
|
|
237
237
|
function serializeRowHeader(tag, id) {
|
238
|
-
return
|
238
|
+
return id.toString(16) + ':' + tag;
|
239
239
|
}
|
240
240
|
|
241
241
|
function processErrorChunkProd(request, id, digest) {
|
@@ -262,26 +262,17 @@ function processErrorChunkDev(request, id, digest, message, stack) {
|
|
262
262
|
}
|
263
263
|
function processModelChunk(request, id, model) {
|
264
264
|
var json = stringify(model, request.toJSON);
|
265
|
-
var row =
|
265
|
+
var row = id.toString(16) + ':' + json + '\n';
|
266
266
|
return stringToChunk(row);
|
267
267
|
}
|
268
268
|
function processReferenceChunk(request, id, reference) {
|
269
269
|
var json = stringify(reference);
|
270
|
-
var row =
|
270
|
+
var row = id.toString(16) + ':' + json + '\n';
|
271
271
|
return stringToChunk(row);
|
272
272
|
}
|
273
273
|
function processModuleChunk(request, id, moduleMetaData) {
|
274
274
|
var json = stringify(moduleMetaData);
|
275
|
-
var row = serializeRowHeader('
|
276
|
-
return stringToChunk(row);
|
277
|
-
}
|
278
|
-
function processProviderChunk(request, id, contextName) {
|
279
|
-
var row = serializeRowHeader('P', id) + contextName + '\n';
|
280
|
-
return stringToChunk(row);
|
281
|
-
}
|
282
|
-
function processSymbolChunk(request, id, name) {
|
283
|
-
var json = stringify(name);
|
284
|
-
var row = serializeRowHeader('S', id) + json + '\n';
|
275
|
+
var row = serializeRowHeader('I', id) + json + '\n';
|
285
276
|
return stringToChunk(row);
|
286
277
|
}
|
287
278
|
|
@@ -294,7 +285,7 @@ function isClientReference(reference) {
|
|
294
285
|
return reference.$$typeof === CLIENT_REFERENCE_TAG;
|
295
286
|
}
|
296
287
|
function resolveModuleMetaData(config, clientReference) {
|
297
|
-
var resolvedModuleData = config[clientReference.filepath][clientReference.name];
|
288
|
+
var resolvedModuleData = config.clientManifest[clientReference.filepath][clientReference.name];
|
298
289
|
|
299
290
|
if (clientReference.async) {
|
300
291
|
return {
|
@@ -1489,7 +1480,15 @@ function serializeByValueID(id) {
|
|
1489
1480
|
}
|
1490
1481
|
|
1491
1482
|
function serializeByRefID(id) {
|
1492
|
-
return '
|
1483
|
+
return '$L' + id.toString(16);
|
1484
|
+
}
|
1485
|
+
|
1486
|
+
function serializeSymbolReference(name) {
|
1487
|
+
return '$S' + name;
|
1488
|
+
}
|
1489
|
+
|
1490
|
+
function serializeProviderReference(name) {
|
1491
|
+
return '$P' + name;
|
1493
1492
|
}
|
1494
1493
|
|
1495
1494
|
function serializeClientReference(request, parent, key, moduleReference) {
|
@@ -1545,7 +1544,7 @@ function serializeClientReference(request, parent, key, moduleReference) {
|
|
1545
1544
|
}
|
1546
1545
|
|
1547
1546
|
function escapeStringValue(value) {
|
1548
|
-
if (value[0] === '$'
|
1547
|
+
if (value[0] === '$') {
|
1549
1548
|
// We need to escape $ or @ prefixed strings since we use those to encode
|
1550
1549
|
// references to IDs and as special symbol values.
|
1551
1550
|
return '$' + value;
|
@@ -2132,12 +2131,14 @@ function emitModuleChunk(request, id, moduleMetaData) {
|
|
2132
2131
|
}
|
2133
2132
|
|
2134
2133
|
function emitSymbolChunk(request, id, name) {
|
2135
|
-
var
|
2134
|
+
var symbolReference = serializeSymbolReference(name);
|
2135
|
+
var processedChunk = processReferenceChunk(request, id, symbolReference);
|
2136
2136
|
request.completedModuleChunks.push(processedChunk);
|
2137
2137
|
}
|
2138
2138
|
|
2139
2139
|
function emitProviderChunk(request, id, contextName) {
|
2140
|
-
var
|
2140
|
+
var contextReference = serializeProviderReference(contextName);
|
2141
|
+
var processedChunk = processReferenceChunk(request, id, contextReference);
|
2141
2142
|
request.completedJSONChunks.push(processedChunk);
|
2142
2143
|
}
|
2143
2144
|
|
@@ -2418,8 +2419,8 @@ function createDrainHandler(destination, request) {
|
|
2418
2419
|
};
|
2419
2420
|
}
|
2420
2421
|
|
2421
|
-
function renderToPipeableStream(model,
|
2422
|
-
var request = createRequest(model,
|
2422
|
+
function renderToPipeableStream(model, webpackMaps, options) {
|
2423
|
+
var request = createRequest(model, webpackMaps, options ? options.onError : undefined, options ? options.context : undefined, options ? options.identifierPrefix : undefined);
|
2423
2424
|
var hasStartedFlowing = false;
|
2424
2425
|
startWork(request);
|
2425
2426
|
return {
|
@@ -7,54 +7,54 @@
|
|
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
|
10
|
+
'use strict';var aa=require("util"),ea=require("async_hooks"),fa=require("react");var ha=new ea.AsyncLocalStorage,e=null,m=0,n=!0;function p(a,b){a=a.write(b);n=n&&a}
|
11
11
|
function q(a,b){if("string"===typeof b){if(0!==b.length)if(2048<3*b.length)0<m&&(p(a,e.subarray(0,m)),e=new Uint8Array(2048),m=0),p(a,r.encode(b));else{var d=e;0<m&&(d=e.subarray(m));d=r.encodeInto(b,d);var c=d.read;m+=d.written;c<b.length&&(p(a,e),e=new Uint8Array(2048),m=r.encodeInto(b.slice(c),e).written);2048===m&&(p(a,e),e=new Uint8Array(2048),m=0)}}else 0!==b.byteLength&&(2048<b.byteLength?(0<m&&(p(a,e.subarray(0,m)),e=new Uint8Array(2048),m=0),p(a,b)):(d=e.length-m,d<b.byteLength&&(0===d?p(a,
|
12
|
-
e):(e.set(b.subarray(0,d),m),m+=d,p(a,e),b=b.subarray(d)),e=new Uint8Array(2048),m=0),e.set(b,m),m+=b.byteLength,2048===m&&(p(a,e),e=new Uint8Array(2048),m=0)));return n}var r=new
|
13
|
-
var
|
14
|
-
function
|
15
|
-
[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){new
|
16
|
-
"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
|
17
|
-
["cols","rows","size","span"].forEach(function(a){new
|
18
|
-
"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 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(
|
19
|
-
|
20
|
-
new
|
21
|
-
var
|
22
|
-
fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ra=["Webkit","ms","Moz","O"];Object.keys(
|
12
|
+
e):(e.set(b.subarray(0,d),m),m+=d,p(a,e),b=b.subarray(d)),e=new Uint8Array(2048),m=0),e.set(b,m),m+=b.byteLength,2048===m&&(p(a,e),e=new Uint8Array(2048),m=0)));return n}var r=new aa.TextEncoder;function t(a){return r.encode(a)}var u=JSON.stringify;function v(a,b,d){a=u(d);return b.toString(16)+":"+a+"\n"}
|
13
|
+
var w=Symbol.for("react.client.reference"),x=Symbol.for("react.element"),ia=Symbol.for("react.fragment"),ja=Symbol.for("react.provider"),ka=Symbol.for("react.server_context"),la=Symbol.for("react.forward_ref"),ma=Symbol.for("react.suspense"),na=Symbol.for("react.suspense_list"),oa=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),pa=Symbol.for("react.default_value"),qa=Symbol.for("react.memo_cache_sentinel");
|
14
|
+
function A(a,b,d,c,f,g,h){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=c;this.attributeNamespace=f;this.mustUseProperty=d;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 A(a,0,!1,a,null,!1,!1)});
|
15
|
+
[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){new A(a[0],1,!1,a[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){new A(a,2,!1,a.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){new A(a,2,!1,a,null,!1,!1)});
|
16
|
+
"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 A(a,3,!1,a.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(a){new A(a,3,!0,a,null,!1,!1)});["capture","download"].forEach(function(a){new A(a,4,!1,a,null,!1,!1)});
|
17
|
+
["cols","rows","size","span"].forEach(function(a){new A(a,6,!1,a,null,!1,!1)});["rowSpan","start"].forEach(function(a){new A(a,5,!1,a.toLowerCase(),null,!1,!1)});var B=/[\-:]([a-z])/g;function C(a){return a[1].toUpperCase()}
|
18
|
+
"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 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(B,
|
19
|
+
C);new A(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(B,C);new A(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(B,C);new A(b,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(a){new A(a,1,!1,a.toLowerCase(),null,!1,!1)});
|
20
|
+
new A("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(a){new A(a,1,!1,a.toLowerCase(),null,!0,!0)});
|
21
|
+
var D={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,
|
22
|
+
fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ra=["Webkit","ms","Moz","O"];Object.keys(D).forEach(function(a){ra.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);D[b]=D[a]})});var sa=Array.isArray;t('"></template>');t("<script>");t("\x3c/script>");t('<script src="');t('<script type="module" src="');t('" integrity="');t('" async="">\x3c/script>');t("\x3c!-- --\x3e");t(' style="');t(":");t(";");
|
23
23
|
t(" ");t('="');t('"');t('=""');t(">");t("/>");t(' selected=""');t("\n");t("<!DOCTYPE html>");t("</");t(">");t('<template id="');t('"></template>');t("\x3c!--$--\x3e");t('\x3c!--$?--\x3e<template id="');t('"></template>');t("\x3c!--$!--\x3e");t("\x3c!--/$--\x3e");t("<template");t('"');t(' data-dgst="');t(' data-msg="');t(' data-stck="');t("></template>");t('<div hidden id="');t('">');t("</div>");t('<svg aria-hidden="true" style="display:none" id="');t('">');t("</svg>");t('<math aria-hidden="true" style="display:none" id="');
|
24
24
|
t('">');t("</math>");t('<table hidden id="');t('">');t("</table>");t('<table hidden><tbody id="');t('">');t("</tbody></table>");t('<table hidden><tr id="');t('">');t("</tr></table>");t('<table hidden><colgroup id="');t('">');t("</colgroup></table>");t('$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("');t('$RS("');t('","');t('")\x3c/script>');t('<template data-rsi="" data-sid="');
|
25
25
|
t('" data-pid="');t('$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("');
|
26
26
|
t('$RC("');t('$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,v){function r(l){this.s=l}for(var t=$RC,u=$RM,m=new Map,n=document,g,e,f=n.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;e=f[d++];)m.set(e.dataset.precedence,g=e);e=0;f=[];for(var c,h,b,a;c=v[e++];){var k=0;h=c[k++];if(b=u.get(h))"l"!==b.s&&f.push(b);else{a=n.createElement("link");a.href=h;a.rel="stylesheet";for(a.dataset.precedence=d=c[k++];b=c[k++];)a.setAttribute(b,c[k++]);b=a._p=new Promise(function(l,w){a.onload=l;a.onerror=w});b.then(r.bind(b,\n"l"),r.bind(b,"e"));u.set(h,b);f.push(b);c=m.get(d)||g;c===g&&(g=a);m.set(d,a);c?c.parentNode.insertBefore(a,c.nextSibling):(d=n.head,d.insertBefore(a,d.firstChild))}}Promise.all(f).then(t.bind(null,p,q,""),t.bind(null,p,q,"Resource failed to load"))};;$RR("');
|
27
27
|
t('$RM=new Map;\n$RR=function(p,q,v){function r(l){this.s=l}for(var t=$RC,u=$RM,m=new Map,n=document,g,e,f=n.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;e=f[d++];)m.set(e.dataset.precedence,g=e);e=0;f=[];for(var c,h,b,a;c=v[e++];){var k=0;h=c[k++];if(b=u.get(h))"l"!==b.s&&f.push(b);else{a=n.createElement("link");a.href=h;a.rel="stylesheet";for(a.dataset.precedence=d=c[k++];b=c[k++];)a.setAttribute(b,c[k++]);b=a._p=new Promise(function(l,w){a.onload=l;a.onerror=w});b.then(r.bind(b,\n"l"),r.bind(b,"e"));u.set(h,b);f.push(b);c=m.get(d)||g;c===g&&(g=a);m.set(d,a);c?c.parentNode.insertBefore(a,c.nextSibling):(d=n.head,d.insertBefore(a,d.firstChild))}}Promise.all(f).then(t.bind(null,p,q,""),t.bind(null,p,q,"Resource failed to load"))};;$RR("');
|
28
28
|
t('$RR("');t('","');t('",');t('"');t(")\x3c/script>");t('<template data-rci="" data-bid="');t('<template data-rri="" data-bid="');t('" data-sid="');t('" data-sty="');t('$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("');t('$RX("');t('"');t(",");t(")\x3c/script>");t('<template data-rxi="" data-bid="');t('" data-dgst="');t('" data-msg="');t('" data-stck="');t('<style data-precedence="');
|
29
|
-
t('"></style>');t("[");t(",[");t(",");t("]");var
|
30
|
-
function ua(a){var b=a.parent;null!==b&&ua(b);a.context._currentValue=a.value}function va(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?
|
31
|
-
function wa(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?
|
32
|
-
function ya(){}function za(a,b,d){d=a[d];void 0===d?a.push(b):d!==b&&(b.then(ya,ya),b=d);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;}
|
33
|
-
function Aa(){if(null===
|
34
|
-
var Ha={useMemo:function(a){return a()},useCallback:function(a){return a},useDebugValue:function(){},useDeferredValue:
|
35
|
-
function
|
36
|
-
function Ga(a){if(null!==a&&"object"===typeof a||"function"===typeof a){if("function"===typeof a.then){var b=
|
37
|
-
var Ja={getCacheSignal:function(){var a=Ia(),b=a.get(
|
38
|
-
function La(a,b,d,c,f){if(null!==
|
29
|
+
t('"></style>');t("[");t(",[");t(",");t("]");var G=null;function H(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.");H(a,d);b.context._currentValue=b.value}}}function ta(a){a.context._currentValue=a.parentValue;a=a.parent;null!==a&&ta(a)}
|
30
|
+
function ua(a){var b=a.parent;null!==b&&ua(b);a.context._currentValue=a.value}function va(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?H(a,b):va(a,b)}
|
31
|
+
function wa(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?H(a,d):wa(a,d);b.context._currentValue=b.value}function I(a){var b=G;b!==a&&(null===b?ua(a):null===a?ta(b):b.depth===a.depth?H(b,a):b.depth>a.depth?va(b,a):wa(b,a),G=a)}function xa(a,b){var d=a._currentValue;a._currentValue=b;var c=G;return G=a={parent:c,depth:null===c?0:c.depth+1,context:a,parentValue:d,value:b}}var J=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`");
|
32
|
+
function ya(){}function za(a,b,d){d=a[d];void 0===d?a.push(b):d!==b&&(b.then(ya,ya),b=d);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;}K=b;throw J;}}var K=null;
|
33
|
+
function Aa(){if(null===K)throw Error("Expected a suspended thenable. This is a bug in React. Please file an issue.");var a=K;K=null;return a}var L=null,M=0,N=null;function Ba(){var a=N;N=null;return a}function Ca(a){return a._currentValue}
|
34
|
+
var Ha={useMemo:function(a){return a()},useCallback:function(a){return a},useDebugValue:function(){},useDeferredValue:O,useTransition:O,readContext:Ca,useContext:Ca,useReducer:O,useRef:O,useState:O,useInsertionEffect:O,useLayoutEffect:O,useImperativeHandle:O,useEffect:O,useId:Da,useMutableSource:O,useSyncExternalStore:O,useCacheRefresh:function(){return Fa},useMemoCache:function(a){for(var b=Array(a),d=0;d<a;d++)b[d]=qa;return b},use:Ga};
|
35
|
+
function O(){throw Error("This Hook is not supported in Server Components.");}function Fa(){throw Error("Refreshing the cache is not supported in Server Components.");}function Da(){if(null===L)throw Error("useId can only be used while React is rendering");var a=L.identifierCount++;return":"+L.identifierPrefix+"S"+a.toString(32)+":"}
|
36
|
+
function Ga(a){if(null!==a&&"object"===typeof a||"function"===typeof a){if("function"===typeof a.then){var b=M;M+=1;null===N&&(N=[]);return za(N,a,b)}if(a.$$typeof===ka)return a._currentValue}throw Error("An unsupported type was passed to use(): "+String(a));}function P(){return(new AbortController).signal}function Ia(){if(Q)return Q;var a=ha.getStore();return a?a:new Map}
|
37
|
+
var Ja={getCacheSignal:function(){var a=Ia(),b=a.get(P);void 0===b&&(b=P(),a.set(P,b));return b},getCacheForType:function(a){var b=Ia(),d=b.get(a);void 0===d&&(d=a(),b.set(a,d));return d}},Q=null,R=fa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,S=R.ContextRegistry,T=R.ReactCurrentDispatcher,U=R.ReactCurrentCache;function Ka(a){console.error(a)}
|
38
|
+
function La(a,b,d,c,f){if(null!==U.current&&U.current!==Ja)throw Error("Currently React only supports one RSC renderer at a time.");U.current=Ja;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,completedModuleChunks:[],completedJSONChunks:[],completedErrorChunks:[],writtenSymbols:new Map,writtenModules:new Map,writtenProviders:new Map,identifierPrefix:f||"",identifierCount:1,onError:void 0===
|
39
39
|
d?Ka:d,toJSON:function(a,b){return Ma(k,this,a,b)}};k.pendingChunks++;b=Na(c);a=Oa(k,a,b,g);h.push(a);return k}var Pa={};function Qa(a){if("fulfilled"===a.status)return a.value;if("rejected"===a.status)throw a.reason;throw a;}
|
40
|
-
function Ra(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:
|
41
|
-
function
|
42
|
-
return
|
43
|
-
function
|
44
|
-
b=a.nextChunkId++,d=W(a,
|
45
|
-
function Y(a){if("string"===typeof a)return a;switch(a){case ma:return"Suspense";case na:return"SuspenseList"}if("object"===typeof a)switch(a.$$typeof){case la:return Y(a.render);case oa:return Y(a.type);case
|
46
|
-
function Z(a,b){var d=
|
47
|
-
|
48
|
-
function Ma(a,b,d,c){switch(c){case
|
49
|
-
c.toString(16)}if(null===c)return null;if("object"===typeof c){if(c.$$typeof===
|
50
|
-
|
51
|
-
Z(b,d));}if("symbol"===typeof c){f=a.writtenSymbols;g=f.get(c);if(void 0!==g)return"$"+g.toString(16);g=c.description;if(Symbol.for(g)!==c)throw Error("Only global symbols received from Symbol.for(...) can be passed to Client Components. The symbol Symbol.for("+(c.description+") cannot be found among global symbols.")+Z(b,d));a.pendingChunks++;d=a.nextChunkId++;b=
|
52
|
-
|
53
|
-
function
|
54
|
-
function
|
55
|
-
|
56
|
-
function
|
57
|
-
typeof b.flush&&b.flush();0===a.pendingChunks&&b.end()}function
|
58
|
-
function
|
59
|
-
function Na(a){if(a){var b=
|
60
|
-
exports.renderToPipeableStream=function(a,b,d){var c=La(a,b,d?d.onError:void 0,d?d.context:void 0,d?d.identifierPrefix:void 0),f=!1;
|
40
|
+
function Ra(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:z,_payload:a,_init:Qa}}
|
41
|
+
function V(a,b,d,c,f){if(null!==d&&void 0!==d)throw Error("Refs cannot be used in Server Components, nor passed to Client Components.");if("function"===typeof a){if(a.$$typeof===w)return[x,a,b,c];M=0;N=f;c=a(c);return"object"===typeof c&&null!==c&&"function"===typeof c.then?Ra(c):c}if("string"===typeof a)return[x,a,b,c];if("symbol"===typeof a)return a===ia?c.children:[x,a,b,c];if(null!=a&&"object"===typeof a){if(a.$$typeof===w)return[x,a,b,c];switch(a.$$typeof){case z:var g=a._init;a=g(a._payload);
|
42
|
+
return V(a,b,d,c,f);case la:return b=a.render,M=0,N=f,b(c,void 0);case oa:return V(a.type,b,d,c,f);case ja:return xa(a._context,c.value),[x,a,b,{value:c.value,children:c.children,__pop:Pa}]}}throw Error("Unsupported Server Component type: "+Sa(a));}function Ta(a,b){var d=a.pingedTasks;d.push(b);1===d.length&&setImmediate(function(){return Ua(a)})}function Oa(a,b,d,c){var f={id:a.nextChunkId++,status:0,model:b,context:d,ping:function(){return Ta(a,f)},thenableState:null};c.add(f);return f}
|
43
|
+
function Va(a,b,d,c){var f=c.filepath+"#"+c.name+(c.async?"#async":""),g=a.writtenModules,h=g.get(f);if(void 0!==h)return b[0]===x&&"1"===d?"$L"+h.toString(16):"$"+h.toString(16);try{var k=a.bundlerConfig.clientManifest[c.filepath][c.name];var l=c.async?{id:k.id,chunks:k.chunks,name:k.name,async:!0}:k;a.pendingChunks++;var y=a.nextChunkId++,ba=u(l);var ca=y.toString(16)+":I"+ba+"\n";a.completedModuleChunks.push(ca);g.set(f,y);return b[0]===x&&"1"===d?"$L"+y.toString(16):"$"+y.toString(16)}catch(da){return a.pendingChunks++,
|
44
|
+
b=a.nextChunkId++,d=W(a,da),X(a,b,d),"$"+b.toString(16)}}function Wa(a){return Object.prototype.toString.call(a).replace(/^\[object (.*)\]$/,function(a,d){return d})}function Sa(a){switch(typeof a){case "string":return JSON.stringify(10>=a.length?a:a.substr(0,10)+"...");case "object":if(sa(a))return"[...]";a=Wa(a);return"Object"===a?"{...}":a;case "function":return"function";default:return String(a)}}
|
45
|
+
function Y(a){if("string"===typeof a)return a;switch(a){case ma:return"Suspense";case na:return"SuspenseList"}if("object"===typeof a)switch(a.$$typeof){case la:return Y(a.render);case oa:return Y(a.type);case z:var b=a._payload;a=a._init;try{return Y(a(b))}catch(d){}}return""}
|
46
|
+
function Z(a,b){var d=Wa(a);if("Object"!==d&&"Array"!==d)return d;d=-1;var c=0;if(sa(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):Sa(h);""+g===b?(d=f.length,c=h.length,f+=h):f=10>h.length&&40>f.length+h.length?f+h:f+"..."}f+="]"}else if(a.$$typeof===x)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):
|
47
|
+
Sa(l);k===b?(d=f.length,c=l.length,f+=l):f=10>l.length&&40>f.length+l.length?f+l:f+"..."}f+="}"}return void 0===b?f:-1<d&&0<c?(a=" ".repeat(d)+"^".repeat(c),"\n "+f+"\n "+a):"\n "+f}
|
48
|
+
function Ma(a,b,d,c){switch(c){case x:return"$"}for(;"object"===typeof c&&null!==c&&(c.$$typeof===x||c.$$typeof===z);)try{switch(c.$$typeof){case x:var f=c;c=V(f.type,f.key,f.ref,f.props,null);break;case z:var g=c._init;c=g(c._payload)}}catch(h){d=h===J?Aa():h;if("object"===typeof d&&null!==d&&"function"===typeof d.then)return a.pendingChunks++,a=Oa(a,c,G,a.abortableTasks),c=a.ping,d.then(c,c),a.thenableState=Ba(),"$L"+a.id.toString(16);a.pendingChunks++;c=a.nextChunkId++;d=W(a,d);X(a,c,d);return"$L"+
|
49
|
+
c.toString(16)}if(null===c)return null;if("object"===typeof c){if(c.$$typeof===w)return Va(a,b,d,c);if(c.$$typeof===ja)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=v(a,d,"$P"+c),a.completedJSONChunks.push(c)),"$"+d.toString(16);if(c===Pa){a=G;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=c===pa?a.context._defaultValue:c;G=a.parent;
|
50
|
+
return}return c}if("string"===typeof c)return a="$"===c[0]?"$"+c:c,a;if("boolean"===typeof c||"number"===typeof c||"undefined"===typeof c)return c;if("function"===typeof c){if(c.$$typeof===w)return Va(a,b,d,c);if(/^on[A-Z]/.test(d))throw Error("Event handlers cannot be passed to Client Component props."+Z(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 because they're not serializable."+
|
51
|
+
Z(b,d));}if("symbol"===typeof c){f=a.writtenSymbols;g=f.get(c);if(void 0!==g)return"$"+g.toString(16);g=c.description;if(Symbol.for(g)!==c)throw Error("Only global symbols received from Symbol.for(...) can be passed to Client Components. The symbol Symbol.for("+(c.description+") cannot be found among global symbols.")+Z(b,d));a.pendingChunks++;d=a.nextChunkId++;b=v(a,d,"$S"+g);a.completedModuleChunks.push(b);f.set(c,d);return"$"+d.toString(16)}if("bigint"===typeof c)throw Error("BigInt ("+c+") is not yet supported in Client Component props."+
|
52
|
+
Z(b,d));throw Error("Type "+typeof c+" is not supported in Client Component props."+Z(b,d));}function W(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||""}
|
53
|
+
function Xa(a,b){null!==a.destination?(a.status=2,a.destination.destroy(b)):(a.status=1,a.fatalError=b)}function X(a,b,d){d={digest:d};b=b.toString(16)+":E"+u(d)+"\n";a.completedErrorChunks.push(b)}
|
54
|
+
function Ua(a){var b=T.current,d=Q;T.current=Ha;Q=a.cache;L=a;try{var c=a.pingedTasks;a.pingedTasks=[];for(var f=0;f<c.length;f++){var g=c[f];var h=a;if(0===g.status){I(g.context);try{var k=g.model;if("object"===typeof k&&null!==k&&k.$$typeof===x){var l=k,y=g.thenableState;g.model=k;k=V(l.type,l.key,l.ref,l.props,y);for(g.thenableState=null;"object"===typeof k&&null!==k&&k.$$typeof===x;)l=k,g.model=k,k=V(l.type,l.key,l.ref,l.props,null)}var ba=g.id,ca=u(k,h.toJSON);var da=ba.toString(16)+":"+ca+"\n";
|
55
|
+
h.completedJSONChunks.push(da);h.abortableTasks.delete(g);g.status=1}catch(E){var F=E===J?Aa():E;if("object"===typeof F&&null!==F&&"function"===typeof F.then){var Ea=g.ping;F.then(Ea,Ea);g.thenableState=Ba()}else{h.abortableTasks.delete(g);g.status=4;var $a=W(h,F);X(h,g.id,$a)}}}}null!==a.destination&&Ya(a,a.destination)}catch(E){W(a,E),Xa(a,E)}finally{T.current=b,Q=d,L=null}}
|
56
|
+
function Ya(a,b){e=new Uint8Array(2048);m=0;n=!0;try{for(var d=a.completedModuleChunks,c=0;c<d.length;c++)if(a.pendingChunks--,!q(b,d[c])){a.destination=null;c++;break}d.splice(0,c);var f=a.completedJSONChunks;for(c=0;c<f.length;c++)if(a.pendingChunks--,!q(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--,!q(b,g[c])){a.destination=null;c++;break}g.splice(0,c)}finally{e&&0<m&&b.write(e.subarray(0,m)),e=null,m=0,n=!0}"function"===
|
57
|
+
typeof b.flush&&b.flush();0===a.pendingChunks&&b.end()}function Za(a){setImmediate(function(){return ha.run(a.cache,Ua,a)})}function ab(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{Ya(a,b)}catch(d){W(a,d),Xa(a,d)}}}
|
58
|
+
function bb(a,b){try{var d=a.abortableTasks;if(0<d.size){var c=W(a,void 0===b?Error("The render was aborted by the server without a reason."):b);a.pendingChunks++;var f=a.nextChunkId++;X(a,f,c);d.forEach(function(b){b.status=3;var c="$"+f.toString(16);b=v(a,b.id,c);a.completedErrorChunks.push(b)});d.clear()}null!==a.destination&&Ya(a,a.destination)}catch(g){W(a,g),Xa(a,g)}}
|
59
|
+
function Na(a){if(a){var b=G;I(null);for(var d=0;d<a.length;d++){var c=a[d],f=c[0];c=c[1];S[f]||(S[f]=fa.createServerContext(f,pa));xa(S[f],c)}a=G;I(b);return a}return null}function cb(a,b){return function(){return ab(b,a)}}
|
60
|
+
exports.renderToPipeableStream=function(a,b,d){var c=La(a,b,d?d.onError:void 0,d?d.context:void 0,d?d.identifierPrefix:void 0),f=!1;Za(c);return{pipe:function(a){if(f)throw Error("React currently only supports piping to one writable stream.");f=!0;ab(c,a);a.on("drain",cb(a,c));return a},abort:function(a){bb(c,a)}}};
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "react-server-dom-webpack",
|
3
3
|
"description": "React Server Components bindings for DOM using Webpack. This is intended to be integrated into meta-frameworks. It is not intended to be imported directly.",
|
4
|
-
"version": "18.3.0-next-
|
4
|
+
"version": "18.3.0-next-0ba4698c7-20230201",
|
5
5
|
"keywords": [
|
6
6
|
"react"
|
7
7
|
],
|
@@ -49,8 +49,8 @@
|
|
49
49
|
"node": ">=0.10.0"
|
50
50
|
},
|
51
51
|
"peerDependencies": {
|
52
|
-
"react": "18.3.0-next-
|
53
|
-
"react-dom": "18.3.0-next-
|
52
|
+
"react": "18.3.0-next-0ba4698c7-20230201",
|
53
|
+
"react-dom": "18.3.0-next-0ba4698c7-20230201",
|
54
54
|
"webpack": "^5.59.0"
|
55
55
|
},
|
56
56
|
"dependencies": {
|
@@ -278,11 +278,6 @@
|
|
278
278
|
return new Chunk(ERRORED, null, error, response);
|
279
279
|
}
|
280
280
|
|
281
|
-
function createInitializedChunk(response, value) {
|
282
|
-
// $FlowFixMe Flow doesn't support functions as constructors
|
283
|
-
return new Chunk(INITIALIZED, value, null, response);
|
284
|
-
}
|
285
|
-
|
286
281
|
function wakeChunk(listeners, value) {
|
287
282
|
for (var i = 0; i < listeners.length; i++) {
|
288
283
|
var listener = listeners[i];
|
@@ -543,55 +538,74 @@
|
|
543
538
|
}
|
544
539
|
|
545
540
|
function parseModelString(response, parentObject, key, value) {
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
541
|
+
if (value[0] === '$') {
|
542
|
+
if (value === '$') {
|
543
|
+
// A very common symbol.
|
544
|
+
return REACT_ELEMENT_TYPE;
|
545
|
+
}
|
546
|
+
|
547
|
+
switch (value[1]) {
|
548
|
+
case '$':
|
549
|
+
{
|
552
550
|
// This was an escaped string value.
|
553
551
|
return value.substring(1);
|
554
|
-
}
|
555
|
-
|
556
|
-
|
552
|
+
}
|
553
|
+
|
554
|
+
case 'L':
|
555
|
+
{
|
556
|
+
// Lazy node
|
557
|
+
var id = parseInt(value.substring(2), 16);
|
558
|
+
var chunk = getChunk(response, id); // We create a React.lazy wrapper around any lazy values.
|
559
|
+
// When passed into React, we'll know how to suspend on this.
|
557
560
|
|
558
|
-
|
561
|
+
return createLazyChunkWrapper(chunk);
|
562
|
+
}
|
563
|
+
|
564
|
+
case 'S':
|
565
|
+
{
|
566
|
+
return Symbol.for(value.substring(2));
|
567
|
+
}
|
568
|
+
|
569
|
+
case 'P':
|
570
|
+
{
|
571
|
+
return getOrCreateServerContext(value.substring(2)).Provider;
|
572
|
+
}
|
573
|
+
|
574
|
+
default:
|
575
|
+
{
|
576
|
+
// We assume that anything else is a reference ID.
|
577
|
+
var _id = parseInt(value.substring(1), 16);
|
578
|
+
|
579
|
+
var _chunk = getChunk(response, _id);
|
580
|
+
|
581
|
+
switch (_chunk.status) {
|
559
582
|
case RESOLVED_MODEL:
|
560
|
-
initializeModelChunk(
|
583
|
+
initializeModelChunk(_chunk);
|
561
584
|
break;
|
562
585
|
|
563
586
|
case RESOLVED_MODULE:
|
564
|
-
initializeModuleChunk(
|
587
|
+
initializeModuleChunk(_chunk);
|
565
588
|
break;
|
566
589
|
} // The status might have changed after initialization.
|
567
590
|
|
568
591
|
|
569
|
-
switch (
|
592
|
+
switch (_chunk.status) {
|
570
593
|
case INITIALIZED:
|
571
|
-
return
|
594
|
+
return _chunk.value;
|
572
595
|
|
573
596
|
case PENDING:
|
574
597
|
case BLOCKED:
|
575
598
|
var parentChunk = initializingChunk;
|
576
|
-
|
599
|
+
|
600
|
+
_chunk.then(createModelResolver(parentChunk, parentObject, key), createModelReject(parentChunk));
|
601
|
+
|
577
602
|
return null;
|
578
603
|
|
579
604
|
default:
|
580
|
-
throw
|
605
|
+
throw _chunk.reason;
|
581
606
|
}
|
582
607
|
}
|
583
|
-
|
584
|
-
|
585
|
-
case '@':
|
586
|
-
{
|
587
|
-
var _id = parseInt(value.substring(1), 16);
|
588
|
-
|
589
|
-
var _chunk = getChunk(response, _id); // We create a React.lazy wrapper around any lazy values.
|
590
|
-
// When passed into React, we'll know how to suspend on this.
|
591
|
-
|
592
|
-
|
593
|
-
return createLazyChunkWrapper(_chunk);
|
594
|
-
}
|
608
|
+
}
|
595
609
|
}
|
596
610
|
|
597
611
|
return value;
|
@@ -625,10 +639,6 @@
|
|
625
639
|
resolveModelChunk(chunk, model);
|
626
640
|
}
|
627
641
|
}
|
628
|
-
function resolveProvider(response, id, contextName) {
|
629
|
-
var chunks = response._chunks;
|
630
|
-
chunks.set(id, createInitializedChunk(response, getOrCreateServerContext(contextName).Provider));
|
631
|
-
}
|
632
642
|
function resolveModule(response, id, model) {
|
633
643
|
var chunks = response._chunks;
|
634
644
|
var chunk = chunks.get(id);
|
@@ -669,12 +679,6 @@
|
|
669
679
|
}
|
670
680
|
}
|
671
681
|
}
|
672
|
-
function resolveSymbol(response, id, name) {
|
673
|
-
var chunks = response._chunks; // We assume that we'll always emit the symbol before anything references it
|
674
|
-
// to save a few bytes.
|
675
|
-
|
676
|
-
chunks.set(id, createInitializedChunk(response, Symbol.for(name)));
|
677
|
-
}
|
678
682
|
function resolveErrorDev(response, id, digest, message, stack) {
|
679
683
|
|
680
684
|
|
@@ -704,43 +708,23 @@
|
|
704
708
|
return;
|
705
709
|
}
|
706
710
|
|
707
|
-
var
|
711
|
+
var colon = row.indexOf(':', 0);
|
712
|
+
var id = parseInt(row.substring(0, colon), 16);
|
713
|
+
var tag = row[colon + 1]; // When tags that are not text are added, check them here before
|
708
714
|
// parsing the row as text.
|
709
715
|
// switch (tag) {
|
710
716
|
// }
|
711
717
|
|
712
|
-
var colon = row.indexOf(':', 1);
|
713
|
-
var id = parseInt(row.substring(1, colon), 16);
|
714
|
-
var text = row.substring(colon + 1);
|
715
|
-
|
716
718
|
switch (tag) {
|
717
|
-
case '
|
718
|
-
{
|
719
|
-
resolveModel(response, id, text);
|
720
|
-
return;
|
721
|
-
}
|
722
|
-
|
723
|
-
case 'M':
|
724
|
-
{
|
725
|
-
resolveModule(response, id, text);
|
726
|
-
return;
|
727
|
-
}
|
728
|
-
|
729
|
-
case 'P':
|
730
|
-
{
|
731
|
-
resolveProvider(response, id, text);
|
732
|
-
return;
|
733
|
-
}
|
734
|
-
|
735
|
-
case 'S':
|
719
|
+
case 'I':
|
736
720
|
{
|
737
|
-
|
721
|
+
resolveModule(response, id, row.substring(colon + 2));
|
738
722
|
return;
|
739
723
|
}
|
740
724
|
|
741
725
|
case 'E':
|
742
726
|
{
|
743
|
-
var errorInfo = JSON.parse(
|
727
|
+
var errorInfo = JSON.parse(row.substring(colon + 2));
|
744
728
|
|
745
729
|
{
|
746
730
|
resolveErrorDev(response, id, errorInfo.digest, errorInfo.message, errorInfo.stack);
|
@@ -751,7 +735,9 @@
|
|
751
735
|
|
752
736
|
default:
|
753
737
|
{
|
754
|
-
|
738
|
+
// We assume anything else is JSON.
|
739
|
+
resolveModel(response, id, row.substring(colon + 1));
|
740
|
+
return;
|
755
741
|
}
|
756
742
|
}
|
757
743
|
}
|
@@ -7,17 +7,17 @@
|
|
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
|
-
(function(){'use strict';(function(l,n){"object"===typeof exports&&"undefined"!==typeof module?n(exports,require("react")):"function"===typeof define&&define.amd?define(["exports","react"],n):(l=l||self,n(l.ReactServerDOMClient={},l.React))})(this,function(l,n){function
|
11
|
-
var h=q.set.bind(q,e,null);f.then(h,
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
case "pending":case "blocked":return d=w,a.then(
|
17
|
-
Error("Connection closed."))}function
|
18
|
-
b
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
10
|
+
(function(){'use strict';(function(l,n){"object"===typeof exports&&"undefined"!==typeof module?n(exports,require("react")):"function"===typeof define&&define.amd?define(["exports","react"],n):(l=l||self,n(l.ReactServerDOMClient={},l.React))})(this,function(l,n){function H(a,b){return a?(a=a[b.id][b.name],b.async?{id:a.id,chunks:a.chunks,name:a.name,async:!0}:a):b}function I(){}function J(a){for(var b=a.chunks,c=[],d=0;d<b.length;d++){var e=b[d],f=q.get(e);if(void 0===f){f=__webpack_chunk_load__(e);c.push(f);
|
11
|
+
var h=q.set.bind(q,e,null);f.then(h,I);q.set(e,f)}else null!==f&&c.push(f)}if(a.async){if(b=y.get(a.id))return"fulfilled"===b.status?null:b;var k=Promise.all(c).then(function(){return __webpack_require__(a.id)});k.then(function(a){k.status="fulfilled";k.value=a},function(a){k.status="rejected";k.reason=a});y.set(a.id,k);return k}return 0<c.length?Promise.all(c):null}function m(a,b,c,d){this.status=a;this.value=b;this.reason=c;this._response=d}function K(a){switch(a.status){case "resolved_model":r(a);
|
12
|
+
break;case "resolved_module":t(a)}switch(a.status){case "fulfilled":return a.value;case "pending":case "blocked":throw a;default:throw a.reason;}}function u(a,b){for(var c=0;c<a.length;c++)(0,a[c])(b)}function C(a,b,c){switch(a.status){case "fulfilled":u(b,a.value);break;case "pending":case "blocked":a.value=b;a.reason=c;break;case "rejected":c&&u(c,a.reason)}}function v(a,b){if("pending"===a.status||"blocked"===a.status){var c=a.reason;a.status="rejected";a.reason=b;null!==c&&u(c,b)}}function D(a,
|
13
|
+
b){if("pending"===a.status||"blocked"===a.status){var c=a.value,d=a.reason;a.status="resolved_module";a.value=b;null!==c&&(t(a),C(a,c,d))}}function r(a){var b=w,c=g;w=a;g=null;try{var d=JSON.parse(a.value,a._response._fromJSON);null!==g&&0<g.deps?(g.value=d,a.status="blocked",a.value=null,a.reason=null):(a.status="fulfilled",a.value=d)}catch(e){a.status="rejected",a.reason=e}finally{w=b,g=c}}function t(a){try{var b=a.value;if(b.async){var c=y.get(b.id);if("fulfilled"===c.status)var d=c.value;else throw c.reason;
|
14
|
+
}else d=__webpack_require__(b.id);var e="*"===b.name?d:""===b.name?d.__esModule?d.default:d:d[b.name];a.status="fulfilled";a.value=e}catch(f){a.status="rejected",a.reason=f}}function x(a,b){a._chunks.forEach(function(a){"pending"===a.status&&v(a,b)})}function p(a,b){var c=a._chunks,d=c.get(b);d||(d=new m("pending",null,null,a),c.set(b,d));return d}function L(a,b,c){if(g){var d=g;d.deps++}else d=g={deps:1,value:null};return function(e){b[c]=e;d.deps--;0===d.deps&&"blocked"===a.status&&(e=a.value,a.status=
|
15
|
+
"fulfilled",a.value=d.value,null!==e&&u(e,d.value))}}function M(a){return function(b){return v(a,b)}}function N(a,b,c,d){if("$"===d[0]){if("$"===d)return z;switch(d[1]){case "$":return d.substring(1);case "L":return b=parseInt(d.substring(2),16),b=p(a,b),{$$typeof:O,_payload:b,_init:K};case "S":return Symbol.for(d.substring(2));case "P":return b=d.substring(2),A[b]||(A[b]=n.createServerContext(b,P)),A[b].Provider;default:d=parseInt(d.substring(1),16);a=p(a,d);switch(a.status){case "resolved_model":r(a);
|
16
|
+
break;case "resolved_module":t(a)}switch(a.status){case "fulfilled":return a.value;case "pending":case "blocked":return d=w,a.then(L(d,b,c),M(d)),null;default:throw a.reason;}}}return d}function Q(a,b,c){var d=a._chunks,e=d.get(b);c=JSON.parse(c,a._fromJSON);var f=H(a._bundlerConfig,c);if(c=J(f)){if(e){var h=e;h.status="blocked"}else h=new m("blocked",null,null,a),d.set(b,h);c.then(function(){return D(h,f)},function(a){return v(h,a)})}else e?D(e,f):d.set(b,new m("resolved_module",f,null,a))}function E(a){x(a,
|
17
|
+
Error("Connection closed."))}function F(a,b){if(""!==b){var c=b.indexOf(":",0),d=parseInt(b.substring(0,c),16);switch(b[c+1]){case "I":Q(a,d,b.substring(c+2));break;case "E":c=JSON.parse(b.substring(c+2)).digest;b=Error("An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error.");b.stack="Error: "+
|
18
|
+
b.message;b.digest=c;c=a._chunks;var e=c.get(d);e?v(e,b):c.set(d,new m("rejected",null,b,a));break;default:b=b.substring(c+1),e=a._chunks,(c=e.get(d))?"pending"===c.status&&(a=c.value,d=c.reason,c.status="resolved_model",c.value=b,null!==a&&(r(c),C(c,a,d))):e.set(d,new m("resolved_model",b,null,a))}}}function R(a){return function(b,c){return"string"===typeof c?N(a,this,b,c):"object"===typeof c&&null!==c?(b=c[0]===z?{$$typeof:z,type:c[1],key:c[2],ref:null,props:c[3],_owner:null}:c,b):c}}function B(a){var b=
|
19
|
+
new TextDecoder,c=new Map;a={_bundlerConfig:a,_chunks:c,_partialRow:"",_stringDecoder:b};a._fromJSON=R(a);return a}function G(a,b){function c(b){var h=b.value;if(b.done)E(a);else{b=h;h=a._stringDecoder;for(var k=b.indexOf(10);-1<k;){var f=a._partialRow;var g=b.subarray(0,k);g=h.decode(g);F(a,f+g);a._partialRow="";b=b.subarray(k+1);k=b.indexOf(10)}a._partialRow+=h.decode(b,S);return e.read().then(c).catch(d)}}function d(b){x(a,b)}var e=b.getReader();e.read().then(c).catch(d)}var S={stream:!0},q=new Map,
|
20
|
+
y=new Map,z=Symbol.for("react.element"),O=Symbol.for("react.lazy"),P=Symbol.for("react.default_value"),A=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ContextRegistry;m.prototype=Object.create(Promise.prototype);m.prototype.then=function(a,b){switch(this.status){case "resolved_model":r(this);break;case "resolved_module":t(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&&
|
21
|
+
(this.reason=[]),this.reason.push(b));break;default:b(this.reason)}};var w=null,g=null;l.createFromFetch=function(a,b){var c=B(b&&b.moduleMap?b.moduleMap:null);a.then(function(a){G(c,a.body)},function(a){x(c,a)});return p(c,0)};l.createFromReadableStream=function(a,b){b=B(b&&b.moduleMap?b.moduleMap:null);G(b,a);return p(b,0)};l.createFromXHR=function(a,b){function c(b){b=a.responseText;for(var c=f,d=b.indexOf("\n",c);-1<d;)c=e._partialRow+b.substring(c,d),F(e,c),e._partialRow="",c=d+1,d=b.indexOf("\n",
|
22
|
+
c);e._partialRow+=b.substring(c);f=b.length}function d(a){x(e,new TypeError("Network error"))}var e=B(b&&b.moduleMap?b.moduleMap:null),f=0;a.addEventListener("progress",c);a.addEventListener("load",function(a){c();E(e)});a.addEventListener("error",d);a.addEventListener("abort",d);a.addEventListener("timeout",d);return p(e,0)}});
|
23
23
|
})();
|