Assuming I’ve no infinite scroll or anything happening in my theme:
Is there a option to enqueue my customized Gutenberg block kinds and scripts so they’re solely (lazy) loaded within the front-end when the block is absolutely used? One thing like
is_active_widget, only for blocks?
If I enqueue them inside a
enqueue_block_assets perform they’re added to any web site.
On github, I discovered this https://github.com/WordPress/gutenberg/points/5445 , however it sounds prefer it’s extra on bundling than conditional load, so I nonetheless hope they did not depart that optimization alternative out – in any other case another web site will quickly be junked with 20 further scripts from quite a few Gutenberg block plugins folks set up and solely use as soon as on a web page (consider massive picture gallery block scripts for instance).
Thanks & Regards!