react-server-dom-webpack 18.3.0-next-4bf2113a1-20230206 → 18.3.0-next-594093496-20230209

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.
@@ -0,0 +1,60 @@
1
+ /**
2
+ * @license React
3
+ * react-server-dom-webpack-server.edge.production.min.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */
10
+ 'use strict';var aa=require("react");var e="function"===typeof AsyncLocalStorage,ba=e?new AsyncLocalStorage:null,m=null,n=0;function p(a,b){if(0!==b.length)if(512<b.length)0<n&&(a.enqueue(new Uint8Array(m.buffer,0,n)),m=new Uint8Array(512),n=0),a.enqueue(b);else{var c=m.length-n;c<b.length&&(0===c?a.enqueue(m):(m.set(b.subarray(0,c),n),a.enqueue(m),b=b.subarray(c)),m=new Uint8Array(512),n=0);m.set(b,n);n+=b.length}return!0}var q=new TextEncoder;
11
+ function r(a){return q.encode(a)}function ca(a,b){"function"===typeof a.error?a.error(b):a.close()}var t=JSON.stringify;function u(a,b,c){a=t(c);b=b.toString(16)+":"+a+"\n";return q.encode(b)}
12
+ var v=Symbol.for("react.client.reference"),w=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"),y=Symbol.for("react.lazy"),pa=Symbol.for("react.default_value"),qa=Symbol.for("react.memo_cache_sentinel");
13
+ function z(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 z(a,0,!1,a,null,!1,!1)});
14
+ [["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){new z(a[0],1,!1,a[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){new z(a,2,!1,a.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){new z(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 z(a,3,!1,a.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(a){new z(a,3,!0,a,null,!1,!1)});["capture","download"].forEach(function(a){new z(a,4,!1,a,null,!1,!1)});
16
+ ["cols","rows","size","span"].forEach(function(a){new z(a,6,!1,a,null,!1,!1)});["rowSpan","start"].forEach(function(a){new z(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 z(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 z(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 z(b,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(a){new z(a,1,!1,a.toLowerCase(),null,!1,!1)});
19
+ new z("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(a){new z(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},ra=["Webkit","ms","Moz","O"];Object.keys(C).forEach(function(a){ra.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);C[b]=C[a]})});var sa=Array.isArray;r('"></template>');r("<script>");r("\x3c/script>");r('<script src="');r('<script type="module" src="');r('" integrity="');r('" async="">\x3c/script>');r("\x3c!-- --\x3e");r(' style="');r(":");r(";");
22
+ r(" ");r('="');r('"');r('=""');r(">");r("/>");r(' selected=""');r("\n");r("<!DOCTYPE html>");r("</");r(">");r('<template id="');r('"></template>');r("\x3c!--$--\x3e");r('\x3c!--$?--\x3e<template id="');r('"></template>');r("\x3c!--$!--\x3e");r("\x3c!--/$--\x3e");r("<template");r('"');r(' data-dgst="');r(' data-msg="');r(' data-stck="');r("></template>");r('<div hidden id="');r('">');r("</div>");r('<svg aria-hidden="true" style="display:none" id="');r('">');r("</svg>");r('<math aria-hidden="true" style="display:none" id="');
23
+ r('">');r("</math>");r('<table hidden id="');r('">');r("</table>");r('<table hidden><tbody id="');r('">');r("</tbody></table>");r('<table hidden><tr id="');r('">');r("</tr></table>");r('<table hidden><colgroup id="');r('">');r("</colgroup></table>");r('$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("');r('$RS("');r('","');r('")\x3c/script>');r('<template data-rsi="" data-sid="');
24
+ r('" data-pid="');r('$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
+ r('$RC("');r('$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("');
26
+ r('$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
+ r('$RR("');r('","');r('",');r('"');r(")\x3c/script>");r('<template data-rci="" data-bid="');r('<template data-rri="" data-bid="');r('" data-sid="');r('" data-sty="');r('$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("');r('$RX("');r('"');r(",");r(")\x3c/script>");r('<template data-rxi="" data-bid="');r('" data-dgst="');r('" data-msg="');r('" data-stck="');r('<style data-precedence="');
28
+ r('"></style>');r("[");r(",[");r(",");r("]");var D=null;function G(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.");G(a,c);b.context._currentValue=b.value}}}function ta(a){a.context._currentValue=a.parentValue;a=a.parent;null!==a&&ta(a)}
29
+ 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?G(a,b):va(a,b)}
30
+ function wa(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?G(a,c):wa(a,c);b.context._currentValue=b.value}function H(a){var b=D;b!==a&&(null===b?ua(a):null===a?ta(b):b.depth===a.depth?G(b,a):b.depth>a.depth?va(b,a):wa(b,a),D=a)}function xa(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 I=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`");
31
+ function ya(){}function za(a,b,c){c=a[c];void 0===c?a.push(b):c!==b&&(b.then(ya,ya),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;}J=b;throw I;}}var J=null;
32
+ function Aa(){if(null===J)throw Error("Expected a suspended thenable. This is a bug in React. Please file an issue.");var a=J;J=null;return a}var K=null,L=0,M=null;function Ba(){var a=M;M=null;return a}function Ca(a){return a._currentValue}
33
+ var Ha={useMemo:function(a){return a()},useCallback:function(a){return a},useDebugValue:function(){},useDeferredValue:N,useTransition:N,readContext:Ca,useContext:Ca,useReducer:N,useRef:N,useState:N,useInsertionEffect:N,useLayoutEffect:N,useImperativeHandle:N,useEffect:N,useId:Da,useMutableSource:N,useSyncExternalStore:N,useCacheRefresh:function(){return Ea},useMemoCache:function(a){for(var b=Array(a),c=0;c<a;c++)b[c]=qa;return b},use:Fa};
34
+ function N(){throw Error("This Hook is not supported in Server Components.");}function Ea(){throw Error("Refreshing the cache is not supported in Server Components.");}function Da(){if(null===K)throw Error("useId can only be used while React is rendering");var a=K.identifierCount++;return":"+K.identifierPrefix+"S"+a.toString(32)+":"}
35
+ function Fa(a){if(null!==a&&"object"===typeof a||"function"===typeof a){if("function"===typeof a.then){var b=L;L+=1;null===M&&(M=[]);return za(M,a,b)}if(a.$$typeof===ka)return a._currentValue}throw Error("An unsupported type was passed to use(): "+String(a));}function O(){return(new AbortController).signal}function Ia(){if(P)return P;if(e){var a=ba.getStore();if(a)return a}return new Map}
36
+ var Ja={getCacheSignal:function(){var a=Ia(),b=a.get(O);void 0===b&&(b=O(),a.set(O,b));return b},getCacheForType:function(a){var b=Ia(),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 Ka(a){console.error(a)}
37
+ function La(a,b,c,d,f){if(null!==T.current&&T.current!==Ja)throw Error("Currently React only supports one RSC renderer at a time.");T.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===
38
+ c?Ka:c,toJSON:function(a,b){return Ma(k,this,a,b)}};k.pendingChunks++;b=Na(d);a=U(k,a,b,g);h.push(a);return k}var Oa={};
39
+ function Pa(a,b){a.pendingChunks++;var c=U(a,null,D,a.abortableTasks);switch(b.status){case "fulfilled":return c.model=b.value,Qa(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;Qa(a,c)},function(b){b=V(a,b);W(a,c.id,b)});return c.id}
40
+ function Ra(a){if("fulfilled"===a.status)return a.value;if("rejected"===a.status)throw a.reason;throw a;}function Sa(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:y,_payload:a,_init:Ra}}
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===v)return[w,b,c,f];L=0;M=g;f=b(f);return"object"===typeof f&&null!==f&&"function"===typeof f.then?"fulfilled"===f.status?f.value:Sa(f):f}if("string"===typeof b)return[w,b,c,f];if("symbol"===typeof b)return b===ia?f.children:[w,b,c,f];if(null!=b&&"object"===typeof b){if(b.$$typeof===v)return[w,b,c,f];switch(b.$$typeof){case y:var h=
42
+ b._init;b=h(b._payload);return X(a,b,c,d,f,g);case la:return a=b.render,L=0,M=g,a(f,void 0);case oa:return X(a,b.type,c,d,f,g);case ja:return xa(b._context,f.value),[w,b,c,{value:f.value,children:f.children,__pop:Oa}]}}throw Error("Unsupported Server Component type: "+Ta(b));}function Qa(a,b){var c=a.pingedTasks;c.push(b);1===c.length&&Ua(a)}function U(a,b,c,d){var f={id:a.nextChunkId++,status:0,model:b,context:c,ping:function(){return Qa(a,f)},thenableState:null};d.add(f);return f}
43
+ function Va(a,b,c,d){var f=d.filepath+"#"+d.name+(d.async?"#async":""),g=a.writtenModules,h=g.get(f);if(void 0!==h)return b[0]===w&&"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 x=a.nextChunkId++,da=t(l),ea=x.toString(16)+":I"+da+"\n";var fa=q.encode(ea);a.completedModuleChunks.push(fa);g.set(f,x);return b[0]===w&&"1"===c?"$L"+x.toString(16):"$"+x.toString(16)}catch(ha){return a.pendingChunks++,
44
+ b=a.nextChunkId++,c=V(a,ha),W(a,b,c),"$"+b.toString(16)}}function Wa(a){return Object.prototype.toString.call(a).replace(/^\[object (.*)\]$/,function(a,c){return c})}function Ta(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 y:var b=a._payload;a=a._init;try{return Y(a(b))}catch(c){}}return""}
46
+ function Z(a,b){var c=Wa(a);if("Object"!==c&&"Array"!==c)return c;c=-1;var d=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):Ta(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===w)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
+ Ta(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}
48
+ function Ma(a,b,c,d){switch(d){case w:return"$"}for(;"object"===typeof d&&null!==d&&(d.$$typeof===w||d.$$typeof===y);)try{switch(d.$$typeof){case w:var f=d;d=X(a,f.type,f.key,f.ref,f.props,null);break;case y:var g=d._init;d=g(d._payload)}}catch(h){c=h===I?Aa():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=Ba(),"$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===v)return Va(a,b,c,d);if("function"===typeof d.then)return"$@"+Pa(a,d).toString(16);if(d.$$typeof===ja)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=u(a,c,"$P"+d),a.completedJSONChunks.push(d)),"$"+c.toString(16);if(d===Oa){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===pa?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===v)return Va(a,b,c,d);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 because they're not serializable."+
51
+ 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("+(d.description+") cannot be found among global symbols.")+Z(b,c));a.pendingChunks++;c=a.nextChunkId++;b=u(a,c,"$S"+g);a.completedModuleChunks.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."+
52
+ Z(b,c));throw Error("Type "+typeof d+" is not supported in Client Component props."+Z(b,c));}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 Xa(a,b){null!==a.destination?(a.status=2,ca(a.destination,b)):(a.status=1,a.fatalError=b)}
53
+ function W(a,b,c){c={digest:c};b=b.toString(16)+":E"+t(c)+"\n";b=q.encode(b);a.completedErrorChunks.push(b)}
54
+ function Ua(a){var b=S.current,c=P;S.current=Ha;P=a.cache;K=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){H(g.context);try{var k=g.model;if("object"===typeof k&&null!==k&&k.$$typeof===w){var l=k,x=g.thenableState;g.model=k;k=X(h,l.type,l.key,l.ref,l.props,x);for(g.thenableState=null;"object"===typeof k&&null!==k&&k.$$typeof===w;)l=k,g.model=k,k=X(h,l.type,l.key,l.ref,l.props,null)}var da=g.id,ea=t(k,h.toJSON),fa=da.toString(16)+":"+ea+"\n";
55
+ var ha=q.encode(fa);h.completedJSONChunks.push(ha);h.abortableTasks.delete(g);g.status=1}catch(E){var F=E===I?Aa():E;if("object"===typeof F&&null!==F&&"function"===typeof F.then){var Ga=g.ping;F.then(Ga,Ga);g.thenableState=Ba()}else{h.abortableTasks.delete(g);g.status=4;var $a=V(h,F);W(h,g.id,$a)}}}}null!==a.destination&&Ya(a,a.destination)}catch(E){V(a,E),Xa(a,E)}finally{S.current=b,P=c,K=null}}
56
+ function Ya(a,b){m=new Uint8Array(512);n=0;try{for(var c=a.completedModuleChunks,d=0;d<c.length;d++)if(a.pendingChunks--,!p(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--,!p(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--,!p(b,g[d])){a.destination=null;d++;break}g.splice(0,d)}finally{m&&0<n&&(b.enqueue(new Uint8Array(m.buffer,0,n)),m=null,n=0)}0===
57
+ a.pendingChunks&&b.close()}function Za(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=u(a,b.id,c);a.completedErrorChunks.push(b)});c.clear()}null!==a.destination&&Ya(a,a.destination)}catch(g){V(a,g),Xa(a,g)}}
58
+ function Na(a){if(a){var b=D;H(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,pa));xa(R[f],d)}a=D;H(b);return a}return null}
59
+ exports.renderToReadableStream=function(a,b,c){var d=La(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)Za(d,f.reason);else{var g=function(){Za(d,f.reason);f.removeEventListener("abort",g)};f.addEventListener("abort",g)}}return new ReadableStream({type:"bytes",start:function(){e?ba.run(d.cache,Ua,d):Ua(d)},pull:function(a){if(1===d.status)d.status=2,ca(a,d.fatalError);else if(2!==d.status&&null===d.destination){d.destination=a;try{Ya(d,
60
+ a)}catch(k){V(d,k),Xa(d,k)}}},cancel:function(){}},{highWaterMark:0})};
@@ -478,7 +478,7 @@ var capitalize = function (token) {
478
478
  // scraping the MDN documentation.
479
479
 
480
480
 
481
- ['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' // NOTE: if you add a camelCased prop to this list,
481
+ ['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' // NOTE: if you add a camelCased prop to this list,
482
482
  // you'll need to set attributeName to name.toLowerCase()
483
483
  // instead in the assignment below.
484
484
  ].forEach(function (attributeName) {
@@ -15,7 +15,7 @@ function A(a,b,c,d,f,g,h){this.acceptsBooleans=2===b||3===b||4===b;this.attribut
15
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
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
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,
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 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(B,
19
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
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
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,
@@ -76,25 +76,7 @@ async function resolve(specifier, context, defaultResolve) {
76
76
  }
77
77
  }
78
78
 
79
- var resolved = await defaultResolve(specifier, context, defaultResolve);
80
-
81
- if (resolved.url.endsWith('.server.js')) {
82
- var parentURL = context.parentURL;
83
-
84
- if (parentURL && !parentURL.endsWith('.server.js')) {
85
- var reason;
86
-
87
- if (specifier.endsWith('.server.js')) {
88
- reason = "\"" + specifier + "\"";
89
- } else {
90
- reason = "\"" + specifier + "\" (which expands to \"" + resolved.url + "\")";
91
- }
92
-
93
- throw new Error("Cannot import " + reason + " from \"" + parentURL + "\". " + 'By react-server convention, .server.js files can only be imported from other .server.js files. ' + 'That way nobody accidentally sends these to the client by indirectly importing it.');
94
- }
95
- }
96
-
97
- return resolved;
79
+ return await defaultResolve(specifier, context, defaultResolve);
98
80
  }
99
81
  async function getSource(url, context, defaultGetSource) {
100
82
  // We stash this in case we end up needing to resolve export * statements later.
@@ -159,30 +141,7 @@ function resolveClientImport(specifier, parentURL) {
159
141
  }, stashedResolve);
160
142
  }
161
143
 
162
- async function loadClientImport(url, defaultTransformSource) {
163
- if (stashedGetSource === null) {
164
- throw new Error('Expected getSource to have been called before transformSource');
165
- } // TODO: Validate that this is another module by calling getFormat.
166
-
167
-
168
- var _await$stashedGetSour = await stashedGetSource(url, {
169
- format: 'module'
170
- }, stashedGetSource),
171
- source = _await$stashedGetSour.source;
172
-
173
- return defaultTransformSource(source, {
174
- format: 'module',
175
- url: url
176
- }, defaultTransformSource);
177
- }
178
-
179
- async function parseExportNamesInto(transformedSource, names, parentURL, defaultTransformSource) {
180
- var _acorn$parse = parse(transformedSource, {
181
- ecmaVersion: '2019',
182
- sourceType: 'module'
183
- }),
184
- body = _acorn$parse.body;
185
-
144
+ async function parseExportNamesInto(body, names, parentURL, loader) {
186
145
  for (var i = 0; i < body.length; i++) {
187
146
  var node = body[i];
188
147
 
@@ -195,14 +154,24 @@ async function parseExportNamesInto(transformedSource, names, parentURL, default
195
154
  var _await$resolveClientI = await resolveClientImport(node.source.value, parentURL),
196
155
  url = _await$resolveClientI.url;
197
156
 
198
- var _await$loadClientImpo = await loadClientImport(url, defaultTransformSource),
199
- source = _await$loadClientImpo.source;
157
+ var _await$loader = await loader(url, {
158
+ format: 'module',
159
+ conditions: [],
160
+ importAssertions: {}
161
+ }, loader),
162
+ source = _await$loader.source;
200
163
 
201
164
  if (typeof source !== 'string') {
202
165
  throw new Error('Expected the transformed source to be a string.');
203
166
  }
204
167
 
205
- parseExportNamesInto(source, names, url, defaultTransformSource);
168
+ var _acorn$parse = parse(source, {
169
+ ecmaVersion: '2019',
170
+ sourceType: 'module'
171
+ }),
172
+ childBody = _acorn$parse.body;
173
+
174
+ await parseExportNamesInto(childBody, names, url, loader);
206
175
  continue;
207
176
  }
208
177
 
@@ -236,47 +205,122 @@ async function parseExportNamesInto(transformedSource, names, parentURL, default
236
205
  }
237
206
  }
238
207
 
208
+ async function transformClientModule(source, url, loader) {
209
+ var names = []; // Do a quick check for the exact string. If it doesn't exist, don't
210
+ // bother parsing.
211
+
212
+ if (source.indexOf('use client') === -1) {
213
+ return source;
214
+ }
215
+
216
+ var _acorn$parse2 = parse(source, {
217
+ ecmaVersion: '2019',
218
+ sourceType: 'module'
219
+ }),
220
+ body = _acorn$parse2.body;
221
+
222
+ var useClient = false;
223
+
224
+ for (var i = 0; i < body.length; i++) {
225
+ var node = body[i];
226
+
227
+ if (node.type !== 'ExpressionStatement' || !node.directive) {
228
+ break;
229
+ }
230
+
231
+ if (node.directive === 'use client') {
232
+ useClient = true;
233
+ break;
234
+ }
235
+ }
236
+
237
+ if (!useClient) {
238
+ return source;
239
+ }
240
+
241
+ await parseExportNamesInto(body, names, url, loader);
242
+ var newSrc = "const CLIENT_REFERENCE = Symbol.for('react.client.reference');\n";
243
+
244
+ for (var _i2 = 0; _i2 < names.length; _i2++) {
245
+ var name = names[_i2];
246
+
247
+ if (name === 'default') {
248
+ newSrc += 'export default ';
249
+ newSrc += 'Object.defineProperties(function() {';
250
+ newSrc += 'throw new Error(' + JSON.stringify("Attempted to call the default export of " + url + " from the server" + "but it's on the client. It's not possible to invoke a client function from " + "the server, it can only be rendered as a Component or passed to props of a" + "Client Component.") + ');';
251
+ } else {
252
+ newSrc += 'export const ' + name + ' = ';
253
+ newSrc += 'Object.defineProperties(function() {';
254
+ newSrc += 'throw new Error(' + JSON.stringify("Attempted to call " + name + "() from the server but " + name + " is on the client. " + "It's not possible to invoke a client function from the server, it can " + "only be rendered as a Component or passed to props of a Client Component.") + ');';
255
+ }
256
+
257
+ newSrc += '},{';
258
+ newSrc += 'name: { value: ' + JSON.stringify(name) + '},';
259
+ newSrc += '$$typeof: {value: CLIENT_REFERENCE},';
260
+ newSrc += 'filepath: {value: ' + JSON.stringify(url) + '}';
261
+ newSrc += '});\n';
262
+ }
263
+
264
+ return newSrc;
265
+ }
266
+
267
+ async function loadClientImport(url, defaultTransformSource) {
268
+ if (stashedGetSource === null) {
269
+ throw new Error('Expected getSource to have been called before transformSource');
270
+ } // TODO: Validate that this is another module by calling getFormat.
271
+
272
+
273
+ var _await$stashedGetSour = await stashedGetSource(url, {
274
+ format: 'module'
275
+ }, stashedGetSource),
276
+ source = _await$stashedGetSour.source;
277
+
278
+ var result = await defaultTransformSource(source, {
279
+ format: 'module',
280
+ url: url
281
+ }, defaultTransformSource);
282
+ return {
283
+ format: 'module',
284
+ source: result.source
285
+ };
286
+ }
287
+
239
288
  async function transformSource(source, context, defaultTransformSource) {
240
289
  var transformed = await defaultTransformSource(source, context, defaultTransformSource);
241
290
 
242
- if (context.format === 'module' && context.url.endsWith('.client.js')) {
291
+ if (context.format === 'module') {
243
292
  var transformedSource = transformed.source;
244
293
 
245
294
  if (typeof transformedSource !== 'string') {
246
295
  throw new Error('Expected source to have been transformed to a string.');
247
296
  }
248
297
 
249
- var names = [];
250
- await parseExportNamesInto(transformedSource, names, context.url, defaultTransformSource);
251
- var newSrc = "const CLIENT_REFERENCE = Symbol.for('react.client.reference');\n";
252
-
253
- for (var i = 0; i < names.length; i++) {
254
- var name = names[i];
255
-
256
- if (name === 'default') {
257
- newSrc += 'export default ';
258
- newSrc += 'Object.defineProperties(function() {';
259
- newSrc += 'throw new Error(' + JSON.stringify("Attempted to call the default export of " + context.url + " from the server" + "but it's on the client. It's not possible to invoke a client function from " + "the server, it can only be rendered as a Component or passed to props of a" + "Client Component.") + ');';
260
- } else {
261
- newSrc += 'export const ' + name + ' = ';
262
- newSrc += 'export default ';
263
- newSrc += 'Object.defineProperties(function() {';
264
- newSrc += 'throw new Error(' + JSON.stringify("Attempted to call " + name + "() from the server but " + name + " is on the client. " + "It's not possible to invoke a client function from the server, it can " + "only be rendered as a Component or passed to props of a Client Component.") + ');';
265
- }
298
+ var newSrc = await transformClientModule(transformedSource, context.url, function (url, ctx, defaultLoad) {
299
+ return loadClientImport(url, defaultTransformSource);
300
+ });
301
+ return {
302
+ source: newSrc
303
+ };
304
+ }
266
305
 
267
- newSrc += '},{';
268
- newSrc += 'name: { value: ' + JSON.stringify(name) + '},';
269
- newSrc += '$$typeof: {value: CLIENT_REFERENCE},';
270
- newSrc += 'filepath: {value: ' + JSON.stringify(context.url) + '}';
271
- newSrc += '});\n';
306
+ return transformed;
307
+ }
308
+ async function load(url, context, defaultLoad) {
309
+ if (context.format === 'module') {
310
+ var result = await defaultLoad(url, context, defaultLoad);
311
+
312
+ if (typeof result.source !== 'string') {
313
+ throw new Error('Expected source to have been loaded into a string.');
272
314
  }
273
315
 
316
+ var newSrc = await transformClientModule(result.source, url, defaultLoad);
274
317
  return {
318
+ format: 'module',
275
319
  source: newSrc
276
320
  };
277
321
  }
278
322
 
279
- return transformed;
323
+ return defaultLoad(url, context, defaultLoad);
280
324
  }
281
325
 
282
- export { getSource, resolve, transformSource };
326
+ export { getSource, load, resolve, transformSource };
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-4bf2113a1-20230206",
4
+ "version": "18.3.0-next-594093496-20230209",
5
5
  "keywords": [
6
6
  "react"
7
7
  ],
@@ -16,6 +16,7 @@
16
16
  "client.js",
17
17
  "server.js",
18
18
  "server.browser.js",
19
+ "server.edge.js",
19
20
  "server.node.js",
20
21
  "node-register.js",
21
22
  "cjs/",
@@ -28,13 +29,17 @@
28
29
  "./client": "./client.js",
29
30
  "./server": {
30
31
  "react-server": {
32
+ "edge-light": "./server.edge.js",
33
+ "workerd": "./server.edge.js",
34
+ "deno": "./server.browser.js",
31
35
  "node": "./server.node.js",
32
36
  "browser": "./server.browser.js"
33
37
  },
34
38
  "default": "./server.js"
35
39
  },
36
- "./server.node": "./server.node.js",
37
40
  "./server.browser": "./server.browser.js",
41
+ "./server.edge": "./server.edge.js",
42
+ "./server.node": "./server.node.js",
38
43
  "./node-loader": "./esm/react-server-dom-webpack-node-loader.js",
39
44
  "./node-register": "./node-register.js",
40
45
  "./package.json": "./package.json"
@@ -49,8 +54,8 @@
49
54
  "node": ">=0.10.0"
50
55
  },
51
56
  "peerDependencies": {
52
- "react": "18.3.0-next-4bf2113a1-20230206",
53
- "react-dom": "18.3.0-next-4bf2113a1-20230206",
57
+ "react": "18.3.0-next-594093496-20230209",
58
+ "react-dom": "18.3.0-next-594093496-20230209",
54
59
  "webpack": "^5.59.0"
55
60
  },
56
61
  "dependencies": {
package/server.edge.js ADDED
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ if (process.env.NODE_ENV === 'production') {
4
+ module.exports = require('./cjs/react-server-dom-webpack-server.edge.production.min.js');
5
+ } else {
6
+ module.exports = require('./cjs/react-server-dom-webpack-server.edge.development.js');
7
+ }
@@ -55,10 +55,6 @@
55
55
  function scheduleWork(callback) {
56
56
  callback();
57
57
  }
58
- // TODO: Move this to some special WinterCG build.
59
-
60
- var supportsRequestStorage = typeof AsyncLocalStorage === 'function';
61
- var requestStorage = supportsRequestStorage ? new AsyncLocalStorage() : null;
62
58
  var VIEW_SIZE = 512;
63
59
  var currentView = null;
64
60
  var writtenBytes = 0;
@@ -408,7 +404,7 @@
408
404
  // scraping the MDN documentation.
409
405
 
410
406
 
411
- ['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' // NOTE: if you add a camelCased prop to this list,
407
+ ['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' // NOTE: if you add a camelCased prop to this list,
412
408
  // you'll need to set attributeName to name.toLowerCase()
413
409
  // instead in the assignment below.
414
410
  ].forEach(function (attributeName) {
@@ -1099,11 +1095,6 @@
1099
1095
 
1100
1096
  function resolveCache() {
1101
1097
  if (currentCache) return currentCache;
1102
-
1103
- if (supportsRequestStorage) {
1104
- var cache = requestStorage.getStore();
1105
- if (cache) return cache;
1106
- } // Since we override the dispatcher all the time, we're effectively always
1107
1098
  // active and so to support cache() and fetch() outside of render, we yield
1108
1099
  // an empty Map.
1109
1100
 
@@ -2345,11 +2336,7 @@
2345
2336
  }
2346
2337
 
2347
2338
  function startWork(request) {
2348
- if (supportsRequestStorage) {
2349
- scheduleWork(function () {
2350
- return requestStorage.run(request.cache, performWork, request);
2351
- });
2352
- } else {
2339
+ {
2353
2340
  scheduleWork(function () {
2354
2341
  return performWork(request);
2355
2342
  });