diff --git a/package.json b/package.json index 5cd05bf38186a..acb8f21608b5e 100644 --- a/package.json +++ b/package.json @@ -198,16 +198,16 @@ "random-seed": "0.3.0", "react": "18.2.0", "react-17": "npm:react@17.0.2", - "react-builtin": "npm:react@18.3.0-canary-a515d753b-20240220", + "react-builtin": "npm:react@18.3.0-canary-6c3b8dbfe-20240226", "react-dom": "18.2.0", "react-dom-17": "npm:react-dom@17.0.2", - "react-dom-builtin": "npm:react-dom@18.3.0-canary-a515d753b-20240220", - "react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-a515d753b-20240220", - "react-experimental-builtin": "npm:react@0.0.0-experimental-a515d753b-20240220", - "react-server-dom-turbopack": "18.3.0-canary-a515d753b-20240220", - "react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-a515d753b-20240220", - "react-server-dom-webpack": "18.3.0-canary-a515d753b-20240220", - "react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-a515d753b-20240220", + "react-dom-builtin": "npm:react-dom@18.3.0-canary-6c3b8dbfe-20240226", + "react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-6c3b8dbfe-20240226", + "react-experimental-builtin": "npm:react@0.0.0-experimental-6c3b8dbfe-20240226", + "react-server-dom-turbopack": "18.3.0-canary-6c3b8dbfe-20240226", + "react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-6c3b8dbfe-20240226", + "react-server-dom-webpack": "18.3.0-canary-6c3b8dbfe-20240226", + "react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-6c3b8dbfe-20240226", "react-ssr-prepass": "1.0.8", "react-virtualized": "9.22.3", "relay-compiler": "13.0.2", @@ -217,8 +217,8 @@ "resolve-from": "5.0.0", "sass": "1.54.0", "satori": "0.10.9", - "scheduler-builtin": "npm:scheduler@0.24.0-canary-a515d753b-20240220", - "scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-a515d753b-20240220", + "scheduler-builtin": "npm:scheduler@0.24.0-canary-6c3b8dbfe-20240226", + "scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-6c3b8dbfe-20240226", "seedrandom": "3.0.5", "selenium-webdriver": "4.0.0-beta.4", "semver": "7.3.7", diff --git a/packages/next/src/client/components/react-dev-overlay/internal/helpers/hydration-error-info.ts b/packages/next/src/client/components/react-dev-overlay/internal/helpers/hydration-error-info.ts index d32c1f73d3ec7..13fe1409265c8 100644 --- a/packages/next/src/client/components/react-dev-overlay/internal/helpers/hydration-error-info.ts +++ b/packages/next/src/client/components/react-dev-overlay/internal/helpers/hydration-error-info.ts @@ -3,6 +3,7 @@ export let hydrationErrorComponentStack: string | undefined // https://github.com/facebook/react/blob/main/packages/react-dom/src/__tests__/ReactDOMHydrationDiff-test.js used as a reference const knownHydrationWarnings = new Set([ + 'Warning: In HTML, %s cannot be a descendant of <%s>.\nThis will cause a hydration error.%s', 'Warning: Text content did not match. Server: "%s" Client: "%s"%s', 'Warning: Expected server HTML to contain a matching <%s> in <%s>.%s', 'Warning: Expected server HTML to contain a matching text node for "%s" in <%s>.%s', diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js index eda842f982009..6ead0128d8502 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js @@ -17,7 +17,7 @@ if (process.env.NODE_ENV !== "production") { var React = require("next/dist/compiled/react-experimental"); var ReactDOM = require('react-dom'); -var ReactVersion = '18.3.0-experimental-a515d753b-20240220'; +var ReactVersion = '18.3.0-experimental-6c3b8dbfe-20240226'; var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; @@ -74,9 +74,6 @@ function printWarning(level, format, args) { } } -// ----------------------------------------------------------------------------- -var enableFloat = true; // Enables unstable_useMemoCache hook, intended as a compilation target for - // ATTENTION // When adding new symbols to this file, // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' @@ -615,6 +612,9 @@ function checkHtmlStringCoercion(value) { } } +// ----------------------------------------------------------------------------- +var enableFloat = true; // Enables unstable_useMemoCache hook, intended as a compilation target for + // $FlowFixMe[method-unbinding] var hasOwnProperty = Object.prototype.hasOwnProperty; @@ -1510,6 +1510,7 @@ function validateProperty(tagName, name, value, eventRegistry) { case 'defaultChecked': case 'innerHTML': + case 'ref': { return true; } @@ -1933,7 +1934,7 @@ var clientRenderBoundary = '$RX=function(b,c,d,e){var a=document.getElementById( var completeBoundary = '$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()}};'; var completeBoundaryWithStyles = '$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};'; var completeSegment = '$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)};'; -var formReplaying = 'addEventListener("submit",function(a){if(!a.defaultPrevented){var c=a.target,d=a.submitter,e=c.action,b=d;if(d){var f=d.getAttribute("formAction");null!=f&&(e=f,b=null)}"javascript:throw new Error(\'A React form was unexpectedly submitted.\')"===e&&(a.preventDefault(),b?(a=document.createElement("input"),a.name=b.name,a.value=b.value,b.parentNode.insertBefore(a,b),b=new FormData(c),a.parentNode.removeChild(a)):b=new FormData(c),a=c.getRootNode(),(a.$$reactFormReplay=a.$$reactFormReplay||[]).push(c,\nd,b))}});'; +var formReplaying = 'addEventListener("submit",function(a){if(!a.defaultPrevented){var c=a.target,d=a.submitter,e=c.action,b=d;if(d){var f=d.getAttribute("formAction");null!=f&&(e=f,b=null)}"javascript:throw new Error(\'React form unexpectedly submitted.\')"===e&&(a.preventDefault(),b?(a=document.createElement("input"),a.name=b.name,a.value=b.value,b.parentNode.insertBefore(a,b),b=new FormData(c),a.parentNode.removeChild(a)):b=new FormData(c),a=c.ownerDocument||c,(a.$$reactFormReplay=a.$$reactFormReplay||[]).push(c,d,b))}});'; function getValueDescriptorExpectingObjectForWarning(thing) { return thing === null ? '`null`' : thing === undefined ? '`undefined`' : thing === '' ? 'an empty string' : "something with type \"" + typeof thing + "\""; @@ -2540,7 +2541,7 @@ function makeFormFieldPrefix(resumableState) { var actionJavaScriptURL = stringToPrecomputedChunk(escapeTextForBrowser( // eslint-disable-next-line no-script-url -"javascript:throw new Error('A React form was unexpectedly submitted.')")); +"javascript:throw new Error('React form unexpectedly submitted.')")); var startHiddenInputChunk = stringToPrecomputedChunk('")} +function ac(a,b,c){c&&"function"!==typeof c&&"symbol"!==typeof c&&a.push(" ",b,'=""')}function K(a,b,c){"function"!==typeof c&&"symbol"!==typeof c&&"boolean"!==typeof c&&a.push(" ",b,'="',C(c),'"')}function bc(a){var b=a.nextFormID++;return a.idPrefix+b}var cc=C("javascript:throw new Error('React form unexpectedly submitted.')");function dc(a,b){this.push('")} function ec(a,b,c,d,e,f,g,h){var k=null;"function"===typeof d&&("function"===typeof d.$$FORM_ACTION?(e=bc(b),b=d.$$FORM_ACTION(e),h=b.name,d=b.action||"",e=b.encType,f=b.method,g=b.target,k=b.data):(a.push(" ","formAction",'="',cc,'"'),g=f=e=d=h=null,qc(b,c)));null!=h&&L(a,"name",h);null!=d&&L(a,"formAction",d);null!=e&&L(a,"formEncType",e);null!=f&&L(a,"formMethod",f);null!=g&&L(a,"formTarget",g);return k} -function L(a,b,c){switch(b){case "className":K(a,"class",c);break;case "tabIndex":K(a,"tabindex",c);break;case "dir":case "role":case "viewBox":case "width":case "height":K(a,b,c);break;case "style":$b(a,c);break;case "src":case "href":if(""===c)break;case "action":case "formAction":if(null==c||"function"===typeof c||"symbol"===typeof c||"boolean"===typeof c)break;a.push(" ",b,'="',C(""+c),'"');break;case "defaultValue":case "defaultChecked":case "innerHTML":case "suppressContentEditableWarning":case "suppressHydrationWarning":break; +function L(a,b,c){switch(b){case "className":K(a,"class",c);break;case "tabIndex":K(a,"tabindex",c);break;case "dir":case "role":case "viewBox":case "width":case "height":K(a,b,c);break;case "style":$b(a,c);break;case "src":case "href":if(""===c)break;case "action":case "formAction":if(null==c||"function"===typeof c||"symbol"===typeof c||"boolean"===typeof c)break;a.push(" ",b,'="',C(""+c),'"');break;case "defaultValue":case "defaultChecked":case "innerHTML":case "suppressContentEditableWarning":case "suppressHydrationWarning":case "ref":break; case "autoFocus":case "multiple":case "muted":ac(a,b.toLowerCase(),c);break;case "xlinkHref":if("function"===typeof c||"symbol"===typeof c||"boolean"===typeof c)break;a.push(" ","xlink:href",'="',C(""+c),'"');break;case "contentEditable":case "spellCheck":case "draggable":case "value":case "autoReverse":case "externalResourcesRequired":case "focusable":case "preserveAlpha":"function"!==typeof c&&"symbol"!==typeof c&&a.push(" ",b,'="',C(c),'"');break;case "allowFullScreen":case "async":case "autoPlay":case "controls":case "default":case "defer":case "disabled":case "disablePictureInPicture":case "disableRemotePlayback":case "formNoValidate":case "hidden":case "loop":case "noModule":case "noValidate":case "open":case "playsInline":case "readOnly":case "required":case "reversed":case "scoped":case "seamless":case "itemScope":c&& "function"!==typeof c&&"symbol"!==typeof c&&a.push(" ",b,'=""');break;case "capture":case "download":!0===c?a.push(" ",b,'=""'):!1!==c&&"function"!==typeof c&&"symbol"!==typeof c&&a.push(" ",b,'="',C(c),'"');break;case "cols":case "rows":case "size":case "span":"function"!==typeof c&&"symbol"!==typeof c&&!isNaN(c)&&1<=c&&a.push(" ",b,'="',C(c),'"');break;case "rowSpan":case "start":"function"===typeof c||"symbol"===typeof c||isNaN(c)||a.push(" ",b,'="',C(c),'"');break;case "xlinkActuate":K(a,"xlink:actuate", c);break;case "xlinkArcrole":K(a,"xlink:arcrole",c);break;case "xlinkRole":K(a,"xlink:role",c);break;case "xlinkShow":K(a,"xlink:show",c);break;case "xlinkTitle":K(a,"xlink:title",c);break;case "xlinkType":K(a,"xlink:type",c);break;case "xmlBase":K(a,"xml:base",c);break;case "xmlLang":K(a,"xml:lang",c);break;case "xmlSpace":K(a,"xml:space",c);break;default:if(!(2"))} +function qc(a,b){0!==(a.instructions&16)||b.externalRuntimeScript||(a.instructions|=16,b.bootstrapChunks.unshift(b.startInlineScript,'addEventListener("submit",function(a){if(!a.defaultPrevented){var c=a.target,d=a.submitter,e=c.action,b=d;if(d){var f=d.getAttribute("formAction");null!=f&&(e=f,b=null)}"javascript:throw new Error(\'React form unexpectedly submitted.\')"===e&&(a.preventDefault(),b?(a=document.createElement("input"),a.name=b.name,a.value=b.value,b.parentNode.insertBefore(a,b),b=new FormData(c),a.parentNode.removeChild(a)):b=new FormData(c),a=c.ownerDocument||c,(a.$$reactFormReplay=a.$$reactFormReplay||[]).push(c,d,b))}});',"\x3c/script>"))} function P(a,b){a.push(Q("link"));for(var c in b)if(A.call(b,c)){var d=b[c];if(null!=d)switch(c){case "children":case "dangerouslySetInnerHTML":throw Error(q(399,"link"));default:L(a,c,d)}}a.push("/>");return null}function sc(a,b,c){a.push(Q(c));for(var d in b)if(A.call(b,d)){var e=b[d];if(null!=e)switch(d){case "children":case "dangerouslySetInnerHTML":throw Error(q(399,c));default:L(a,d,e)}}a.push("/>");return null} function tc(a,b){a.push(Q("title"));var c=null,d=null,e;for(e in b)if(A.call(b,e)){var f=b[e];if(null!=f)switch(e){case "children":c=f;break;case "dangerouslySetInnerHTML":d=f;break;default:L(a,e,f)}}a.push(">");b=Array.isArray(c)?2>c.length?c[0]:null:c;"function"!==typeof b&&"symbol"!==typeof b&&null!==b&&void 0!==b&&a.push(C(""+b));M(a,d,c);a.push(uc("title"));return null} function vc(a,b){a.push(Q("script"));var c=null,d=null,e;for(e in b)if(A.call(b,e)){var f=b[e];if(null!=f)switch(e){case "children":c=f;break;case "dangerouslySetInnerHTML":d=f;break;default:L(a,e,f)}}a.push(">");M(a,d,c);"string"===typeof c&&a.push(C(c));a.push(uc("script"));return null} function wc(a,b,c){a.push(Q(c));var d=c=null,e;for(e in b)if(A.call(b,e)){var f=b[e];if(null!=f)switch(e){case "children":c=f;break;case "dangerouslySetInnerHTML":d=f;break;default:L(a,e,f)}}a.push(">");M(a,d,c);return"string"===typeof c?(a.push(C(c)),null):c}var xc=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,yc=new Map;function Q(a){var b=yc.get(a);if(void 0===b){if(!xc.test(a))throw Error(q(65,a));b="<"+a;yc.set(a,b)}return b} -function zc(a,b,c,d,e,f,g,h,k){switch(b){case "div":case "span":case "svg":case "path":break;case "a":a.push(Q("a"));var m=null,n=null,l;for(l in c)if(A.call(c,l)){var t=c[l];if(null!=t)switch(l){case "children":m=t;break;case "dangerouslySetInnerHTML":n=t;break;case "href":""===t?K(a,"href",""):L(a,l,t);break;default:L(a,l,t)}}a.push(">");M(a,n,m);if("string"===typeof m){a.push(C(m));var r=null}else r=m;return r;case "g":case "p":case "li":break;case "select":a.push(Q("select"));var D=null,w=null, +function zc(a,b,c,d,e,f,g,h,k){switch(b){case "div":case "span":case "svg":case "path":break;case "a":a.push(Q("a"));var m=null,n=null,l;for(l in c)if(A.call(c,l)){var r=c[l];if(null!=r)switch(l){case "children":m=r;break;case "dangerouslySetInnerHTML":n=r;break;case "href":""===r?K(a,"href",""):L(a,l,r);break;default:L(a,l,r)}}a.push(">");M(a,n,m);if("string"===typeof m){a.push(C(m));var t=null}else t=m;return t;case "g":case "p":case "li":break;case "select":a.push(Q("select"));var D=null,w=null, y;for(y in c)if(A.call(c,y)){var x=c[y];if(null!=x)switch(y){case "children":D=x;break;case "dangerouslySetInnerHTML":w=x;break;case "defaultValue":case "value":break;default:L(a,y,x)}}a.push(">");M(a,w,D);return D;case "option":var p=g.selectedValue;a.push(Q("option"));var G=null,F=null,u=null,z=null,B;for(B in c)if(A.call(c,B)){var H=c[B];if(null!=H)switch(B){case "children":G=H;break;case "selected":u=H;break;case "dangerouslySetInnerHTML":z=H;break;case "value":F=H;default:L(a,B,H)}}if(null!= p){var sb=null!==F?""+F:rc(G);if(ib(p))for(var sa=0;sa");M(a,z,G);return G;case "textarea":a.push(Q("textarea"));var R=null,da=null,T=null,ta;for(ta in c)if(A.call(c,ta)){var ua=c[ta];if(null!=ua)switch(ta){case "children":T=ua;break;case "value":R=ua;break;case "defaultValue":da=ua;break;case "dangerouslySetInnerHTML":throw Error(q(91));default:L(a,ta,ua)}}null=== R&&null!==da&&(R=da);a.push(">");if(null!=T){if(null!=R)throw Error(q(92));if(ib(T)){if(1e.highImagePreloads.size)mc.delete(Ja),e.highImagePreloads.add(za)}else if(!d.imageResources.hasOwnProperty(Ja)){d.imageResources[Ja]=E;var nc=c.crossOrigin;var Hd="string"===typeof nc?"use-credentials"===nc?nc:"":void 0;var aa=e.headers,oc;aa&&0aa.highImagePreloads.length)&& (oc=Bc(O,"image",{imageSrcSet:c.srcSet,imageSizes:c.sizes,crossOrigin:Hd,integrity:c.integrity,nonce:c.nonce,type:c.type,fetchPriority:c.fetchPriority,referrerPolicy:c.refererPolicy}),2<=(aa.remainingCapacity-=oc.length))?(e.resets.image[Ja]=E,aa.highImagePreloads&&(aa.highImagePreloads+=", "),aa.highImagePreloads+=oc):(za=[],P(za,{rel:"preload",as:"image",href:J?void 0:O,imageSrcSet:J,imageSizes:Gd,crossOrigin:Hd,integrity:c.integrity,type:c.type,fetchPriority:c.fetchPriority,referrerPolicy:c.referrerPolicy}), "high"===c.fetchPriority||10>e.highImagePreloads.size?e.highImagePreloads.add(za):(e.bulkPreloads.add(za),mc.set(Ja,za)))}}return sc(a,c,"img");case "base":case "area":case "br":case "col":case "embed":case "hr":case "keygen":case "param":case "source":case "track":case "wbr":return sc(a,c,b);case "annotation-xml":case "color-profile":case "font-face":case "font-face-src":case "font-face-uri":case "font-face-format":case "font-face-name":case "missing-glyph":break;case "head":if(2>g.insertionMode&& -null===e.headChunks){e.headChunks=[];var Id=wc(e.headChunks,c,"head")}else Id=wc(a,c,"head");return Id;case "html":if(0===g.insertionMode&&null===e.htmlChunks){e.htmlChunks=[""];var Jd=wc(e.htmlChunks,c,"html")}else Jd=wc(a,c,"html");return Jd;default:if(-1!==b.indexOf("-")){a.push(Q(b));var pc=null,Kd=null,Ka;for(Ka in c)if(A.call(c,Ka)){var X=c[Ka];if(null!=X){var Ld=Ka;switch(Ka){case "children":pc=X;break;case "dangerouslySetInnerHTML":Kd=X;break;case "style":$b(a,X);break;case "suppressContentEditableWarning":case "suppressHydrationWarning":break; +null===e.headChunks){e.headChunks=[];var Id=wc(e.headChunks,c,"head")}else Id=wc(a,c,"head");return Id;case "html":if(0===g.insertionMode&&null===e.htmlChunks){e.htmlChunks=[""];var Jd=wc(e.htmlChunks,c,"html")}else Jd=wc(a,c,"html");return Jd;default:if(-1!==b.indexOf("-")){a.push(Q(b));var pc=null,Kd=null,Ka;for(Ka in c)if(A.call(c,Ka)){var X=c[Ka];if(null!=X){var Ld=Ka;switch(Ka){case "children":pc=X;break;case "dangerouslySetInnerHTML":Kd=X;break;case "style":$b(a,X);break;case "suppressContentEditableWarning":case "suppressHydrationWarning":case "ref":break; case "className":Ld="class";default:if(nb(Ka)&&"function"!==typeof X&&"symbol"!==typeof X&&!1!==X){if(!0===X)X="";else if("object"===typeof X)continue;a.push(" ",Ld,'="',C(X),'"')}}}}a.push(">");M(a,Kd,pc);return pc}}return wc(a,c,b)}var Cc=new Map;function uc(a){var b=Cc.get(a);void 0===b&&(b="",Cc.set(a,b));return b}function Dc(a,b){b=b.bootstrapChunks;for(var c=0;c')} function Fc(a,b,c,d){switch(c.insertionMode){case 0:case 1:case 2:return a.push('