-
Notifications
You must be signed in to change notification settings - Fork 798
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tiled gallery block: load assets #10728
Conversation
D21373-code. (newly created revision) |
@@ -17,6 +17,7 @@ public function __construct() { | |||
add_filter( 'jetpack_gallery_types', array( $this, 'jetpack_gallery_types' ), 9 ); | |||
add_filter( 'jetpack_default_gallery_type', array( $this, 'jetpack_default_gallery_type' ) ); | |||
|
|||
jetpack_register_block( 'tiled-gallery' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit unsure if I should instead do this:
if ( $this->tiles_enabled() ) {
jetpack_register_block( 'tiled-gallery' );
} else {
jetpack_register_block(
'tiled-gallery',
array(),
array( 'available' => false, 'unavailable_reason' => 'missing_module' )
);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea behind missing_module
is that we would have a component that would just allow us to show a toggle to the user to activate the missing module. I am not sure this would work the same way.
I am not too familiar with the tile gallery code and how that would work.
I think the check makes sense but I would just be careful to make sure that reason still make sense in this context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for elaborating @enejb
I am not too familiar with the tile gallery code and how that would work.
Me neither and it seems like we could leave this for future iterations.
This is automated check which relies on Generated by 🚫 dangerJS |
|
- Add wp-rich text dependency for tiled gallery
1106d71
to
2740f7a
Compare
…things still work as expected.
Noting that Since tiled gallery module gets disabled when disabling Photon from jetpack settings, we might need to change something here later on. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💥
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working 👍 🚢
$dependencies = array( | ||
'lodash', | ||
'wp-i18n', | ||
'wp-token-list', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll try to get this list down: Automattic/wp-calypso#28933
@@ -537,7 +537,7 @@ private function __construct() { | |||
* Prepare Gutenberg Editor functionality | |||
*/ | |||
require_once JETPACK__PLUGIN_DIR . 'class.jetpack-gutenberg.php'; | |||
add_action( 'init', array( 'Jetpack_Gutenberg', 'load_blocks' ) ); // Registers all the Jetpack blocks . | |||
add_action( 'init', array( 'Jetpack_Gutenberg', 'load_blocks' ), 99 ); // Registers all the Jetpack blocks . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to make sure this or something similar makes its way to WordPress.com
Fusuion won't handle this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good call
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@simison could you take care of it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup 👌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good. Merging.
Load Tiled Gallery Gutenberg block assets. ## Testing - Apply the commit 9e27e59 to fix loading block assets at appropiate loading order. (PR #10739) - In Calypso, switch to branch `update/tiled-gallery-updates` (PR Automattic/wp-calypso#27458) and build the blocks to get `_inc/blocks/tiled-gallery/view*` files: ``` npm run sdk -- gutenberg client/gutenberg/extensions/presets/jetpack/ \ --output-dir=~/jetpack/_inc/blocks/ ``` - Insert tiled gallery block in the editor, add some awesome images and publish the post - Check the post frontend, you should observe `tiled-gallery/view.*` files load and the gallery shouldn't look too broken. It might look just a tad bit broken because it's work in progress. ;-)
Load Tiled Gallery Gutenberg block assets.
Testing
update/tiled-gallery-updates
(PR Gutenberg: Tiled gallery block wp-calypso#27458) and build the blocks to get_inc/blocks/tiled-gallery/view*
files:tiled-gallery/view.*
files load and the gallery shouldn't look too broken. It might look just a tad bit broken because it's work in progress. ;-)