Skip to content

Commit 292f65f

Browse files
authored
Fix unexpected hoist meta tags by react in app dir (#46917)
### Bug Fix Update vendor react to fix the unexpected hoist tags issue x-ref: facebook/react#26256 * Fixes #42648 * Closes NEXT-655 * tests added
1 parent 8b50b80 commit 292f65f

30 files changed

+1723
-1419
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,11 @@
191191
"random-seed": "0.3.0",
192192
"react": "18.2.0",
193193
"react-17": "npm:[email protected]",
194-
"react-builtin": "npm:[email protected]49f741046-20230305",
194+
"react-builtin": "npm:[email protected]703c67560-20230307",
195195
"react-dom": "18.2.0",
196196
"react-dom-17": "npm:[email protected]",
197-
"react-dom-builtin": "npm:[email protected]49f741046-20230305",
198-
"react-server-dom-webpack": "18.3.0-next-49f741046-20230305",
197+
"react-dom-builtin": "npm:[email protected]703c67560-20230307",
198+
"react-server-dom-webpack": "18.3.0-next-703c67560-20230307",
199199
"react-ssr-prepass": "1.0.8",
200200
"react-virtualized": "9.22.3",
201201
"relay-compiler": "13.0.2",

packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.development.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ if (process.env.NODE_ENV !== "production") {
1717
var React = require('react');
1818
var ReactDOM = require('react-dom');
1919

20-
var ReactVersion = '18.3.0-next-49f741046-20230305';
20+
var ReactVersion = '18.3.0-next-703c67560-20230307';
2121

2222
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
2323

@@ -2918,7 +2918,7 @@ function pushStartTextArea(target, props) {
29182918

29192919
function pushMeta(target, props, responseState, textEmbedded, insertionMode, noscriptTagInScope) {
29202920
{
2921-
if (insertionMode === SVG_MODE || noscriptTagInScope) {
2921+
if (insertionMode === SVG_MODE || noscriptTagInScope || props.itemProp != null) {
29222922
return pushSelfClosing(target, props, 'meta');
29232923
} else {
29242924
if (textEmbedded) {
@@ -2942,7 +2942,7 @@ function pushLink(target, props, responseState, resources, textEmbedded, inserti
29422942
var href = props.href;
29432943
var precedence = props.precedence;
29442944

2945-
if (insertionMode === SVG_MODE || noscriptTagInScope || typeof rel !== 'string' || typeof href !== 'string' || href === '') {
2945+
if (insertionMode === SVG_MODE || noscriptTagInScope || props.itemProp != null || typeof rel !== 'string' || typeof href !== 'string' || href === '') {
29462946
{
29472947
if (rel === 'stylesheet' && typeof props.precedence === 'string') {
29482948
if (typeof href !== 'string' || !href) {
@@ -3167,7 +3167,7 @@ function pushStyle(target, props, resources, textEmbedded, insertionMode, noscri
31673167
var precedence = props.precedence;
31683168
var href = props.href;
31693169

3170-
if (insertionMode === SVG_MODE || noscriptTagInScope || typeof precedence !== 'string' || typeof href !== 'string' || href === '') {
3170+
if (insertionMode === SVG_MODE || noscriptTagInScope || props.itemProp != null || typeof precedence !== 'string' || typeof href !== 'string' || href === '') {
31713171
// This style tag is not able to be turned into a Style Resource
31723172
return pushStyleImpl(target, props);
31733173
}
@@ -3382,7 +3382,7 @@ function pushTitle(target, props, responseState, insertionMode, noscriptTagInSco
33823382
}
33833383

33843384
{
3385-
if (insertionMode !== SVG_MODE && !noscriptTagInScope) {
3385+
if (insertionMode !== SVG_MODE && !noscriptTagInScope && props.itemProp == null) {
33863386
pushTitleImpl(responseState.hoistableChunks, props);
33873387
return null;
33883388
} else {
@@ -3463,7 +3463,7 @@ function pushStartHtml(target, props, responseState, insertionMode) {
34633463

34643464
function pushScript(target, props, resources, textEmbedded, insertionMode, noscriptTagInScope) {
34653465
{
3466-
if (insertionMode === SVG_MODE || noscriptTagInScope || typeof props.src !== 'string' || !props.src) {
3466+
if (insertionMode === SVG_MODE || noscriptTagInScope || props.itemProp != null || typeof props.src !== 'string' || !props.src) {
34673467
// This script will not be a resource nor can it be preloaded, we bailout early
34683468
// and emit it in place.
34693469
return pushScriptImpl(target, props);

packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.production.min.js

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.development.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var React = require('react');
1818
var ReactDOM = require('react-dom');
1919
var stream = require('stream');
2020

21-
var ReactVersion = '18.3.0-next-49f741046-20230305';
21+
var ReactVersion = '18.3.0-next-703c67560-20230307';
2222

2323
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
2424

@@ -2925,7 +2925,7 @@ function pushStartTextArea(target, props) {
29252925

29262926
function pushMeta(target, props, responseState, textEmbedded, insertionMode, noscriptTagInScope) {
29272927
{
2928-
if (insertionMode === SVG_MODE || noscriptTagInScope) {
2928+
if (insertionMode === SVG_MODE || noscriptTagInScope || props.itemProp != null) {
29292929
return pushSelfClosing(target, props, 'meta');
29302930
} else {
29312931
if (textEmbedded) {
@@ -2949,7 +2949,7 @@ function pushLink(target, props, responseState, resources, textEmbedded, inserti
29492949
var href = props.href;
29502950
var precedence = props.precedence;
29512951

2952-
if (insertionMode === SVG_MODE || noscriptTagInScope || typeof rel !== 'string' || typeof href !== 'string' || href === '') {
2952+
if (insertionMode === SVG_MODE || noscriptTagInScope || props.itemProp != null || typeof rel !== 'string' || typeof href !== 'string' || href === '') {
29532953
{
29542954
if (rel === 'stylesheet' && typeof props.precedence === 'string') {
29552955
if (typeof href !== 'string' || !href) {
@@ -3174,7 +3174,7 @@ function pushStyle(target, props, resources, textEmbedded, insertionMode, noscri
31743174
var precedence = props.precedence;
31753175
var href = props.href;
31763176

3177-
if (insertionMode === SVG_MODE || noscriptTagInScope || typeof precedence !== 'string' || typeof href !== 'string' || href === '') {
3177+
if (insertionMode === SVG_MODE || noscriptTagInScope || props.itemProp != null || typeof precedence !== 'string' || typeof href !== 'string' || href === '') {
31783178
// This style tag is not able to be turned into a Style Resource
31793179
return pushStyleImpl(target, props);
31803180
}
@@ -3389,7 +3389,7 @@ function pushTitle(target, props, responseState, insertionMode, noscriptTagInSco
33893389
}
33903390

33913391
{
3392-
if (insertionMode !== SVG_MODE && !noscriptTagInScope) {
3392+
if (insertionMode !== SVG_MODE && !noscriptTagInScope && props.itemProp == null) {
33933393
pushTitleImpl(responseState.hoistableChunks, props);
33943394
return null;
33953395
} else {
@@ -3470,7 +3470,7 @@ function pushStartHtml(target, props, responseState, insertionMode) {
34703470

34713471
function pushScript(target, props, resources, textEmbedded, insertionMode, noscriptTagInScope) {
34723472
{
3473-
if (insertionMode === SVG_MODE || noscriptTagInScope || typeof props.src !== 'string' || !props.src) {
3473+
if (insertionMode === SVG_MODE || noscriptTagInScope || props.itemProp != null || typeof props.src !== 'string' || !props.src) {
34743474
// This script will not be a resource nor can it be preloaded, we bailout early
34753475
// and emit it in place.
34763476
return pushScriptImpl(target, props);

0 commit comments

Comments
 (0)