Make WordPress Core

Opened 3 weeks ago

Closed 12 days ago

Last modified 10 days ago

#61641 closed enhancement (fixed)

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

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

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 (9)

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


3 weeks 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
3 weeks ago

  • Component changed from General to Editor

#3 @gziolo
2 weeks ago

  • Keywords needs-unit-tests added
  • Milestone changed from Awaiting Review to 6.7

@gziolo commented on PR #7020:


2 weeks 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 weeks 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
12 days ago

  • Owner set to cbravobernal
  • Resolution set to fixed
  • Status changed from new to closed

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:


12 days ago
#7

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

#8 @czapla
12 days 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:


10 days ago
#9

Thanks for committing this early in the 6.7 cycle ❤️

Note: See TracTickets for help on using tickets.