Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#61641 closed enhancement (fixed)

Block Bindings: Expose sources in the editor settings to consume them in the client

Reported by: santosguillamot Owned by: cbravobernal
Priority: normal Milestone: 6.7
Component: Editor Version: 6.6
Severity: normal Keywords: has-patch, has-unit-tests
Cc: Focuses:

Description

Add a new property to the editor settings to expose the block bindings sources registered in the server. This allows to reuse some of its properties like label and uses_context without having to replicate that in JavaScript.

It makes some block bindings editor functionalities work by default, improving the user experience, and it simplifies how sources are registered in the client.

Change History (10)

This ticket was mentioned in PR #7020 on WordPress/wordpress-develop by @santosguillamot.


2 years ago
#1

Originally explored in this other pull request: https://github.com/WordPress/wordpress-develop/pull/6456

## What?

It adds a new property to the editor settings to expose the block bindings sources registered in the server. This allows to reuse some of its properties like label and uses_context without having to replicate that in JavaScript.

## Why?

It makes some block bindings editor functionalities work by default, improving the user experience, and it simplifies how sources are registered in the client.

## How?

Add a new property including all the registered sources while the editor settings are being initialized.

Trac ticket: https://core.trac.wordpress.org/ticket/61641

#2 @sabernhardt
2 years ago

  • Component GeneralEditor

#3 @gziolo
2 years ago

  • Keywords needs-unit-tests added
  • Milestone Awaiting Review6.7

@gziolo commented on PR #7020:


2 years ago
#4

I’m wondering if we can update an existing unit test to validate the setting is correctly propagated to the editor

@santosguillamot commented on PR #7020:


2 years ago
#5

I’m wondering if we can update an existing unit test to validate the setting is correctly propagated to the editor

I have just added this new unit test to check that the registered sources are properly added to the editor settings: link.

#6 @cbravobernal
2 years ago

  • Owner set to cbravobernal
  • Resolutionfixed
  • Status newclosed

In 58798:

Block Bindings: Adds sources in the editor settings to consume them in the client

Adds a new property blockBindingsSources to the editor settings to expose the block bindings sources registered in the server.

Props santosguillamot, cbravobernal, gziolo, artemiosans.
Fixes #61641.

@cbravobernal commented on PR #7020:


2 years ago
#7

Completed with my first commit to Core in https://core.trac.wordpress.org/changeset/58798

#8 @czapla
2 years ago

In 58799:

Tests: Removes the obsolete Block Binding unregistration

Follow-up to [58798].
Props santosguillamot, cbravobernal, gziolo.
See #61641.

@noisysocks commented on PR #7020:


2 years ago
#9

Thanks for committing this early in the 6.7 cycle ❤️

#10 @ironprogrammer
2 years ago

  • Keywords has-unit-tests added; needs-unit-tests removed
Note: See TracTickets for help on using tickets.