Closed luisherranz closed 1 year ago
I created this pull request to remove gutenberg_should_block_use_interactivity_api
and the old implementation of the Navigation and File blocks. In the end, I decided to do everything simultaneously because of some related conditionals.
Approved! Thanks, Mario π
I've opened a PR to test the WP Core webpack configuration. It's not finished yet, but so far it seems to be working great:
I've opened a PR to add manual SSR to the Navigation block and the File block. As explained in the pull request, I believe that in the File block, it is complicated to replicate the JS logic, so we have to make a decision there.
I've been reviewing the Search block PR, and I think it should be ready to be merged, it needs review and approval. I also modified it so it works without the Interactivity API SSR.
I've opened a draft PR for disabling the enhanced pagination if third-party blocks exist in the Post Template.
I've added a new task for the Query block:
wp_store
.I've created a pull request to remove the usage of wp_store
in the Query block:
The PR to move the Search block to the Interactivity API has been merged:
I've sucessfully finished modifying the Webpack files to make @wordpress/interactivity
a private package:
The next step is to try to test it out in WP Core. I've also added a couple of related tasks to the opening post.
I've ported the changes to WordPress Core and they are working great. This should be ready to merge once the sync between Gutenberg and WP Core happens (with the correct modifications to the PR).
@artemiomorales, @michalczaplinski: @tellthemachines mentioned me that we need to review the usage of WP_Theme_JSON_Resolver_Gutenberg
in the Image block before the 16.7 RC release (20th of Sept).
This is the exact message:
We're calling
WP_Theme_JSON_Resolver_Gutenberg
in the Image block PHP file, which isn't defined in core. We'll need to add some logic similar to this to check if the core class exists.
I've added to the list of tasks in the opening post. Please take care of it and mark it as ready afterward. Thanks π
I've opened an issue with some design enhancements mentioned by @jasmussen. There are some that we should do before the 16.7 RC release, and others that we can try if we have time:
The changes to allow only core blocks inside a Query Loop with enhanced pagination are done and merged.
I'll continue with the rest of the enhancements.
This addresses most of the design feedback from @jasmussen. π
It's ready for review.
I've created another PR that adds a timeout
option to navigate()
, with a default value of 10000
milliseconds (10 seconds).
David opened another PR to improve the accessibility of the modal:
Open PR in Gutenberg to add this code to each interactive block to make sure that all the scripts have the
wp-interactivity
dependency
I think it's safe to do this in WordPress itself. I'll add it to this PR instead: (see below)
We're calling WP_Theme_JSON_Resolver_Gutenberg in the Image block PHP file, which isn't defined in core. We'll need to add some logic similar to this to check if the core class exists.
This issue was fixed by merging https://github.com/WordPress/gutenberg/pull/53851 which removes the reference to WP_Theme_JSON_Resolver_Gutenberg
in the Image block. There is another reference to WP_Theme_JSON_Resolver_Gutenberg
in https://github.com/WordPress/gutenberg/blob/62c1f50704d7b2235a525e121d5ee6ea0bc449e1/lib/block-supports/behaviors.php#L67 which is temporarily added to Gutenberg for backward-compatibility and will be removed in GB 17.0.
I've created a PR to handle the remaining tasks related to the lightbox:
Open PR in Gutenberg to add this code to each interactive block to make sure that all the scripts have the
wp-interactivity
dependencyI think it's safe to do this in WordPress itself. I'll add it to this PR instead:
@luisherranz does this require changes to block PHP files? If so, it has to be done in Gutenberg. The block PHP gets generated in core from the block-library
package so it can't be manually edited there.
@luisherranz does this require changes to block PHP files?
No, it doesn't. We can add it in Core in wp-includes/script-loader.php
if that's ok.
EDIT: I tried, but I think it's simpler to add it here in Gutenberg:
I added logic to start prefetching the next pages on the first click to the next and previous buttons:
I opened a PR that shows a subtle animation when the HTML is updated and changes the scroll behavior to smooth
during navigation. Ready for review.
Hi folks, thanks for the good work!
I just wanted to understand better - Interactivity API is not going to be useable outside of WP Core in 6.4? Does it mean it is planned for 6.5?
I just wanted to understand better - Interactivity API is not going to be useable outside of WP Core in 6.4? Does it mean it is planned for 6.5?
Yes, in 6.4, only core blocks can use the Interactivity API. If you want to use the Interactivity API for your custom blocks, you need to install the Gutenberg plugin as well. We considered it safer this way because there are some parts that need more testing and the API is likely to change. So it might require developers who built custom blocks using the API to change the syntax.
On the other hand, if everything goes as expected, the idea is to make it public in WP Core in 6.5 as you say.
Even though there's still some discussion about the fading animation of the Query block, I'm going to close this Tracking Issue as finished because WP 6.4 Beta 1 has already been released.
We will continue working in the new store()
API, please follow the progress in this Tracking Issue:
WP 6.4 will include Gutenberg up to the 16.7 version, which includes the new Image Lightbox, an enhanced pagination for the Query block and accessibility fixes for the Navigation block, all of them powered by the Interactivity API. Although the Interactivity API is still in the proposal phase, we can include a private version that only Core blocks can access in WP 6.4 to release these features/enhancements.
Please note that the Interactivity API is still likely to change before the final public version is released, but by keeping it private to Core blocks in WP 6.4, we can still modify it before it's public. Furthermore, if the proposal is finally rejected for some reason, we just have to replace the Interactivity API implementation of the Core blocks with whatever new approach is adopted instead.
The release of the 16.7 RC is scheduled for the 20th of September. Before that date, we need to complete the following tasks:
wp_store
Figure out if we can combine the focus scroll with the smooth scroll of scrollIntoView.It only works in Chrome.Add a βblinkβ the Query block in the Editor as soon as the toggle is enabled, just to provide some visual feedback in the canvas that something changed.Discarded for now.gutenberg_should_block_use_interactivity_api
and remove old implementationgutenberg_should_block_use_interactivity_api
and remove old implementationview-interactivity.js
file toview.js
WP_Theme_JSON_Resolver_Gutenberg
packages/interactivity
privately and enqueue the new fileswp-interactivity
dependency is always added