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

Block Bindings iteration for WordPress 6.7 #63018

Open
9 of 31 tasks
SantosGuillamot opened this issue Jul 1, 2024 · 7 comments
Open
9 of 31 tasks

Block Bindings iteration for WordPress 6.7 #63018

SantosGuillamot opened this issue Jul 1, 2024 · 7 comments
Labels
[Feature] Block API API that allows to express the block paradigm. [Feature] Block bindings [Feature] Custom Fields Anything related to the custom fields project - connecting block attributes and dynamic values [Type] Iteration Scoped iteration of an effort from a tracking issue or overview issue ideally for a major release.

Comments

@SantosGuillamot
Copy link
Contributor

SantosGuillamot commented Jul 1, 2024

Iteration of the Block bindings API tracking issue.

This issue will be used to gather the new functionalities and bug fixes expected to be included in WordPress 6.7. It will serve to share regular updates and progress.

Please keep in mind that the list of issues will change once new ones come up.

For this iteration of WordPress 6.7, the focus will be on these items (no specific order):

  • Follow-ups from 6.6 and bug fixes: There were a few items that weren't included in the 6.6 iteration that will need some work. Additionally, bugs need to be addressed.
  • Add UI to connect attributes with the binding sources: Basically, add the first iteration to be able to create the bindings through the UI instead of having to go to the Code Editor.
  • Polish and open block bindings editor’s APIs for extenders: Core sources like "Post Meta" use some private APIs to handle bindings in the editor. The idea is to polish those APIs to enable external developers to use them.
  • Experiment supporting more core sources: In order to ensure that the editor APIs fit future use cases, it'd be great to add support for more core sources, or at least experiment with them in case we want to create them in the future.
  • Support anything needed by pattern overrides: We can expect some work needed to support new functionalities in pattern overrides.

EDIT: I created a new section for "Saving workflows" after the issues raised and because it seems a big topic to be discussed.

Follow-ups and bug fixes

UI to create bindings

Polish and open editor APIs

Support for more core sources

  • Create an experiment to support taxonomy meta and decide if it should be included as a core source.
  • Create an experiment to support site data and decide if it should be included as a core source.
  • Create an experiment to support post data and decide if it should be included as a core source.

Saving workflows

It isn't still clear if saving workflows should be modified or not as discussed here.

Backports

@SantosGuillamot SantosGuillamot added [Feature] Block API API that allows to express the block paradigm. [Feature] Custom Fields Anything related to the custom fields project - connecting block attributes and dynamic values [Type] Iteration Scoped iteration of an effort from a tracking issue or overview issue ideally for a major release. [Feature] Block bindings labels Jul 1, 2024
@fabiankaegy
Copy link
Member

@SantosGuillamot Thank you for creating this new iteration issue :)

Do you think it is feasible as part of 6.7 to aim for opening up the block bindings features (and therefore block pattern overrides) to 3rd party blocks / extenders?

@SantosGuillamot
Copy link
Contributor Author

Do you think it is feasible as part of 6.7 to aim for opening up the block bindings features (and therefore block pattern overrides) to 3rd party blocks / extenders?

I'm afraid it will probably take more time than this release. To give more context, block bindings heavily rely on the HTML API, which still lacks a few functionalities to safely interact and modify any HTML element. It needs to ensure that it doesn't create any security issues or break the page. For core blocks where the markup is controlled, this isn't a big problem, but opening it for any 3rd party block, which could have any markup, could trigger unexpected issues. Additionally, a new opt-in mechanism would need to be defined.

Hopefully, if I am not mistaken, the HTML API is not far from being able to handle these use cases, so I believe it should probably be one of the top priorities for upcoming releases.

In the meantime, if there is a need to support other core blocks, those could be considered.

@SantosGuillamot
Copy link
Contributor Author

I've opened a couple of pull requests/discussion that will affect the editor public APIs in case anyone wants to share feedback:

@gziolo
Copy link
Member

gziolo commented Jul 9, 2024

Thank you for opening the iteration for WordPress 6.7.

Add UI to connect attributes with the binding sources: Basically, add the first iteration to be able to create the bindings through the UI instead of having to go to the Code Editor.

That sounds like a potential key highlight in the release. It was one of the most anticipated features so far based on the feedback received. In particular, it will be interesting in conjunction with the Pattern Overrides design interface.

Polish and open block bindings editor’s APIs for extenders: Core sources like "Post Meta" use some private APIs to handle bindings in the editor. The idea is to polish those APIs to enable external developers to use them.

This is another key aspect of opening the counterpart for the server-side API exposed in WordPress 6.5. It will also require some glue layer to pass some data from the server to the client to represent better custom sources that get registered only on the server in the UI.

@SantosGuillamot
Copy link
Contributor Author

SantosGuillamot commented Jul 13, 2024

Update

There have been three main areas of work during the last weeks

UI to create bindings

The issue to discuss the potential workflows is receiving a lot of feedback, which is amazing 👏

The idea is to try to approach it progressively. Start with a basic version and keep iterating on top of that. That way, it adds value and let us test as soon as possible, which should help with the discussion.

We have started working on an initial prototype in this pull request, which is not far from ready.

Polish editor APIs

There have been a bunch of pull requests going on to polish the editor APIs in order to make them ready to be opened. I feel confident that it is on good track and it is a matter of making some decisions and review the existing code.

So far, these are the things that need to be solved before making them public:

Most of them seems to be working. Once they are merged, I feel the APIs could be open in Gutenberg.

Additionally, we have been working on:

This one is not strictly needed to open the APIs, but I consider it important, and it seems to be working.

Saving workflows

While working on improving the saving workflows for post meta ((granular post meta changes and fixing/refactoring the logic for the “Site Updated” message), some important issues where raised that made us revert the current behavior in this pull request.

For that reason, we decided to take one step back and open a new issue to gather all the context to ensure we make informed decisions and avoid more issues like these ones in the future.

The idea is to discuss there how the saving workflows should work and split it into smaller tasks once it is clearer. It'd be great to get more thoughts there.

Next steps

These are what I considered that could be the next steps for the upcoming weeks:

  • Keep the discussion and the prototype around the UI going.
  • Review and make decisions around the editor APIs to start merging the changes progressively.
  • Solve the remaining issues listed in the opening post, especially the bugs.
  • Foster the discussion around saving workflows.

We could also start working on experimenting with potential future core sources to ensure the editor APIs fit their use case. Although we must be aware that the editor APIs are likely going to change in the mentioned PRs.

@bacoords
Copy link
Contributor

Would love to see if this is feasible: #63763

@SantosGuillamot
Copy link
Contributor Author

Would love to see if this is feasible: #63763

Personally, I would prefer to focus on the internals and add support for more core blocks once the right abstractions are in place and "hardcoding" is not needed. But I'm happy to help, review, or guide if this is wanted for pattern overrides and someone plans to work on that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Block API API that allows to express the block paradigm. [Feature] Block bindings [Feature] Custom Fields Anything related to the custom fields project - connecting block attributes and dynamic values [Type] Iteration Scoped iteration of an effort from a tracking issue or overview issue ideally for a major release.
4 participants