Make WordPress Core

Opened 5 months ago

Closed 5 months ago

Last modified 8 weeks 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, has-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 (10)

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


5 months 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
5 months ago

  • Component changed from General to Editor

#3 @gziolo
5 months ago

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

@gziolo commented on PR #7020:


5 months 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:


5 months 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
5 months 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:


5 months ago
#7

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

#8 @czapla
5 months 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:


5 months ago
#9

Thanks for committing this early in the 6.7 cycle ❤️

#10 @ironprogrammer
8 weeks ago

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