Block API: Deprecate id
prop in favor of clientId
#7669
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related: #6741 (comment)
This pull request seeks to propose deprecating the block
id
prop, which was never consistent, with a new standardization toward referencing a block'suid
as itsclientId
. This is also intended as part of a capitalization normalization effort, where equivalent selectors and internal props are planned to be updated as well. The idea with the changes here are to deprecate early for the public-facing API, ahead of the upcoming 3.2 release.Testing instructions:
Verify there are no regressions in the behavior of blocks.
To my knowledge, no core blocks use the
id
prop. You can add this to an existing block to test that the deprecated warning is shown, but the behavior ofid
is otherwise unaffected.Related: Confirmation that destructuring of objects triggers getters (and therein the
deprecated
), thus not requiring a warning to be shown except in the case of blocks making use of this prop:https://codepen.io/aduth/pen/VdRmav?editors=1111