Skip to content
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

Convert lock unlock to generics #66682

Merged

Conversation

manzoorwanijk
Copy link
Member

What?

Addresses the feedback given in #66667 (comment)

Why?

To allow better type support for lock and unlock functions

How?

This PR makes lock and unlock as generics to set the object type

Testing Instructions

Testing Instructions for Keyboard

Screenshots or screencast

Copy link

github-actions bot commented Nov 1, 2024

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: manzoorwanijk <[email protected]>
Co-authored-by: youknowriad <[email protected]>
Co-authored-by: jsnajdr <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@manzoorwanijk
Copy link
Member Author

@jsnajdr Should I fix those types that are affected by the updated signature?

There are 7 errors in total, fixable by 3-4 minor changes

@tyxla tyxla added [Type] Code Quality Issues or PRs that relate to code quality [Package] Private APIs /packages/private-apis labels Nov 6, 2024
@manzoorwanijk
Copy link
Member Author

@jsnajdr this one addresses your feedback given in #66667 (comment).

Can we get this through?

Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me. I'd appreciate @jsnajdr's thoughts too.

Copy link
Member

@jsnajdr jsnajdr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this looks good. We don't have any real-world usages of the types yet, so we are not sure that they are the correct ones, but we can patch that when some problem is uncovered.

@manzoorwanijk
Copy link
Member Author

Thank you folks. I can't merge PRs here. Please go ahead whenever you want.

Copy link
Member

@tyxla tyxla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @manzoorwanijk, this looks great! I'll get it shipped 🚀

@jsnajdr jsnajdr merged commit 5efeef9 into WordPress:trunk Nov 28, 2024
64 checks passed
@manzoorwanijk manzoorwanijk deleted the update/convert-lock-unlock-to-generics branch November 28, 2024 15:45
@github-actions github-actions bot added this to the Gutenberg 19.9 milestone Nov 28, 2024
im3dabasia pushed a commit to im3dabasia/gutenberg that referenced this pull request Dec 4, 2024
* Convert lock unlock to generics

* Set object type from generic for unlock

* Fix types affected by updated signature of lock/unlock

* Improve signature

* Remove expected errors no longer needed

* Restore the type for component private APIs

Co-authored-by: manzoorwanijk <[email protected]>
Co-authored-by: youknowriad <[email protected]>
Co-authored-by: jsnajdr <[email protected]>
michalczaplinski pushed a commit that referenced this pull request Dec 5, 2024
* Convert lock unlock to generics

* Set object type from generic for unlock

* Fix types affected by updated signature of lock/unlock

* Improve signature

* Remove expected errors no longer needed

* Restore the type for component private APIs

Co-authored-by: manzoorwanijk <[email protected]>
Co-authored-by: youknowriad <[email protected]>
Co-authored-by: jsnajdr <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Private APIs /packages/private-apis [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants