-
Notifications
You must be signed in to change notification settings - Fork 19
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
feat(KTable): add types [KHCP-6973] #1457
Conversation
✅ Deploy Preview for kongponents ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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 don't think we want to make the prop types so tight, can we loosen them to avoid typecasting in the host app?
We've had to back out changes like this already: #1299
src/components/KTable/KTable.vue
Outdated
SortColumnOrder, | ||
TableOptions, | ||
TableSortOrder, | ||
TableSortPayload, TableStatePayload, |
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.
TableSortPayload, TableStatePayload, | |
TableSortPayload, | |
TableStatePayload, |
nit
src/components/KTable/KTable.vue
Outdated
@@ -228,7 +239,7 @@ const props = defineProps({ | |||
* @param {Array} options.data - Array of Objects defining column data | |||
*/ | |||
options: { | |||
type: Object, | |||
type: Object as PropType<TableOptions>, |
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 have concerns about breaking existin implementations by making the prop types too strict. We want to avoid making users typecast as much as possible in the host app. Having to do things like
everywhere is not a great DX.
Can we keep the types loose in the prop defs and have the strict types on a local copy of the prop? We can just cast to the correct type like we do for our handling of the headers
prop:
https://github.com/Kong/kongponents/blob/main/src/components/KTable/KTable.vue#L729
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.
tried this new PR in khcp-ui and shared-ui, no ts errors
@DariaYeremina what do we need to do to get this PR merged? |
5c6fd22
to
f0ce39b
Compare
f0ce39b
to
a6323a0
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.
Will cause ts errors in
khcp-ui
and potentiallyshared-ui-components
andpublic-ui-components
Can you expand on this a bit more? What will be the issues?
With today's fixes there's no ts errors in hosted apps |
a6323a0
to
2251b10
Compare
# [8.120.0](v8.119.0...v8.120.0) (2023-08-01) ### Features * **KTable:** add types [KHCP-6973] ([#1457](#1457)) ([461aec6](461aec6))
🎉 This PR is included in version 8.120.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary
https://konghq.atlassian.net/browse/KHCP-6973
Add types for KTable
PR Checklist