Building my first ever Gutenberg block

Gutenberg recently upgraded JSX Runtime which is only compatible WP >= 6.6. See link https://make.wordpress.org/core/2024/06/06/jsx-in-wordpress-6-6/ If you update WordPress to 6.6-beta2 then it should work. In the meantime they are figuring out about back compatibility. See comment – https://make.wordpress.org/core/2024/06/06/jsx-in-wordpress-6-6/#comment-46779 Or if you are not ready to upgrade to WP 6.6 yet, you can downgrade @wordpress/scripts … Read more

How to set autoload from “yes” to “no” _transient_wp_core_block_css_files

Don’t bother messing the with autoload on the transient. If you’re truly not using blocks at all, just unhook the function that creates the transient and uses it to register the style handles: remove_action( ‘init’, ‘register_core_block_style_handles’, 9 ); Just be aware that if you do use blocks, their stylesheets will not load until you let … Read more

add_editor_style now copying html styles to .editor-styles-wrapper?

I had a look at the code history in the Gutenberg repository, and it looks like html and body have been transformed since the very beginning, 5 years ago: https://github.com/WordPress/gutenberg/blame/15fc0c13eb33a6e4426ff4ad681b6bfb6d0adaec/packages/editor/src/editor-styles/transforms/wrap.js :root was added several months later. So yes, it appears to be intentional, but not new. If something has changed in your styles in 6.3 … Read more

Implementing onSplit/onMerge in dynamic Gutenberg Custom Blocks

Based on the use case that lead you to this, the answer is: You don’t, that’s what block styles and variations are for. Your entire block could be eliminated and replaced with this: wp.blocks.registerBlockStyle( ‘core/paragraph’, { name: ‘bc-synopsis’, label: ‘Back Cover Synopsis’, } ); .is-style-bc-synopsis { // styling etc… } Benefits: You can change your … Read more