-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Framework: Deprecate uid
in favor of clientId
#7990
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally prefer the concisness of uid
even if clientId
is more descriptive but noting that client
can have several meanings :)
Anyway, I don't care too much and this PR is very hard to review/upgrade. I kind of trust our tests for it, so I'm approving to avoid staling PR. (I took a look but it's not easy to validate all the implications)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also skimmed those changes. We have deprecations for both updated props in case of components and for updated selectors. We should still include some notes in the deprecation document.
`The \`${ prop }\` prop`, | ||
] ).join( ' ' ); | ||
|
||
deprecated( message, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a really cool usage of createHigherOrderComponent
👍
4b1a490
to
40b988c
Compare
Added a broad note to the
Rebased and did another pass of instances of |
Related: #7669
This pull request seeks to deprecate all references to "UID" in the codebase with equivalent "Client ID" naming. This change is being made in an effort to promote consistency on abbreviation capitalization, where, for example, previous selectors...
getAdjacentBlockUid
getBlockRootUID
...become:
getAdjacentBlockClientId
getBlockRootClientId
Observing the changes, you should see a number of other inconsistencies having been addressed here, including references to a block's
id
whereuid
is intended.Note: This is a massive pull request, which is prone to becoming stale very quickly. I'd urge that this be acted upon soon to avoid issues with merge conflicts.
Implementation notes:
This does include deprecations, not only for the selectors, but also covering components which we expose on
wp.editor
which accept some prop referencing a "uid". This is achieved through a new (and temporary)withDeprecatedUniqueId
higher-order component.Testing instructions:
Ensure all forms of automated tests pass.
Verify there are no lingering references to UID in the entire codebase, aside from those necessary for temporary compatibility until total removal.
Ensure that deprecations work effectively. Here's a test block as an example, whose
edit
function depends on both theid
prop being passed and theBlockTitle
component accepting auid
prop: