Skip to content

Commit 26a2891

Browse files
gnoffAndyPengc12
authored andcommitted
[Fizz][Float] emit viewport meta before preloads (facebook#27201)
Fixes: facebook#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
1 parent d8b20a9 commit 26a2891

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js

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

19211921
if (typeof props.charSet === 'string') {
19221922
return pushSelfClosing(responseState.charsetChunks, props, 'meta');
1923+
} else if (props.name === 'viewport') {
1924+
// "viewport" isn't related to preconnect but it has the right priority
1925+
return pushSelfClosing(responseState.preconnectChunks, props, 'meta');
19231926
} else {
19241927
return pushSelfClosing(responseState.hoistableChunks, props, 'meta');
19251928
}

0 commit comments

Comments
 (0)