react-server-dom-webpack 18.3.0-next-3706edb81-20230308 → 18.3.0-next-a8875eab7-20230310

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.
Files changed (21) hide show
  1. package/cjs/react-server-dom-webpack-client.browser.development.js +7 -0
  2. package/cjs/react-server-dom-webpack-client.browser.production.min.js +1 -1
  3. package/cjs/react-server-dom-webpack-client.edge.development.js +7 -0
  4. package/cjs/react-server-dom-webpack-client.edge.production.min.js +1 -1
  5. package/cjs/react-server-dom-webpack-client.node.development.js +7 -0
  6. package/cjs/react-server-dom-webpack-client.node.production.min.js +1 -1
  7. package/cjs/react-server-dom-webpack-client.node.unbundled.development.js +7 -0
  8. package/cjs/react-server-dom-webpack-client.node.unbundled.production.min.js +1 -1
  9. package/cjs/react-server-dom-webpack-server.browser.development.js +9 -1
  10. package/cjs/react-server-dom-webpack-server.browser.production.min.js +3 -3
  11. package/cjs/react-server-dom-webpack-server.edge.development.js +9 -1
  12. package/cjs/react-server-dom-webpack-server.edge.production.min.js +3 -3
  13. package/cjs/react-server-dom-webpack-server.node.development.js +9 -1
  14. package/cjs/react-server-dom-webpack-server.node.production.min.js +3 -3
  15. package/cjs/react-server-dom-webpack-server.node.unbundled.development.js +9 -1
  16. package/cjs/react-server-dom-webpack-server.node.unbundled.production.min.js +3 -3
  17. package/package.json +3 -3
  18. package/umd/react-server-dom-webpack-client.browser.development.js +7 -0
  19. package/umd/react-server-dom-webpack-client.browser.production.min.js +1 -1
  20. package/umd/react-server-dom-webpack-server.browser.development.js +9 -1
  21. package/umd/react-server-dom-webpack-server.browser.production.min.js +2 -2
@@ -639,6 +639,13 @@ function parseModelString(response, parentObject, key, value) {
639
639
  }
640
640
  }
641
641
 
642
+ case 'u':
643
+ {
644
+ // matches "$undefined"
645
+ // Special encoding for `undefined` which can't be serialized as JSON otherwise.
646
+ return undefined;
647
+ }
648
+
642
649
  default:
643
650
  {
644
651
  // We assume that anything else is a reference ID.
@@ -18,7 +18,7 @@ function A(a){try{var b=a.value;if(b.async){var c=q.get(b.id);if("fulfilled"===c
18
18
  function L(a,b,c){if(I){var d=I;d.deps++}else d=I={deps:1,value:null};return function(e){b[c]=e;d.deps--;0===d.deps&&"blocked"===a.status&&(e=a.value,a.status="fulfilled",a.value=d.value,null!==e&&D(e,d.value))}}function M(a){return function(b){return F(a,b)}}
19
19
  function N(a,b){var c=a._callServer;return function(){var d=Array.prototype.slice.call(arguments),e=b.bound;return e?"fulfilled"===e.status?c(b.id,e.value.concat(d)):Promise.resolve(e).then(function(f){return c(b.id,f.concat(d))}):c(b.id,d)}}
20
20
  function O(a,b,c,d){if("$"===d[0]){if("$"===d)return u;switch(d[1]){case "$":return d.substring(1);case "L":return b=parseInt(d.substring(2),16),a=K(a,b),{$$typeof:v,_payload:a,_init:C};case "@":return b=parseInt(d.substring(2),16),K(a,b);case "S":return Symbol.for(d.substring(2));case "P":return a=d.substring(2),x[a]||(x[a]=l.createServerContext(a,w)),x[a].Provider;case "F":b=parseInt(d.substring(2),16);b=K(a,b);switch(b.status){case "resolved_model":z(b)}switch(b.status){case "fulfilled":return N(a,
21
- b.value);default:throw b.reason;}default:d=parseInt(d.substring(1),16);a=K(a,d);switch(a.status){case "resolved_model":z(a);break;case "resolved_module":A(a)}switch(a.status){case "fulfilled":return a.value;case "pending":case "blocked":return d=H,a.then(L(d,b,c),M(d)),null;default:throw a.reason;}}}return d}function P(){throw Error('Trying to call a function from "use server" but the callServer option was not implemented in your router runtime.');}
21
+ b.value);default:throw b.reason;}case "u":return;default:d=parseInt(d.substring(1),16);a=K(a,d);switch(a.status){case "resolved_model":z(a);break;case "resolved_module":A(a)}switch(a.status){case "fulfilled":return a.value;case "pending":case "blocked":return d=H,a.then(L(d,b,c),M(d)),null;default:throw a.reason;}}}return d}function P(){throw Error('Trying to call a function from "use server" but the callServer option was not implemented in your router runtime.');}
22
22
  function Q(a,b,c){var d=a._chunks,e=d.get(b);c=JSON.parse(c,a._fromJSON);var f=n(a._bundlerConfig,c);if(c=t(f)){if(e){var h=e;h.status="blocked"}else h=new y("blocked",null,null,a),d.set(b,h);c.then(function(){return G(h,f)},function(g){return F(h,g)})}else e?G(e,f):d.set(b,new y("resolved_module",f,null,a))}function R(a){J(a,Error("Connection closed."))}
23
23
  function S(a,b){if(""!==b){var c=b.indexOf(":",0),d=parseInt(b.substring(0,c),16);switch(b[c+1]){case "I":Q(a,d,b.substring(c+2));break;case "E":c=JSON.parse(b.substring(c+2)).digest;b=Error("An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error.");b.stack="Error: "+b.message;b.digest=c;c=a._chunks;
24
24
  var e=c.get(d);e?F(e,b):c.set(d,new y("rejected",null,b,a));break;default:b=b.substring(c+1),e=a._chunks,(c=e.get(d))?"pending"===c.status&&(a=c.value,d=c.reason,c.status="resolved_model",c.value=b,null!==a&&(z(c),E(c,a,d))):e.set(d,new y("resolved_model",b,null,a))}}}function T(a){return function(b,c){return"string"===typeof c?O(a,this,b,c):"object"===typeof c&&null!==c?(b=c[0]===u?{$$typeof:u,type:c[1],key:c[2],ref:null,props:c[3],_owner:null}:c,b):c}}
@@ -639,6 +639,13 @@ function parseModelString(response, parentObject, key, value) {
639
639
  }
640
640
  }
641
641
 
642
+ case 'u':
643
+ {
644
+ // matches "$undefined"
645
+ // Special encoding for `undefined` which can't be serialized as JSON otherwise.
646
+ return undefined;
647
+ }
648
+
642
649
  default:
643
650
  {
644
651
  // We assume that anything else is a reference ID.
@@ -18,7 +18,7 @@ function E(a){try{var b=a.value;if(b.async){var c=u.get(b.id);if("fulfilled"===c
18
18
  function O(a,b,c){if(L){var d=L;d.deps++}else d=L={deps:1,value:null};return function(f){b[c]=f;d.deps--;0===d.deps&&"blocked"===a.status&&(f=a.value,a.status="fulfilled",a.value=d.value,null!==f&&G(f,d.value))}}function P(a){return function(b){return I(a,b)}}
19
19
  function Q(a,b){var c=a._callServer;return function(){var d=Array.prototype.slice.call(arguments),f=b.bound;return f?"fulfilled"===f.status?c(b.id,f.value.concat(d)):Promise.resolve(f).then(function(e){return c(b.id,e.concat(d))}):c(b.id,d)}}
20
20
  function R(a,b,c,d){if("$"===d[0]){if("$"===d)return x;switch(d[1]){case "$":return d.substring(1);case "L":return b=parseInt(d.substring(2),16),a=N(a,b),{$$typeof:y,_payload:a,_init:F};case "@":return b=parseInt(d.substring(2),16),N(a,b);case "S":return Symbol.for(d.substring(2));case "P":return a=d.substring(2),B[a]||(B[a]=p.createServerContext(a,A)),B[a].Provider;case "F":b=parseInt(d.substring(2),16);b=N(a,b);switch(b.status){case "resolved_model":D(b)}switch(b.status){case "fulfilled":return Q(a,
21
- b.value);default:throw b.reason;}default:d=parseInt(d.substring(1),16);a=N(a,d);switch(a.status){case "resolved_model":D(a);break;case "resolved_module":E(a)}switch(a.status){case "fulfilled":return a.value;case "pending":case "blocked":return d=K,a.then(O(d,b,c),P(d)),null;default:throw a.reason;}}}return d}function S(){throw Error('Trying to call a function from "use server" but the callServer option was not implemented in your router runtime.');}
21
+ b.value);default:throw b.reason;}case "u":return;default:d=parseInt(d.substring(1),16);a=N(a,d);switch(a.status){case "resolved_model":D(a);break;case "resolved_module":E(a)}switch(a.status){case "fulfilled":return a.value;case "pending":case "blocked":return d=K,a.then(O(d,b,c),P(d)),null;default:throw a.reason;}}}return d}function S(){throw Error('Trying to call a function from "use server" but the callServer option was not implemented in your router runtime.');}
22
22
  function T(a,b,c){var d=a._chunks,f=d.get(b);c=JSON.parse(c,a._fromJSON);var e=r(a._bundlerConfig,c);if(c=w(e)){if(f){var m=f;m.status="blocked"}else m=new C("blocked",null,null,a),d.set(b,m);c.then(function(){return J(m,e)},function(l){return I(m,l)})}else f?J(f,e):d.set(b,new C("resolved_module",e,null,a))}function U(a){return function(b,c){return"string"===typeof c?R(a,this,b,c):"object"===typeof c&&null!==c?(b=c[0]===x?{$$typeof:x,type:c[1],key:c[2],ref:null,props:c[3],_owner:null}:c,b):c}}
23
23
  function V(a,b){var c=new TextDecoder,d=new Map;a={_bundlerConfig:a,_callServer:void 0!==b?b:S,_chunks:d,_partialRow:"",_stringDecoder:c};a._fromJSON=U(a);return a}function W(){throw Error("Server Functions cannot be called during initial render. This would create a fetch waterfall. Try to use a Server Component to pass data to Client Components instead.");}
24
24
  function X(a,b){function c(e){var m=e.value;if(e.done)M(a,Error("Connection closed."));else{e=m;m=a._stringDecoder;for(var l=e.indexOf(10);-1<l;){var g=a._partialRow;var n=e.subarray(0,l);n=m.decode(n);var h=g+n;g=a;if(""!==h){var k=h.indexOf(":",0);n=parseInt(h.substring(0,k),16);switch(h[k+1]){case "I":T(g,n,h.substring(k+2));break;case "E":k=JSON.parse(h.substring(k+2)).digest;h=Error("An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error.");
@@ -640,6 +640,13 @@ function parseModelString(response, parentObject, key, value) {
640
640
  }
641
641
  }
642
642
 
643
+ case 'u':
644
+ {
645
+ // matches "$undefined"
646
+ // Special encoding for `undefined` which can't be serialized as JSON otherwise.
647
+ return undefined;
648
+ }
649
+
643
650
  default:
644
651
  {
645
652
  // We assume that anything else is a reference ID.
@@ -18,7 +18,7 @@ function B(a){try{var c=a.value;if(c.async){var b=q.get(c.id);if("fulfilled"===b
18
18
  function L(a,c,b){if(I){var d=I;d.deps++}else d=I={deps:1,value:null};return function(e){c[b]=e;d.deps--;0===d.deps&&"blocked"===a.status&&(e=a.value,a.status="fulfilled",a.value=d.value,null!==e&&D(e,d.value))}}function M(a){return function(c){return F(a,c)}}
19
19
  function N(a,c){var b=a._callServer;return function(){var d=Array.prototype.slice.call(arguments),e=c.bound;return e?"fulfilled"===e.status?b(c.id,e.value.concat(d)):Promise.resolve(e).then(function(f){return b(c.id,f.concat(d))}):b(c.id,d)}}
20
20
  function O(a,c,b,d){if("$"===d[0]){if("$"===d)return u;switch(d[1]){case "$":return d.substring(1);case "L":return c=parseInt(d.substring(2),16),a=K(a,c),{$$typeof:v,_payload:a,_init:C};case "@":return c=parseInt(d.substring(2),16),K(a,c);case "S":return Symbol.for(d.substring(2));case "P":return a=d.substring(2),y[a]||(y[a]=l.createServerContext(a,x)),y[a].Provider;case "F":c=parseInt(d.substring(2),16);c=K(a,c);switch(c.status){case "resolved_model":A(c)}switch(c.status){case "fulfilled":return N(a,
21
- c.value);default:throw c.reason;}default:d=parseInt(d.substring(1),16);a=K(a,d);switch(a.status){case "resolved_model":A(a);break;case "resolved_module":B(a)}switch(a.status){case "fulfilled":return a.value;case "pending":case "blocked":return d=H,a.then(L(d,c,b),M(d)),null;default:throw a.reason;}}}return d}function P(){throw Error('Trying to call a function from "use server" but the callServer option was not implemented in your router runtime.');}
21
+ c.value);default:throw c.reason;}case "u":return;default:d=parseInt(d.substring(1),16);a=K(a,d);switch(a.status){case "resolved_model":A(a);break;case "resolved_module":B(a)}switch(a.status){case "fulfilled":return a.value;case "pending":case "blocked":return d=H,a.then(L(d,c,b),M(d)),null;default:throw a.reason;}}}return d}function P(){throw Error('Trying to call a function from "use server" but the callServer option was not implemented in your router runtime.');}
22
22
  function Q(a,c,b){var d=a._chunks,e=d.get(c);b=JSON.parse(b,a._fromJSON);var f=n(a._bundlerConfig,b);if(b=t(f)){if(e){var h=e;h.status="blocked"}else h=new z("blocked",null,null,a),d.set(c,h);b.then(function(){return G(h,f)},function(g){return F(h,g)})}else e?G(e,f):d.set(c,new z("resolved_module",f,null,a))}
23
23
  function R(a,c){if(""!==c){var b=c.indexOf(":",0),d=parseInt(c.substring(0,b),16);switch(c[b+1]){case "I":Q(a,d,c.substring(b+2));break;case "E":b=JSON.parse(c.substring(b+2)).digest;c=Error("An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error.");c.stack="Error: "+c.message;c.digest=b;b=a._chunks;
24
24
  var e=b.get(d);e?F(e,c):b.set(d,new z("rejected",null,c,a));break;default:c=c.substring(b+1),e=a._chunks,(b=e.get(d))?"pending"===b.status&&(a=b.value,d=b.reason,b.status="resolved_model",b.value=c,null!==a&&(A(b),E(b,a,d))):e.set(d,new z("resolved_model",c,null,a))}}}function S(a){return function(c,b){return"string"===typeof b?O(a,this,c,b):"object"===typeof b&&null!==b?(c=b[0]===u?{$$typeof:u,type:b[1],key:b[2],ref:null,props:b[3],_owner:null}:b,c):b}}
@@ -581,6 +581,13 @@ function parseModelString(response, parentObject, key, value) {
581
581
  }
582
582
  }
583
583
 
584
+ case 'u':
585
+ {
586
+ // matches "$undefined"
587
+ // Special encoding for `undefined` which can't be serialized as JSON otherwise.
588
+ return undefined;
589
+ }
590
+
584
591
  default:
585
592
  {
586
593
  // We assume that anything else is a reference ID.
@@ -15,7 +15,7 @@ function w(a){var c=D,b=E;D=a;E=null;try{var d=JSON.parse(a.value,a._response._f
15
15
  function F(a,c){a._chunks.forEach(function(b){"pending"===b.status&&B(b,c)})}function G(a,c){var b=a._chunks,d=b.get(c);d||(d=new v("pending",null,null,a),b.set(c,d));return d}function H(a,c,b){if(E){var d=E;d.deps++}else d=E={deps:1,value:null};return function(e){c[b]=e;d.deps--;0===d.deps&&"blocked"===a.status&&(e=a.value,a.status="fulfilled",a.value=d.value,null!==e&&z(e,d.value))}}function I(a){return function(c){return B(a,c)}}
16
16
  function J(a,c){var b=a._callServer;return function(){var d=Array.prototype.slice.call(arguments),e=c.bound;return e?"fulfilled"===e.status?b(c.id,e.value.concat(d)):Promise.resolve(e).then(function(f){return b(c.id,f.concat(d))}):b(c.id,d)}}
17
17
  function K(a,c,b,d){if("$"===d[0]){if("$"===d)return q;switch(d[1]){case "$":return d.substring(1);case "L":return c=parseInt(d.substring(2),16),a=G(a,c),{$$typeof:r,_payload:a,_init:y};case "@":return c=parseInt(d.substring(2),16),G(a,c);case "S":return Symbol.for(d.substring(2));case "P":return a=d.substring(2),u[a]||(u[a]=h.createServerContext(a,t)),u[a].Provider;case "F":c=parseInt(d.substring(2),16);c=G(a,c);switch(c.status){case "resolved_model":w(c)}switch(c.status){case "fulfilled":return J(a,
18
- c.value);default:throw c.reason;}default:d=parseInt(d.substring(1),16);a=G(a,d);switch(a.status){case "resolved_model":w(a);break;case "resolved_module":x(a)}switch(a.status){case "fulfilled":return a.value;case "pending":case "blocked":return d=D,a.then(H(d,c,b),I(d)),null;default:throw a.reason;}}}return d}function L(){throw Error('Trying to call a function from "use server" but the callServer option was not implemented in your router runtime.');}
18
+ c.value);default:throw c.reason;}case "u":return;default:d=parseInt(d.substring(1),16);a=G(a,d);switch(a.status){case "resolved_model":w(a);break;case "resolved_module":x(a)}switch(a.status){case "fulfilled":return a.value;case "pending":case "blocked":return d=D,a.then(H(d,c,b),I(d)),null;default:throw a.reason;}}}return d}function L(){throw Error('Trying to call a function from "use server" but the callServer option was not implemented in your router runtime.');}
19
19
  function M(a,c,b){var d=a._chunks,e=d.get(c);b=JSON.parse(b,a._fromJSON);var f=a._bundlerConfig[b.id][b.name];if(b=p(f)){if(e){var k=e;k.status="blocked"}else k=new v("blocked",null,null,a),d.set(c,k);b.then(function(){return C(k,f)},function(n){return B(k,n)})}else e?C(e,f):d.set(c,new v("resolved_module",f,null,a))}
20
20
  function N(a,c){if(""!==c){var b=c.indexOf(":",0),d=parseInt(c.substring(0,b),16);switch(c[b+1]){case "I":M(a,d,c.substring(b+2));break;case "E":b=JSON.parse(c.substring(b+2)).digest;c=Error("An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error.");c.stack="Error: "+c.message;c.digest=b;b=a._chunks;
21
21
  var e=b.get(d);e?B(e,c):b.set(d,new v("rejected",null,c,a));break;default:c=c.substring(b+1),e=a._chunks,(b=e.get(d))?"pending"===b.status&&(a=b.value,d=b.reason,b.status="resolved_model",b.value=c,null!==a&&(w(b),A(b,a,d))):e.set(d,new v("resolved_model",c,null,a))}}}function O(a){return function(c,b){return"string"===typeof b?K(a,this,c,b):"object"===typeof b&&null!==b?(c=b[0]===q?{$$typeof:q,type:b[1],key:b[2],ref:null,props:b[3],_owner:null}:b,c):b}}
@@ -1534,6 +1534,10 @@ function serializeProviderReference(name) {
1534
1534
  return '$P' + name;
1535
1535
  }
1536
1536
 
1537
+ function serializeUndefined() {
1538
+ return '$undefined';
1539
+ }
1540
+
1537
1541
  function serializeClientReference(request, parent, key, clientReference) {
1538
1542
  var clientReferenceKey = getClientReferenceKey(clientReference);
1539
1543
  var writtenClientReferences = request.writtenClientReferences;
@@ -2099,10 +2103,14 @@ function resolveModelToJSON(request, parent, key, value) {
2099
2103
  return escapeStringValue(value);
2100
2104
  }
2101
2105
 
2102
- if (typeof value === 'boolean' || typeof value === 'number' || typeof value === 'undefined') {
2106
+ if (typeof value === 'boolean' || typeof value === 'number') {
2103
2107
  return value;
2104
2108
  }
2105
2109
 
2110
+ if (typeof value === 'undefined') {
2111
+ return serializeUndefined();
2112
+ }
2113
+
2106
2114
  if (typeof value === 'function') {
2107
2115
  if (isClientReference(value)) {
2108
2116
  return serializeClientReference(request, parent, key, value);
@@ -48,9 +48,9 @@ function Z(a,b){var c=Va(a);if("Object"!==c&&"Array"!==c)return c;c=-1;var d=0;i
48
48
  Sa(l);k===b?(c=e.length,d=l.length,e+=l):e=10>l.length&&40>e.length+l.length?e+l:e+"..."}e+="}"}return void 0===b?e:-1<c&&0<d?(a=" ".repeat(c)+"^".repeat(d),"\n "+e+"\n "+a):"\n "+e}
49
49
  function Ka(a,b,c,d){switch(d){case w:return"$"}for(;"object"===typeof d&&null!==d&&(d.$$typeof===w||d.$$typeof===x);)try{switch(d.$$typeof){case w:var e=d;d=X(a,e.type,e.key,e.ref,e.props,null);break;case x:var g=d._init;d=g(d._payload)}}catch(h){c=h===I?za():h;if("object"===typeof c&&null!==c&&"function"===typeof c.then)return a.pendingChunks++,a=Ma(a,d,E,a.abortableTasks),d=a.ping,c.then(d,d),a.thenableState=Aa(),"$L"+a.id.toString(16);a.pendingChunks++;d=a.nextChunkId++;c=U(a,c);V(a,d,c);return"$L"+
50
50
  d.toString(16)}if(null===d)return null;if("object"===typeof d){if(d.$$typeof===u)return Ua(a,b,c,d);if("function"===typeof d.then)return"$@"+Oa(a,d).toString(16);if(d.$$typeof===ia)return d=d._context._globalName,b=a.writtenProviders,c=b.get(c),void 0===c&&(a.pendingChunks++,c=a.nextChunkId++,b.set(d,c),d=t(a,c,"$P"+d),a.completedJSONChunks.push(d)),"$"+c.toString(16);if(d===Na){a=E;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=
51
- d===oa?a.context._defaultValue:d;E=a.parent;return}return!D(d)&&(null===d||"object"!==typeof d?a=null:(a=qa&&d[qa]||d["@@iterator"],a="function"===typeof a?a:null),a)?Array.from(d):d}if("string"===typeof d)return a="$"===d[0]?"$"+d:d,a;if("boolean"===typeof d||"number"===typeof d||"undefined"===typeof d)return d;if("function"===typeof d){if(d.$$typeof===u)return Ua(a,b,c,d);if(d.$$typeof===da)return c=a.writtenServerReferences,b=c.get(d),void 0!==b?a="$F"+b.toString(16):(b=d.$$bound,e={id:d.$$id,
52
- bound:b?Promise.resolve(b):null},a.pendingChunks++,b=a.nextChunkId++,e=ca(a,b,e),a.completedJSONChunks.push(e),c.set(d,b),a="$F"+b.toString(16)),a;if(/^on[A-Z]/.test(c))throw Error("Event handlers cannot be passed to Client Component props."+Z(b,c)+"\nIf you need interactivity, consider converting part of this to a Client Component.");throw Error('Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server".'+Z(b,c));}if("symbol"===typeof d){e=
53
- a.writtenSymbols;g=e.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=t(a,c,"$S"+g);a.completedImportChunks.push(b);e.set(d,c);return"$"+c.toString(16)}if("bigint"===typeof d)throw Error("BigInt ("+d+") is not yet supported in Client Component props."+
51
+ d===oa?a.context._defaultValue:d;E=a.parent;return}return!D(d)&&(null===d||"object"!==typeof d?a=null:(a=qa&&d[qa]||d["@@iterator"],a="function"===typeof a?a:null),a)?Array.from(d):d}if("string"===typeof d)return a="$"===d[0]?"$"+d:d,a;if("boolean"===typeof d||"number"===typeof d)return d;if("undefined"===typeof d)return"$undefined";if("function"===typeof d){if(d.$$typeof===u)return Ua(a,b,c,d);if(d.$$typeof===da)return c=a.writtenServerReferences,b=c.get(d),void 0!==b?a="$F"+b.toString(16):(b=d.$$bound,
52
+ e={id:d.$$id,bound:b?Promise.resolve(b):null},a.pendingChunks++,b=a.nextChunkId++,e=ca(a,b,e),a.completedJSONChunks.push(e),c.set(d,b),a="$F"+b.toString(16)),a;if(/^on[A-Z]/.test(c))throw Error("Event handlers cannot be passed to Client Component props."+Z(b,c)+"\nIf you need interactivity, consider converting part of this to a Client Component.");throw Error('Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server".'+Z(b,c));}if("symbol"===
53
+ typeof d){e=a.writtenSymbols;g=e.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=t(a,c,"$S"+g);a.completedImportChunks.push(b);e.set(d,c);return"$"+c.toString(16)}if("bigint"===typeof d)throw Error("BigInt ("+d+") is not yet supported in Client Component props."+
54
54
  Z(b,c));throw Error("Type "+typeof d+" is not supported in Client Component props."+Z(b,c));}function U(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 Wa(a,b){null!==a.destination?(a.status=2,ba(a.destination,b)):(a.status=1,a.fatalError=b)}
55
55
  function V(a,b,c){c={digest:c};b=b.toString(16)+":E"+r(c)+"\n";b=p.encode(b);a.completedErrorChunks.push(b)}
56
56
  function Ta(a){var b=T.current,c=Q;T.current=Fa;Q=a.cache;K=a;try{var d=a.pingedTasks;a.pingedTasks=[];for(var e=0;e<d.length;e++){var g=d[e];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,v=g.thenableState;g.model=k;k=X(h,l.type,l.key,l.ref,l.props,v);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 ea=ca(h,g.id,k);h.completedJSONChunks.push(ea);h.abortableTasks.delete(g);
@@ -1542,6 +1542,10 @@ function serializeProviderReference(name) {
1542
1542
  return '$P' + name;
1543
1543
  }
1544
1544
 
1545
+ function serializeUndefined() {
1546
+ return '$undefined';
1547
+ }
1548
+
1545
1549
  function serializeClientReference(request, parent, key, clientReference) {
1546
1550
  var clientReferenceKey = getClientReferenceKey(clientReference);
1547
1551
  var writtenClientReferences = request.writtenClientReferences;
@@ -2107,10 +2111,14 @@ function resolveModelToJSON(request, parent, key, value) {
2107
2111
  return escapeStringValue(value);
2108
2112
  }
2109
2113
 
2110
- if (typeof value === 'boolean' || typeof value === 'number' || typeof value === 'undefined') {
2114
+ if (typeof value === 'boolean' || typeof value === 'number') {
2111
2115
  return value;
2112
2116
  }
2113
2117
 
2118
+ if (typeof value === 'undefined') {
2119
+ return serializeUndefined();
2120
+ }
2121
+
2114
2122
  if (typeof value === 'function') {
2115
2123
  if (isClientReference(value)) {
2116
2124
  return serializeClientReference(request, parent, key, value);
@@ -49,9 +49,9 @@ function Z(a,b){var c=Ya(a);if("Object"!==c&&"Array"!==c)return c;c=-1;var d=0;i
49
49
  Va(l);k===b?(c=e.length,d=l.length,e+=l):e=10>l.length&&40>e.length+l.length?e+l:e+"..."}e+="}"}return void 0===b?e:-1<c&&0<d?(a=" ".repeat(c)+"^".repeat(d),"\n "+e+"\n "+a):"\n "+e}
50
50
  function Na(a,b,c,d){switch(d){case y:return"$"}for(;"object"===typeof d&&null!==d&&(d.$$typeof===y||d.$$typeof===z);)try{switch(d.$$typeof){case y:var e=d;d=X(a,e.type,e.key,e.ref,e.props,null);break;case z:var g=d._init;d=g(d._payload)}}catch(h){c=h===J?Aa():h;if("object"===typeof c&&null!==c&&"function"===typeof c.then)return a.pendingChunks++,a=Pa(a,d,G,a.abortableTasks),d=a.ping,c.then(d,d),a.thenableState=Ba(),"$L"+a.id.toString(16);a.pendingChunks++;d=a.nextChunkId++;c=U(a,c);V(a,d,c);return"$L"+
51
51
  d.toString(16)}if(null===d)return null;if("object"===typeof d){if(d.$$typeof===w)return Xa(a,b,c,d);if("function"===typeof d.then)return"$@"+Ra(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===Qa){a=G;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=
52
- d===pa?a.context._defaultValue:d;G=a.parent;return}return!E(d)&&(null===d||"object"!==typeof d?a=null:(a=ra&&d[ra]||d["@@iterator"],a="function"===typeof a?a:null),a)?Array.from(d):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===w)return Xa(a,b,c,d);if(d.$$typeof===ea)return c=a.writtenServerReferences,b=c.get(d),void 0!==b?a="$F"+b.toString(16):(b=d.$$bound,e={id:d.$$id,
53
- bound:b?Promise.resolve(b):null},a.pendingChunks++,b=a.nextChunkId++,e=da(a,b,e),a.completedJSONChunks.push(e),c.set(d,b),a="$F"+b.toString(16)),a;if(/^on[A-Z]/.test(c))throw Error("Event handlers cannot be passed to Client Component props."+Z(b,c)+"\nIf you need interactivity, consider converting part of this to a Client Component.");throw Error('Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server".'+Z(b,c));}if("symbol"===typeof d){e=
54
- a.writtenSymbols;g=e.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.completedImportChunks.push(b);e.set(d,c);return"$"+c.toString(16)}if("bigint"===typeof d)throw Error("BigInt ("+d+") is not yet supported in Client Component props."+
52
+ d===pa?a.context._defaultValue:d;G=a.parent;return}return!E(d)&&(null===d||"object"!==typeof d?a=null:(a=ra&&d[ra]||d["@@iterator"],a="function"===typeof a?a:null),a)?Array.from(d):d}if("string"===typeof d)return a="$"===d[0]?"$"+d:d,a;if("boolean"===typeof d||"number"===typeof d)return d;if("undefined"===typeof d)return"$undefined";if("function"===typeof d){if(d.$$typeof===w)return Xa(a,b,c,d);if(d.$$typeof===ea)return c=a.writtenServerReferences,b=c.get(d),void 0!==b?a="$F"+b.toString(16):(b=d.$$bound,
53
+ e={id:d.$$id,bound:b?Promise.resolve(b):null},a.pendingChunks++,b=a.nextChunkId++,e=da(a,b,e),a.completedJSONChunks.push(e),c.set(d,b),a="$F"+b.toString(16)),a;if(/^on[A-Z]/.test(c))throw Error("Event handlers cannot be passed to Client Component props."+Z(b,c)+"\nIf you need interactivity, consider converting part of this to a Client Component.");throw Error('Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server".'+Z(b,c));}if("symbol"===
54
+ typeof d){e=a.writtenSymbols;g=e.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.completedImportChunks.push(b);e.set(d,c);return"$"+c.toString(16)}if("bigint"===typeof d)throw Error("BigInt ("+d+") is not yet supported in Client Component props."+
55
55
  Z(b,c));throw Error("Type "+typeof d+" is not supported in Client Component props."+Z(b,c));}function U(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 Za(a,b){null!==a.destination?(a.status=2,ca(a.destination,b)):(a.status=1,a.fatalError=b)}
56
56
  function V(a,b,c){c={digest:c};b=b.toString(16)+":E"+t(c)+"\n";b=q.encode(b);a.completedErrorChunks.push(b)}
57
57
  function Wa(a){var b=Ja.current,c=R;Ja.current=Ga;R=a.cache;L=a;try{var d=a.pingedTasks;a.pingedTasks=[];for(var e=0;e<d.length;e++){var g=d[e];var h=a;if(0===g.status){I(g.context);try{var k=g.model;if("object"===typeof k&&null!==k&&k.$$typeof===y){var l=k,v=g.thenableState;g.model=k;k=X(h,l.type,l.key,l.ref,l.props,v);for(g.thenableState=null;"object"===typeof k&&null!==k&&k.$$typeof===y;)l=k,g.model=k,k=X(h,l.type,l.key,l.ref,l.props,null)}var ha=da(h,g.id,k);h.completedJSONChunks.push(ha);h.abortableTasks.delete(g);
@@ -1608,6 +1608,10 @@ function serializeProviderReference(name) {
1608
1608
  return '$P' + name;
1609
1609
  }
1610
1610
 
1611
+ function serializeUndefined() {
1612
+ return '$undefined';
1613
+ }
1614
+
1611
1615
  function serializeClientReference(request, parent, key, clientReference) {
1612
1616
  var clientReferenceKey = getClientReferenceKey(clientReference);
1613
1617
  var writtenClientReferences = request.writtenClientReferences;
@@ -2173,10 +2177,14 @@ function resolveModelToJSON(request, parent, key, value) {
2173
2177
  return escapeStringValue(value);
2174
2178
  }
2175
2179
 
2176
- if (typeof value === 'boolean' || typeof value === 'number' || typeof value === 'undefined') {
2180
+ if (typeof value === 'boolean' || typeof value === 'number') {
2177
2181
  return value;
2178
2182
  }
2179
2183
 
2184
+ if (typeof value === 'undefined') {
2185
+ return serializeUndefined();
2186
+ }
2187
+
2180
2188
  if (typeof value === 'function') {
2181
2189
  if (isClientReference(value)) {
2182
2190
  return serializeClientReference(request, parent, key, value);
@@ -50,9 +50,9 @@ function Z(a,b){var c=Za(a);if("Object"!==c&&"Array"!==c)return c;c=-1;var d=0;i
50
50
  Wa(l);k===b?(c=e.length,d=l.length,e+=l):e=10>l.length&&40>e.length+l.length?e+l:e+"..."}e+="}"}return void 0===b?e:-1<c&&0<d?(a=" ".repeat(c)+"^".repeat(d),"\n "+e+"\n "+a):"\n "+e}
51
51
  function Oa(a,b,c,d){switch(d){case z:return"$"}for(;"object"===typeof d&&null!==d&&(d.$$typeof===z||d.$$typeof===A);)try{switch(d.$$typeof){case z:var e=d;d=X(a,e.type,e.key,e.ref,e.props,null);break;case A:var g=d._init;d=g(d._payload)}}catch(h){c=h===K?Aa():h;if("object"===typeof c&&null!==c&&"function"===typeof c.then)return a.pendingChunks++,a=Qa(a,d,H,a.abortableTasks),d=a.ping,c.then(d,d),a.thenableState=Ba(),"$L"+a.id.toString(16);a.pendingChunks++;d=a.nextChunkId++;c=U(a,c);V(a,d,c);return"$L"+
52
52
  d.toString(16)}if(null===d)return null;if("object"===typeof d){if(d.$$typeof===x)return Ya(a,b,c,d);if("function"===typeof d.then)return"$@"+Sa(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=v(a,c,"$P"+d),a.completedJSONChunks.push(d)),"$"+c.toString(16);if(d===Ra){a=H;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=
53
- d===pa?a.context._defaultValue:d;H=a.parent;return}return!F(d)&&(null===d||"object"!==typeof d?a=null:(a=ra&&d[ra]||d["@@iterator"],a="function"===typeof a?a:null),a)?Array.from(d):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===x)return Ya(a,b,c,d);if(d.$$typeof===fa)return c=a.writtenServerReferences,b=c.get(d),void 0!==b?a="$F"+b.toString(16):(b=d.$$bound,e={id:d.$$id,
54
- bound:b?Promise.resolve(b):null},a.pendingChunks++,b=a.nextChunkId++,e=ea(a,b,e),a.completedJSONChunks.push(e),c.set(d,b),a="$F"+b.toString(16)),a;if(/^on[A-Z]/.test(c))throw Error("Event handlers cannot be passed to Client Component props."+Z(b,c)+"\nIf you need interactivity, consider converting part of this to a Client Component.");throw Error('Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server".'+Z(b,c));}if("symbol"===typeof d){e=
55
- a.writtenSymbols;g=e.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=v(a,c,"$S"+g);a.completedImportChunks.push(b);e.set(d,c);return"$"+c.toString(16)}if("bigint"===typeof d)throw Error("BigInt ("+d+") is not yet supported in Client Component props."+
53
+ d===pa?a.context._defaultValue:d;H=a.parent;return}return!F(d)&&(null===d||"object"!==typeof d?a=null:(a=ra&&d[ra]||d["@@iterator"],a="function"===typeof a?a:null),a)?Array.from(d):d}if("string"===typeof d)return a="$"===d[0]?"$"+d:d,a;if("boolean"===typeof d||"number"===typeof d)return d;if("undefined"===typeof d)return"$undefined";if("function"===typeof d){if(d.$$typeof===x)return Ya(a,b,c,d);if(d.$$typeof===fa)return c=a.writtenServerReferences,b=c.get(d),void 0!==b?a="$F"+b.toString(16):(b=d.$$bound,
54
+ e={id:d.$$id,bound:b?Promise.resolve(b):null},a.pendingChunks++,b=a.nextChunkId++,e=ea(a,b,e),a.completedJSONChunks.push(e),c.set(d,b),a="$F"+b.toString(16)),a;if(/^on[A-Z]/.test(c))throw Error("Event handlers cannot be passed to Client Component props."+Z(b,c)+"\nIf you need interactivity, consider converting part of this to a Client Component.");throw Error('Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server".'+Z(b,c));}if("symbol"===
55
+ typeof d){e=a.writtenSymbols;g=e.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=v(a,c,"$S"+g);a.completedImportChunks.push(b);e.set(d,c);return"$"+c.toString(16)}if("bigint"===typeof d)throw Error("BigInt ("+d+") is not yet supported in Client Component props."+
56
56
  Z(b,c));throw Error("Type "+typeof d+" is not supported in Client Component props."+Z(b,c));}function U(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||""}
57
57
  function $a(a,b){null!==a.destination?(a.status=2,a.destination.destroy(b)):(a.status=1,a.fatalError=b)}function V(a,b,c){c={digest:c};b=b.toString(16)+":E"+u(c)+"\n";a.completedErrorChunks.push(b)}
58
58
  function Xa(a){var b=Ka.current,c=S;Ka.current=Ga;S=a.cache;M=a;try{var d=a.pingedTasks;a.pingedTasks=[];for(var e=0;e<d.length;e++){var g=d[e];var h=a;if(0===g.status){J(g.context);try{var k=g.model;if("object"===typeof k&&null!==k&&k.$$typeof===z){var l=k,w=g.thenableState;g.model=k;k=X(h,l.type,l.key,l.ref,l.props,w);for(g.thenableState=null;"object"===typeof k&&null!==k&&k.$$typeof===z;)l=k,g.model=k,k=X(h,l.type,l.key,l.ref,l.props,null)}var ha=ea(h,g.id,k);h.completedJSONChunks.push(ha);h.abortableTasks.delete(g);
@@ -1608,6 +1608,10 @@ function serializeProviderReference(name) {
1608
1608
  return '$P' + name;
1609
1609
  }
1610
1610
 
1611
+ function serializeUndefined() {
1612
+ return '$undefined';
1613
+ }
1614
+
1611
1615
  function serializeClientReference(request, parent, key, clientReference) {
1612
1616
  var clientReferenceKey = getClientReferenceKey(clientReference);
1613
1617
  var writtenClientReferences = request.writtenClientReferences;
@@ -2173,10 +2177,14 @@ function resolveModelToJSON(request, parent, key, value) {
2173
2177
  return escapeStringValue(value);
2174
2178
  }
2175
2179
 
2176
- if (typeof value === 'boolean' || typeof value === 'number' || typeof value === 'undefined') {
2180
+ if (typeof value === 'boolean' || typeof value === 'number') {
2177
2181
  return value;
2178
2182
  }
2179
2183
 
2184
+ if (typeof value === 'undefined') {
2185
+ return serializeUndefined();
2186
+ }
2187
+
2180
2188
  if (typeof value === 'function') {
2181
2189
  if (isClientReference(value)) {
2182
2190
  return serializeClientReference(request, parent, key, value);
@@ -50,9 +50,9 @@ function Z(a,b){var c=Za(a);if("Object"!==c&&"Array"!==c)return c;c=-1;var d=0;i
50
50
  Wa(l);k===b?(c=e.length,d=l.length,e+=l):e=10>l.length&&40>e.length+l.length?e+l:e+"..."}e+="}"}return void 0===b?e:-1<c&&0<d?(a=" ".repeat(c)+"^".repeat(d),"\n "+e+"\n "+a):"\n "+e}
51
51
  function Oa(a,b,c,d){switch(d){case z:return"$"}for(;"object"===typeof d&&null!==d&&(d.$$typeof===z||d.$$typeof===A);)try{switch(d.$$typeof){case z:var e=d;d=X(a,e.type,e.key,e.ref,e.props,null);break;case A:var g=d._init;d=g(d._payload)}}catch(h){c=h===K?Aa():h;if("object"===typeof c&&null!==c&&"function"===typeof c.then)return a.pendingChunks++,a=Qa(a,d,H,a.abortableTasks),d=a.ping,c.then(d,d),a.thenableState=Ba(),"$L"+a.id.toString(16);a.pendingChunks++;d=a.nextChunkId++;c=U(a,c);V(a,d,c);return"$L"+
52
52
  d.toString(16)}if(null===d)return null;if("object"===typeof d){if(d.$$typeof===x)return Ya(a,b,c,d);if("function"===typeof d.then)return"$@"+Sa(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=v(a,c,"$P"+d),a.completedJSONChunks.push(d)),"$"+c.toString(16);if(d===Ra){a=H;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=
53
- d===pa?a.context._defaultValue:d;H=a.parent;return}return!F(d)&&(null===d||"object"!==typeof d?a=null:(a=ra&&d[ra]||d["@@iterator"],a="function"===typeof a?a:null),a)?Array.from(d):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===x)return Ya(a,b,c,d);if(d.$$typeof===fa)return c=a.writtenServerReferences,b=c.get(d),void 0!==b?a="$F"+b.toString(16):(b=d.$$bound,e={id:d.$$id,
54
- bound:b?Promise.resolve(b):null},a.pendingChunks++,b=a.nextChunkId++,e=ea(a,b,e),a.completedJSONChunks.push(e),c.set(d,b),a="$F"+b.toString(16)),a;if(/^on[A-Z]/.test(c))throw Error("Event handlers cannot be passed to Client Component props."+Z(b,c)+"\nIf you need interactivity, consider converting part of this to a Client Component.");throw Error('Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server".'+Z(b,c));}if("symbol"===typeof d){e=
55
- a.writtenSymbols;g=e.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=v(a,c,"$S"+g);a.completedImportChunks.push(b);e.set(d,c);return"$"+c.toString(16)}if("bigint"===typeof d)throw Error("BigInt ("+d+") is not yet supported in Client Component props."+
53
+ d===pa?a.context._defaultValue:d;H=a.parent;return}return!F(d)&&(null===d||"object"!==typeof d?a=null:(a=ra&&d[ra]||d["@@iterator"],a="function"===typeof a?a:null),a)?Array.from(d):d}if("string"===typeof d)return a="$"===d[0]?"$"+d:d,a;if("boolean"===typeof d||"number"===typeof d)return d;if("undefined"===typeof d)return"$undefined";if("function"===typeof d){if(d.$$typeof===x)return Ya(a,b,c,d);if(d.$$typeof===fa)return c=a.writtenServerReferences,b=c.get(d),void 0!==b?a="$F"+b.toString(16):(b=d.$$bound,
54
+ e={id:d.$$id,bound:b?Promise.resolve(b):null},a.pendingChunks++,b=a.nextChunkId++,e=ea(a,b,e),a.completedJSONChunks.push(e),c.set(d,b),a="$F"+b.toString(16)),a;if(/^on[A-Z]/.test(c))throw Error("Event handlers cannot be passed to Client Component props."+Z(b,c)+"\nIf you need interactivity, consider converting part of this to a Client Component.");throw Error('Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server".'+Z(b,c));}if("symbol"===
55
+ typeof d){e=a.writtenSymbols;g=e.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=v(a,c,"$S"+g);a.completedImportChunks.push(b);e.set(d,c);return"$"+c.toString(16)}if("bigint"===typeof d)throw Error("BigInt ("+d+") is not yet supported in Client Component props."+
56
56
  Z(b,c));throw Error("Type "+typeof d+" is not supported in Client Component props."+Z(b,c));}function U(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||""}
57
57
  function $a(a,b){null!==a.destination?(a.status=2,a.destination.destroy(b)):(a.status=1,a.fatalError=b)}function V(a,b,c){c={digest:c};b=b.toString(16)+":E"+u(c)+"\n";a.completedErrorChunks.push(b)}
58
58
  function Xa(a){var b=Ka.current,c=S;Ka.current=Ga;S=a.cache;M=a;try{var d=a.pingedTasks;a.pingedTasks=[];for(var e=0;e<d.length;e++){var g=d[e];var h=a;if(0===g.status){J(g.context);try{var k=g.model;if("object"===typeof k&&null!==k&&k.$$typeof===z){var l=k,w=g.thenableState;g.model=k;k=X(h,l.type,l.key,l.ref,l.props,w);for(g.thenableState=null;"object"===typeof k&&null!==k&&k.$$typeof===z;)l=k,g.model=k,k=X(h,l.type,l.key,l.ref,l.props,null)}var ha=ea(h,g.id,k);h.completedJSONChunks.push(ha);h.abortableTasks.delete(g);
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-3706edb81-20230308",
4
+ "version": "18.3.0-next-a8875eab7-20230310",
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-next-3706edb81-20230308",
82
- "react-dom": "18.3.0-next-3706edb81-20230308",
81
+ "react": "18.3.0-next-a8875eab7-20230310",
82
+ "react-dom": "18.3.0-next-a8875eab7-20230310",
83
83
  "webpack": "^5.59.0"
84
84
  },
85
85
  "dependencies": {
@@ -636,6 +636,13 @@
636
636
  }
637
637
  }
638
638
 
639
+ case 'u':
640
+ {
641
+ // matches "$undefined"
642
+ // Special encoding for `undefined` which can't be serialized as JSON otherwise.
643
+ return undefined;
644
+ }
645
+
639
646
  default:
640
647
  {
641
648
  // We assume that anything else is a reference ID.
@@ -13,7 +13,7 @@ break;case "resolved_module":u(a)}switch(a.status){case "fulfilled":return a.val
13
13
  b){if("pending"===a.status||"blocked"===a.status){var c=a.value,d=a.reason;a.status="resolved_module";a.value=b;null!==c&&(u(a),E(a,c,d))}}function r(a){var b=x,c=l;x=a;l=null;try{var d=JSON.parse(a.value,a._response._fromJSON);null!==l&&0<l.deps?(l.value=d,a.status="blocked",a.value=null,a.reason=null):(a.status="fulfilled",a.value=d)}catch(e){a.status="rejected",a.reason=e}finally{x=b,l=c}}function u(a){try{var b=a.value;if(b.async){var c=z.get(b.id);if("fulfilled"===c.status)var d=c.value;else throw c.reason;
14
14
  }else d=__webpack_require__(b.id);var e="*"===b.name?d:""===b.name?d.__esModule?d.default:d:d[b.name];a.status="fulfilled";a.value=e}catch(f){a.status="rejected",a.reason=f}}function y(a,b){a._chunks.forEach(function(c){"pending"===c.status&&w(c,b)})}function p(a,b){var c=a._chunks,d=c.get(b);d||(d=new n("pending",null,null,a),c.set(b,d));return d}function N(a,b,c){if(l){var d=l;d.deps++}else d=l={deps:1,value:null};return function(e){b[c]=e;d.deps--;0===d.deps&&"blocked"===a.status&&(e=a.value,a.status=
15
15
  "fulfilled",a.value=d.value,null!==e&&v(e,d.value))}}function O(a){return function(b){return w(a,b)}}function P(a,b){var c=a._callServer;return function(){var d=Array.prototype.slice.call(arguments),e=b.bound;return e?"fulfilled"===e.status?c(b.id,e.value.concat(d)):Promise.resolve(e).then(function(f){return c(b.id,f.concat(d))}):c(b.id,d)}}function Q(a,b,c,d){if("$"===d[0]){if("$"===d)return A;switch(d[1]){case "$":return d.substring(1);case "L":return b=parseInt(d.substring(2),16),a=p(a,b),{$$typeof:R,
16
- _payload:a,_init:M};case "@":return b=parseInt(d.substring(2),16),p(a,b);case "S":return Symbol.for(d.substring(2));case "P":return a=d.substring(2),B[a]||(B[a]=q.createServerContext(a,S)),B[a].Provider;case "F":b=parseInt(d.substring(2),16);b=p(a,b);switch(b.status){case "resolved_model":r(b)}switch(b.status){case "fulfilled":return P(a,b.value);default:throw b.reason;}default:d=parseInt(d.substring(1),16);a=p(a,d);switch(a.status){case "resolved_model":r(a);break;case "resolved_module":u(a)}switch(a.status){case "fulfilled":return a.value;
16
+ _payload:a,_init:M};case "@":return b=parseInt(d.substring(2),16),p(a,b);case "S":return Symbol.for(d.substring(2));case "P":return a=d.substring(2),B[a]||(B[a]=q.createServerContext(a,S)),B[a].Provider;case "F":b=parseInt(d.substring(2),16);b=p(a,b);switch(b.status){case "resolved_model":r(b)}switch(b.status){case "fulfilled":return P(a,b.value);default:throw b.reason;}case "u":return;default:d=parseInt(d.substring(1),16);a=p(a,d);switch(a.status){case "resolved_model":r(a);break;case "resolved_module":u(a)}switch(a.status){case "fulfilled":return a.value;
17
17
  case "pending":case "blocked":return d=x,a.then(N(d,b,c),O(d)),null;default:throw a.reason;}}}return d}function T(){throw Error('Trying to call a function from "use server" but the callServer option was not implemented in your router runtime.');}function U(a,b,c){var d=a._chunks,e=d.get(b);c=JSON.parse(c,a._fromJSON);var f=J(a._bundlerConfig,c);if(c=L(f)){if(e){var h=e;h.status="blocked"}else h=new n("blocked",null,null,a),d.set(b,h);c.then(function(){return F(h,f)},function(g){return w(h,g)})}else e?
18
18
  F(e,f):d.set(b,new n("resolved_module",f,null,a))}function G(a){y(a,Error("Connection closed."))}function H(a,b){if(""!==b){var c=b.indexOf(":",0),d=parseInt(b.substring(0,c),16);switch(b[c+1]){case "I":U(a,d,b.substring(c+2));break;case "E":c=JSON.parse(b.substring(c+2)).digest;b=Error("An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error.");
19
19
  b.stack="Error: "+b.message;b.digest=c;c=a._chunks;var e=c.get(d);e?w(e,b):c.set(d,new n("rejected",null,b,a));break;default:b=b.substring(c+1),e=a._chunks,(c=e.get(d))?"pending"===c.status&&(a=c.value,d=c.reason,c.status="resolved_model",c.value=b,null!==a&&(r(c),E(c,a,d))):e.set(d,new n("resolved_model",b,null,a))}}}function V(a){return function(b,c){return"string"===typeof c?Q(a,this,b,c):"object"===typeof c&&null!==c?(b=c[0]===A?{$$typeof:A,type:c[1],key:c[2],ref:null,props:c[3],_owner:null}:
@@ -1531,6 +1531,10 @@
1531
1531
  return '$P' + name;
1532
1532
  }
1533
1533
 
1534
+ function serializeUndefined() {
1535
+ return '$undefined';
1536
+ }
1537
+
1534
1538
  function serializeClientReference(request, parent, key, clientReference) {
1535
1539
  var clientReferenceKey = getClientReferenceKey(clientReference);
1536
1540
  var writtenClientReferences = request.writtenClientReferences;
@@ -2096,10 +2100,14 @@
2096
2100
  return escapeStringValue(value);
2097
2101
  }
2098
2102
 
2099
- if (typeof value === 'boolean' || typeof value === 'number' || typeof value === 'undefined') {
2103
+ if (typeof value === 'boolean' || typeof value === 'number') {
2100
2104
  return value;
2101
2105
  }
2102
2106
 
2107
+ if (typeof value === 'undefined') {
2108
+ return serializeUndefined();
2109
+ }
2110
+
2103
2111
  if (typeof value === 'function') {
2104
2112
  if (isClientReference(value)) {
2105
2113
  return serializeClientReference(request, parent, key, value);
@@ -24,8 +24,8 @@ a=Ca(a);return"Object"===a?"{...}":a;case "function":return"function";default:re
24
24
  g&&(e+=", ");var h=a[g];h="object"===typeof h&&null!==h?y(h):Y(h);""+g===b?(c=e.length,d=h.length,e+=h):e=10>h.length&&40>e.length+h.length?e+h:e+"..."}e+="]"}else if(a.$$typeof===n)e="<"+P(a.type)+"/>";else{e="{";g=Object.keys(a);for(h=0;h<g.length;h++){0<h&&(e+=", ");var k=g[h],l=JSON.stringify(k);e+=('"'+k+'"'===l?k:l)+": ";l=a[k];l="object"===typeof l&&null!==l?y(l):Y(l);k===b?(c=e.length,d=l.length,e+=l):e=10>l.length&&40>e.length+l.length?e+l:e+"..."}e+="}"}return void 0===b?e:-1<c&&0<d?(a=
25
25
  " ".repeat(c)+"^".repeat(d),"\n "+e+"\n "+a):"\n "+e}function Ka(a,b,c,d){switch(d){case n:return"$"}for(;"object"===typeof d&&null!==d&&(d.$$typeof===n||d.$$typeof===E);)try{switch(d.$$typeof){case n:var e=d;d=F(a,e.type,e.key,e.ref,e.props,null);break;case E:var g=d._init;d=g(d._payload)}}catch(h){c=h===T?sa():h;if("object"===typeof c&&null!==c&&"function"===typeof c.then)return a.pendingChunks++,a=W(a,d,t,a.abortableTasks),d=a.ping,c.then(d,d),a.thenableState=ta(),"$L"+a.id.toString(16);a.pendingChunks++;
26
26
  d=a.nextChunkId++;c=u(a,c);C(a,d,c);return"$L"+d.toString(16)}if(null===d)return null;if("object"===typeof d){if(d.$$typeof===M)return Ba(a,b,c,d);if("function"===typeof d.then)return"$@"+Ma(a,d).toString(16);if(d.$$typeof===ya)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=R(a,c,"$P"+d),a.completedJSONChunks.push(d)),"$"+c.toString(16);if(d===za){a=t;if(null===a)throw Error("Tried to pop a Context at the root of the app. This is a bug in React.");
27
- d=a.parentValue;a.context._currentValue=d===Da?a.context._defaultValue:d;t=a.parent;return}return!ba(d)&&(null===d||"object"!==typeof d?a=null:(a=Ea&&d[Ea]||d["@@iterator"],a="function"===typeof a?a:null),a)?Array.from(d):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===M)return Ba(a,b,c,d);if(d.$$typeof===Sa)return c=a.writtenServerReferences,b=c.get(d),void 0!==b?a="$F"+
28
- b.toString(16):(b=d.$$bound,e={id:d.$$id,bound:b?Promise.resolve(b):null},a.pendingChunks++,b=a.nextChunkId++,e=la(a,b,e),a.completedJSONChunks.push(e),c.set(d,b),a="$F"+b.toString(16)),a;if(/^on[A-Z]/.test(c))throw Error("Event handlers cannot be passed to Client Component props."+y(b,c)+"\nIf you need interactivity, consider converting part of this to a Client Component.");throw Error('Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server".'+
27
+ d=a.parentValue;a.context._currentValue=d===Da?a.context._defaultValue:d;t=a.parent;return}return!ba(d)&&(null===d||"object"!==typeof d?a=null:(a=Ea&&d[Ea]||d["@@iterator"],a="function"===typeof a?a:null),a)?Array.from(d):d}if("string"===typeof d)return a="$"===d[0]?"$"+d:d,a;if("boolean"===typeof d||"number"===typeof d)return d;if("undefined"===typeof d)return"$undefined";if("function"===typeof d){if(d.$$typeof===M)return Ba(a,b,c,d);if(d.$$typeof===Sa)return c=a.writtenServerReferences,b=c.get(d),
28
+ void 0!==b?a="$F"+b.toString(16):(b=d.$$bound,e={id:d.$$id,bound:b?Promise.resolve(b):null},a.pendingChunks++,b=a.nextChunkId++,e=la(a,b,e),a.completedJSONChunks.push(e),c.set(d,b),a="$F"+b.toString(16)),a;if(/^on[A-Z]/.test(c))throw Error("Event handlers cannot be passed to Client Component props."+y(b,c)+"\nIf you need interactivity, consider converting part of this to a Client Component.");throw Error('Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server".'+
29
29
  y(b,c));}if("symbol"===typeof d){e=a.writtenSymbols;g=e.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.")+y(b,c));a.pendingChunks++;c=a.nextChunkId++;b=R(a,c,"$S"+g);a.completedImportChunks.push(b);e.set(d,c);return"$"+c.toString(16)}if("bigint"===typeof d)throw Error("BigInt ("+d+") is not yet supported in Client Component props."+
30
30
  y(b,c));throw Error("Type "+typeof d+" is not supported in Client Component props."+y(b,c));}function u(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 ca(a,b){null!==a.destination?(a.status=2,ka(a.destination,b)):(a.status=1,a.fatalError=b)}function C(a,
31
31
  b,c){c={digest:c};b=b.toString(16)+":E"+I(c)+"\n";b=D.encode(b);a.completedErrorChunks.push(b)}function Aa(a){var b=da.current,c=z;da.current=Ta;z=a.cache;G=a;try{var d=a.pingedTasks;a.pingedTasks=[];for(var e=0;e<d.length;e++){var g=d[e];var h=a;if(0===g.status){S(g.context);try{var k=g.model;if("object"===typeof k&&null!==k&&k.$$typeof===n){var l=k,v=g.thenableState;g.model=k;k=F(h,l.type,l.key,l.ref,l.props,v);for(g.thenableState=null;"object"===typeof k&&null!==k&&k.$$typeof===n;)l=k,g.model=