Skip to content

Reusable blocks: Mark API as experimental - #11230

Merged
gziolo merged 2 commits into
masterfrom
update/mark-reusable-block-api-as-experimental
Oct 30, 2018
Merged

gziolo merged 2 commits into
masterfrom
update/mark-reusable-block-api-as-experimental

Conversation

@noisysocks

Copy link
Copy Markdown
Member

The reusable block selectors and actions will need to change in the future when we finish the work in #7453.

This PR gives us some breathing room to make these changes after the API lockdown in 4.2 by marking all reusable block selectors and actions as __experimental.

Deprecated selectors:

  • getReusableBlock, getReusableBlocks – Best to use getEntityRecord instead
  • isFetchingReusableBlock – Best to use isResolving instead
  • isSavingReusableBlock – We'll likely add an equivalent core data selector for this

Deprecated actions:

  • fetchReusableBlocks, receiveReusableBlocks – Best to use getEntityRecords instead
  • saveReusableBlock, updateReusableBlockTitle – Best to use saveEntityRecord instead
  • convertBlockToStatic, convertBlockToRegular – Not likely to go away, but better safe than sorry

Untouched:

  • wp.blocks.isReusableBlock – This helper won't need to change.
  • getInserterItems – In the future we'll have to have this selector select from getEntityRecords(). Not sure if we should deprecate it to be safe...

To test:

npm run test-e2e reusable-blocks

@noisysocks noisysocks added the [Feature] Synced Patterns Related to synced patterns (formerly reusable blocks) label Oct 30, 2018
@noisysocks noisysocks added this to the 4.2 milestone Oct 30, 2018
@noisysocks
noisysocks force-pushed the update/mark-reusable-block-api-as-experimental branch from c9ac799 to 9b8ccac Compare October 30, 2018 05:58

@youknowriad youknowriad left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to work as intended for me 👍

Maybe just a generic message in the deprecated and changelogs:

The Reusable Blocks Data API is marked as experimental as it's subject to change in the future.

@gziolo

gziolo commented Oct 30, 2018

Copy link
Copy Markdown
Member

I will add it.

The reusable block selectors and actions will need to change in the
future. Give ourselves some breathing room to make these changes after
Gutenberg 4.2 by marking them as experimental.
@gziolo
gziolo force-pushed the update/mark-reusable-block-api-as-experimental branch from 9b8ccac to 175d3cc Compare October 30, 2018 14:51
@gziolo
gziolo force-pushed the update/mark-reusable-block-api-as-experimental branch from 175d3cc to 7975381 Compare October 30, 2018 14:53
@gziolo

gziolo commented Oct 30, 2018

Copy link
Copy Markdown
Member

Addressed with 7975381.

@gziolo
gziolo merged commit 70eea01 into master Oct 30, 2018
@gziolo
gziolo deleted the update/mark-reusable-block-api-as-experimental branch October 30, 2018 15:11
ellatrix added a commit that referenced this pull request Mar 11, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Synced Patterns Related to synced patterns (formerly reusable blocks)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants