Skip to content
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

Allow blocks with interactivity support inside core/query (useUnsupportedBlocks) #59752

Closed
poof86 opened this issue Mar 11, 2024 · 15 comments · Fixed by #60006
Closed

Allow blocks with interactivity support inside core/query (useUnsupportedBlocks) #59752

poof86 opened this issue Mar 11, 2024 · 15 comments · Fixed by #60006
Labels
[Block] Query Loop Affects the Query Loop Block [Feature] Blocks Overall functionality of blocks [Feature] Interactivity API API to add frontend interactivity to blocks. [Type] Bug An existing feature does not function as intended

Comments

@poof86
Copy link

poof86 commented Mar 11, 2024

What problem does this address?

I want to create blocks that I can use in the core/query block, but because my custom blocks don't start with the prefix "core/" they are flagged as unsupported while support for interactivity is set to true or support for interactivity.clientNavigation is set to true.

Edit: The server side part is already using the supports instead of core/-- string, so it differs from the edit part when checking the Interactivity supports.

What is your proposed solution?

Allow for prefixes other then "core/" and check if the block has support for interactivity instead.

@poof86 poof86 added the [Type] Enhancement A suggestion for improvement. label Mar 11, 2024
@jordesign jordesign added the [Feature] Blocks Overall functionality of blocks label Mar 12, 2024
@gziolo gziolo added the [Feature] Interactivity API API to add frontend interactivity to blocks. label Mar 15, 2024
@cbravobernal
Copy link
Contributor

Hi there!

When you mention the unsupported flag, you mean the client side navigation that is handled here?

@poof86
Copy link
Author

poof86 commented Mar 19, 2024

Hey,

I’m referring to this hook that is called in the editor that doesn’t allow non core blocks to be present for interactivity to be enabled

export const useUnsupportedBlocks = ( clientId ) => {

@colinduwe
Copy link
Contributor

I'll take a quick stab at this one. One quick question is what is the history of this check? Why was it implemented in its current form @gziolo do you know that bit of history or perhaps know who to ask? Are we overlooking a some pitfall?

@colinduwe
Copy link
Contributor

@poof86 PR submitted. Please give it a whirl.

@gziolo
Copy link
Member

gziolo commented Mar 21, 2024

I’m referring to this hook that is called in the editor that doesn’t allow non core blocks to be present for interactivity to be enabled

It looks like the logic on the server and on the client differ when making the decision whether the page can be loaded without the full reload.

I'll take a quick stab at this one. One quick question is what is the history of this check? Why was it implemented in its current form @gziolo do you know that bit of history or perhaps know who to ask? Are we overlooking a some pitfall?

@DAreRodz and @c4rl0sbr4v0, should be able to help resolve this issue.

@gziolo gziolo added the [Block] Query Loop Affects the Query Loop Block label Mar 21, 2024
@colinduwe
Copy link
Contributor

It looks like the logic on the server and on the client differ when making the decision whether the page can be loaded without the full reload.

The php logic makes sense; it checks if interactivity or interactivity.clientNavigation are set true. If so, the page can be loaded without refresh.
I've updated the PR so it makes the same check. It also allows any 'core/' block to be in the query loop, although I think they all already have their block.supports attributes set.

@sethrubenstein
Copy link
Contributor

Yes please, I've tried numerous ways to hijack the force disabling of enhanced pagination with no luck... even though my interactive blocks work perfectly fine in the query block.

@cbravobernal
Copy link
Contributor

It looks like the logic on the server and on the client differ when making the decision whether the page can be loaded without the full reload.

And because of that, I think this issue is a bug instead of an enhancement 😅

@cbravobernal cbravobernal added [Type] Bug An existing feature does not function as intended and removed [Type] Enhancement A suggestion for improvement. labels Apr 3, 2024
@colorful-tones
Copy link
Member

I sense that although this is noted as a bug it may not be critical enough to include in 6.5.1 (timeline to be determined), but would be nice to have, correct? I just wanted to evaluate and clarify the impact.

@c4rl0sbr4v0 perhaps you have an impending pull request for review?

@cbravobernal
Copy link
Contributor

The PR is almost ready (I would like the contributor to remove just one "bool" word, I can do it my self, but is not critical).

It's not critical, but is a really nice to have. Cause right now, nobody can have a Core Query block with "force reload" disabled and an Interactive block or a client side navigation compatible block inside that Query block.

You would need a block variation, and that is adding too much hustle just for that. The server side is already allowing that, but we forgot to update that logic in the edit part.

@gziolo
Copy link
Member

gziolo commented Apr 10, 2024

The fix was released in WordPress 6.5.2.

@kelvin-xu
Copy link

Can anyone get the same fix to the most recent version of the Gutenberg plugin as well?

@kelvin-xu
Copy link

I'm running version 18.1.2 of the Gutenberg plugin. And the same issue happens. I have checked the code within the plugin and it is still looking for 'core/' blocks only.

@colinduwe
Copy link
Contributor

This fix is in 18.2 which is scheduled for release tomorrow, 4/24

@kelvin-xu
Copy link

@colinduwe Thank you so much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Query Loop Affects the Query Loop Block [Feature] Blocks Overall functionality of blocks [Feature] Interactivity API API to add frontend interactivity to blocks. [Type] Bug An existing feature does not function as intended
Projects
Development

Successfully merging a pull request may close this issue.

8 participants