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

Pattern Overrides: Refactor pattern (wp:block) block to use the block binding editing API #59817

Closed
talldan opened this issue Mar 13, 2024 · 5 comments · Fixed by #60721
Closed
Labels
[Feature] Block bindings [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Type] Enhancement A suggestion for improvement.

Comments

@talldan
Copy link
Contributor

talldan commented Mar 13, 2024

What problem does this address?

As mentioned in #53705 (comment), it'd be good to explore making the pattern block use the block bindings useSource API that was introduced in #58085.

edit: useSource was replaced in Block bindings: don't use hooks, so this issue should now be about using that new block bindings editing API.

@talldan talldan added [Type] Enhancement A suggestion for improvement. [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced labels Mar 13, 2024
@SantosGuillamot
Copy link
Contributor

Note here that the useSource API will likely change during this release cycle. So we should probably wait to address this until that is done.

Having said that, I started this branch as an experiment to see how it could work. It's on my to-do list to review it and open an experimental PR at some point.

@talldan
Copy link
Contributor Author

talldan commented Mar 14, 2024

@SantosGuillamot How much time do you think that will take?

Hopefully it isn't something that will end up being merged very close to the 6.6 beta, I'd rather see these changes made early, and pattern overrides can even help inform the implementation.

@SantosGuillamot
Copy link
Contributor

Editing the value of the sources, which is what is needed for this use case, it's planned to be the top priority of block bindings for 6.6: link. And to do that, the API must meet the requirements for pattern overrides.

I can't say how much time it will take to be ready, but I feel confident that it will be available earlier in the release process.

@talldan
Copy link
Contributor Author

talldan commented Apr 3, 2024

@SantosGuillamot Is there an update on the status of useSource? Let me know if there's anything I can help with reviewing.

@SantosGuillamot
Copy link
Contributor

We've spent some time to understand better the different use cases and requirements for useSource to ensure that whatever we build works for the different sources, including pattern/overrides. I feel we have a better picture right now. I'm working on reorganizing the block bindings project on GitHub, and it's clearer how to approach it after that.

@talldan talldan linked a pull request Apr 18, 2024 that will close this issue
@talldan talldan changed the title Pattern Overrides: Refactor pattern (wp:block) block to use the block binding useSource function Pattern Overrides: Refactor pattern (wp:block) block to use the block binding editing API Apr 18, 2024
@github-project-automation github-project-automation bot moved this from 📥 Todo to ✅ Done in WordPress 6.6 Editor Tasks May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Block bindings [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Type] Enhancement A suggestion for improvement.
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants