Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try: React 19 #61521

Draft
wants to merge 27 commits into
base: trunk
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
695f19a
Bump react deps to 19.0.0-beta-6946ebe620-20240508
tyxla May 9, 2024
074be4e
Workaround portal iframe body handling limitations
tyxla Apr 3, 2024
d5ce3bc
Fix deprecated types: React.ReactChild
tyxla May 9, 2024
031f9f0
Fix deprecated types: React.ReactNodeArray
tyxla May 9, 2024
d919db1
Fix deprecated types: React.ReactFragment
tyxla May 9, 2024
a323821
Fix deprecated types: React.ReactText
tyxla May 9, 2024
43a885d
beta -> rc
tyxla May 23, 2024
6dddd4d
Update a snapshot test
tyxla May 23, 2024
24e7ad4
Fix context consumer serialization
tyxla May 23, 2024
6cb623c
Add @ariakit/react-core patch for element.props.ref support
tyxla May 23, 2024
8398bd6
Fix some unit tests
tyxla May 23, 2024
332cfe2
REVERTME: Hack a test
tyxla May 23, 2024
eb93dc4
Bump to 19.0.0-rc-100dfd7dab-20240701
tyxla Jul 2, 2024
ab01b93
Bump to 19.0.0-rc-33c7bd9a-20241104
tyxla Nov 6, 2024
d81a245
Revert "Add @ariakit/react-core patch for element.props.ref support"
tyxla Nov 6, 2024
a749e83
Revert "React: Restore umd builds (#63602)"
tyxla Nov 6, 2024
3d311a1
Edit Post: Check for meta box container before adding constraints
tyxla Nov 6, 2024
01bc6eb
Inserter: Fix InserterListbox rendering
tyxla Nov 6, 2024
f861631
Bump framer-motion to 12.0.0-alpha.1
tyxla Nov 6, 2024
260fe88
Bump to 19.0.0-rc.1
tyxla Nov 20, 2024
c8f6924
Move framer-motion dependency to root to make patchable
tyxla Nov 20, 2024
51d8b02
Patch framer-motion types
tyxla Nov 20, 2024
68b1af4
motion() -> motion.create()
tyxla Nov 20, 2024
58eccfa
Update useSuspenseSelect tests
tyxla Nov 20, 2024
26d7d97
Bump to v19.0.0 (stable)
tyxla Dec 6, 2024
f757b53
Revert "Patch framer-motion types"
Mamaduka Dec 18, 2024
23bba7d
Bump framer-motion to v11.15.0
Mamaduka Dec 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
168 changes: 103 additions & 65 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,14 @@
"progress": "2.0.3",
"puppeteer-core": "23.10.1",
"raw-loader": "4.0.2",
"react": "18.3.1",
"react": "19.0.0",
"react-docgen-typescript": "2.2.2",
"react-dom": "18.3.1",
"react-dom": "19.0.0",
"react-native": "0.73.3",
"react-native-url-polyfill": "1.1.2",
"react-refresh": "0.14.0",
"react-scanner": "1.2.0",
"react-test-renderer": "18.3.1",
"react-test-renderer": "19.0.0",
"reassure": "0.7.1",
"redux": "5.0.1",
"resize-observer-polyfill": "1.5.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-preset-default/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"@wordpress/warning": "*",
"browserslist": "^4.21.10",
"core-js": "^3.31.0",
"react": "^18.3.0"
"react": "^19.0.0"
},
"publishConfig": {
"access": "public"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe( 'createCustomColorsHOC', () => {
colors: undefined,
setBackgroundColor: expect.any( Function ),
} ),
expect.anything()
undefined
);
} );

Expand Down
7 changes: 2 additions & 5 deletions packages/block-editor/src/components/iframe/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,6 @@ function Iframe( {
${ styles }
${ scripts }
</head>
<body>
<script>document.currentScript.parentElement.remove()</script>
</body>
Comment on lines -264 to -266
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tyxla, what's the reason for removing this logic?

I think this is the cause of at least one e2e test failure. Ref #52405.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Back when I was testing with the beta, this was an essential fix to make the editor work (see 7936e41 for the full fix). Without it, the editor was crashing during its initial boot.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the context, @tyxla!

I'll continue debugging. The document.currentScript.parentElement.remove removal is regressing #52405.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate your work on it, @Mamaduka! Feel free to revert it and seek a different fix. I've been delayed by other things, but hoping to get back to this one soon.

</html>`;

const [ src, cleanup ] = useMemo( () => {
Expand Down Expand Up @@ -328,7 +325,7 @@ function Iframe( {
}
} }
>
{ iframeDocument &&
{ iframeDocument?.body &&
createPortal(
// We want to prevent React events from bubbling throught the iframe
// we bubble these manually.
Expand All @@ -346,7 +343,7 @@ function Iframe( {
{ children }
</StyleProvider>
</body>,
iframeDocument.documentElement
iframeDocument?.documentElement
) }
</iframe>
{ shouldRenderFocusCaptureElements && after }
Expand Down
11 changes: 10 additions & 1 deletion packages/block-editor/src/components/inserter-listbox/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* WordPress dependencies
*/
import { Composite } from '@wordpress/components';
import { Fragment } from '@wordpress/element';

/**
* Internal dependencies
Expand All @@ -11,9 +12,17 @@ export { default as InserterListboxGroup } from './group';
export { default as InserterListboxRow } from './row';
export { default as InserterListboxItem } from './item';

function InserterListBoxWrapper( { key, children } ) {
return <Fragment key={ key }>{ children }</Fragment>;
}

function InserterListbox( { children } ) {
return (
<Composite focusShift focusWrap="horizontal" render={ <></> }>
<Composite
focusShift
focusWrap="horizontal"
render={ InserterListBoxWrapper }
>
{ children }
</Composite>
);
Expand Down
Loading
Loading