diff --git a/package.json b/package.json index 0f30740850f13..6c7256ad09f7b 100644 --- a/package.json +++ b/package.json @@ -100,8 +100,8 @@ "@types/jest": "29.5.5", "@types/node": "20.2.5", "@types/node-fetch": "2.6.1", - "@types/react": "18.2.33", - "@types/react-dom": "18.2.14", + "@types/react": "18.2.37", + "@types/react-dom": "18.2.15", "@types/relay-runtime": "14.1.13", "@types/selenium-webdriver": "4.0.15", "@types/sharp": "0.29.3", @@ -193,16 +193,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-08a39539f-20231031", + "react-builtin": "npm:react@18.3.0-canary-2983249dd-20231107", "react-dom": "18.2.0", "react-dom-17": "npm:react-dom@17.0.2", - "react-dom-builtin": "npm:react-dom@18.3.0-canary-08a39539f-20231031", - "react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-08a39539f-20231031", - "react-experimental-builtin": "npm:react@0.0.0-experimental-08a39539f-20231031", - "react-server-dom-turbopack": "18.3.0-canary-08a39539f-20231031", - "react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-08a39539f-20231031", - "react-server-dom-webpack": "18.3.0-canary-08a39539f-20231031", - "react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-08a39539f-20231031", + "react-dom-builtin": "npm:react-dom@18.3.0-canary-2983249dd-20231107", + "react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-2983249dd-20231107", + "react-experimental-builtin": "npm:react@0.0.0-experimental-2983249dd-20231107", + "react-server-dom-turbopack": "18.3.0-canary-2983249dd-20231107", + "react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-2983249dd-20231107", + "react-server-dom-webpack": "18.3.0-canary-2983249dd-20231107", + "react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-2983249dd-20231107", "react-ssr-prepass": "1.0.8", "react-virtualized": "9.22.3", "relay-compiler": "13.0.2", @@ -212,8 +212,8 @@ "resolve-from": "5.0.0", "sass": "1.54.0", "satori": "0.10.6", - "scheduler-builtin": "npm:scheduler@0.24.0-canary-08a39539f-20231031", - "scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-08a39539f-20231031", + "scheduler-builtin": "npm:scheduler@0.24.0-canary-2983249dd-20231107", + "scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-2983249dd-20231107", "seedrandom": "3.0.5", "selenium-webdriver": "4.0.0-beta.4", "semver": "7.3.7", @@ -245,8 +245,8 @@ "@babel/parser": "7.22.5", "@babel/types": "7.22.5", "@babel/traverse": "7.22.5", - "@types/react": "18.2.33", - "@types/react-dom": "18.2.14" + "@types/react": "18.2.37", + "@types/react-dom": "18.2.15" }, "engines": { "node": ">=18.17.0", diff --git a/packages/next/package.json b/packages/next/package.json index 62dedfde67cba..9203c929856e1 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -179,8 +179,8 @@ "@types/micromatch": "4.0.2", "@types/path-to-regexp": "1.7.0", "@types/platform": "1.3.4", - "@types/react": "18.2.33", - "@types/react-dom": "18.2.14", + "@types/react": "18.2.37", + "@types/react-dom": "18.2.15", "@types/react-is": "17.0.3", "@types/semver": "7.3.1", "@types/send": "0.14.4", 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 a739d153c87e9..e42b81e70af15 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-08a39539f-20231031'; +var ReactVersion = '18.3.0-experimental-2983249dd-20231107'; var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; @@ -264,6 +264,15 @@ function checkAttributeStringCoercion(value, attributeName) { } } } +function checkOptionStringCoercion(value, propName) { + { + if (willCoercionThrow(value)) { + error('The provided `%s` option is an unsupported type %s.' + ' This value must be coerced to a string before using it here.', propName, typeName(value)); + + return testStringCoercion(value); // throw (to help callers find troubleshooting comments) + } + } +} function checkCSSPropertyStringCoercion(value, propName) { { if (willCoercionThrow(value)) { @@ -1448,6 +1457,14 @@ function warnValidStyle(name, value) { } } +function getCrossOriginString(input) { + if (typeof input === 'string') { + return input === 'use-credentials' ? input : ''; + } + + return undefined; +} + // code copied and modified from escape-html var matchHtmlRegExp = /["'&<>]/; /** @@ -1628,7 +1645,7 @@ var ReactDOMServerDispatcher = { }; function prepareHostDispatcher() { ReactDOMCurrentDispatcher.current = ReactDOMServerDispatcher; -} // Used to distinguish these contexts from ones used in other renderers. +} // We make every property of the descriptor optional because it is not a contract that var ScriptStreamingFormat = 0; var DataStreamingFormat = 1; var NothingSent @@ -1707,11 +1724,19 @@ var scriptReplacer = function (match, prefix, s, suffix) { }; var importMapScriptStart = stringToPrecomputedChunk(''); // Allows us to keep track of what we've already written so we can refer back to it. +var importMapScriptEnd = stringToPrecomputedChunk(''); // Since we store headers as strings we deal with their length in utf16 code units +// rather than visual characters or the utf8 encoding that is used for most binary +// serialization. Some common HTTP servers only allow for headers to be 4kB in length. +// We choose a default length that is likely to be well under this already limited length however +// pathological cases may still cause the utf-8 encoding of the headers to approach this limit. +// It should also be noted that this maximum is a soft maximum. we have not reached the limit we will +// allow one more header to be captured which means in practice if the limit is approached it will be exceeded + +var DEFAULT_HEADERS_CAPACITY_IN_UTF16_CODE_UNITS = 2000; // Allows us to keep track of what we've already written so we can refer back to it. // if passed externalRuntimeConfig and the enableFizzExternalRuntime feature flag // is set, the server will send instructions via data attributes (instead of inline scripts) -function createRenderState$1(resumableState, nonce, bootstrapScriptContent, bootstrapScripts, bootstrapModules, externalRuntimeConfig, importMap) { +function createRenderState$1(resumableState, nonce, bootstrapScriptContent, bootstrapScripts, bootstrapModules, externalRuntimeConfig, importMap, onHeaders, maxHeadersLength) { var inlineScriptWithNonce = nonce === undefined ? startInlineScript : stringToPrecomputedChunk(''); // Allows us to keep track of what we've already written so we can refer back to it. +var importMapScriptEnd = stringToPrecomputedChunk(''); // Since we store headers as strings we deal with their length in utf16 code units +// rather than visual characters or the utf8 encoding that is used for most binary +// serialization. Some common HTTP servers only allow for headers to be 4kB in length. +// We choose a default length that is likely to be well under this already limited length however +// pathological cases may still cause the utf-8 encoding of the headers to approach this limit. +// It should also be noted that this maximum is a soft maximum. we have not reached the limit we will +// allow one more header to be captured which means in practice if the limit is approached it will be exceeded + +var DEFAULT_HEADERS_CAPACITY_IN_UTF16_CODE_UNITS = 2000; // Allows us to keep track of what we've already written so we can refer back to it. // if passed externalRuntimeConfig and the enableFizzExternalRuntime feature flag // is set, the server will send instructions via data attributes (instead of inline scripts) -function createRenderState$1(resumableState, nonce, bootstrapScriptContent, bootstrapScripts, bootstrapModules, externalRuntimeConfig, importMap) { +function createRenderState$1(resumableState, nonce, bootstrapScriptContent, bootstrapScripts, bootstrapModules, externalRuntimeConfig, importMap, onHeaders, maxHeadersLength) { var inlineScriptWithNonce = nonce === undefined ? startInlineScript : stringToPrecomputedChunk(''); // Allows us to keep track of what we've already written so we can refer back to it. +var importMapScriptEnd = stringToPrecomputedChunk(''); // Since we store headers as strings we deal with their length in utf16 code units +// rather than visual characters or the utf8 encoding that is used for most binary +// serialization. Some common HTTP servers only allow for headers to be 4kB in length. +// We choose a default length that is likely to be well under this already limited length however +// pathological cases may still cause the utf-8 encoding of the headers to approach this limit. +// It should also be noted that this maximum is a soft maximum. we have not reached the limit we will +// allow one more header to be captured which means in practice if the limit is approached it will be exceeded + +var DEFAULT_HEADERS_CAPACITY_IN_UTF16_CODE_UNITS = 2000; // Allows us to keep track of what we've already written so we can refer back to it. // if passed externalRuntimeConfig and the enableFizzExternalRuntime feature flag // is set, the server will send instructions via data attributes (instead of inline scripts) -function createRenderState(resumableState, nonce, bootstrapScriptContent, bootstrapScripts, bootstrapModules, externalRuntimeConfig, importMap) { +function createRenderState(resumableState, nonce, bootstrapScriptContent, bootstrapScripts, bootstrapModules, externalRuntimeConfig, importMap, onHeaders, maxHeadersLength) { var inlineScriptWithNonce = nonce === undefined ? startInlineScript : stringToPrecomputedChunk(''); // Allows us to keep track of what we've already written so we can refer back to it. +var importMapScriptEnd = stringToPrecomputedChunk(''); // Since we store headers as strings we deal with their length in utf16 code units +// rather than visual characters or the utf8 encoding that is used for most binary +// serialization. Some common HTTP servers only allow for headers to be 4kB in length. +// We choose a default length that is likely to be well under this already limited length however +// pathological cases may still cause the utf-8 encoding of the headers to approach this limit. +// It should also be noted that this maximum is a soft maximum. we have not reached the limit we will +// allow one more header to be captured which means in practice if the limit is approached it will be exceeded + +var DEFAULT_HEADERS_CAPACITY_IN_UTF16_CODE_UNITS = 2000; // Allows us to keep track of what we've already written so we can refer back to it. // if passed externalRuntimeConfig and the enableFizzExternalRuntime feature flag // is set, the server will send instructions via data attributes (instead of inline scripts) -function createRenderState(resumableState, nonce, bootstrapScriptContent, bootstrapScripts, bootstrapModules, externalRuntimeConfig, importMap) { +function createRenderState(resumableState, nonce, bootstrapScriptContent, bootstrapScripts, bootstrapModules, externalRuntimeConfig, importMap, onHeaders, maxHeadersLength) { var inlineScriptWithNonce = nonce === undefined ? startInlineScript : stringToPrecomputedChunk(''); // Allows us to keep track of what we've already written so we can refer back to it. +var importMapScriptEnd = stringToPrecomputedChunk(''); // Since we store headers as strings we deal with their length in utf16 code units +// rather than visual characters or the utf8 encoding that is used for most binary +// serialization. Some common HTTP servers only allow for headers to be 4kB in length. +// We choose a default length that is likely to be well under this already limited length however +// pathological cases may still cause the utf-8 encoding of the headers to approach this limit. +// It should also be noted that this maximum is a soft maximum. we have not reached the limit we will +// allow one more header to be captured which means in practice if the limit is approached it will be exceeded + +var DEFAULT_HEADERS_CAPACITY_IN_UTF16_CODE_UNITS = 2000; // Allows us to keep track of what we've already written so we can refer back to it. // if passed externalRuntimeConfig and the enableFizzExternalRuntime feature flag // is set, the server will send instructions via data attributes (instead of inline scripts) -function createRenderState(resumableState, nonce, bootstrapScriptContent, bootstrapScripts, bootstrapModules, externalRuntimeConfig, importMap) { +function createRenderState(resumableState, nonce, bootstrapScriptContent, bootstrapScripts, bootstrapModules, externalRuntimeConfig, importMap, onHeaders, maxHeadersLength) { var inlineScriptWithNonce = nonce === undefined ? startInlineScript : stringToPrecomputedChunk(''); // Allows us to keep track of what we've already written so we can refer back to it. +var importMapScriptEnd = stringToPrecomputedChunk(''); // Since we store headers as strings we deal with their length in utf16 code units +// rather than visual characters or the utf8 encoding that is used for most binary +// serialization. Some common HTTP servers only allow for headers to be 4kB in length. +// We choose a default length that is likely to be well under this already limited length however +// pathological cases may still cause the utf-8 encoding of the headers to approach this limit. +// It should also be noted that this maximum is a soft maximum. we have not reached the limit we will +// allow one more header to be captured which means in practice if the limit is approached it will be exceeded + +var DEFAULT_HEADERS_CAPACITY_IN_UTF16_CODE_UNITS = 2000; // Allows us to keep track of what we've already written so we can refer back to it. // if passed externalRuntimeConfig and the enableFizzExternalRuntime feature flag // is set, the server will send instructions via data attributes (instead of inline scripts) -function createRenderState$1(resumableState, nonce, bootstrapScriptContent, bootstrapScripts, bootstrapModules, externalRuntimeConfig, importMap) { +function createRenderState$1(resumableState, nonce, bootstrapScriptContent, bootstrapScripts, bootstrapModules, externalRuntimeConfig, importMap, onHeaders, maxHeadersLength) { var inlineScriptWithNonce = nonce === undefined ? startInlineScript : stringToPrecomputedChunk(''); // Allows us to keep track of what we've already written so we can refer back to it. +var importMapScriptEnd = stringToPrecomputedChunk(''); // Since we store headers as strings we deal with their length in utf16 code units +// rather than visual characters or the utf8 encoding that is used for most binary +// serialization. Some common HTTP servers only allow for headers to be 4kB in length. +// We choose a default length that is likely to be well under this already limited length however +// pathological cases may still cause the utf-8 encoding of the headers to approach this limit. +// It should also be noted that this maximum is a soft maximum. we have not reached the limit we will +// allow one more header to be captured which means in practice if the limit is approached it will be exceeded + +var DEFAULT_HEADERS_CAPACITY_IN_UTF16_CODE_UNITS = 2000; // Allows us to keep track of what we've already written so we can refer back to it. // if passed externalRuntimeConfig and the enableFizzExternalRuntime feature flag // is set, the server will send instructions via data attributes (instead of inline scripts) -function createRenderState$1(resumableState, nonce, bootstrapScriptContent, bootstrapScripts, bootstrapModules, externalRuntimeConfig, importMap) { +function createRenderState$1(resumableState, nonce, bootstrapScriptContent, bootstrapScripts, bootstrapModules, externalRuntimeConfig, importMap, onHeaders, maxHeadersLength) { var inlineScriptWithNonce = nonce === undefined ? startInlineScript : stringToPrecomputedChunk(''); // Allows us to keep track of what we've already written so we can refer back to it. +var importMapScriptEnd = stringToPrecomputedChunk(''); // Since we store headers as strings we deal with their length in utf16 code units +// rather than visual characters or the utf8 encoding that is used for most binary +// serialization. Some common HTTP servers only allow for headers to be 4kB in length. +// We choose a default length that is likely to be well under this already limited length however +// pathological cases may still cause the utf-8 encoding of the headers to approach this limit. +// It should also be noted that this maximum is a soft maximum. we have not reached the limit we will +// allow one more header to be captured which means in practice if the limit is approached it will be exceeded + +var DEFAULT_HEADERS_CAPACITY_IN_UTF16_CODE_UNITS = 2000; // Allows us to keep track of what we've already written so we can refer back to it. // if passed externalRuntimeConfig and the enableFizzExternalRuntime feature flag // is set, the server will send instructions via data attributes (instead of inline scripts) -function createRenderState(resumableState, nonce, bootstrapScriptContent, bootstrapScripts, bootstrapModules, externalRuntimeConfig, importMap) { +function createRenderState(resumableState, nonce, bootstrapScriptContent, bootstrapScripts, bootstrapModules, externalRuntimeConfig, importMap, onHeaders, maxHeadersLength) { var inlineScriptWithNonce = nonce === undefined ? startInlineScript : stringToPrecomputedChunk(''); // Allows us to keep track of what we've already written so we can refer back to it. +var importMapScriptEnd = stringToPrecomputedChunk(''); // Since we store headers as strings we deal with their length in utf16 code units +// rather than visual characters or the utf8 encoding that is used for most binary +// serialization. Some common HTTP servers only allow for headers to be 4kB in length. +// We choose a default length that is likely to be well under this already limited length however +// pathological cases may still cause the utf-8 encoding of the headers to approach this limit. +// It should also be noted that this maximum is a soft maximum. we have not reached the limit we will +// allow one more header to be captured which means in practice if the limit is approached it will be exceeded + +var DEFAULT_HEADERS_CAPACITY_IN_UTF16_CODE_UNITS = 2000; // Allows us to keep track of what we've already written so we can refer back to it. // if passed externalRuntimeConfig and the enableFizzExternalRuntime feature flag // is set, the server will send instructions via data attributes (instead of inline scripts) -function createRenderState(resumableState, nonce, bootstrapScriptContent, bootstrapScripts, bootstrapModules, externalRuntimeConfig, importMap) { +function createRenderState(resumableState, nonce, bootstrapScriptContent, bootstrapScripts, bootstrapModules, externalRuntimeConfig, importMap, onHeaders, maxHeadersLength) { var inlineScriptWithNonce = nonce === undefined ? startInlineScript : stringToPrecomputedChunk(''); // Allows us to keep track of what we've already written so we can refer back to it. +var importMapScriptEnd = stringToPrecomputedChunk(''); // Since we store headers as strings we deal with their length in utf16 code units +// rather than visual characters or the utf8 encoding that is used for most binary +// serialization. Some common HTTP servers only allow for headers to be 4kB in length. +// We choose a default length that is likely to be well under this already limited length however +// pathological cases may still cause the utf-8 encoding of the headers to approach this limit. +// It should also be noted that this maximum is a soft maximum. we have not reached the limit we will +// allow one more header to be captured which means in practice if the limit is approached it will be exceeded + +var DEFAULT_HEADERS_CAPACITY_IN_UTF16_CODE_UNITS = 2000; // Allows us to keep track of what we've already written so we can refer back to it. // if passed externalRuntimeConfig and the enableFizzExternalRuntime feature flag // is set, the server will send instructions via data attributes (instead of inline scripts) -function createRenderState(resumableState, nonce, bootstrapScriptContent, bootstrapScripts, bootstrapModules, externalRuntimeConfig, importMap) { +function createRenderState(resumableState, nonce, bootstrapScriptContent, bootstrapScripts, bootstrapModules, externalRuntimeConfig, importMap, onHeaders, maxHeadersLength) { var inlineScriptWithNonce = nonce === undefined ? startInlineScript : stringToPrecomputedChunk('