-
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
DotTip: Rename id
attribute to tipId
#10317
DotTip: Rename id
attribute to tipId
#10317
Conversation
Note to reviewer: different e2e tests are failing each time I push. I can't replicate anything consistent locally. |
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.
LGTM 👍
@@ -58,19 +58,19 @@ export function DotTip( { | |||
} | |||
|
|||
export default compose( | |||
withSelect( ( select, { id } ) => { | |||
withSelect( ( select, { tipId } ) => { |
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.
Should we support id
as well in conjunction with a deprecated
call?
…void using common DOM attributes as prop names. Updates prop names where we're using the component, including in README examples and documentation. Updates related unit tests and snapshot. Removes eslint exception.
Thanks for the PR @ramonjd I pushed a change add the deprecation, I hope you don't mind :) |
No worries @youknowriad ! I had a change ready to commit, but wasn't sure about what to write in the deprecation text or which version was going out next, so I'm glad you got in first :) I had something like:
Thanks!! |
Oh sorry, I should have waited, both work though :). Let's wait for the test and merge. |
Resolves #10305
Description
This PR renames
id
prop on<DotTip />
totipId
to avoid using common DOM attributes as prop names.It also removes the eslint exception in the selector, thus reverting it back to its original rule.
How has this been tested?
Manually tested by viewing NUX tips in a new post. Execute
localStorage.setItem('WP_DATA_USER_1', '')
in the console to remove user data from locale storage if you've already dismissed tips beforeI also ran both unit and e2e tests.
npm run lint
against changes. Also ran against original props, e.g.,<DotTip id="core/editor.publish">
and received the following error:error Do not use string literals for IDs; use withInstanceId instead no-restricted-syntax
Screenshots
Types of changes
This PR renames the
id
prop totipId
, and correcting related side effects in the tests/snapshots.We're also updating the documentation to reflect this change, and removing the exception in the eslint selector.
Checklist: