next 13.4.9-canary.2 → 13.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/next +1 -1
- package/dist/build/index.js +2 -2
- package/dist/build/swc/index.js +1 -1
- package/dist/build/utils.js +7 -5
- package/dist/build/utils.js.map +1 -1
- package/dist/build/webpack/config/blocks/css/index.js +30 -5
- package/dist/build/webpack/config/blocks/css/index.js.map +1 -1
- package/dist/build/webpack/config/blocks/css/loaders/getCssModuleLocalIdent.js +1 -1
- package/dist/build/webpack/config/blocks/css/loaders/getCssModuleLocalIdent.js.map +1 -1
- package/dist/build/webpack/loaders/next-flight-css-loader.d.ts +5 -2
- package/dist/build/webpack/loaders/next-flight-css-loader.js +12 -23
- package/dist/build/webpack/loaders/next-flight-css-loader.js.map +1 -1
- package/dist/build/webpack/loaders/next-font-loader/index.js +1 -1
- package/dist/build/webpack/loaders/next-font-loader/index.js.map +1 -1
- package/dist/build/webpack/plugins/{next-types-plugin.d.ts → next-types-plugin/index.d.ts} +1 -2
- package/dist/build/webpack/plugins/{next-types-plugin.js → next-types-plugin/index.js} +14 -26
- package/dist/build/webpack/plugins/next-types-plugin/index.js.map +1 -0
- package/dist/build/webpack/plugins/next-types-plugin/shared.d.ts +1 -0
- package/dist/build/webpack/plugins/next-types-plugin/shared.js +14 -0
- package/dist/build/webpack/plugins/next-types-plugin/shared.js.map +1 -0
- package/dist/build/webpack-config.js +2 -2
- package/dist/cli/next-dev.js +1 -1
- package/dist/cli/next-dev.js.map +1 -1
- package/dist/client/app-bootstrap.js +1 -1
- package/dist/client/components/app-router.js +57 -48
- package/dist/client/components/app-router.js.map +1 -1
- package/dist/client/components/async-local-storage.js +3 -2
- package/dist/client/components/async-local-storage.js.map +1 -1
- package/dist/client/components/react-dev-overlay/hot-reloader-client.js +1 -1
- package/dist/client/components/react-dev-overlay/hot-reloader-client.js.map +1 -1
- package/dist/client/index.js +1 -1
- package/dist/compiled/react/cjs/react-jsx-dev-runtime.development.js +8 -1
- package/dist/compiled/react/cjs/react-jsx-runtime.development.js +8 -1
- package/dist/compiled/react/cjs/react.development.js +9 -2
- package/dist/compiled/react/cjs/react.production.min.js +1 -1
- package/dist/compiled/react/cjs/react.shared-subset.development.js +9 -2
- package/dist/compiled/react/cjs/react.shared-subset.production.min.js +1 -1
- package/dist/compiled/react-dom/cjs/react-dom-server-legacy.browser.development.js +224 -205
- package/dist/compiled/react-dom/cjs/react-dom-server-legacy.browser.production.min.js +120 -123
- package/dist/compiled/react-dom/cjs/react-dom-server-legacy.node.development.js +226 -206
- package/dist/compiled/react-dom/cjs/react-dom-server-legacy.node.production.min.js +131 -135
- package/dist/compiled/react-dom/cjs/react-dom-server-rendering-stub.development.js +9 -1
- package/dist/compiled/react-dom/cjs/react-dom-server-rendering-stub.production.min.js +3 -2
- package/dist/compiled/react-dom/cjs/react-dom-server.browser.development.js +227 -208
- package/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js +125 -128
- package/dist/compiled/react-dom/cjs/react-dom-server.edge.development.js +227 -208
- package/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js +135 -138
- package/dist/compiled/react-dom/cjs/react-dom-server.node.development.js +222 -203
- package/dist/compiled/react-dom/cjs/react-dom-server.node.production.min.js +136 -138
- package/dist/compiled/react-dom/cjs/react-dom.development.js +244 -251
- package/dist/compiled/react-dom/cjs/react-dom.production.min.js +300 -300
- package/dist/compiled/react-dom/cjs/react-dom.profiling.min.js +304 -305
- package/dist/compiled/react-dom/package.json +2 -2
- package/dist/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js +224 -205
- package/dist/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.min.js +123 -127
- package/dist/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.development.js +226 -206
- package/dist/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.production.min.js +134 -138
- package/dist/compiled/react-dom-experimental/cjs/react-dom-server-rendering-stub.development.js +9 -1
- package/dist/compiled/react-dom-experimental/cjs/react-dom-server-rendering-stub.production.min.js +3 -3
- package/dist/compiled/react-dom-experimental/cjs/react-dom-server.browser.development.js +227 -208
- package/dist/compiled/react-dom-experimental/cjs/react-dom-server.browser.production.min.js +129 -133
- package/dist/compiled/react-dom-experimental/cjs/react-dom-server.edge.development.js +227 -208
- package/dist/compiled/react-dom-experimental/cjs/react-dom-server.edge.production.min.js +140 -142
- package/dist/compiled/react-dom-experimental/cjs/react-dom-server.node.development.js +222 -203
- package/dist/compiled/react-dom-experimental/cjs/react-dom-server.node.production.min.js +139 -142
- package/dist/compiled/react-dom-experimental/cjs/react-dom-static.browser.development.js +227 -208
- package/dist/compiled/react-dom-experimental/cjs/react-dom-static.browser.production.min.js +129 -133
- package/dist/compiled/react-dom-experimental/cjs/react-dom-static.edge.development.js +227 -208
- package/dist/compiled/react-dom-experimental/cjs/react-dom-static.edge.production.min.js +130 -134
- package/dist/compiled/react-dom-experimental/cjs/react-dom-static.node.development.js +222 -203
- package/dist/compiled/react-dom-experimental/cjs/react-dom-static.node.production.min.js +141 -144
- package/dist/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.development.js +250 -255
- package/dist/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.production.min.js +328 -330
- package/dist/compiled/react-dom-experimental/cjs/react-dom.development.js +250 -255
- package/dist/compiled/react-dom-experimental/cjs/react-dom.production.min.js +327 -327
- package/dist/compiled/react-dom-experimental/cjs/react-dom.profiling.min.js +325 -325
- package/dist/compiled/react-dom-experimental/package.json +2 -2
- package/dist/compiled/react-experimental/cjs/react-jsx-dev-runtime.development.js +8 -1
- package/dist/compiled/react-experimental/cjs/react-jsx-runtime.development.js +8 -1
- package/dist/compiled/react-experimental/cjs/react.development.js +9 -2
- package/dist/compiled/react-experimental/cjs/react.production.min.js +1 -1
- package/dist/compiled/react-experimental/cjs/react.shared-subset.development.js +9 -2
- package/dist/compiled/react-experimental/cjs/react.shared-subset.production.min.js +1 -1
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js +299 -218
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.production.min.js +24 -25
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js +326 -96
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.production.min.js +26 -25
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.development.js +325 -113
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.production.min.js +26 -25
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.development.js +304 -82
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.production.min.js +24 -24
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js +144 -71
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.production.min.js +50 -48
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js +144 -71
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.production.min.js +52 -50
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js +142 -68
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.min.js +44 -42
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js +119 -36
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.production.min.js +58 -57
- package/dist/compiled/react-server-dom-webpack/package.json +2 -2
- package/dist/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.browser.development.js +451 -218
- package/dist/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.browser.production.min.js +27 -26
- package/dist/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.edge.development.js +478 -96
- package/dist/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.edge.production.min.js +29 -25
- package/dist/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.node.development.js +477 -113
- package/dist/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.node.production.min.js +28 -25
- package/dist/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.node.unbundled.development.js +456 -82
- package/dist/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.node.unbundled.production.min.js +26 -24
- package/dist/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.browser.development.js +238 -71
- package/dist/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.browser.production.min.js +56 -52
- package/dist/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.edge.development.js +238 -71
- package/dist/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.edge.production.min.js +57 -53
- package/dist/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.node.development.js +230 -68
- package/dist/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.node.production.min.js +51 -47
- package/dist/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.node.unbundled.development.js +207 -36
- package/dist/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.node.unbundled.production.min.js +61 -58
- package/dist/compiled/react-server-dom-webpack-experimental/package.json +2 -2
- package/dist/esm/build/index.js +2 -2
- package/dist/esm/build/swc/index.js +1 -1
- package/dist/esm/build/utils.js +7 -5
- package/dist/esm/build/utils.js.map +1 -1
- package/dist/esm/build/webpack/config/blocks/css/index.js +30 -5
- package/dist/esm/build/webpack/config/blocks/css/index.js.map +1 -1
- package/dist/esm/build/webpack/config/blocks/css/loaders/getCssModuleLocalIdent.js +1 -1
- package/dist/esm/build/webpack/config/blocks/css/loaders/getCssModuleLocalIdent.js.map +1 -1
- package/dist/esm/build/webpack/loaders/next-flight-css-loader.js +9 -8
- package/dist/esm/build/webpack/loaders/next-flight-css-loader.js.map +1 -1
- package/dist/esm/build/webpack/loaders/next-font-loader/index.js +1 -1
- package/dist/esm/build/webpack/loaders/next-font-loader/index.js.map +1 -1
- package/dist/esm/build/webpack/plugins/{next-types-plugin.js → next-types-plugin/index.js} +10 -10
- package/dist/esm/build/webpack/plugins/next-types-plugin/index.js.map +1 -0
- package/dist/esm/build/webpack/plugins/next-types-plugin/shared.js +4 -0
- package/dist/esm/build/webpack/plugins/next-types-plugin/shared.js.map +1 -0
- package/dist/esm/build/webpack-config.js +2 -2
- package/dist/esm/client/app-bootstrap.js +1 -1
- package/dist/esm/client/components/app-router.js +57 -48
- package/dist/esm/client/components/app-router.js.map +1 -1
- package/dist/esm/client/components/async-local-storage.js +3 -2
- package/dist/esm/client/components/async-local-storage.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/hot-reloader-client.js +1 -1
- package/dist/esm/client/components/react-dev-overlay/hot-reloader-client.js.map +1 -1
- package/dist/esm/client/index.js +1 -1
- package/dist/esm/lib/find-pages-dir.js +0 -7
- package/dist/esm/lib/find-pages-dir.js.map +1 -1
- package/dist/esm/lib/metadata/resolve-metadata.js +2 -1
- package/dist/esm/lib/metadata/resolve-metadata.js.map +1 -1
- package/dist/esm/server/config.js +5 -3
- package/dist/esm/server/config.js.map +1 -1
- package/dist/esm/server/dev/hot-reloader.js +2 -2
- package/dist/esm/server/dev/hot-reloader.js.map +1 -1
- package/dist/esm/server/dev/next-dev-server.js +3 -3
- package/dist/esm/server/dev/next-dev-server.js.map +1 -1
- package/dist/esm/server/lib/incremental-cache/fetch-cache.js +34 -0
- package/dist/esm/server/lib/incremental-cache/fetch-cache.js.map +1 -1
- package/dist/esm/server/lib/incremental-cache/index.js +3 -1
- package/dist/esm/server/lib/incremental-cache/index.js.map +1 -1
- package/dist/esm/server/lib/render-server-standalone.js +4 -3
- package/dist/esm/server/lib/render-server-standalone.js.map +1 -1
- package/dist/lib/find-pages-dir.js +0 -46
- package/dist/lib/find-pages-dir.js.map +1 -1
- package/dist/lib/metadata/resolve-metadata.js +2 -1
- package/dist/lib/metadata/resolve-metadata.js.map +1 -1
- package/dist/lib/metadata/types/twitter-types.d.ts +1 -1
- package/dist/server/config.js +5 -3
- package/dist/server/config.js.map +1 -1
- package/dist/server/dev/hot-reloader.js +2 -2
- package/dist/server/dev/hot-reloader.js.map +1 -1
- package/dist/server/dev/next-dev-server.js +7 -7
- package/dist/server/dev/next-dev-server.js.map +1 -1
- package/dist/server/lib/incremental-cache/fetch-cache.d.ts +3 -0
- package/dist/server/lib/incremental-cache/fetch-cache.js +34 -0
- package/dist/server/lib/incremental-cache/fetch-cache.js.map +1 -1
- package/dist/server/lib/incremental-cache/index.js +3 -1
- package/dist/server/lib/incremental-cache/index.js.map +1 -1
- package/dist/server/lib/render-server-standalone.d.ts +2 -1
- package/dist/server/lib/render-server-standalone.js +4 -3
- package/dist/server/lib/render-server-standalone.js.map +1 -1
- package/dist/telemetry/anonymous-meta.js +1 -1
- package/dist/telemetry/events/session-stopped.js +2 -2
- package/dist/telemetry/events/version.js +2 -2
- package/package.json +16 -16
- package/dist/build/webpack/plugins/next-types-plugin.js.map +0 -1
- package/dist/esm/build/webpack/plugins/next-types-plugin.js.map +0 -1
- /package/dist/build/webpack/plugins/{next-types-plugin.test.d.ts → next-types-plugin/index.test.d.ts} +0 -0
|
@@ -17,7 +17,7 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
17
17
|
var React = require("next/dist/compiled/react");
|
|
18
18
|
var ReactDOM = require('react-dom');
|
|
19
19
|
|
|
20
|
-
var ReactVersion = '18.3.0-canary-
|
|
20
|
+
var ReactVersion = '18.3.0-canary-7118f5dd7-20230705';
|
|
21
21
|
|
|
22
22
|
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
23
23
|
|
|
@@ -1839,6 +1839,7 @@ var startScriptSrc = stringToPrecomputedChunk('<script src="');
|
|
|
1839
1839
|
var startModuleSrc = stringToPrecomputedChunk('<script type="module" src="');
|
|
1840
1840
|
var scriptNonce = stringToPrecomputedChunk('" nonce="');
|
|
1841
1841
|
var scriptIntegirty = stringToPrecomputedChunk('" integrity="');
|
|
1842
|
+
var scriptCrossOrigin = stringToPrecomputedChunk('" crossorigin="');
|
|
1842
1843
|
var endAsyncScript = stringToPrecomputedChunk('" async=""></script>');
|
|
1843
1844
|
/**
|
|
1844
1845
|
* This escaping function is designed to work with bootstrapScriptContent only.
|
|
@@ -1868,7 +1869,7 @@ var scriptReplacer = function (match, prefix, s, suffix) {
|
|
|
1868
1869
|
// is set, the server will send instructions via data attributes (instead of inline scripts)
|
|
1869
1870
|
|
|
1870
1871
|
|
|
1871
|
-
function createResponseState$1(identifierPrefix, nonce, bootstrapScriptContent, bootstrapScripts, bootstrapModules, externalRuntimeConfig) {
|
|
1872
|
+
function createResponseState$1(resources, identifierPrefix, nonce, bootstrapScriptContent, bootstrapScripts, bootstrapModules, externalRuntimeConfig) {
|
|
1872
1873
|
var idPrefix = identifierPrefix === undefined ? '' : identifierPrefix;
|
|
1873
1874
|
var inlineScriptWithNonce = nonce === undefined ? startInlineScript : stringToPrecomputedChunk('<script nonce="' + escapeTextForBrowser(nonce) + '">');
|
|
1874
1875
|
var bootstrapChunks = [];
|
|
@@ -1915,6 +1916,8 @@ function createResponseState$1(identifierPrefix, nonce, bootstrapScriptContent,
|
|
|
1915
1916
|
var scriptConfig = bootstrapScripts[i];
|
|
1916
1917
|
var src = typeof scriptConfig === 'string' ? scriptConfig : scriptConfig.src;
|
|
1917
1918
|
var integrity = typeof scriptConfig === 'string' ? undefined : scriptConfig.integrity;
|
|
1919
|
+
var crossOrigin = typeof scriptConfig === 'string' || scriptConfig.crossOrigin == null ? undefined : scriptConfig.crossOrigin === 'use-credentials' ? 'use-credentials' : '';
|
|
1920
|
+
preloadBootstrapScript(resources, src, nonce, integrity, crossOrigin);
|
|
1918
1921
|
bootstrapChunks.push(startScriptSrc, stringToChunk(escapeTextForBrowser(src)));
|
|
1919
1922
|
|
|
1920
1923
|
if (nonce) {
|
|
@@ -1925,6 +1928,10 @@ function createResponseState$1(identifierPrefix, nonce, bootstrapScriptContent,
|
|
|
1925
1928
|
bootstrapChunks.push(scriptIntegirty, stringToChunk(escapeTextForBrowser(integrity)));
|
|
1926
1929
|
}
|
|
1927
1930
|
|
|
1931
|
+
if (typeof crossOrigin === 'string') {
|
|
1932
|
+
bootstrapChunks.push(scriptCrossOrigin, stringToChunk(escapeTextForBrowser(crossOrigin)));
|
|
1933
|
+
}
|
|
1934
|
+
|
|
1928
1935
|
bootstrapChunks.push(endAsyncScript);
|
|
1929
1936
|
}
|
|
1930
1937
|
}
|
|
@@ -1937,6 +1944,9 @@ function createResponseState$1(identifierPrefix, nonce, bootstrapScriptContent,
|
|
|
1937
1944
|
|
|
1938
1945
|
var _integrity = typeof _scriptConfig === 'string' ? undefined : _scriptConfig.integrity;
|
|
1939
1946
|
|
|
1947
|
+
var _crossOrigin = typeof _scriptConfig === 'string' || _scriptConfig.crossOrigin == null ? undefined : _scriptConfig.crossOrigin === 'use-credentials' ? 'use-credentials' : '';
|
|
1948
|
+
|
|
1949
|
+
preloadBootstrapModule(resources, _src, nonce, _integrity, _crossOrigin);
|
|
1940
1950
|
bootstrapChunks.push(startModuleSrc, stringToChunk(escapeTextForBrowser(_src)));
|
|
1941
1951
|
|
|
1942
1952
|
if (nonce) {
|
|
@@ -1947,6 +1957,10 @@ function createResponseState$1(identifierPrefix, nonce, bootstrapScriptContent,
|
|
|
1947
1957
|
bootstrapChunks.push(scriptIntegirty, stringToChunk(escapeTextForBrowser(_integrity)));
|
|
1948
1958
|
}
|
|
1949
1959
|
|
|
1960
|
+
if (typeof _crossOrigin === 'string') {
|
|
1961
|
+
bootstrapChunks.push(scriptCrossOrigin, stringToChunk(escapeTextForBrowser(_crossOrigin)));
|
|
1962
|
+
}
|
|
1963
|
+
|
|
1950
1964
|
bootstrapChunks.push(endAsyncScript);
|
|
1951
1965
|
}
|
|
1952
1966
|
}
|
|
@@ -3182,31 +3196,13 @@ function pushLink(target, props, responseState, resources, textEmbedded, inserti
|
|
|
3182
3196
|
}
|
|
3183
3197
|
}
|
|
3184
3198
|
|
|
3185
|
-
var resource = resources.preloadsMap.get(key);
|
|
3186
|
-
|
|
3187
|
-
if (!resource) {
|
|
3188
|
-
resource = {
|
|
3189
|
-
type: 'preload',
|
|
3190
|
-
chunks: [],
|
|
3191
|
-
state: NoState,
|
|
3192
|
-
props: preloadAsStylePropsFromProps(href, props)
|
|
3193
|
-
};
|
|
3194
|
-
resources.preloadsMap.set(key, resource);
|
|
3195
|
-
|
|
3196
|
-
{
|
|
3197
|
-
markAsImplicitResourceDEV(resource, props, resource.props);
|
|
3198
|
-
}
|
|
3199
|
-
}
|
|
3200
|
-
|
|
3201
|
-
pushLinkImpl(resource.chunks, resource.props);
|
|
3202
|
-
resources.usedStylesheets.add(resource);
|
|
3203
3199
|
return pushLinkImpl(target, props);
|
|
3204
3200
|
} else {
|
|
3205
3201
|
// This stylesheet refers to a Resource and we create a new one if necessary
|
|
3206
|
-
var
|
|
3202
|
+
var resource = resources.stylesMap.get(key);
|
|
3207
3203
|
|
|
3208
3204
|
{
|
|
3209
|
-
var devResource = getAsResourceDEV(
|
|
3205
|
+
var devResource = getAsResourceDEV(resource);
|
|
3210
3206
|
|
|
3211
3207
|
if (devResource) {
|
|
3212
3208
|
switch (devResource.__provenance) {
|
|
@@ -3237,7 +3233,7 @@ function pushLink(target, props, responseState, resources, textEmbedded, inserti
|
|
|
3237
3233
|
}
|
|
3238
3234
|
}
|
|
3239
3235
|
|
|
3240
|
-
if (!
|
|
3236
|
+
if (!resource) {
|
|
3241
3237
|
var resourceProps = stylesheetPropsFromRawProps(props);
|
|
3242
3238
|
var preloadResource = resources.preloadsMap.get(key);
|
|
3243
3239
|
var state = NoState;
|
|
@@ -3253,16 +3249,16 @@ function pushLink(target, props, responseState, resources, textEmbedded, inserti
|
|
|
3253
3249
|
}
|
|
3254
3250
|
}
|
|
3255
3251
|
|
|
3256
|
-
|
|
3252
|
+
resource = {
|
|
3257
3253
|
type: 'stylesheet',
|
|
3258
3254
|
chunks: [],
|
|
3259
3255
|
state: state,
|
|
3260
3256
|
props: resourceProps
|
|
3261
3257
|
};
|
|
3262
|
-
resources.stylesMap.set(key,
|
|
3258
|
+
resources.stylesMap.set(key, resource);
|
|
3263
3259
|
|
|
3264
3260
|
{
|
|
3265
|
-
markAsRenderedResourceDEV(
|
|
3261
|
+
markAsRenderedResourceDEV(resource, props);
|
|
3266
3262
|
}
|
|
3267
3263
|
|
|
3268
3264
|
var precedenceSet = resources.precedences.get(precedence);
|
|
@@ -3290,11 +3286,11 @@ function pushLink(target, props, responseState, resources, textEmbedded, inserti
|
|
|
3290
3286
|
resources.stylePrecedences.set(precedence, emptyStyleResource);
|
|
3291
3287
|
}
|
|
3292
3288
|
|
|
3293
|
-
precedenceSet.add(
|
|
3289
|
+
precedenceSet.add(resource);
|
|
3294
3290
|
}
|
|
3295
3291
|
|
|
3296
3292
|
if (resources.boundaryResources) {
|
|
3297
|
-
resources.boundaryResources.add(
|
|
3293
|
+
resources.boundaryResources.add(resource);
|
|
3298
3294
|
}
|
|
3299
3295
|
|
|
3300
3296
|
if (textEmbedded) {
|
|
@@ -3672,114 +3668,78 @@ function pushStartHtml(target, props, responseState, insertionMode) {
|
|
|
3672
3668
|
|
|
3673
3669
|
function pushScript(target, props, resources, textEmbedded, insertionMode, noscriptTagInScope) {
|
|
3674
3670
|
{
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3671
|
+
var asyncProp = props.async;
|
|
3672
|
+
|
|
3673
|
+
if (typeof props.src !== 'string' || !props.src || !(asyncProp && typeof asyncProp !== 'function' && typeof asyncProp !== 'symbol') || props.onLoad || props.onError || insertionMode === SVG_MODE || noscriptTagInScope || props.itemProp != null) {
|
|
3674
|
+
// This script will not be a resource, we bailout early and emit it in place.
|
|
3678
3675
|
return pushScriptImpl(target, props);
|
|
3679
3676
|
}
|
|
3680
3677
|
|
|
3681
3678
|
var src = props.src;
|
|
3682
|
-
var key = getResourceKey('script', src);
|
|
3683
|
-
|
|
3684
|
-
if (props.async !== true || props.onLoad || props.onError) {
|
|
3685
|
-
// we don't want to preload nomodule scripts
|
|
3686
|
-
if (props.noModule !== true) {
|
|
3687
|
-
// We can't resourcify scripts with load listeners. To avoid ambiguity with
|
|
3688
|
-
// other Resourcified async scripts on the server we omit them from the server
|
|
3689
|
-
// stream and expect them to be inserted during hydration on the client.
|
|
3690
|
-
// We can still preload them however so the client can start fetching the script
|
|
3691
|
-
// as soon as possible
|
|
3692
|
-
var resource = resources.preloadsMap.get(key);
|
|
3693
|
-
|
|
3694
|
-
if (!resource) {
|
|
3695
|
-
resource = {
|
|
3696
|
-
type: 'preload',
|
|
3697
|
-
chunks: [],
|
|
3698
|
-
state: NoState,
|
|
3699
|
-
props: preloadAsScriptPropsFromProps(props.src, props)
|
|
3700
|
-
};
|
|
3701
|
-
resources.preloadsMap.set(key, resource);
|
|
3702
|
-
|
|
3703
|
-
{
|
|
3704
|
-
markAsImplicitResourceDEV(resource, props, resource.props);
|
|
3705
|
-
}
|
|
3679
|
+
var key = getResourceKey('script', src); // We can make this <script> into a ScriptResource
|
|
3706
3680
|
|
|
3707
|
-
|
|
3708
|
-
pushLinkImpl(resource.chunks, resource.props);
|
|
3709
|
-
}
|
|
3710
|
-
}
|
|
3681
|
+
var resource = resources.scriptsMap.get(key);
|
|
3711
3682
|
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
// be emitted in place since it needs to hydrate on the client
|
|
3715
|
-
pushScriptImpl(target, props);
|
|
3716
|
-
return null;
|
|
3717
|
-
}
|
|
3718
|
-
} else {
|
|
3719
|
-
// We can make this <script> into a ScriptResource
|
|
3720
|
-
var _resource2 = resources.scriptsMap.get(key);
|
|
3721
|
-
|
|
3722
|
-
{
|
|
3723
|
-
var devResource = getAsResourceDEV(_resource2);
|
|
3724
|
-
|
|
3725
|
-
if (devResource) {
|
|
3726
|
-
switch (devResource.__provenance) {
|
|
3727
|
-
case 'rendered':
|
|
3728
|
-
{
|
|
3729
|
-
var differenceDescription = describeDifferencesForScripts( // Diff the props from the JSX element, not the derived resource props
|
|
3730
|
-
props, devResource.__originalProps);
|
|
3683
|
+
{
|
|
3684
|
+
var devResource = getAsResourceDEV(resource);
|
|
3731
3685
|
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3686
|
+
if (devResource) {
|
|
3687
|
+
switch (devResource.__provenance) {
|
|
3688
|
+
case 'rendered':
|
|
3689
|
+
{
|
|
3690
|
+
var differenceDescription = describeDifferencesForScripts( // Diff the props from the JSX element, not the derived resource props
|
|
3691
|
+
props, devResource.__originalProps);
|
|
3735
3692
|
|
|
3736
|
-
|
|
3693
|
+
if (differenceDescription) {
|
|
3694
|
+
error('React encountered a <script async={true} src="%s" .../> that has props that conflict' + ' with another hoistable script with the same `src`. When rendering hoistable scripts (async scripts without any loading handlers)' + ' the props from the first encountered instance will be used and props from later instances will be ignored.' + ' Update the props on both <script async={true} .../> instance so they agree.%s', src, differenceDescription);
|
|
3737
3695
|
}
|
|
3738
3696
|
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
var _differenceDescription2 = describeDifferencesForScriptOverPreinit( // Diff the props from the JSX element, not the derived resource props
|
|
3742
|
-
props, devResource.__propsEquivalent);
|
|
3697
|
+
break;
|
|
3698
|
+
}
|
|
3743
3699
|
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3700
|
+
case 'preinit':
|
|
3701
|
+
{
|
|
3702
|
+
var _differenceDescription2 = describeDifferencesForScriptOverPreinit( // Diff the props from the JSX element, not the derived resource props
|
|
3703
|
+
props, devResource.__propsEquivalent);
|
|
3747
3704
|
|
|
3748
|
-
|
|
3705
|
+
if (_differenceDescription2) {
|
|
3706
|
+
error('React encountered a <script async={true} src="%s" .../> with props that conflict' + ' with the options provided to `ReactDOM.preinit("%s", { as: "script", ... })`. React will use the first props or preinitialization' + ' options encountered when rendering a hoistable script with a particular `src` and will ignore any newer props or' + ' options. The first instance of this script resource was created using the `ReactDOM.preinit()` function.' + ' Please note, `ReactDOM.preinit()` is modeled off of module import assertions capabilities and does not support' + ' arbitrary props. If you need to have props not included with the preinit options you will need to rely on rendering' + ' <script> tags only.%s', src, src, _differenceDescription2);
|
|
3749
3707
|
}
|
|
3750
|
-
|
|
3708
|
+
|
|
3709
|
+
break;
|
|
3710
|
+
}
|
|
3751
3711
|
}
|
|
3752
3712
|
}
|
|
3713
|
+
}
|
|
3753
3714
|
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3715
|
+
if (!resource) {
|
|
3716
|
+
resource = {
|
|
3717
|
+
type: 'script',
|
|
3718
|
+
chunks: [],
|
|
3719
|
+
state: NoState,
|
|
3720
|
+
props: null
|
|
3721
|
+
};
|
|
3722
|
+
resources.scriptsMap.set(key, resource);
|
|
3762
3723
|
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3724
|
+
{
|
|
3725
|
+
markAsRenderedResourceDEV(resource, props);
|
|
3726
|
+
} // Add to the script flushing queue
|
|
3766
3727
|
|
|
3767
3728
|
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3729
|
+
resources.scripts.add(resource);
|
|
3730
|
+
var scriptProps = props;
|
|
3731
|
+
var preloadResource = resources.preloadsMap.get(key);
|
|
3771
3732
|
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3733
|
+
if (preloadResource) {
|
|
3734
|
+
// If we already had a preload we don't want that resource to flush directly.
|
|
3735
|
+
// We let the newly created resource govern flushing.
|
|
3736
|
+
preloadResource.state |= Blocked;
|
|
3737
|
+
scriptProps = assign({}, props);
|
|
3738
|
+
adoptPreloadPropsForScriptProps(scriptProps, preloadResource.props);
|
|
3739
|
+
} // encode the tag as Chunks
|
|
3779
3740
|
|
|
3780
3741
|
|
|
3781
|
-
|
|
3782
|
-
}
|
|
3742
|
+
pushScriptImpl(resource.chunks, scriptProps);
|
|
3783
3743
|
}
|
|
3784
3744
|
|
|
3785
3745
|
if (textEmbedded) {
|
|
@@ -4999,22 +4959,8 @@ function writePreamble(destination, resources, responseState, willFlushAllSegmen
|
|
|
4999
4959
|
resources.fontPreloads.clear(); // Flush unblocked stylesheets by precedence
|
|
5000
4960
|
|
|
5001
4961
|
resources.precedences.forEach(flushAllStylesInPreamble, destination);
|
|
5002
|
-
resources.usedStylesheets.forEach(function (resource) {
|
|
5003
|
-
var key = getResourceKey(resource.props.as, resource.props.href);
|
|
5004
|
-
|
|
5005
|
-
if (resources.stylesMap.has(key)) ; else {
|
|
5006
|
-
var _chunks = resource.chunks;
|
|
5007
|
-
|
|
5008
|
-
for (i = 0; i < _chunks.length; i++) {
|
|
5009
|
-
writeChunk(destination, _chunks[i]);
|
|
5010
|
-
}
|
|
5011
|
-
}
|
|
5012
|
-
});
|
|
5013
|
-
resources.usedStylesheets.clear();
|
|
5014
4962
|
resources.scripts.forEach(flushResourceInPreamble, destination);
|
|
5015
4963
|
resources.scripts.clear();
|
|
5016
|
-
resources.usedScripts.forEach(flushResourceInPreamble, destination);
|
|
5017
|
-
resources.usedScripts.clear();
|
|
5018
4964
|
resources.explicitStylesheetPreloads.forEach(flushResourceInPreamble, destination);
|
|
5019
4965
|
resources.explicitStylesheetPreloads.clear();
|
|
5020
4966
|
resources.explicitScriptPreloads.forEach(flushResourceInPreamble, destination);
|
|
@@ -5072,22 +5018,8 @@ function writeHoistables(destination, resources, responseState) {
|
|
|
5072
5018
|
// but we want to kick off preloading as soon as possible
|
|
5073
5019
|
|
|
5074
5020
|
resources.precedences.forEach(preloadLateStyles, destination);
|
|
5075
|
-
resources.usedStylesheets.forEach(function (resource) {
|
|
5076
|
-
var key = getResourceKey(resource.props.as, resource.props.href);
|
|
5077
|
-
|
|
5078
|
-
if (resources.stylesMap.has(key)) ; else {
|
|
5079
|
-
var chunks = resource.chunks;
|
|
5080
|
-
|
|
5081
|
-
for (i = 0; i < chunks.length; i++) {
|
|
5082
|
-
writeChunk(destination, chunks[i]);
|
|
5083
|
-
}
|
|
5084
|
-
}
|
|
5085
|
-
});
|
|
5086
|
-
resources.usedStylesheets.clear();
|
|
5087
5021
|
resources.scripts.forEach(flushResourceLate, destination);
|
|
5088
5022
|
resources.scripts.clear();
|
|
5089
|
-
resources.usedScripts.forEach(flushResourceLate, destination);
|
|
5090
|
-
resources.usedScripts.clear();
|
|
5091
5023
|
resources.explicitStylesheetPreloads.forEach(flushResourceLate, destination);
|
|
5092
5024
|
resources.explicitStylesheetPreloads.clear();
|
|
5093
5025
|
resources.explicitScriptPreloads.forEach(flushResourceLate, destination);
|
|
@@ -5513,9 +5445,7 @@ function createResources() {
|
|
|
5513
5445
|
// usedImagePreloads: new Set(),
|
|
5514
5446
|
precedences: new Map(),
|
|
5515
5447
|
stylePrecedences: new Map(),
|
|
5516
|
-
usedStylesheets: new Set(),
|
|
5517
5448
|
scripts: new Set(),
|
|
5518
|
-
usedScripts: new Set(),
|
|
5519
5449
|
explicitStylesheetPreloads: new Set(),
|
|
5520
5450
|
// explicitImagePreloads: new Set(),
|
|
5521
5451
|
explicitScriptPreloads: new Set(),
|
|
@@ -5649,18 +5579,50 @@ function preload(href, options) {
|
|
|
5649
5579
|
var resources = getResources(request);
|
|
5650
5580
|
|
|
5651
5581
|
{
|
|
5582
|
+
var encountered = '';
|
|
5583
|
+
|
|
5652
5584
|
if (typeof href !== 'string' || !href) {
|
|
5653
|
-
|
|
5654
|
-
}
|
|
5655
|
-
|
|
5656
|
-
|
|
5657
|
-
|
|
5585
|
+
encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + ".";
|
|
5586
|
+
}
|
|
5587
|
+
|
|
5588
|
+
if (options == null || typeof options !== 'object') {
|
|
5589
|
+
encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options) + ".";
|
|
5590
|
+
} else if (typeof options.as !== 'string' || !options.as) {
|
|
5591
|
+
encountered += " The `as` option encountered was " + getValueDescriptorExpectingObjectForWarning(options.as) + ".";
|
|
5592
|
+
}
|
|
5593
|
+
|
|
5594
|
+
if (encountered) {
|
|
5595
|
+
error('ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel="preload" as="..." />` tag.%s', encountered);
|
|
5658
5596
|
}
|
|
5659
5597
|
}
|
|
5660
5598
|
|
|
5661
|
-
if (typeof href === 'string' && href && typeof options === 'object' && options !== null && typeof options.as === 'string') {
|
|
5599
|
+
if (typeof href === 'string' && href && typeof options === 'object' && options !== null && typeof options.as === 'string' && options.as) {
|
|
5662
5600
|
var as = options.as;
|
|
5663
|
-
var key
|
|
5601
|
+
var key;
|
|
5602
|
+
|
|
5603
|
+
if (as === 'image') {
|
|
5604
|
+
// For image preloads the key contains either the imageSrcSet + imageSizes or the href but not
|
|
5605
|
+
// both. This is to prevent identical calls with the same srcSet and sizes to be duplicated
|
|
5606
|
+
// by varying the href. this is an edge case but it is the most correct behavior.
|
|
5607
|
+
var imageSrcSet = options.imageSrcSet,
|
|
5608
|
+
imageSizes = options.imageSizes;
|
|
5609
|
+
var uniquePart = '';
|
|
5610
|
+
|
|
5611
|
+
if (typeof imageSrcSet === 'string' && imageSrcSet !== '') {
|
|
5612
|
+
uniquePart += '[' + imageSrcSet + ']';
|
|
5613
|
+
|
|
5614
|
+
if (typeof imageSizes === 'string') {
|
|
5615
|
+
uniquePart += '[' + imageSizes + ']';
|
|
5616
|
+
}
|
|
5617
|
+
} else {
|
|
5618
|
+
uniquePart += '[][]' + href;
|
|
5619
|
+
}
|
|
5620
|
+
|
|
5621
|
+
key = getResourceKey(as, uniquePart);
|
|
5622
|
+
} else {
|
|
5623
|
+
key = getResourceKey(as, href);
|
|
5624
|
+
}
|
|
5625
|
+
|
|
5664
5626
|
var resource = resources.preloadsMap.get(key);
|
|
5665
5627
|
|
|
5666
5628
|
{
|
|
@@ -5875,10 +5837,10 @@ function preinit(href, options) {
|
|
|
5875
5837
|
|
|
5876
5838
|
var _key = getResourceKey(as, src);
|
|
5877
5839
|
|
|
5878
|
-
var
|
|
5840
|
+
var _resource = resources.scriptsMap.get(_key);
|
|
5879
5841
|
|
|
5880
5842
|
{
|
|
5881
|
-
var _devResource = getAsResourceDEV(
|
|
5843
|
+
var _devResource = getAsResourceDEV(_resource);
|
|
5882
5844
|
|
|
5883
5845
|
if (_devResource) {
|
|
5884
5846
|
var _propsEquivalent = scriptPropsFromPreinitOptions(src, options);
|
|
@@ -5911,23 +5873,23 @@ function preinit(href, options) {
|
|
|
5911
5873
|
}
|
|
5912
5874
|
}
|
|
5913
5875
|
|
|
5914
|
-
if (!
|
|
5915
|
-
|
|
5876
|
+
if (!_resource) {
|
|
5877
|
+
_resource = {
|
|
5916
5878
|
type: 'script',
|
|
5917
5879
|
chunks: [],
|
|
5918
5880
|
state: NoState,
|
|
5919
5881
|
props: null
|
|
5920
5882
|
};
|
|
5921
|
-
resources.scriptsMap.set(_key,
|
|
5883
|
+
resources.scriptsMap.set(_key, _resource);
|
|
5922
5884
|
|
|
5923
5885
|
var _resourceProps = scriptPropsFromPreinitOptions(src, options);
|
|
5924
5886
|
|
|
5925
5887
|
{
|
|
5926
|
-
markAsImperativeResourceDEV(
|
|
5888
|
+
markAsImperativeResourceDEV(_resource, 'preinit', href, options, _resourceProps);
|
|
5927
5889
|
}
|
|
5928
5890
|
|
|
5929
|
-
resources.scripts.add(
|
|
5930
|
-
pushScriptImpl(
|
|
5891
|
+
resources.scripts.add(_resource);
|
|
5892
|
+
pushScriptImpl(_resource.chunks, _resourceProps);
|
|
5931
5893
|
flushResources(request);
|
|
5932
5894
|
}
|
|
5933
5895
|
|
|
@@ -5935,6 +5897,76 @@ function preinit(href, options) {
|
|
|
5935
5897
|
}
|
|
5936
5898
|
}
|
|
5937
5899
|
}
|
|
5900
|
+
} // This function is only safe to call at Request start time since it assumes
|
|
5901
|
+
// that each script has not already been preloaded. If we find a need to preload
|
|
5902
|
+
// scripts at any other point in time we will need to check whether the preload
|
|
5903
|
+
// already exists and not assume it
|
|
5904
|
+
|
|
5905
|
+
|
|
5906
|
+
function preloadBootstrapScript(resources, src, nonce, integrity, crossOrigin) {
|
|
5907
|
+
var key = getResourceKey('script', src);
|
|
5908
|
+
|
|
5909
|
+
{
|
|
5910
|
+
if (resources.preloadsMap.has(key)) {
|
|
5911
|
+
// This is coded as a React error because it should be impossible for a userspace preload to preempt this call
|
|
5912
|
+
// If a userspace preload can preempt it then this assumption is broken and we need to reconsider this strategy
|
|
5913
|
+
// rather than instruct the user to not preload their bootstrap scripts themselves
|
|
5914
|
+
error('Internal React Error: React expected bootstrap script with src "%s" to not have been preloaded already. please file an issue', src);
|
|
5915
|
+
}
|
|
5916
|
+
}
|
|
5917
|
+
|
|
5918
|
+
var props = {
|
|
5919
|
+
rel: 'preload',
|
|
5920
|
+
href: src,
|
|
5921
|
+
as: 'script',
|
|
5922
|
+
nonce: nonce,
|
|
5923
|
+
integrity: integrity,
|
|
5924
|
+
crossOrigin: crossOrigin
|
|
5925
|
+
};
|
|
5926
|
+
var resource = {
|
|
5927
|
+
type: 'preload',
|
|
5928
|
+
chunks: [],
|
|
5929
|
+
state: NoState,
|
|
5930
|
+
props: props
|
|
5931
|
+
};
|
|
5932
|
+
resources.preloadsMap.set(key, resource);
|
|
5933
|
+
resources.explicitScriptPreloads.add(resource);
|
|
5934
|
+
pushLinkImpl(resource.chunks, props);
|
|
5935
|
+
} // This function is only safe to call at Request start time since it assumes
|
|
5936
|
+
// that each module has not already been preloaded. If we find a need to preload
|
|
5937
|
+
// scripts at any other point in time we will need to check whether the preload
|
|
5938
|
+
// already exists and not assume it
|
|
5939
|
+
|
|
5940
|
+
|
|
5941
|
+
function preloadBootstrapModule(resources, src, nonce, integrity, crossOrigin) {
|
|
5942
|
+
var key = getResourceKey('script', src);
|
|
5943
|
+
|
|
5944
|
+
{
|
|
5945
|
+
if (resources.preloadsMap.has(key)) {
|
|
5946
|
+
// This is coded as a React error because it should be impossible for a userspace preload to preempt this call
|
|
5947
|
+
// If a userspace preload can preempt it then this assumption is broken and we need to reconsider this strategy
|
|
5948
|
+
// rather than instruct the user to not preload their bootstrap scripts themselves
|
|
5949
|
+
error('Internal React Error: React expected bootstrap module with src "%s" to not have been preloaded already. please file an issue', src);
|
|
5950
|
+
}
|
|
5951
|
+
}
|
|
5952
|
+
|
|
5953
|
+
var props = {
|
|
5954
|
+
rel: 'modulepreload',
|
|
5955
|
+
href: src,
|
|
5956
|
+
nonce: nonce,
|
|
5957
|
+
integrity: integrity,
|
|
5958
|
+
crossOrigin: crossOrigin
|
|
5959
|
+
};
|
|
5960
|
+
var resource = {
|
|
5961
|
+
type: 'preload',
|
|
5962
|
+
chunks: [],
|
|
5963
|
+
state: NoState,
|
|
5964
|
+
props: props
|
|
5965
|
+
};
|
|
5966
|
+
resources.preloadsMap.set(key, resource);
|
|
5967
|
+
resources.explicitScriptPreloads.add(resource);
|
|
5968
|
+
pushLinkImpl(resource.chunks, props);
|
|
5969
|
+
return;
|
|
5938
5970
|
}
|
|
5939
5971
|
|
|
5940
5972
|
function internalPreinitScript(resources, src, chunks) {
|
|
@@ -5959,10 +5991,18 @@ function preloadPropsFromPreloadOptions(href, as, options) {
|
|
|
5959
5991
|
return {
|
|
5960
5992
|
rel: 'preload',
|
|
5961
5993
|
as: as,
|
|
5962
|
-
|
|
5994
|
+
// There is a bug in Safari where imageSrcSet is not respected on preload links
|
|
5995
|
+
// so we omit the href here if we have imageSrcSet b/c safari will load the wrong image.
|
|
5996
|
+
// This harms older browers that do not support imageSrcSet by making their preloads not work
|
|
5997
|
+
// but this population is shrinking fast and is already small so we accept this tradeoff.
|
|
5998
|
+
href: as === 'image' && options.imageSrcSet ? undefined : href,
|
|
5963
5999
|
crossOrigin: as === 'font' ? '' : options.crossOrigin,
|
|
5964
6000
|
integrity: options.integrity,
|
|
5965
|
-
type: options.type
|
|
6001
|
+
type: options.type,
|
|
6002
|
+
nonce: options.nonce,
|
|
6003
|
+
fetchPriority: options.fetchPriority,
|
|
6004
|
+
imageSrcSet: options.imageSrcSet,
|
|
6005
|
+
imageSizes: options.imageSizes
|
|
5966
6006
|
};
|
|
5967
6007
|
}
|
|
5968
6008
|
|
|
@@ -5980,26 +6020,14 @@ function preloadAsStylePropsFromProps(href, props) {
|
|
|
5980
6020
|
};
|
|
5981
6021
|
}
|
|
5982
6022
|
|
|
5983
|
-
function preloadAsScriptPropsFromProps(href, props) {
|
|
5984
|
-
return {
|
|
5985
|
-
rel: 'preload',
|
|
5986
|
-
as: 'script',
|
|
5987
|
-
href: href,
|
|
5988
|
-
crossOrigin: props.crossOrigin,
|
|
5989
|
-
fetchPriority: props.fetchPriority,
|
|
5990
|
-
integrity: props.integrity,
|
|
5991
|
-
nonce: props.nonce,
|
|
5992
|
-
referrerPolicy: props.referrerPolicy
|
|
5993
|
-
};
|
|
5994
|
-
}
|
|
5995
|
-
|
|
5996
6023
|
function stylesheetPropsFromPreinitOptions(href, precedence, options) {
|
|
5997
6024
|
return {
|
|
5998
6025
|
rel: 'stylesheet',
|
|
5999
6026
|
href: href,
|
|
6000
6027
|
'data-precedence': precedence,
|
|
6001
6028
|
crossOrigin: options.crossOrigin,
|
|
6002
|
-
integrity: options.integrity
|
|
6029
|
+
integrity: options.integrity,
|
|
6030
|
+
fetchPriority: options.fetchPriority
|
|
6003
6031
|
};
|
|
6004
6032
|
}
|
|
6005
6033
|
|
|
@@ -6021,7 +6049,8 @@ function scriptPropsFromPreinitOptions(src, options) {
|
|
|
6021
6049
|
async: true,
|
|
6022
6050
|
crossOrigin: options.crossOrigin,
|
|
6023
6051
|
integrity: options.integrity,
|
|
6024
|
-
nonce: options.nonce
|
|
6052
|
+
nonce: options.nonce,
|
|
6053
|
+
fetchPriority: options.fetchPriority
|
|
6025
6054
|
};
|
|
6026
6055
|
}
|
|
6027
6056
|
|
|
@@ -6070,20 +6099,6 @@ function markAsImperativeResourceDEV(resource, provenance, originalHref, origina
|
|
|
6070
6099
|
}
|
|
6071
6100
|
}
|
|
6072
6101
|
|
|
6073
|
-
function markAsImplicitResourceDEV(resource, underlyingProps, impliedProps) {
|
|
6074
|
-
{
|
|
6075
|
-
var devResource = resource;
|
|
6076
|
-
|
|
6077
|
-
if (typeof devResource.__provenance === 'string') {
|
|
6078
|
-
error('Resource already marked for DEV type. This is a bug in React.');
|
|
6079
|
-
}
|
|
6080
|
-
|
|
6081
|
-
devResource.__provenance = 'implicit';
|
|
6082
|
-
devResource.__underlyingProps = underlyingProps;
|
|
6083
|
-
devResource.__impliedProps = impliedProps;
|
|
6084
|
-
}
|
|
6085
|
-
}
|
|
6086
|
-
|
|
6087
6102
|
function getAsResourceDEV(resource) {
|
|
6088
6103
|
{
|
|
6089
6104
|
if (resource) {
|
|
@@ -6098,8 +6113,8 @@ function getAsResourceDEV(resource) {
|
|
|
6098
6113
|
}
|
|
6099
6114
|
}
|
|
6100
6115
|
|
|
6101
|
-
function createResponseState(generateStaticMarkup, identifierPrefix, externalRuntimeConfig) {
|
|
6102
|
-
var responseState = createResponseState$1(identifierPrefix, undefined, undefined, undefined, undefined, externalRuntimeConfig);
|
|
6116
|
+
function createResponseState(resources, generateStaticMarkup, identifierPrefix, externalRuntimeConfig) {
|
|
6117
|
+
var responseState = createResponseState$1(resources, identifierPrefix, undefined, undefined, undefined, undefined, externalRuntimeConfig);
|
|
6103
6118
|
return {
|
|
6104
6119
|
// Keep this in sync with ReactFizzConfigDOM
|
|
6105
6120
|
bootstrapChunks: responseState.bootstrapChunks,
|
|
@@ -6526,7 +6541,14 @@ function describeNativeComponentFrame(fn, construct) {
|
|
|
6526
6541
|
// in simple components too
|
|
6527
6542
|
|
|
6528
6543
|
|
|
6529
|
-
fn();
|
|
6544
|
+
var maybePromise = fn(); // If the function component returns a promise, it's likely an async
|
|
6545
|
+
// component, which we don't yet support. Attach a noop catch handler to
|
|
6546
|
+
// silence the error.
|
|
6547
|
+
// TODO: Implement component stacks for async client components?
|
|
6548
|
+
|
|
6549
|
+
if (maybePromise && typeof maybePromise.catch === 'function') {
|
|
6550
|
+
maybePromise.catch(function () {});
|
|
6551
|
+
}
|
|
6530
6552
|
}
|
|
6531
6553
|
} catch (sample) {
|
|
6532
6554
|
// This is inlined manually because closure doesn't do it for us.
|
|
@@ -8138,13 +8160,6 @@ function useCallback(callback, deps) {
|
|
|
8138
8160
|
return callback;
|
|
8139
8161
|
}, deps);
|
|
8140
8162
|
}
|
|
8141
|
-
// If a mutation occurs during render, consider triggering a Suspense boundary
|
|
8142
|
-
// and falling back to client rendering.
|
|
8143
|
-
|
|
8144
|
-
function useMutableSource(source, getSnapshot, subscribe) {
|
|
8145
|
-
resolveCurrentlyRenderingComponent();
|
|
8146
|
-
return getSnapshot(source._source);
|
|
8147
|
-
}
|
|
8148
8163
|
|
|
8149
8164
|
function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
|
|
8150
8165
|
if (getServerSnapshot === undefined) {
|
|
@@ -8240,7 +8255,6 @@ var HooksDispatcher = {
|
|
|
8240
8255
|
useTransition: useTransition,
|
|
8241
8256
|
useId: useId,
|
|
8242
8257
|
// Subscriptions are not setup in a server environment.
|
|
8243
|
-
useMutableSource: useMutableSource,
|
|
8244
8258
|
useSyncExternalStore: useSyncExternalStore
|
|
8245
8259
|
};
|
|
8246
8260
|
|
|
@@ -8332,11 +8346,10 @@ function defaultErrorHandler(error) {
|
|
|
8332
8346
|
|
|
8333
8347
|
function noop() {}
|
|
8334
8348
|
|
|
8335
|
-
function createRequest(children, responseState, rootFormatContext, progressiveChunkSize, onError, onAllReady, onShellReady, onShellError, onFatalError) {
|
|
8349
|
+
function createRequest(children, resources, responseState, rootFormatContext, progressiveChunkSize, onError, onAllReady, onShellReady, onShellError, onFatalError) {
|
|
8336
8350
|
prepareHostDispatcher();
|
|
8337
8351
|
var pingedTasks = [];
|
|
8338
8352
|
var abortSet = new Set();
|
|
8339
|
-
var resources = createResources();
|
|
8340
8353
|
var request = {
|
|
8341
8354
|
destination: null,
|
|
8342
8355
|
flushScheduled: false,
|
|
@@ -9949,7 +9962,12 @@ function flushCompletedQueues(request, destination) {
|
|
|
9949
9962
|
// We haven't flushed the root yet so we don't need to check any other branches further down
|
|
9950
9963
|
return;
|
|
9951
9964
|
}
|
|
9952
|
-
} else if (
|
|
9965
|
+
} else if (request.pendingRootTasks > 0) {
|
|
9966
|
+
// We have not yet flushed the root segment so we early return
|
|
9967
|
+
return;
|
|
9968
|
+
}
|
|
9969
|
+
|
|
9970
|
+
if (enableFloat) {
|
|
9953
9971
|
writeHoistables(destination, request.resources, request.responseState);
|
|
9954
9972
|
} // We emit client rendering instructions for already emitted boundaries first.
|
|
9955
9973
|
// This is so that we can signal to the client to start client rendering them as
|
|
@@ -10151,7 +10169,8 @@ function renderToStringImpl(children, options, generateStaticMarkup, abortReason
|
|
|
10151
10169
|
readyToStream = true;
|
|
10152
10170
|
}
|
|
10153
10171
|
|
|
10154
|
-
var
|
|
10172
|
+
var resources = createResources();
|
|
10173
|
+
var request = createRequest(children, resources, createResponseState(resources, generateStaticMarkup, options ? options.identifierPrefix : undefined, unstable_externalRuntimeSrc), createRootFormatContext(), Infinity, onError, undefined, onShellReady, undefined, undefined);
|
|
10155
10174
|
startWork(request); // If anything suspended and is still pending, we'll abort it before writing.
|
|
10156
10175
|
// That way we write only client-rendered boundaries from the start.
|
|
10157
10176
|
|