Repository navigation
Conversation
a37b3fa to
5e57031
Compare
This is automated check which relies on Generated by 🚫 dangerJS |
|
You might want to consider removing CDN parts first in a separate PR to make reviewing this one easier. CDN parts were almost removed earlier already, see: #10299 |
|
Remember to update |
|
On the frontend, I'm not seeing the Tiled Gallery view script load and the block doesn't appear. At first glance it looks like this may be because |
|
Thanks for all the reviews here. I am closing this in favor of #10405 |
The Tile Gallery front end assets should be required in I have re implemented this PR in #10405 it is a more consise and only changes the relevant parts. |
* Gutenblock: Add the frontend code only if the block is being called. This Removed the loading of the front end code that comes as a bundle of all the files. And make sure that it loads only the front end code that is needed when the block is going to be displayed. * Register the tiled-galley code block This lets us register the tiled gallery code to be loaded on the front end only * Changes applied to #10397 by gititon Props @gititon. * Minor bug fix * fix linting * missing ! * Added code dock blocks and set the default priority * Fixed the RTL issue * Minor doc block fixes * Gutenberg: fix all linter errors in file. We'll rely on those functions a lot in the next few months, the different comments should help us get all the info we need in our IDEs. It also acts as a good example for other folks who may be interested in how Jetpack adds support for its blocks. * Language extraction: account for blocks in sub-directories. @see #10405 (comment) * Sanitize the type. * Sanitize the type again
This PR tries to load
Only the required front end assets when the block is being rendered.
It also removes the CDN part since we assume that part would be taken care of by the CDN project.
cc: @zinigor (let me know if this is not the case)
This PR implement a new jetpack_register_block function. Which helps Jetpack have a better understand what blocks are supported and active. Different modules could be disabled. This information could then also be used in the editor to show/hide the blocks there as well.
To test
Add the tile block and maker sure that the assests are only loaded on the front end (css and js) related to this.
This is the required wp-calypso branch. Automattic/wp-calypso#28066 that needs to be used to build the bundle.