Andrew Hey, our engraving block comes up unstyled in the post editor on 7.1 RC1, but the front end is fine. The css is enqueued on admin_enqueue_scripts, same as since 5.x. Nothing changed on our side. What changed in the editor?
BraveWalrus Could be the theme not the RC! Which RC exactly, and is the demo running a block theme or a classic one?
quietraven I tested my own widget styles on RC1 yesterday and they came through fine but mine go in with a block handle not a plain admin hook so that's probably the difference. How is this stylesheet registered? Handle hook priority and what it depends on. The https://developer.wordpress.org/reference/functions/wp_enqueue_style/ page isn't much help here it says nothing about editor.
Atif Same thing on a client block last week. The post editor is an iframe since this RC, so anything from admin_enqueue_scripts lands on the parent document and never gets into the frame. Two ways out. 1) enqueue_block_assets instead, that fires inside the iframe as well. 2) editorStyle in block.json, the clean one, see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/
Andrew Moved it to enqueue_block_assets this morning, same handle. Editor on RC1 is styled again. But Query Monitor now lists the stylesheet on every front-end page, pages without the block too -- which never happened on 7.0. The https://developer.wordpress.org/reference/hooks/enqueue_block_assets/ page does say both sides, but that isn't what the plugin wants.
quietraven Hi! That hook runs on front end as well so that's expected. Wrap it in is_admin() if it must stay but the right place is editorStyle in block.json (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/) then it loads only inside editor. Is this block registered from block.json at all? Cheers
Andrew went with editorStyle in block.json, editor styled, front end clean.. Thanks Atif and quietraven.