-
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
Add types for shortcode package #67416
Add types for shortcode package #67416
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. |
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.
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 |
be47330
to
4da692e
Compare
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.
Awesome, thank you!
* Add types for shortcode package * Remove WP Prefix * Update CHANGELOG.md Co-authored-by: manzoorwanijk <[email protected]> Co-authored-by: gziolo <[email protected]>
* Add types for shortcode package * Remove WP Prefix * Update CHANGELOG.md Co-authored-by: manzoorwanijk <[email protected]> Co-authored-by: gziolo <[email protected]>
What?
Add TS types for shortcode package.
Why?
To have better type safety and to unblock
blocks
package being converted to TSHow?
Unlike #60526, this PR extracts the JSDoc types to a
types.ts
file to expose types without making changes to the actual JS code.However, the next steps should be to convert
shortcode
Object.assign
to JS Class declaration for better code quality.Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast
Next steps
Deprecate
@types/wordpress__shortcode
after this PR gets merged and released to npm.