react-server-dom-webpack 18.3.0-canary-21a161fa3-20230609 → 18.3.0-canary-88df88f94-20230613
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/react-server-dom-webpack-client.browser.development.js +178 -36
- package/cjs/react-server-dom-webpack-client.browser.production.min.js +24 -24
- package/cjs/react-server-dom-webpack-client.edge.development.js +178 -36
- package/cjs/react-server-dom-webpack-client.edge.production.min.js +23 -23
- package/cjs/react-server-dom-webpack-client.node.development.js +177 -53
- package/cjs/react-server-dom-webpack-client.node.production.min.js +25 -25
- package/cjs/react-server-dom-webpack-client.node.unbundled.development.js +177 -53
- package/cjs/react-server-dom-webpack-client.node.unbundled.production.min.js +24 -24
- package/cjs/react-server-dom-webpack-server.browser.development.js +32 -8
- package/cjs/react-server-dom-webpack-server.browser.production.min.js +46 -46
- package/cjs/react-server-dom-webpack-server.edge.development.js +32 -8
- package/cjs/react-server-dom-webpack-server.edge.production.min.js +49 -49
- package/cjs/react-server-dom-webpack-server.node.development.js +32 -8
- package/cjs/react-server-dom-webpack-server.node.production.min.js +37 -37
- package/cjs/react-server-dom-webpack-server.node.unbundled.development.js +32 -8
- package/cjs/react-server-dom-webpack-server.node.unbundled.production.min.js +56 -56
- package/package.json +3 -3
- package/umd/react-server-dom-webpack-client.browser.development.js +178 -36
- package/umd/react-server-dom-webpack-client.browser.production.min.js +21 -20
- package/umd/react-server-dom-webpack-server.browser.development.js +32 -8
- package/umd/react-server-dom-webpack-server.browser.production.min.js +43 -42
@@ -8,60 +8,60 @@
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
9
9
|
*/
|
10
10
|
'use strict';var aa=require("util"),ba=require("async_hooks"),ca=require("react"),da=require("react-dom"),l=null,m=0,p=!0;function r(a,b){a=a.write(b);p=p&&a}
|
11
|
-
function t(a,b){if("string"===typeof b){if(0!==b.length)if(2048<3*b.length)0<m&&(r(a,l.subarray(0,m)),l=new Uint8Array(2048),m=0),r(a,
|
12
|
-
(0===d?r(a,l):(l.set(b.subarray(0,d),m),m+=d,r(a,l),b=b.subarray(d)),l=new Uint8Array(2048),m=0),l.set(b,m),m+=b.byteLength,2048===m&&(r(a,l),l=new Uint8Array(2048),m=0)));return p}var
|
13
|
-
function
|
14
|
-
function
|
15
|
-
var
|
16
|
-
function
|
17
|
-
function
|
18
|
-
function
|
19
|
-
function
|
20
|
-
function
|
21
|
-
var
|
22
|
-
function
|
23
|
-
function
|
24
|
-
var
|
25
|
-
function
|
26
|
-
function
|
27
|
-
function
|
28
|
-
|
29
|
-
function
|
30
|
-
writtenServerReferences:new Map,writtenProviders:new Map,identifierPrefix:e||"",identifierCount:1,onError:void 0===d?
|
31
|
-
function
|
32
|
-
|
33
|
-
function
|
34
|
-
b._init;b=g(b._payload);return
|
35
|
-
function
|
36
|
-
function
|
37
|
-
|
38
|
-
function
|
39
|
-
c.toString(16)}if(null===c)return null;if("object"===typeof c){if(c.$$typeof===
|
40
|
-
|
41
|
-
typeof c)return"$undefined";if("function"===typeof c){if(c.$$typeof===
|
42
|
-
throw Error('Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server".'+
|
43
|
-
|
44
|
-
function
|
45
|
-
function
|
46
|
-
function
|
47
|
-
f.status=1}catch(
|
48
|
-
function
|
49
|
-
null;c++;break}g.splice(0,c)}finally{a.flushScheduled=!1,l&&0<m&&b.write(l.subarray(0,m)),l=null,m=0,p=!0}"function"===typeof b.flush&&b.flush();0===a.pendingChunks&&b.end()}function
|
50
|
-
function
|
51
|
-
function
|
52
|
-
function
|
53
|
-
function
|
11
|
+
function t(a,b){if("string"===typeof b){if(0!==b.length)if(2048<3*b.length)0<m&&(r(a,l.subarray(0,m)),l=new Uint8Array(2048),m=0),r(a,ea.encode(b));else{var d=l;0<m&&(d=l.subarray(m));d=ea.encodeInto(b,d);var c=d.read;m+=d.written;c<b.length&&(r(a,l.subarray(0,m)),l=new Uint8Array(2048),m=ea.encodeInto(b.slice(c),l).written);2048===m&&(r(a,l),l=new Uint8Array(2048),m=0)}}else 0!==b.byteLength&&(2048<b.byteLength?(0<m&&(r(a,l.subarray(0,m)),l=new Uint8Array(2048),m=0),r(a,b)):(d=l.length-m,d<b.byteLength&&
|
12
|
+
(0===d?r(a,l):(l.set(b.subarray(0,d),m),m+=d,r(a,l),b=b.subarray(d)),l=new Uint8Array(2048),m=0),l.set(b,m),m+=b.byteLength,2048===m&&(r(a,l),l=new Uint8Array(2048),m=0)));return p}var ea=new aa.TextEncoder,v=Symbol.for("react.client.reference"),fa=Symbol.for("react.server.reference"),la={prefetchDNS:ha,preconnect:ia,preload:ja,preinit:ka};function ha(a,b){if("string"===typeof a){var d=w();if(d){var c=d.hints,e="D"+a;c.has(e)||(c.add(e),b?x(d,"D",[a,b]):x(d,"D",a),y(d))}}}
|
13
|
+
function ia(a,b){if("string"===typeof a){var d=w();if(d){var c=d.hints,e=null==b||"string"!==typeof b.crossOrigin?null:"use-credentials"===b.crossOrigin?"use-credentials":"";e="C"+(null===e?"null":e)+"|"+a;c.has(e)||(c.add(e),b?x(d,"C",[a,b]):x(d,"C",a),y(d))}}}function ja(a,b){if("string"===typeof a){var d=w();if(d){var c=d.hints,e="L"+a;c.has(e)||(c.add(e),x(d,"L",[a,b]),y(d))}}}
|
14
|
+
function ka(a,b){if("string"===typeof a){var d=w();if(d){var c=d.hints,e="I"+a;c.has(e)||(c.add(e),x(d,"I",[a,b]),y(d))}}}
|
15
|
+
var ma=da.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Dispatcher,oa=new ba.AsyncLocalStorage,z=Symbol.for("react.element"),pa=Symbol.for("react.fragment"),qa=Symbol.for("react.provider"),ra=Symbol.for("react.server_context"),sa=Symbol.for("react.forward_ref"),ta=Symbol.for("react.suspense"),ua=Symbol.for("react.suspense_list"),va=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),wa=Symbol.for("react.default_value"),xa=Symbol.for("react.memo_cache_sentinel"),ya=Symbol.iterator,D=null;
|
16
|
+
function E(a,b){if(a!==b){a.context._currentValue=a.parentValue;a=a.parent;var d=b.parent;if(null===a){if(null!==d)throw Error("The stacks must reach the root at the same time. This is a bug in React.");}else{if(null===d)throw Error("The stacks must reach the root at the same time. This is a bug in React.");E(a,d);b.context._currentValue=b.value}}}function za(a){a.context._currentValue=a.parentValue;a=a.parent;null!==a&&za(a)}
|
17
|
+
function Aa(a){var b=a.parent;null!==b&&Aa(b);a.context._currentValue=a.value}function Ba(a,b){a.context._currentValue=a.parentValue;a=a.parent;if(null===a)throw Error("The depth must equal at least at zero before reaching the root. This is a bug in React.");a.depth===b.depth?E(a,b):Ba(a,b)}
|
18
|
+
function Ca(a,b){var d=b.parent;if(null===d)throw Error("The depth must equal at least at zero before reaching the root. This is a bug in React.");a.depth===d.depth?E(a,d):Ca(a,d);b.context._currentValue=b.value}function Da(a){var b=D;b!==a&&(null===b?Aa(a):null===a?za(b):b.depth===a.depth?E(b,a):b.depth>a.depth?Ba(b,a):Ca(b,a),D=a)}function Ea(a,b){var d=a._currentValue;a._currentValue=b;var c=D;return D=a={parent:c,depth:null===c?0:c.depth+1,context:a,parentValue:d,value:b}}var Fa=Error("Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`");
|
19
|
+
function Ga(){}function Ha(a,b,d){d=a[d];void 0===d?a.push(b):d!==b&&(b.then(Ga,Ga),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(c){if("pending"===b.status){var e=b;e.status="fulfilled";e.value=c}},function(c){if("pending"===b.status){var e=b;e.status="rejected";e.reason=c}}),b.status){case "fulfilled":return b.value;case "rejected":throw b.reason;}F=b;throw Fa;}}var F=null;
|
20
|
+
function Ia(){if(null===F)throw Error("Expected a suspended thenable. This is a bug in React. Please file an issue.");var a=F;F=null;return a}var G=null,H=0,I=null;function Ja(){var a=I;I=null;return a}function Ka(a){return a._currentValue}
|
21
|
+
var Oa={useMemo:function(a){return a()},useCallback:function(a){return a},useDebugValue:function(){},useDeferredValue:J,useTransition:J,readContext:Ka,useContext:Ka,useReducer:J,useRef:J,useState:J,useInsertionEffect:J,useLayoutEffect:J,useImperativeHandle:J,useEffect:J,useId:La,useMutableSource:J,useSyncExternalStore:J,useCacheRefresh:function(){return Ma},useMemoCache:function(a){for(var b=Array(a),d=0;d<a;d++)b[d]=xa;return b},use:Na};
|
22
|
+
function J(){throw Error("This Hook is not supported in Server Components.");}function Ma(){throw Error("Refreshing the cache is not supported in Server Components.");}function La(){if(null===G)throw Error("useId can only be used while React is rendering");var a=G.identifierCount++;return":"+G.identifierPrefix+"S"+a.toString(32)+":"}
|
23
|
+
function Na(a){if(null!==a&&"object"===typeof a||"function"===typeof a){if("function"===typeof a.then){var b=H;H+=1;null===I&&(I=[]);return Ha(I,a,b)}if(a.$$typeof===ra)return a._currentValue}throw Error("An unsupported type was passed to use(): "+String(a));}function Pa(){return(new AbortController).signal}function Qa(){var a=w();return a?a.cache:new Map}
|
24
|
+
var Ra={getCacheSignal:function(){var a=Qa(),b=a.get(Pa);void 0===b&&(b=Pa(),a.set(Pa,b));return b},getCacheForType:function(a){var b=Qa(),d=b.get(a);void 0===d&&(d=a(),b.set(a,d));return d}},Sa=Array.isArray;function Ta(a){return Object.prototype.toString.call(a).replace(/^\[object (.*)\]$/,function(b,d){return d})}
|
25
|
+
function Ua(a){switch(typeof a){case "string":return JSON.stringify(10>=a.length?a:a.slice(0,10)+"...");case "object":if(Sa(a))return"[...]";a=Ta(a);return"Object"===a?"{...}":a;case "function":return"function";default:return String(a)}}
|
26
|
+
function K(a){if("string"===typeof a)return a;switch(a){case ta:return"Suspense";case ua:return"SuspenseList"}if("object"===typeof a)switch(a.$$typeof){case sa:return K(a.render);case va:return K(a.type);case C:var b=a._payload;a=a._init;try{return K(a(b))}catch(d){}}return""}
|
27
|
+
function L(a,b){var d=Ta(a);if("Object"!==d&&"Array"!==d)return d;d=-1;var c=0;if(Sa(a)){var e="[";for(var f=0;f<a.length;f++){0<f&&(e+=", ");var g=a[f];g="object"===typeof g&&null!==g?L(g):Ua(g);""+f===b?(d=e.length,c=g.length,e+=g):e=10>g.length&&40>e.length+g.length?e+g:e+"..."}e+="]"}else if(a.$$typeof===z)e="<"+K(a.type)+"/>";else{e="{";f=Object.keys(a);for(g=0;g<f.length;g++){0<g&&(e+=", ");var k=f[g],h=JSON.stringify(k);e+=('"'+k+'"'===h?k:h)+": ";h=a[k];h="object"===typeof h&&null!==h?L(h):
|
28
|
+
Ua(h);k===b?(d=e.length,c=h.length,e+=h):e=10>h.length&&40>e.length+h.length?e+h:e+"..."}e+="}"}return void 0===b?e:-1<d&&0<c?(a=" ".repeat(d)+"^".repeat(c),"\n "+e+"\n "+a):"\n "+e}var Va=ca.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Wa=Va.ContextRegistry,M=JSON.stringify,Xa=Va.ReactCurrentDispatcher,Ya=Va.ReactCurrentCache;function Za(a){console.error(a)}
|
29
|
+
function $a(a,b,d,c,e){if(null!==Ya.current&&Ya.current!==Ra)throw Error("Currently React only supports one RSC renderer at a time.");ma.current=la;Ya.current=Ra;var f=new Set,g=[],k=new Set,h={status:0,flushScheduled:!1,fatalError:null,destination:null,bundlerConfig:b,cache:new Map,nextChunkId:0,pendingChunks:0,hints:k,abortableTasks:f,pingedTasks:g,completedImportChunks:[],completedHintChunks:[],completedRegularChunks:[],completedErrorChunks:[],writtenSymbols:new Map,writtenClientReferences:new Map,
|
30
|
+
writtenServerReferences:new Map,writtenProviders:new Map,identifierPrefix:e||"",identifierCount:1,onError:void 0===d?Za:d,toJSON:function(q,u){return ab(h,this,q,u)}};h.pendingChunks++;b=bb(c);a=cb(h,a,b,f);g.push(a);return h}var N=null;function w(){if(N)return N;var a=oa.getStore();return a?a:null}var db={};
|
31
|
+
function eb(a,b){a.pendingChunks++;var d=cb(a,null,D,a.abortableTasks);switch(b.status){case "fulfilled":return d.model=b.value,fb(a,d),d.id;case "rejected":var c=O(a,b.reason);P(a,d.id,c);return d.id;default:"string"!==typeof b.status&&(b.status="pending",b.then(function(e){"pending"===b.status&&(b.status="fulfilled",b.value=e)},function(e){"pending"===b.status&&(b.status="rejected",b.reason=e)}))}b.then(function(e){d.model=e;fb(a,d)},function(e){d.status=4;e=O(a,e);P(a,d.id,e);null!==a.destination&&
|
32
|
+
Q(a,a.destination)});return d.id}function gb(a){if("fulfilled"===a.status)return a.value;if("rejected"===a.status)throw a.reason;throw a;}function hb(a){switch(a.status){case "fulfilled":case "rejected":break;default:"string"!==typeof a.status&&(a.status="pending",a.then(function(b){"pending"===a.status&&(a.status="fulfilled",a.value=b)},function(b){"pending"===a.status&&(a.status="rejected",a.reason=b)}))}return{$$typeof:C,_payload:a,_init:gb}}
|
33
|
+
function R(a,b,d,c,e,f){if(null!==c&&void 0!==c)throw Error("Refs cannot be used in Server Components, nor passed to Client Components.");if("function"===typeof b){if(b.$$typeof===v)return[z,b,d,e];H=0;I=f;e=b(e);return"object"===typeof e&&null!==e&&"function"===typeof e.then?"fulfilled"===e.status?e.value:hb(e):e}if("string"===typeof b)return[z,b,d,e];if("symbol"===typeof b)return b===pa?e.children:[z,b,d,e];if(null!=b&&"object"===typeof b){if(b.$$typeof===v)return[z,b,d,e];switch(b.$$typeof){case C:var g=
|
34
|
+
b._init;b=g(b._payload);return R(a,b,d,c,e,f);case sa:return a=b.render,H=0,I=f,a(e,void 0);case va:return R(a,b.type,d,c,e,f);case qa:return Ea(b._context,e.value),[z,b,d,{value:e.value,children:e.children,__pop:db}]}}throw Error("Unsupported Server Component type: "+Ua(b));}function fb(a,b){var d=a.pingedTasks;d.push(b);1===d.length&&(a.flushScheduled=null!==a.destination,setImmediate(function(){return ib(a)}))}
|
35
|
+
function cb(a,b,d,c){var e={id:a.nextChunkId++,status:0,model:b,context:d,ping:function(){return fb(a,e)},thenableState:null};c.add(e);return e}function S(a){return"$"+a.toString(16)}
|
36
|
+
function jb(a,b,d,c){var e=c.$$async?c.$$id+"#async":c.$$id,f=a.writtenClientReferences,g=f.get(e);if(void 0!==g)return b[0]===z&&"1"===d?"$L"+g.toString(16):S(g);try{var k=a.bundlerConfig,h=c.$$id;g="";var q=k[h];if(q)g=q.name;else{var u=h.lastIndexOf("#");-1!==u&&(g=h.slice(u+1),q=k[h.slice(0,u)]);if(!q)throw Error('Could not find the module "'+h+'" in the React Client Manifest. This is probably a bug in the React Server Components bundler.');}var n={id:q.id,chunks:q.chunks,name:g,async:!!c.$$async};
|
37
|
+
a.pendingChunks++;var A=a.nextChunkId++,na=M(n);var B=A.toString(16)+":I"+na+"\n";a.completedImportChunks.push(B);f.set(e,A);return b[0]===z&&"1"===d?"$L"+A.toString(16):S(A)}catch(zb){return a.pendingChunks++,b=a.nextChunkId++,d=O(a,zb),P(a,b,d),S(b)}}
|
38
|
+
function ab(a,b,d,c){switch(c){case z:return"$"}for(;"object"===typeof c&&null!==c&&(c.$$typeof===z||c.$$typeof===C);)try{switch(c.$$typeof){case z:var e=c;c=R(a,e.type,e.key,e.ref,e.props,null);break;case C:var f=c._init;c=f(c._payload)}}catch(g){d=g===Fa?Ia():g;if("object"===typeof d&&null!==d&&"function"===typeof d.then)return a.pendingChunks++,a=cb(a,c,D,a.abortableTasks),c=a.ping,d.then(c,c),a.thenableState=Ja(),"$L"+a.id.toString(16);a.pendingChunks++;c=a.nextChunkId++;d=O(a,d);P(a,c,d);return"$L"+
|
39
|
+
c.toString(16)}if(null===c)return null;if("object"===typeof c){if(c.$$typeof===v)return jb(a,b,d,c);if("function"===typeof c.then)return"$@"+eb(a,c).toString(16);if(c.$$typeof===qa)return c=c._context._globalName,b=a.writtenProviders,d=b.get(d),void 0===d&&(a.pendingChunks++,d=a.nextChunkId++,b.set(c,d),c=kb(a,d,"$P"+c),a.completedRegularChunks.push(c)),S(d);if(c===db){a=D;if(null===a)throw Error("Tried to pop a Context at the root of the app. This is a bug in React.");c=a.parentValue;a.context._currentValue=
|
40
|
+
c===wa?a.context._defaultValue:c;D=a.parent;return}return!Sa(c)&&(null===c||"object"!==typeof c?a=null:(a=ya&&c[ya]||c["@@iterator"],a="function"===typeof a?a:null),a)?Array.from(c):c}if("string"===typeof c){if("Z"===c[c.length-1]&&b[d]instanceof Date)return"$D"+c;if(1024<=c.length)return a.pendingChunks+=2,d=a.nextChunkId++,b="string"===typeof c?Buffer.byteLength(c,"utf8"):c.byteLength,b=d.toString(16)+":T"+b.toString(16)+",",a.completedRegularChunks.push(b,c),S(d);a="$"===c[0]?"$"+c:c;return a}if("boolean"===
|
41
|
+
typeof c)return c;if("number"===typeof c)return a=c,Number.isFinite(a)?0===a&&-Infinity===1/a?"$-0":a:Infinity===a?"$Infinity":-Infinity===a?"$-Infinity":"$NaN";if("undefined"===typeof c)return"$undefined";if("function"===typeof c){if(c.$$typeof===v)return jb(a,b,d,c);if(c.$$typeof===fa)return d=a.writtenServerReferences,b=d.get(c),void 0!==b?a="$F"+b.toString(16):(b=c.$$bound,e={id:c.$$id,bound:b?Promise.resolve(b):null},a.pendingChunks++,b=a.nextChunkId++,e=lb(a,b,e),a.completedRegularChunks.push(e),
|
42
|
+
d.set(c,b),a="$F"+b.toString(16)),a;if(/^on[A-Z]/.test(d))throw Error("Event handlers cannot be passed to Client Component props."+L(b,d)+"\nIf you need interactivity, consider converting part of this to a Client Component.");throw Error('Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server".'+L(b,d));}if("symbol"===typeof c){e=a.writtenSymbols;f=e.get(c);if(void 0!==f)return S(f);f=c.description;if(Symbol.for(f)!==c)throw Error("Only global symbols received from Symbol.for(...) can be passed to Client Components. The symbol Symbol.for("+
|
43
|
+
(c.description+") cannot be found among global symbols.")+L(b,d));a.pendingChunks++;d=a.nextChunkId++;b=kb(a,d,"$S"+f);a.completedImportChunks.push(b);e.set(c,d);return S(d)}if("bigint"===typeof c)return"$n"+c.toString(10);throw Error("Type "+typeof c+" is not supported in Client Component props."+L(b,d));}
|
44
|
+
function O(a,b){a=a.onError;b=a(b);if(null!=b&&"string"!==typeof b)throw Error('onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "'+typeof b+'" instead');return b||""}function mb(a,b){null!==a.destination?(a.status=2,a.destination.destroy(b)):(a.status=1,a.fatalError=b)}
|
45
|
+
function P(a,b,d){d={digest:d};b=b.toString(16)+":E"+M(d)+"\n";a.completedErrorChunks.push(b)}function x(a,b,d){var c=a.nextChunkId++;d=M(d);b="H"+b;c=c.toString(16)+":"+b;a.completedHintChunks.push(c+d+"\n")}
|
46
|
+
function ib(a){var b=Xa.current;Xa.current=Oa;var d=N;G=N=a;try{var c=a.pingedTasks;a.pingedTasks=[];for(var e=0;e<c.length;e++){var f=c[e];var g=a;if(0===f.status){Da(f.context);try{var k=f.model;if("object"===typeof k&&null!==k&&k.$$typeof===z){var h=k,q=f.thenableState;f.model=k;k=R(g,h.type,h.key,h.ref,h.props,q);for(f.thenableState=null;"object"===typeof k&&null!==k&&k.$$typeof===z;)h=k,f.model=k,k=R(g,h.type,h.key,h.ref,h.props,null)}var u=lb(g,f.id,k);g.completedRegularChunks.push(u);g.abortableTasks.delete(f);
|
47
|
+
f.status=1}catch(B){var n=B===Fa?Ia():B;if("object"===typeof n&&null!==n&&"function"===typeof n.then){var A=f.ping;n.then(A,A);f.thenableState=Ja()}else{g.abortableTasks.delete(f);f.status=4;var na=O(g,n);P(g,f.id,na)}}}}null!==a.destination&&Q(a,a.destination)}catch(B){O(a,B),mb(a,B)}finally{Xa.current=b,G=null,N=d}}
|
48
|
+
function Q(a,b){l=new Uint8Array(2048);m=0;p=!0;try{for(var d=a.completedImportChunks,c=0;c<d.length;c++)if(a.pendingChunks--,!t(b,d[c])){a.destination=null;c++;break}d.splice(0,c);var e=a.completedHintChunks;for(c=0;c<e.length;c++)if(!t(b,e[c])){a.destination=null;c++;break}e.splice(0,c);var f=a.completedRegularChunks;for(c=0;c<f.length;c++)if(a.pendingChunks--,!t(b,f[c])){a.destination=null;c++;break}f.splice(0,c);var g=a.completedErrorChunks;for(c=0;c<g.length;c++)if(a.pendingChunks--,!t(b,g[c])){a.destination=
|
49
|
+
null;c++;break}g.splice(0,c)}finally{a.flushScheduled=!1,l&&0<m&&b.write(l.subarray(0,m)),l=null,m=0,p=!0}"function"===typeof b.flush&&b.flush();0===a.pendingChunks&&b.end()}function nb(a){a.flushScheduled=null!==a.destination;setImmediate(function(){return oa.run(a,ib,a)})}function y(a){if(!1===a.flushScheduled&&0===a.pingedTasks.length&&null!==a.destination){var b=a.destination;a.flushScheduled=!0;setImmediate(function(){return Q(a,b)})}}
|
50
|
+
function ob(a,b){if(1===a.status)a.status=2,b.destroy(a.fatalError);else if(2!==a.status&&null===a.destination){a.destination=b;try{Q(a,b)}catch(d){O(a,d),mb(a,d)}}}
|
51
|
+
function pb(a,b){try{var d=a.abortableTasks;if(0<d.size){var c=O(a,void 0===b?Error("The render was aborted by the server without a reason."):b);a.pendingChunks++;var e=a.nextChunkId++;P(a,e,c);d.forEach(function(f){f.status=3;var g=S(e);f=kb(a,f.id,g);a.completedErrorChunks.push(f)});d.clear()}null!==a.destination&&Q(a,a.destination)}catch(f){O(a,f),mb(a,f)}}
|
52
|
+
function bb(a){if(a){var b=D;Da(null);for(var d=0;d<a.length;d++){var c=a[d],e=c[0];c=c[1];Wa[e]||(Wa[e]=ca.createServerContext(e,wa));Ea(Wa[e],c)}a=D;Da(b);return a}return null}function lb(a,b,d){a=M(d,a.toJSON);return b.toString(16)+":"+a+"\n"}function kb(a,b,d){a=M(d);return b.toString(16)+":"+a+"\n"}function qb(a,b){var d=b.lastIndexOf("#");a=b.slice(0,d);b=b.slice(d+1);return{specifier:a,name:b}}var rb=new Map;
|
53
|
+
function sb(a){var b=rb.get(a.specifier);if(b)return"fulfilled"===b.status?null:b;var d=import(a.specifier);d.then(function(c){d.status="fulfilled";d.value=c},function(c){d.status="rejected";d.reason=c});rb.set(a.specifier,d);return d}function T(a){var b=rb.get(a.specifier);if("fulfilled"===b.status)b=b.value;else throw b.reason;return"*"===a.name?b:""===a.name?b.default:b[a.name]}function U(a,b,d,c){this.status=a;this.value=b;this.reason=d;this._response=c}U.prototype=Object.create(Promise.prototype);
|
54
54
|
U.prototype.then=function(a,b){switch(this.status){case "resolved_model":V(this)}switch(this.status){case "fulfilled":a(this.value);break;case "pending":case "blocked":a&&(null===this.value&&(this.value=[]),this.value.push(a));b&&(null===this.reason&&(this.reason=[]),this.reason.push(b));break;default:b(this.reason)}};function W(a,b){for(var d=0;d<a.length;d++)(0,a[d])(b)}
|
55
|
-
function
|
56
|
-
function V(a){var b=X,d=Y;X=a;Y=null;try{var c=JSON.parse(a.value,a._response._fromJSON);null!==Y&&0<Y.deps?(Y.value=c,a.status="blocked",a.value=null,a.reason=null):(a.status="fulfilled",a.value=c)}catch(e){a.status="rejected",a.reason=e}finally{X=b,Y=d}}function
|
57
|
-
function Z(a,b){var d=a._chunks,c=d.get(b);c||(c=a._formData.get(a._prefix+b),c=null!=c?new U("resolved_model",c,null,a):new U("pending",null,null,a),d.set(b,c));return c}function
|
58
|
-
function
|
59
|
-
c?-0:-Infinity;case "N":return NaN;case "u":return;case "D":return new Date(Date.parse(c.slice(2)));case "n":return BigInt(c.slice(2));default:c=parseInt(c.slice(1),16);a=Z(a,c);switch(a.status){case "resolved_model":V(a)}switch(a.status){case "fulfilled":return a.value;case "pending":case "blocked":return c=X,a.then(
|
60
|
-
function
|
61
|
-
function
|
62
|
-
function
|
63
|
-
exports.decodeAction=function(a,b){var d=new FormData,c=null;a.forEach(function(e,f){if(f.startsWith("$ACTION_"))if(f.startsWith("$ACTION_REF_")){e="$ACTION_"+f.slice(12)+":";e=
|
64
|
-
exports.decodeReply=function(a,b){if("string"===typeof a){var d=new FormData;d.append("0",a);a=d}a=
|
65
|
-
exports.decodeReplyFromBusboy=function(a,b){var d=
|
66
|
-
new Blob(u,{type:q});d._formData.append(f,n,h);c--;if(0===c){for(n=0;n<e.length;n+=2)
|
67
|
-
exports.renderToPipeableStream=function(a,b,d){var c
|
55
|
+
function tb(a,b){if("pending"===a.status||"blocked"===a.status){var d=a.reason;a.status="rejected";a.reason=b;null!==d&&W(d,b)}}function ub(a,b,d,c,e,f){var g=qb(a._bundlerConfig,b);a=sb(g);if(d)d=Promise.all([d,a]).then(function(k){k=k[0];var h=T(g);return h.bind.apply(h,[null].concat(k))});else if(a)d=Promise.resolve(a).then(function(){return T(g)});else return T(g);d.then(vb(c,e,f),wb(c));return null}var X=null,Y=null;
|
56
|
+
function V(a){var b=X,d=Y;X=a;Y=null;try{var c=JSON.parse(a.value,a._response._fromJSON);null!==Y&&0<Y.deps?(Y.value=c,a.status="blocked",a.value=null,a.reason=null):(a.status="fulfilled",a.value=c)}catch(e){a.status="rejected",a.reason=e}finally{X=b,Y=d}}function xb(a,b){a._chunks.forEach(function(d){"pending"===d.status&&tb(d,b)})}
|
57
|
+
function Z(a,b){var d=a._chunks,c=d.get(b);c||(c=a._formData.get(a._prefix+b),c=null!=c?new U("resolved_model",c,null,a):new U("pending",null,null,a),d.set(b,c));return c}function vb(a,b,d){if(Y){var c=Y;c.deps++}else c=Y={deps:1,value:null};return function(e){b[d]=e;c.deps--;0===c.deps&&"blocked"===a.status&&(e=a.value,a.status="fulfilled",a.value=c.value,null!==e&&W(e,c.value))}}function wb(a){return function(b){return tb(a,b)}}
|
58
|
+
function yb(a,b,d,c){if("$"===c[0])switch(c[1]){case "$":return c.slice(1);case "@":return b=parseInt(c.slice(2),16),Z(a,b);case "S":return Symbol.for(c.slice(2));case "F":c=parseInt(c.slice(2),16);c=Z(a,c);"resolved_model"===c.status&&V(c);if("fulfilled"!==c.status)throw c.reason;c=c.value;return ub(a,c.id,c.bound,X,b,d);case "K":b=c.slice(2);var e=a._prefix+b+"_",f=new FormData;a._formData.forEach(function(g,k){k.startsWith(e)&&f.append(k.slice(e.length),g)});return f;case "I":return Infinity;case "-":return"$-0"===
|
59
|
+
c?-0:-Infinity;case "N":return NaN;case "u":return;case "D":return new Date(Date.parse(c.slice(2)));case "n":return BigInt(c.slice(2));default:c=parseInt(c.slice(1),16);a=Z(a,c);switch(a.status){case "resolved_model":V(a)}switch(a.status){case "fulfilled":return a.value;case "pending":case "blocked":return c=X,a.then(vb(c,b,d),wb(c)),null;default:throw a.reason;}}return c}
|
60
|
+
function Ab(a,b){var d=2<arguments.length&&void 0!==arguments[2]?arguments[2]:new FormData,c=new Map,e={_bundlerConfig:a,_prefix:b,_formData:d,_chunks:c,_fromJSON:function(f,g){return"string"===typeof g?yb(e,this,f,g):g}};return e}
|
61
|
+
function Bb(a,b,d){a._formData.append(b,d);var c=a._prefix;if(b.startsWith(c)&&(a=a._chunks,b=+b.slice(c.length),(b=a.get(b))&&"pending"===b.status&&(c=b.value,a=b.reason,b.status="resolved_model",b.value=d,null!==c)))switch(V(b),b.status){case "fulfilled":W(c,b.value);break;case "pending":case "blocked":b.value=c;b.reason=a;break;case "rejected":a&&W(a,b.reason)}}function Cb(a){xb(a,Error("Connection closed."))}
|
62
|
+
function Db(a,b,d){var c=qb(a,b);a=sb(c);return d?Promise.all([d,a]).then(function(e){e=e[0];var f=T(c);return f.bind.apply(f,[null].concat(e))}):a?Promise.resolve(a).then(function(){return T(c)}):Promise.resolve(T(c))}function Eb(a,b){return function(){return ob(b,a)}}
|
63
|
+
exports.decodeAction=function(a,b){var d=new FormData,c=null;a.forEach(function(e,f){if(f.startsWith("$ACTION_"))if(f.startsWith("$ACTION_REF_")){e="$ACTION_"+f.slice(12)+":";e=Ab(b,e,a);Cb(e);e=Z(e,0);e.then(function(){});if("fulfilled"!==e.status)throw e.reason;e=e.value;c=Db(b,e.id,e.bound)}else f.startsWith("$ACTION_ID_")&&(e=f.slice(11),c=Db(b,e,null));else d.append(f,e)});return null===c?null:c.then(function(e){return e.bind(null,d)})};
|
64
|
+
exports.decodeReply=function(a,b){if("string"===typeof a){var d=new FormData;d.append("0",a);a=d}a=Ab(b,"",a);Cb(a);return Z(a,0)};
|
65
|
+
exports.decodeReplyFromBusboy=function(a,b){var d=Ab(b,""),c=0,e=[];a.on("field",function(f,g){0<c?e.push(f,g):Bb(d,f,g)});a.on("file",function(f,g,k){var h=k.filename,q=k.mimeType;if("base64"===k.encoding.toLowerCase())throw Error("React doesn't accept base64 encoded file uploads because we don't expect form data passed from a browser to ever encode data that way. If that's the wrong assumption, we can easily fix it.");c++;var u=[];g.on("data",function(n){u.push(n)});g.on("end",function(){var n=
|
66
|
+
new Blob(u,{type:q});d._formData.append(f,n,h);c--;if(0===c){for(n=0;n<e.length;n+=2)Bb(d,e[n],e[n+1]);e.length=0}})});a.on("finish",function(){Cb(d)});a.on("error",function(f){xb(d,f)});return Z(d,0)};
|
67
|
+
exports.renderToPipeableStream=function(a,b,d){var c=$a(a,b,d?d.onError:void 0,d?d.context:void 0,d?d.identifierPrefix:void 0),e=!1;nb(c);return{pipe:function(f){if(e)throw Error("React currently only supports piping to one writable stream.");e=!0;ob(c,f);f.on("drain",Eb(f,c));return f},abort:function(f){pb(c,f)}}};
|
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-canary-
|
4
|
+
"version": "18.3.0-canary-88df88f94-20230613",
|
5
5
|
"keywords": [
|
6
6
|
"react"
|
7
7
|
],
|
@@ -78,8 +78,8 @@
|
|
78
78
|
"node": ">=0.10.0"
|
79
79
|
},
|
80
80
|
"peerDependencies": {
|
81
|
-
"react": "18.3.0-canary-
|
82
|
-
"react-dom": "18.3.0-canary-
|
81
|
+
"react": "18.3.0-canary-88df88f94-20230613",
|
82
|
+
"react-dom": "18.3.0-canary-88df88f94-20230613",
|
83
83
|
"webpack": "^5.59.0"
|
84
84
|
},
|
85
85
|
"dependencies": {
|
@@ -956,6 +956,11 @@
|
|
956
956
|
return ContextRegistry[globalName];
|
957
957
|
}
|
958
958
|
|
959
|
+
var ROW_ID = 0;
|
960
|
+
var ROW_TAG = 1;
|
961
|
+
var ROW_LENGTH = 2;
|
962
|
+
var ROW_CHUNK_BY_NEWLINE = 3;
|
963
|
+
var ROW_CHUNK_BY_LENGTH = 4;
|
959
964
|
var PENDING = 'pending';
|
960
965
|
var BLOCKED = 'blocked';
|
961
966
|
var RESOLVED_MODEL = 'resolved_model';
|
@@ -1121,6 +1126,11 @@
|
|
1121
1126
|
return new Chunk(RESOLVED_MODULE, value, null, response);
|
1122
1127
|
}
|
1123
1128
|
|
1129
|
+
function createInitializedTextChunk(response, value) {
|
1130
|
+
// $FlowFixMe[invalid-constructor] Flow doesn't support functions as constructors
|
1131
|
+
return new Chunk(INITIALIZED, value, null, response);
|
1132
|
+
}
|
1133
|
+
|
1124
1134
|
function resolveModelChunk(chunk, value) {
|
1125
1135
|
if (chunk.status !== PENDING) {
|
1126
1136
|
// We already resolved. We didn't expect to see this.
|
@@ -1532,15 +1542,14 @@
|
|
1532
1542
|
_bundlerConfig: bundlerConfig,
|
1533
1543
|
_callServer: callServer !== undefined ? callServer : missingCall,
|
1534
1544
|
_chunks: chunks,
|
1535
|
-
|
1536
|
-
|
1537
|
-
|
1538
|
-
|
1539
|
-
|
1540
|
-
|
1541
|
-
|
1542
|
-
} // Don't inline this call because it causes closure to outline the call above.
|
1543
|
-
|
1545
|
+
_stringDecoder: createStringDecoder(),
|
1546
|
+
_fromJSON: null,
|
1547
|
+
_rowState: 0,
|
1548
|
+
_rowID: 0,
|
1549
|
+
_rowTag: 0,
|
1550
|
+
_rowLength: 0,
|
1551
|
+
_buffer: []
|
1552
|
+
}; // Don't inline this call because it causes closure to outline the call above.
|
1544
1553
|
|
1545
1554
|
response._fromJSON = createFromJSONCallback(response);
|
1546
1555
|
return response;
|
@@ -1557,6 +1566,13 @@
|
|
1557
1566
|
}
|
1558
1567
|
}
|
1559
1568
|
|
1569
|
+
function resolveText(response, id, text) {
|
1570
|
+
var chunks = response._chunks; // We assume that we always reference large strings after they've been
|
1571
|
+
// emitted.
|
1572
|
+
|
1573
|
+
chunks.set(id, createInitializedTextChunk(response, text));
|
1574
|
+
}
|
1575
|
+
|
1560
1576
|
function resolveModule(response, id, model) {
|
1561
1577
|
var chunks = response._chunks;
|
1562
1578
|
var chunk = chunks.get(id);
|
@@ -1620,35 +1636,44 @@
|
|
1620
1636
|
dispatchHint(code, hintModel);
|
1621
1637
|
}
|
1622
1638
|
|
1623
|
-
function processFullRow(response,
|
1624
|
-
|
1625
|
-
|
1639
|
+
function processFullRow(response, id, tag, buffer, lastChunk) {
|
1640
|
+
var row = '';
|
1641
|
+
var stringDecoder = response._stringDecoder;
|
1642
|
+
|
1643
|
+
for (var i = 0; i < buffer.length; i++) {
|
1644
|
+
var chunk = buffer[i];
|
1645
|
+
row += readPartialStringChunk(stringDecoder, chunk);
|
1626
1646
|
}
|
1627
1647
|
|
1628
|
-
|
1629
|
-
|
1630
|
-
|
1631
|
-
|
1632
|
-
|
1633
|
-
// }
|
1648
|
+
if (typeof lastChunk === 'string') {
|
1649
|
+
row += lastChunk;
|
1650
|
+
} else {
|
1651
|
+
row += readFinalStringChunk(stringDecoder, lastChunk);
|
1652
|
+
}
|
1634
1653
|
|
1635
1654
|
switch (tag) {
|
1636
|
-
case
|
1655
|
+
case 73
|
1656
|
+
/* "I" */
|
1657
|
+
:
|
1637
1658
|
{
|
1638
|
-
resolveModule(response, id, row
|
1659
|
+
resolveModule(response, id, row);
|
1639
1660
|
return;
|
1640
1661
|
}
|
1641
1662
|
|
1642
|
-
case
|
1663
|
+
case 72
|
1664
|
+
/* "H" */
|
1665
|
+
:
|
1643
1666
|
{
|
1644
|
-
var code = row[
|
1645
|
-
resolveHint(response, code, row.slice(
|
1667
|
+
var code = row[0];
|
1668
|
+
resolveHint(response, code, row.slice(1));
|
1646
1669
|
return;
|
1647
1670
|
}
|
1648
1671
|
|
1649
|
-
case
|
1672
|
+
case 69
|
1673
|
+
/* "E" */
|
1674
|
+
:
|
1650
1675
|
{
|
1651
|
-
var errorInfo = JSON.parse(row
|
1676
|
+
var errorInfo = JSON.parse(row);
|
1652
1677
|
|
1653
1678
|
{
|
1654
1679
|
resolveErrorDev(response, id, errorInfo.digest, errorInfo.message, errorInfo.stack);
|
@@ -1657,28 +1682,145 @@
|
|
1657
1682
|
return;
|
1658
1683
|
}
|
1659
1684
|
|
1685
|
+
case 84
|
1686
|
+
/* "T" */
|
1687
|
+
:
|
1688
|
+
{
|
1689
|
+
resolveText(response, id, row);
|
1690
|
+
return;
|
1691
|
+
}
|
1692
|
+
|
1660
1693
|
default:
|
1661
1694
|
{
|
1662
1695
|
// We assume anything else is JSON.
|
1663
|
-
resolveModel(response, id, row
|
1696
|
+
resolveModel(response, id, row);
|
1664
1697
|
return;
|
1665
1698
|
}
|
1666
1699
|
}
|
1667
1700
|
}
|
1701
|
+
|
1668
1702
|
function processBinaryChunk(response, chunk) {
|
1703
|
+
var i = 0;
|
1704
|
+
var rowState = response._rowState;
|
1705
|
+
var rowID = response._rowID;
|
1706
|
+
var rowTag = response._rowTag;
|
1707
|
+
var rowLength = response._rowLength;
|
1708
|
+
var buffer = response._buffer;
|
1709
|
+
var chunkLength = chunk.length;
|
1710
|
+
|
1711
|
+
while (i < chunkLength) {
|
1712
|
+
var lastIdx = -1;
|
1713
|
+
|
1714
|
+
switch (rowState) {
|
1715
|
+
case ROW_ID:
|
1716
|
+
{
|
1717
|
+
var byte = chunk[i++];
|
1718
|
+
|
1719
|
+
if (byte === 58
|
1720
|
+
/* ":" */
|
1721
|
+
) {
|
1722
|
+
// Finished the rowID, next we'll parse the tag.
|
1723
|
+
rowState = ROW_TAG;
|
1724
|
+
} else {
|
1725
|
+
rowID = rowID << 4 | (byte > 96 ? byte - 87 : byte - 48);
|
1726
|
+
}
|
1669
1727
|
|
1670
|
-
|
1671
|
-
|
1672
|
-
|
1673
|
-
|
1674
|
-
|
1675
|
-
|
1676
|
-
|
1677
|
-
|
1678
|
-
|
1728
|
+
continue;
|
1729
|
+
}
|
1730
|
+
|
1731
|
+
case ROW_TAG:
|
1732
|
+
{
|
1733
|
+
var resolvedRowTag = chunk[i];
|
1734
|
+
|
1735
|
+
if (resolvedRowTag === 84
|
1736
|
+
/* "T" */
|
1737
|
+
) {
|
1738
|
+
rowTag = resolvedRowTag;
|
1739
|
+
rowState = ROW_LENGTH;
|
1740
|
+
i++;
|
1741
|
+
} else if (resolvedRowTag > 64 && resolvedRowTag < 91
|
1742
|
+
/* "A"-"Z" */
|
1743
|
+
) {
|
1744
|
+
rowTag = resolvedRowTag;
|
1745
|
+
rowState = ROW_CHUNK_BY_NEWLINE;
|
1746
|
+
i++;
|
1747
|
+
} else {
|
1748
|
+
rowTag = 0;
|
1749
|
+
rowState = ROW_CHUNK_BY_NEWLINE; // This was an unknown tag so it was probably part of the data.
|
1750
|
+
}
|
1751
|
+
|
1752
|
+
continue;
|
1753
|
+
}
|
1754
|
+
|
1755
|
+
case ROW_LENGTH:
|
1756
|
+
{
|
1757
|
+
var _byte = chunk[i++];
|
1758
|
+
|
1759
|
+
if (_byte === 44
|
1760
|
+
/* "," */
|
1761
|
+
) {
|
1762
|
+
// Finished the rowLength, next we'll buffer up to that length.
|
1763
|
+
rowState = ROW_CHUNK_BY_LENGTH;
|
1764
|
+
} else {
|
1765
|
+
rowLength = rowLength << 4 | (_byte > 96 ? _byte - 87 : _byte - 48);
|
1766
|
+
}
|
1767
|
+
|
1768
|
+
continue;
|
1769
|
+
}
|
1770
|
+
|
1771
|
+
case ROW_CHUNK_BY_NEWLINE:
|
1772
|
+
{
|
1773
|
+
// We're looking for a newline
|
1774
|
+
lastIdx = chunk.indexOf(10
|
1775
|
+
/* "\n" */
|
1776
|
+
, i);
|
1777
|
+
break;
|
1778
|
+
}
|
1779
|
+
|
1780
|
+
case ROW_CHUNK_BY_LENGTH:
|
1781
|
+
{
|
1782
|
+
// We're looking for the remaining byte length
|
1783
|
+
if (i + rowLength <= chunk.length) {
|
1784
|
+
lastIdx = i + rowLength;
|
1785
|
+
}
|
1786
|
+
|
1787
|
+
break;
|
1788
|
+
}
|
1789
|
+
}
|
1790
|
+
|
1791
|
+
if (lastIdx > -1) {
|
1792
|
+
// We found the last chunk of the row
|
1793
|
+
var offset = chunk.byteOffset + i;
|
1794
|
+
var length = lastIdx - i;
|
1795
|
+
var lastChunk = new Uint8Array(chunk.buffer, offset, length);
|
1796
|
+
processFullRow(response, rowID, rowTag, buffer, lastChunk); // Reset state machine for a new row
|
1797
|
+
|
1798
|
+
rowState = ROW_ID;
|
1799
|
+
rowTag = 0;
|
1800
|
+
rowID = 0;
|
1801
|
+
rowLength = 0;
|
1802
|
+
buffer.length = 0;
|
1803
|
+
i = lastIdx + 1;
|
1804
|
+
} else {
|
1805
|
+
// The rest of this row is in a future chunk. We stash the rest of the
|
1806
|
+
// current chunk until we can process the full row.
|
1807
|
+
var _offset = chunk.byteOffset + i;
|
1808
|
+
|
1809
|
+
var _length = chunk.byteLength - i;
|
1810
|
+
|
1811
|
+
var remainingSlice = new Uint8Array(chunk.buffer, _offset, _length);
|
1812
|
+
buffer.push(remainingSlice); // Update how many bytes we're still waiting for. If we're looking for
|
1813
|
+
// a newline, this doesn't hurt since we'll just ignore it.
|
1814
|
+
|
1815
|
+
rowLength -= remainingSlice.byteLength;
|
1816
|
+
break;
|
1817
|
+
}
|
1679
1818
|
}
|
1680
1819
|
|
1681
|
-
response.
|
1820
|
+
response._rowState = rowState;
|
1821
|
+
response._rowID = rowID;
|
1822
|
+
response._rowTag = rowTag;
|
1823
|
+
response._rowLength = rowLength;
|
1682
1824
|
}
|
1683
1825
|
|
1684
1826
|
function parseModel(response, json) {
|