Assuming I have no unfinite scroll or anything else going on in my theme: Is there a way to enqueue my custom Gutenberg block styles and scripts so they are only (lazy) loaded in the frontend when the block is really used? Something like is_active_widget, just for blocks? If I enqueue them inside a enqueue_block_assets function they’re added to any site.
On github, I found this https://github.com/WordPress/gutenberg/issues/5445 , but it sounds like it’s more on bundling than conditional load, so I still hope they didn’t leave that optimization opportunity out – otherwise any other site will soon be junked with 20 additional scripts from numerous Gutenberg block plugins people install and only use once on a page (think of large image gallery block scripts for example).
Thanks & Regards!