Skip to content

Commit 9094b9c

Browse files
committed
[Fizz][Float] emit viewport meta before preloads (#27201)
Fixes: #27200 preloads for images that appear before the viewport meta may be loaded twice because the proper device image information is not used with the preload but is with the image itself. The viewport meta should be emitted earlier than all preloads to avoid this. this change moves the queue for the viewport meta to preconnects which already has the right priority for this tag DiffTrain build for [ea17cc1](ea17cc1)
1 parent c61c196 commit 9094b9c

7 files changed

+20
-5
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
587ae49d71f218d34393291933d513d2975e22c3
1+
ea17cc18f458010c89c1bf494be08bb782d034af

compiled/facebook-www/ReactDOMServer-dev.classic.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if (__DEV__) {
1919
var React = require("react");
2020
var ReactDOM = require("react-dom");
2121

22-
var ReactVersion = "18.3.0-www-classic-ee8ed08d";
22+
var ReactVersion = "18.3.0-www-classic-8651ccc3";
2323

2424
// This refers to a WWW module.
2525
var warningWWW = require("warning");
@@ -4015,6 +4015,9 @@ function pushMeta(
40154015

40164016
if (typeof props.charSet === "string") {
40174017
return pushSelfClosing(responseState.charsetChunks, props, "meta");
4018+
} else if (props.name === "viewport") {
4019+
// "viewport" isn't related to preconnect but it has the right priority
4020+
return pushSelfClosing(responseState.preconnectChunks, props, "meta");
40184021
} else {
40194022
return pushSelfClosing(responseState.hoistableChunks, props, "meta");
40204023
}

compiled/facebook-www/ReactDOMServer-dev.modern.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if (__DEV__) {
1919
var React = require("react");
2020
var ReactDOM = require("react-dom");
2121

22-
var ReactVersion = "18.3.0-www-modern-4ffe83e1";
22+
var ReactVersion = "18.3.0-www-modern-f39e0868";
2323

2424
// This refers to a WWW module.
2525
var warningWWW = require("warning");
@@ -4015,6 +4015,9 @@ function pushMeta(
40154015

40164016
if (typeof props.charSet === "string") {
40174017
return pushSelfClosing(responseState.charsetChunks, props, "meta");
4018+
} else if (props.name === "viewport") {
4019+
// "viewport" isn't related to preconnect but it has the right priority
4020+
return pushSelfClosing(responseState.preconnectChunks, props, "meta");
40184021
} else {
40194022
return pushSelfClosing(responseState.hoistableChunks, props, "meta");
40204023
}

compiled/facebook-www/ReactDOMServer-prod.classic.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1181,6 +1181,8 @@ function pushStartInstance(
11811181
(target =
11821182
"string" === typeof props.charSet
11831183
? pushSelfClosing(responseState.charsetChunks, props, "meta")
1184+
: "viewport" === props.name
1185+
? pushSelfClosing(responseState.preconnectChunks, props, "meta")
11841186
: pushSelfClosing(
11851187
responseState.hoistableChunks,
11861188
props,
@@ -4012,4 +4014,4 @@ exports.renderToString = function (children, options) {
40124014
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
40134015
);
40144016
};
4015-
exports.version = "18.3.0-www-classic-4b8ece22";
4017+
exports.version = "18.3.0-www-classic-849751e4";

compiled/facebook-www/ReactDOMServer-prod.modern.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1180,6 +1180,8 @@ function pushStartInstance(
11801180
(target =
11811181
"string" === typeof props.charSet
11821182
? pushSelfClosing(responseState.charsetChunks, props, "meta")
1183+
: "viewport" === props.name
1184+
? pushSelfClosing(responseState.preconnectChunks, props, "meta")
11831185
: pushSelfClosing(
11841186
responseState.hoistableChunks,
11851187
props,
@@ -3910,4 +3912,4 @@ exports.renderToString = function (children, options) {
39103912
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
39113913
);
39123914
};
3913-
exports.version = "18.3.0-www-modern-d39c47bb";
3915+
exports.version = "18.3.0-www-modern-a94e9f5e";

compiled/facebook-www/ReactDOMServerStreaming-dev.modern.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4022,6 +4022,9 @@ function pushMeta(
40224022

40234023
if (typeof props.charSet === "string") {
40244024
return pushSelfClosing(responseState.charsetChunks, props, "meta");
4025+
} else if (props.name === "viewport") {
4026+
// "viewport" isn't related to preconnect but it has the right priority
4027+
return pushSelfClosing(responseState.preconnectChunks, props, "meta");
40254028
} else {
40264029
return pushSelfClosing(responseState.hoistableChunks, props, "meta");
40274030
}

compiled/facebook-www/ReactDOMServerStreaming-prod.modern.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,6 +1205,8 @@ function pushStartInstance(
12051205
(target =
12061206
"string" === typeof props.charSet
12071207
? pushSelfClosing(responseState.charsetChunks, props, "meta")
1208+
: "viewport" === props.name
1209+
? pushSelfClosing(responseState.preconnectChunks, props, "meta")
12081210
: pushSelfClosing(
12091211
responseState.hoistableChunks,
12101212
props,

0 commit comments

Comments
 (0)