-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Remove unused type packages #75413
Remove unused type packages #75413
Conversation
Hm, here's the error:
It must be trying to resolve types from the newer wp data package version which it doesn't actually support. |
This PR does not affect the size of JS and CSS bundles shipped to the user's browser. Generated by performance advisor bot at iscalypsofastyet.com. |
@@ -293,6 +290,7 @@ | |||
"@types/wordpress__editor": "npm:[email protected]", | |||
"@types/wordpress__notices": "npm:[email protected]", | |||
"@types/wordpress__rich-text": "npm:[email protected]", | |||
"@types/wordpress__data-controls/@wordpress/data": "npm:[email protected]", |
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.
This is ok because @wordpress/data
is only a dev dependency of the type package. Unfortunately DT doesn't allow dev dependencies, and using @wordpress/data
for the test file is important. However, the dependency doesn't impact the actual type definitions. (I know this because I had to updated the data-controls package yesterday, after removing the DT definitions for @wordpress/data
)
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.
Sounds good. I'd love to see all those hacks removed once all packages expose their own types.
@@ -166,12 +166,8 @@ | |||
"@types/uuid": "^8.3.4", | |||
"@types/validator": "^13.7.1", | |||
"@types/webpack-env": "^1.16.3", | |||
"@types/wordpress__api-fetch": "^3.2.4", | |||
"@types/wordpress__block-library": "^2.6.1", |
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.
block-library isn't used in calypso. While the other packages are, they bundle their own types (for quite a while actually)
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 cleanup, thanks 🚀
@@ -293,6 +290,7 @@ | |||
"@types/wordpress__editor": "npm:[email protected]", | |||
"@types/wordpress__notices": "npm:[email protected]", | |||
"@types/wordpress__rich-text": "npm:[email protected]", | |||
"@types/wordpress__data-controls/@wordpress/data": "npm:[email protected]", |
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.
Sounds good. I'd love to see all those hacks removed once all packages expose their own types.
Related to #74540
Proposed Changes
As part of work on Typescript and types with packages, I've been getting into a rabbit hole related to WordPress type definitions. This PR removes three DT packages since these types are provided by the packages themselves now.
Testing Instructions
TSC