blocks: Port over some of the type information for @wordpress/blocks from DefinitelyTyped#77393
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. |
|
I’m travelling for the next couple of days. I’ll get back to this next week if nobody beats me to it. |
manzoorwanijk
left a comment
There was a problem hiding this comment.
This looks good to me. I just have a suggestion for improved changelog entry.
|
Meanwhile, I have created a PR to get rid of some |
|
|
||
| ### registerBlockType | ||
|
|
||
| Registers a new block provided a unique name and an object defining its behavior. Once registered, the block is made available as an option to any editor interface where blocks are implemented. |
There was a problem hiding this comment.
It's unfortunate we lost this documentation, as it's one of the most important APIs in the block editor and I would fully expect people would be frequently referencing its API documentation through the developer site.
I'm guessing this is a case where the auto-documentation tool isn't able to handle function overloads we're adding, and the solution would be to improve the auto-documenter to handle those better?
There was a problem hiding this comment.
I'm guessing this is a case where the auto-documentation tool isn't able to handle function overloads we're adding, and the solution would be to improve the auto-documenter to handle those better?
Yes, the tool needs some improvement.
…from DefinitelyTyped (#77393) Co-authored-by: joshualip-plaudit <joshualipstone@git.wordpress.org> Co-authored-by: manzoorwanijk <manzoorwanijk@git.wordpress.org>
|
@manzoorwanijk / @aduth |
Previous versions of |
@manzoorwanijk The problem is that all of these changes have been going out as minor version updates (i.e. "15.16.0 -> 15.17.0" instead of "15.16.0 -> 16.0.0"), which means that even if I pin everything in my root package.json file, the updated (and incompatible) versions get downloaded because every pinned package that I have is using "^15.16.0" for |
@manzoorwanijk Yep. Called it. All of your changes in DefinitelyTyped/DefinitelyTyped#74886 got deployed as minor versions, which broke the processes I mentioned again. |
|
@manzoorwanijk / @aduth Any idea when this is going to get published? I'm using PNPM's overrides for now, but it's been over a week. |
|
You might be able to use the |
|
Thanks |

What?
Closes #77390
This PR adds in the generics that were missing and patches up some differences between the types added in #76312 and the underlying code. It also includes a couple of spots where I patched up mismatches between the types and the underlying logic of the
selectanddispatchcalls in the process of porting over the types.Why?
This PR fixes issues introduced by the differences between the types added in #76312 and the DefinitelyTyped version.
How?
I ported over the original typedefs where useful and tweaked the ones that didn't match. I didn't rename any of the new types, so there will still be compatibility issues in some cases, but those are fixable via a quick find-and-replace, so I didn't think that the added changes in this PR would be worth it
Testing Instructions
@types/wordpress__blockswith the built types