react-server-dom-webpack 18.3.0-next-2ef24145e-20230202 → 18.3.0-next-4bf2113a1-20230206
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-node-register.js +1 -1
- package/cjs/react-server-dom-webpack-server.browser.development.js +3 -3
- package/cjs/react-server-dom-webpack-server.browser.production.min.js +1 -1
- package/cjs/react-server-dom-webpack-server.node.development.js +3 -3
- package/cjs/react-server-dom-webpack-server.node.production.min.js +1 -1
- package/package.json +3 -3
- package/umd/react-server-dom-webpack-server.browser.development.js +3 -3
- package/umd/react-server-dom-webpack-server.browser.production.min.js +6 -6
@@ -114,7 +114,7 @@ module.exports = function register() {
|
|
114
114
|
// an ESM compat module but then we'll check again on the client.
|
115
115
|
var moduleId = target.filepath;
|
116
116
|
target.default = Object.defineProperties(function () {
|
117
|
-
throw new Error("Attempted to call the default export of " + moduleId + " 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.");
|
117
|
+
throw new Error("Attempted to call the default export of " + moduleId + " 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.");
|
118
118
|
}, {
|
119
119
|
// This a placeholder value that tells the client to conditionally use the
|
120
120
|
// whole object or just the default export.
|
@@ -219,7 +219,7 @@ function isClientReference(reference) {
|
|
219
219
|
return reference.$$typeof === CLIENT_REFERENCE_TAG;
|
220
220
|
}
|
221
221
|
function resolveModuleMetaData(config, clientReference) {
|
222
|
-
var resolvedModuleData = config
|
222
|
+
var resolvedModuleData = config[clientReference.filepath][clientReference.name];
|
223
223
|
|
224
224
|
if (clientReference.async) {
|
225
225
|
return {
|
@@ -2443,8 +2443,8 @@ function importServerContexts(contexts) {
|
|
2443
2443
|
return rootContextSnapshot;
|
2444
2444
|
}
|
2445
2445
|
|
2446
|
-
function renderToReadableStream(model,
|
2447
|
-
var request = createRequest(model,
|
2446
|
+
function renderToReadableStream(model, webpackMap, options) {
|
2447
|
+
var request = createRequest(model, webpackMap, options ? options.onError : undefined, options ? options.context : undefined, options ? options.identifierPrefix : undefined);
|
2448
2448
|
|
2449
2449
|
if (options && options.signal) {
|
2450
2450
|
var signal = options.signal;
|
@@ -40,7 +40,7 @@ function Pa(a,b){a.pendingChunks++;var c=U(a,null,D,a.abortableTasks);switch(b.s
|
|
40
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
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
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
|
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
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
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
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):
|
@@ -285,7 +285,7 @@ function isClientReference(reference) {
|
|
285
285
|
return reference.$$typeof === CLIENT_REFERENCE_TAG;
|
286
286
|
}
|
287
287
|
function resolveModuleMetaData(config, clientReference) {
|
288
|
-
var resolvedModuleData = config
|
288
|
+
var resolvedModuleData = config[clientReference.filepath][clientReference.name];
|
289
289
|
|
290
290
|
if (clientReference.async) {
|
291
291
|
return {
|
@@ -2513,8 +2513,8 @@ function createDrainHandler(destination, request) {
|
|
2513
2513
|
};
|
2514
2514
|
}
|
2515
2515
|
|
2516
|
-
function renderToPipeableStream(model,
|
2517
|
-
var request = createRequest(model,
|
2516
|
+
function renderToPipeableStream(model, webpackMap, options) {
|
2517
|
+
var request = createRequest(model, webpackMap, options ? options.onError : undefined, options ? options.context : undefined, options ? options.identifierPrefix : undefined);
|
2518
2518
|
var hasStartedFlowing = false;
|
2519
2519
|
startWork(request);
|
2520
2520
|
return {
|
@@ -42,7 +42,7 @@ function Sa(a){if("fulfilled"===a.status)return a.value;if("rejected"===a.status
|
|
42
42
|
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===w)return[x,b,c,f];M=0;N=g;f=b(f);return"object"===typeof f&&null!==f&&"function"===typeof f.then?"fulfilled"===f.status?f.value:Ta(f):f}if("string"===typeof b)return[x,b,c,f];if("symbol"===typeof b)return b===ia?f.children:[x,b,c,f];if(null!=b&&"object"===typeof b){if(b.$$typeof===w)return[x,b,c,f];switch(b.$$typeof){case z:var h=
|
43
43
|
b._init;b=h(b._payload);return X(a,b,c,d,f,g);case la:return a=b.render,M=0,N=g,a(f,void 0);case oa:return X(a,b.type,c,d,f,g);case ja:return xa(b._context,f.value),[x,b,c,{value:f.value,children:f.children,__pop:Pa}]}}throw Error("Unsupported Server Component type: "+Ua(b));}function Ra(a,b){var c=a.pingedTasks;c.push(b);1===c.length&&setImmediate(function(){return Va(a)})}
|
44
44
|
function Oa(a,b,c,d){var f={id:a.nextChunkId++,status:0,model:b,context:c,ping:function(){return Ra(a,f)},thenableState:null};d.add(f);return f}
|
45
|
-
function Wa(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]===x&&"1"===c?"$L"+h.toString(16):"$"+h.toString(16);try{var k=a.bundlerConfig
|
45
|
+
function Wa(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]===x&&"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 y=a.nextChunkId++,da=u(l);var ea=y.toString(16)+":I"+da+"\n";a.completedModuleChunks.push(ea);g.set(f,y);return b[0]===x&&"1"===c?"$L"+y.toString(16):"$"+y.toString(16)}catch(fa){return a.pendingChunks++,
|
46
46
|
b=a.nextChunkId++,c=V(a,fa),W(a,b,c),"$"+b.toString(16)}}function Xa(a){return Object.prototype.toString.call(a).replace(/^\[object (.*)\]$/,function(a,c){return c})}function Ua(a){switch(typeof a){case "string":return JSON.stringify(10>=a.length?a:a.substr(0,10)+"...");case "object":if(sa(a))return"[...]";a=Xa(a);return"Object"===a?"{...}":a;case "function":return"function";default:return String(a)}}
|
47
47
|
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(c){}}return""}
|
48
48
|
function Z(a,b){var c=Xa(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):Ua(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===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):
|
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-4bf2113a1-20230206",
|
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-4bf2113a1-20230206",
|
53
|
+
"react-dom": "18.3.0-next-4bf2113a1-20230206",
|
54
54
|
"webpack": "^5.59.0"
|
55
55
|
},
|
56
56
|
"dependencies": {
|
@@ -215,7 +215,7 @@
|
|
215
215
|
return reference.$$typeof === CLIENT_REFERENCE_TAG;
|
216
216
|
}
|
217
217
|
function resolveModuleMetaData(config, clientReference) {
|
218
|
-
var resolvedModuleData = config
|
218
|
+
var resolvedModuleData = config[clientReference.filepath][clientReference.name];
|
219
219
|
|
220
220
|
if (clientReference.async) {
|
221
221
|
return {
|
@@ -2439,8 +2439,8 @@
|
|
2439
2439
|
return rootContextSnapshot;
|
2440
2440
|
}
|
2441
2441
|
|
2442
|
-
function renderToReadableStream(model,
|
2443
|
-
var request = createRequest(model,
|
2442
|
+
function renderToReadableStream(model, webpackMap, options) {
|
2443
|
+
var request = createRequest(model, webpackMap, options ? options.onError : undefined, options ? options.context : undefined, options ? options.identifierPrefix : undefined);
|
2444
2444
|
|
2445
2445
|
if (options && options.signal) {
|
2446
2446
|
var signal = options.signal;
|
@@ -18,12 +18,12 @@ completedErrorChunks:[],writtenSymbols:new Map,writtenModules:new Map,writtenPro
|
|
18
18
|
"pending",c.then(function(a){"pending"===c.status&&(c.status="fulfilled",c.value=a)},function(a){"pending"===c.status&&(c.status="rejected",c.reason=a)}))}c.then(function(c){e.model=c;V(a,e)},function(c){c=w(a,c);z(a,e.id,c)});return e.id}function Ja(a){if("fulfilled"===a.status)return a.value;if("rejected"===a.status)throw a.reason;throw a;}function Ka(a){switch(a.status){case "fulfilled":case "rejected":break;default:"string"!==typeof a.status&&(a.status="pending",a.then(function(c){"pending"===
|
19
19
|
a.status&&(a.status="fulfilled",a.value=c)},function(c){"pending"===a.status&&(a.status="rejected",a.reason=c)}))}return{$$typeof:C,_payload:a,_init:Ja}}function D(a,c,e,d,b,f){if(null!==d&&void 0!==d)throw Error("Refs cannot be used in Server Components, nor passed to Client Components.");if("function"===typeof c){if(c.$$typeof===K)return[t,c,e,b];L=0;v=f;b=c(b);return"object"===typeof b&&null!==b&&"function"===typeof b.then?"fulfilled"===b.status?b.value:Ka(b):b}if("string"===typeof c)return[t,
|
20
20
|
c,e,b];if("symbol"===typeof c)return c===La?b.children:[t,c,e,b];if(null!=c&&"object"===typeof c){if(c.$$typeof===K)return[t,c,e,b];switch(c.$$typeof){case C:var m=c._init;c=m(c._payload);return D(a,c,e,d,b,f);case ta:return a=c.render,L=0,v=f,a(b,void 0);case ua:return D(a,c.type,e,d,b,f);case va:return la(c._context,b.value),[t,c,e,{value:b.value,children:b.children,__pop:wa}]}}throw Error("Unsupported Server Component type: "+W(c));}function V(a,c){var e=a.pingedTasks;e.push(c);1===e.length&&X(a)}
|
21
|
-
function U(a,c,e,d){var b={id:a.nextChunkId++,status:0,model:c,context:e,ping:function(){return V(a,b)},thenableState:null};d.add(b);return b}function xa(a,c,e,d){var b=d.filepath+"#"+d.name+(d.async?"#async":""),f=a.writtenModules,g=f.get(b);if(void 0!==g)return c[0]===t&&"1"===e?"$L"+g.toString(16):"$"+g.toString(16);try{var h=a.bundlerConfig
|
22
|
-
"
|
23
|
-
a
|
24
|
-
|
25
|
-
"\n "+
|
26
|
-
b
|
21
|
+
function U(a,c,e,d){var b={id:a.nextChunkId++,status:0,model:c,context:e,ping:function(){return V(a,b)},thenableState:null};d.add(b);return b}function xa(a,c,e,d){var b=d.filepath+"#"+d.name+(d.async?"#async":""),f=a.writtenModules,g=f.get(b);if(void 0!==g)return c[0]===t&&"1"===e?"$L"+g.toString(16):"$"+g.toString(16);try{var h=a.bundlerConfig[d.filepath][d.name];var k=d.async?{id:h.id,chunks:h.chunks,name:h.name,async:!0}:h;a.pendingChunks++;var l=a.nextChunkId++,n=H(k),p=l.toString(16)+":I"+n+
|
22
|
+
"\n";var q=A.encode(p);a.completedModuleChunks.push(q);f.set(b,l);return c[0]===t&&"1"===e?"$L"+l.toString(16):"$"+l.toString(16)}catch(Ma){return a.pendingChunks++,c=a.nextChunkId++,e=w(a,Ma),z(a,c,e),"$"+c.toString(16)}}function ya(a){return Object.prototype.toString.call(a).replace(/^\[object (.*)\]$/,function(a,e){return e})}function W(a){switch(typeof a){case "string":return JSON.stringify(10>=a.length?a:a.substr(0,10)+"...");case "object":if(za(a))return"[...]";a=ya(a);return"Object"===a?"{...}":
|
23
|
+
a;case "function":return"function";default:return String(a)}}function M(a){if("string"===typeof a)return a;switch(a){case Na:return"Suspense";case Oa:return"SuspenseList"}if("object"===typeof a)switch(a.$$typeof){case ta:return M(a.render);case ua:return M(a.type);case C:var c=a._payload;a=a._init;try{return M(a(c))}catch(e){}}return""}function x(a,c){var e=ya(a);if("Object"!==e&&"Array"!==e)return e;e=-1;var d=0;if(za(a)){var b="[";for(var f=0;f<a.length;f++){0<f&&(b+=", ");var g=a[f];g="object"===
|
24
|
+
typeof g&&null!==g?x(g):W(g);""+f===c?(e=b.length,d=g.length,b+=g):b=10>g.length&&40>b.length+g.length?b+g:b+"..."}b+="]"}else if(a.$$typeof===t)b="<"+M(a.type)+"/>";else{b="{";f=Object.keys(a);for(g=0;g<f.length;g++){0<g&&(b+=", ");var h=f[g],k=JSON.stringify(h);b+=('"'+h+'"'===k?h:k)+": ";k=a[h];k="object"===typeof k&&null!==k?x(k):W(k);h===c?(e=b.length,d=k.length,b+=k):b=10>k.length&&40>b.length+k.length?b+k:b+"..."}b+="}"}return void 0===c?b:-1<e&&0<d?(a=" ".repeat(e)+"^".repeat(d),"\n "+b+
|
25
|
+
"\n "+a):"\n "+b}function Ga(a,c,b,d){switch(d){case t:return"$"}for(;"object"===typeof d&&null!==d&&(d.$$typeof===t||d.$$typeof===C);)try{switch(d.$$typeof){case t:var e=d;d=D(a,e.type,e.key,e.ref,e.props,null);break;case C:var f=d._init;d=f(d._payload)}}catch(g){b=g===Q?na():g;if("object"===typeof b&&null!==b&&"function"===typeof b.then)return a.pendingChunks++,a=U(a,d,u,a.abortableTasks),d=a.ping,b.then(d,d),a.thenableState=oa(),"$L"+a.id.toString(16);a.pendingChunks++;d=a.nextChunkId++;b=w(a,
|
26
|
+
b);z(a,d,b);return"$L"+d.toString(16)}if(null===d)return null;if("object"===typeof d){if(d.$$typeof===K)return xa(a,c,b,d);if("function"===typeof d.then)return"$@"+Ia(a,d).toString(16);if(d.$$typeof===va)return d=d._context._globalName,c=a.writtenProviders,b=c.get(b),void 0===b&&(a.pendingChunks++,b=a.nextChunkId++,c.set(d,b),d=O(a,b,"$P"+d),a.completedJSONChunks.push(d)),"$"+b.toString(16);if(d===wa){a=u;if(null===a)throw Error("Tried to pop a Context at the root of the app. This is a bug in React.");
|
27
27
|
d=a.parentValue;a.context._currentValue=d===Aa?a.context._defaultValue:d;u=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===K)return xa(a,c,b,d);if(/^on[A-Z]/.test(b))throw Error("Event handlers cannot be passed to Client Component props."+x(c,b)+"\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."+
|
28
28
|
x(c,b));}if("symbol"===typeof d){e=a.writtenSymbols;f=e.get(d);if(void 0!==f)return"$"+f.toString(16);f=d.description;if(Symbol.for(f)!==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.")+x(c,b));a.pendingChunks++;b=a.nextChunkId++;c=O(a,b,"$S"+f);a.completedModuleChunks.push(c);e.set(d,b);return"$"+b.toString(16)}if("bigint"===typeof d)throw Error("BigInt ("+d+") is not yet supported in Client Component props."+
|
29
29
|
x(c,b));throw Error("Type "+typeof d+" is not supported in Client Component props."+x(c,b));}function w(a,c){a=a.onError;c=a(c);if(null!=c&&"string"!==typeof c)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 c+'" instead');return c||""}function Y(a,c){null!==a.destination?(a.status=2,fa(a.destination,c)):(a.status=1,a.fatalError=c)}function z(a,
|