-
Notifications
You must be signed in to change notification settings - Fork 4.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
DataViews: Full type the dataviews package #61854
Conversation
} ); | ||
} | ||
|
||
// A type assertion is used here to keep the type argument. |
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.
I wonder why React doesn't do this by default using generics.
This reverts commit 78f2ac82066e53b8db43d1384ba2138efe014e6b.
ce5738b
to
e4ab2ce
Compare
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 know we shouldn't be using "as" too much but I'm not sure how to fix the ViewComponent thing, so I've used that for now. Consider updating it if you have a better solution. |
Size Change: -2.56 kB (-0.15%) Total Size: 1.74 MB
ℹ️ View Unchanged
|
Flaky tests detected in 9399bcc. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/9255893962
|
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 seems reasonable. I'd love to find a way to avoid the type assertion, but that may be more effort than it's worth at this time.
Co-authored-by: youknowriad <youknowriad@git.wordpress.org> Co-authored-by: sirreal <jonsurrell@git.wordpress.org>
Co-authored-by: youknowriad <youknowriad@git.wordpress.org> Co-authored-by: sirreal <jonsurrell@git.wordpress.org>
Related #55083
Follow-up to #61185
What?
The DataViews package is a types heavy package. There's a lot of structures that need to be documented properly. So this continues the effort to add explicit types to the package. This PR types the root level DataViews component which basically makes the package fully typed.
Testing instructions
There should be no real change here, it's mostly code quality and documentation.