-
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
TypeScript: Convert factory utils in data package to TS #67667
TypeScript: Convert factory utils in data package to TS #67667
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: +2 B (0%) Total Size: 1.83 MB
ℹ️ View Unchanged
|
Flaky tests detected in 7a6106b. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12195704141
|
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.
Nothing further from my end 👍 Thank you @manzoorwanijk 🚀
@@ -92,7 +92,7 @@ export function getEntityRecordPermissions( | |||
name: string, | |||
id: string | |||
) { | |||
return getEntityRecordsPermissions( state, kind, name, id )[ 0 ]; | |||
return getEntityRecordsPermissions( state, kind, name, [ id ] )[ 0 ]; |
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.
We need to update the getEntityRecordsPermissions
types instead of changing the passed argument. It accepts string|string[]
.
I know it's a bit odd, but that's due to the limitations of memoized selectors. Current change regresses #64091.
Screenshot
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 had done exactly that here #67667 (comment)
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.
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'll create a follow up PR to address that. Thanks.
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.
Thank you, @manzoorwanijk!
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.
…67770) * Update getEntityRecordsPermissions signature to allow string ids * Fix regression caused in #67667 Co-authored-by: manzoorwanijk <[email protected]> Co-authored-by: Mamaduka <[email protected]>
…s#67667 (WordPress#67770) * Update getEntityRecordsPermissions signature to allow string ids * Fix regression caused in WordPress#67667 Co-authored-by: manzoorwanijk <[email protected]> Co-authored-by: Mamaduka <[email protected]>
Supercedes #66746, which got closed after I deleted my fork 🤦
What?
This PR converts the factory utility functions in the data package to TS:
createSelector
createRegistrySelector
createRegistryControl
Why?
To enhance the DX
How?
By renaming the files to TS and updating the types
Testing Instructions
Just verify that CI is happy
Testing Instructions for Keyboard
Screenshots or screencast