-
Notifications
You must be signed in to change notification settings - Fork 377
feat(react-table): convert react-table to typescript #2360
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
Conversation
|
PatternFly-React preview: https://patternfly-react-pr-2360.surge.sh |
9d7b156 to
e6197e3
Compare
ee460d4 to
c4e2d29
Compare
|
cc: @jenny-s51 - please feel free to begin converting tests in thanks for the help here! |
|
cc: @mturley - will definitely try to review this w/ you once through w/ first pass! |
|
Absolutely @priley86 ! At first glance this looks awesome, but I'll dig a little deeper and get back to you. Maybe early next week we can step through it together on a call. This is probably outside the scope of this PR, but I notice you're pulling in tslint.. do you have any opinion on moving to eslint-typescript in the future? or at least enabling the prettier plugin for tslint? currently we're not enforcing code formatting in our CI: #2362 It might be nice to resolve that either before or shortly after we add a bunch of new code like this, so we don't have as much churn later on. |
|
On 7/19/2019 3:13 PM, Mike Turley wrote:
Absolutely @priley86 <https://github.com/priley86> ! At first glance
this looks awesome, but I'll dig a little deeper and get back to you.
Maybe early next week we can step through it together on a call.
This is probably outside the scope of this PR, but I notice you're
pulling in tslint.. do you have any opinion on moving to
eslint-typescript in the future? or at least enabling the prettier
plugin for tslint? currently we're not enforcing code formatting in
our CI: #2362 <#2362>
It might be nice to resolve that either before or shortly after we add
a bunch of new code like this, so we don't have as much churn later on.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2360?email_source=notifications&email_token=AAD32QQZV2IDQPAWAQREBILQAIG5ZA5CNFSM4H3SPW6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2MQGRQ#issuecomment-513344326>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAD32QRVYBKHLGWSWR3FKULQAIG5ZANCNFSM4H3SPW6A>.
FWIW, Keycloak is using eslint with the @typescript-eslint/eslint-plugin
and @typescript-eslint/parser.
I chose this because the TypeScript team is embracing eslint over
tslint: https://eslint.org/blog/2019/01/future-typescript-eslint
|
|
heh ;) - you guys read my mind, I am actually in full support of this move to I chose to follow cc: @dgutride thoughts on this topic? |
|
I realize there was some existing history and this move off of tslint will take some time... |
|
@priley86 it sounds like it's outside the scope of this PR, but let's at least make sure we run Prettier on this code so it has a good start formatting-wise :) It might be worth getting Prettier to run as part of our tslint usage as a first step before we move to eslint.. I'm less concerned about which linter we have and more about just the fact that we have style rules disabled. As for the rest of this PR, I'll be mostly buried in meetings the next two days, so I hope to start a more thorough review on Wednesday. |
|
PatternFly-React preview: https://patternfly-react-pr-2360.surge.sh |
Yea, i believe it should be a different PR, but I'm glad others support this move to
added tslint and some tslint fixes: I've disabled these tslint rules since they will currently be breaking changes: This is more or less just to conform to the existing standards in |
|
PatternFly-React preview: https://patternfly-react-pr-2360.surge.sh |
adf97b7 to
84a943d
Compare
|
PatternFly-React preview: https://patternfly-react-pr-2360.surge.sh |
|
(still probably out of scope, sorry to clutter this thread, but one last thing) I see you added |
|
PatternFly-React preview: https://patternfly-react-pr-2360.surge.sh |
agreed! It does not look like it's functioning correctly. I'll give this a go after other changes are complete! |
2ce7b4b to
72be8ce
Compare
|
PatternFly-React preview: https://patternfly-react-pr-2360.surge.sh |
72be8ce to
5eb9fb7
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.
@dgutride I had approved (after building and installing with Cost management), but the current GitHub setting clears all approvals with each subsequent push.
61ff3bc to
fe06c8d
Compare
seanforyou23
left a comment
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 work! I pulled the simple example into the seed project and while it seems to render just fine, I get the following runtime warning;
Warning: Failed prop type: Invalid prop rows[1] supplied to Table.
FWIW I only see this when running in development mode, it isn't reported in production builds.
I don't see this with the other examples. The only other thing I noticed is that the "Table with headers that wrap" example also uses the CompactTable component name, I assume it's just from copy/pasta but could be confusing. Maybe give that example a more relevant name like WrappableHeadersTable or something of the sort?
mturley
left a comment
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.
@priley86 this was an insane amount of work, kudos! It will be really nice to have this all typesafe as a good foundation for evolving the table API.
I just have a few minor comments here and there (and some might be dumb questions, I'm still getting the hang of TypeScript). I apologize that it took me so long to find time to review this! I'll admit it was a little intimidating 😆
...ges/patternfly-4/react-inline-edit-extension/src/components/InlineEdit/editableRowWrapper.js
Show resolved
Hide resolved
...ges/patternfly-4/react-inline-edit-extension/src/components/InlineEdit/editableRowWrapper.js
Show resolved
Hide resolved
...ages/patternfly-4/react-inline-edit-extension/src/components/InlineEdit/editableTableBody.js
Show resolved
Hide resolved
packages/patternfly-4/react-table/src/components/Table/utils/decorators/classNames.ts
Outdated
Show resolved
Hide resolved
packages/patternfly-4/react-table/src/components/Table/utils/decorators/collapsible.tsx
Show resolved
Hide resolved
packages/patternfly-4/react-table/src/components/Table/utils/decorators/headerCol.tsx
Outdated
Show resolved
Hide resolved
packages/patternfly-4/react-table/src/components/Table/utils/decorators/selectable.tsx
Show resolved
Hide resolved
mturley
left a comment
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.
Oops, accidentally ticked the approve box on my last review.
That warning is interesting (and technically correct). Our Re: "WrappableHeadersTable" - updated! |
mturley
left a comment
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.
Looks great! Awesome job.
|
@dlabrecq and @karelhala, you guys will need to re-approve, sorry for the churn! |
|
thanks for the extensive review @mturley and @seanforyou23 ! Tried to capture all follow-ups in #2673. I believe all breaking changes related to types can come in that future PR... for now, just trying to keep existing consumers unaffected w/ this change. |
seanforyou23
left a comment
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.
👍
|
@dlabrecq @karelhala If you find anything wrong, please open a follow-up issue! |
|
Your changes have been released in:
Thanks for your contribution! 🎉 |
What:
Closes #1950 #2504 - React-Table TypeScript conversion.
Tableand many of the existing React-Table wrapping components to TSX.d.tsfiles for some components missing types so that react-table can be compiled w/noImplicitAnyset, cc: @ssilvertInternalDropdownItem)baseReactabular source to TSXbaseReactabular usage of Context w/ modernReact.createContextsyntaxDropdownto typescript - we'll needDropdownPositionandDropdownDirectiontypes in react-core at leastAdditional issues: