Add types for shortcode package#67416
Add types for shortcode package#67416gziolo merged 4 commits intoWordPress:trunkfrom manzoorwanijk:update/add-types-for-shortcode-package
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. |
Sounds fine, but only makes sense if the file gets converted fully to TypeScript. |
Yes, that's the plan. |
gziolo
left a comment
There was a problem hiding this comment.
Nice one. Thank you for working on it.
I had only one question. We also should update the changelog to include the note that types are now available. 🎉
…or-shortcode-package
|
Adding changelog now |
* Add types for shortcode package * Remove WP Prefix * Update CHANGELOG.md Co-authored-by: manzoorwanijk <manzoorwanijk@git.wordpress.org> Co-authored-by: gziolo <gziolo@git.wordpress.org>
* Add types for shortcode package * Remove WP Prefix * Update CHANGELOG.md Co-authored-by: manzoorwanijk <manzoorwanijk@git.wordpress.org> Co-authored-by: gziolo <gziolo@git.wordpress.org>
What?
Add TS types for shortcode package.
Why?
To have better type safety and to unblock
blockspackage being converted to TSHow?
Unlike #60526, this PR extracts the JSDoc types to a
types.tsfile to expose types without making changes to the actual JS code.Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast
Next steps
@types/wordpress__shortcodeafter this PR gets merged and released to npm.shortcodeObject.assignto JS Class declaration for better code quality.