TypeScript: Convert factory utils in data package to TS#67667
TypeScript: Convert factory utils in data package to TS#67667manzoorwanijk merged 7 commits intotrunkfrom
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
|
tyxla
left a comment
There was a problem hiding this comment.
Nothing further from my end 👍 Thank you @manzoorwanijk 🚀
| id: string | ||
| ) { | ||
| return getEntityRecordsPermissions( state, kind, name, id )[ 0 ]; | ||
| return getEntityRecordsPermissions( state, kind, name, [ id ] )[ 0 ]; |
There was a problem hiding this comment.
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.
I had done exactly that here #67667 (comment)
There was a problem hiding this comment.
I'll create a follow up PR to address that. Thanks.
There was a problem hiding this comment.
…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:
createSelectorcreateRegistrySelectorcreateRegistryControlWhy?
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