thoughtis / cata-blocks

Block Editor components for use with the Cata theme.
GNU General Public License v3.0
1 stars 0 forks source link

WordPress 6.6 and JSX runtime in build scripts #157

Closed douglas-johnson closed 1 month ago

douglas-johnson commented 1 month ago

Testing with WordPress 6.6 before updating the build process to use the new JSX runtime resulted in the following JavaScript warnings. I did not find any errors that broke functionality.

I will follow up with any issue I encounter after updating to use the JSX runtime.

More on the runtime change: https://make.wordpress.org/core/2024/06/06/jsx-in-wordpress-6-6/

We'll have to search for these:

wp.data.select( 'core/editor' ).getSelectedBlock is deprecated since version 5.3 and will be removed in version 6.2. Please use wp.data.select( 'core/block-editor' ).getSelectedBlock instead.

wp.editor.RichTextToolbarButton is deprecated since version 5.3 and will be removed in version 6.2. Please use wp.blockEditor.RichTextToolbarButton instead.

wp.blockEditor.RichText onSplit prop is deprecated since version 6.4. Please use block.json support key: "splitting" instead.

Network Link

Warning: React does not recognize the `setAttributes` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `setattributes` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
button
Role@http://dev.local/wp-includes/js/dist/components.js?ver=54eab95952fe254d64e9:2877:38
UnforwardedTooltip@http://dev.local/wp-includes/js/dist/components.js?ver=54eab95952fe254d64e9:10210:7
UnforwardedButton@http://dev.local/wp-includes/js/dist/components.js?ver=54eab95952fe254d64e9:31665:32
li
edit@http://dev.local/wp-content/plugins/cata-blocks/blocks/network-link/build/index.js?ver=d945a8d528932060379e:1:30063
Edit@http://dev.local/wp-includes/js/dist/block-editor.js?ver=08c7639fec797fe5afb1:39005:7

Shopify

Warning: Each child in a list should have a unique "key" prop.

Check the render method of `edit`. See https://reactjs.org/link/warning-keys for more information.
option
edit@http://dev.local/wp-content/plugins/cata-blocks/blocks/shopify/build/index.js?ver=fb0582c980e27e6a9408:1:2143
Edit@http://dev.local/wp-includes/js/dist/block-editor.js?ver=08c7639fec797fe5afb1:39005:7
douglas-johnson commented 1 month ago

wp.editPost.PluginDocumentSettingPanel is deprecated since version 6.6. Please use wp.editor.PluginDocumentSettingPanel instead.

douglas-johnson commented 1 month ago

@jessica-townsend Do you recall why this Network Link icon is wrapped in a <Button> component? It throws a warning about <button> not having a setAttributes property, and I'm not sure we need this button at all.

https://github.com/thoughtis/cata-blocks/blob/0.9.5/blocks/network-link/src/edit.js#L49

jessica-townsend commented 1 month ago

@douglas-johnson I think it's because I was referencing the social link core block which uses a button: https://github.com/WordPress/gutenberg/blob/trunk/packages/block-library/src/social-link/edit.js#L166

But I don't think we need it on ours