-
Notifications
You must be signed in to change notification settings - Fork 619
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
CONSOLE-2501: Upgrade to Typescript v4 #10432
Conversation
please review @spadgett @vojtechszocs @rawagner @christianvogt |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: glekner The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
e415e7f
to
3f993e3
Compare
@@ -166,7 +166,6 @@ export const createFlashSystemPayload: CreatePayload<FlashSystemState> = ( | |||
const storageSecretTemplate: SecretKind = { | |||
apiVersion: apiVersionForModel(SecretModel), | |||
stringData: { | |||
// eslint-disable-next-line @typescript-eslint/camelcase |
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.
Hm, I don't see why this comment could be removed. We want the camelcase rule active for most of the code. Did the defaults change?
frontend/packages/dev-console/src/components/catalog/providers/useBuilderImages.tsx
Outdated
Show resolved
Hide resolved
@@ -79,6 +79,7 @@ const ClusterInventoryItem = withDashboardResources<ClusterInventoryItemProps>( | |||
}); | |||
}, [mapperLoader]); | |||
|
|||
// eslint-disable-next-line react-hooks/exhaustive-deps |
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.
Why was this needed?
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.
resolves
The 'additionalResourcesData' object makes the dependencies of useCallback Hook (at line 105) change on every render. To fix this, wrap the initialization of 'additionalResourcesData' in its own useMemo()
no need for useMemo here
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.
That sounds like a legitimate problem that shouldn't be ignored?
@@ -1,3 +1,4 @@ | |||
/* eslint-disable react-hooks/exhaustive-deps */ |
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.
Let's avoid adding this at the top of the file. It's better to apply only where it's needed.
@@ -1,3 +1,4 @@ | |||
/* eslint-disable react-hooks/exhaustive-deps */ |
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.
Same comment here.
@@ -101,6 +101,7 @@ export const FilterToolbar: React.FC<FilterToolbarProps> = ({ | |||
const labelFilterQueryArgumentKey = uniqueFilterName | |||
? `${uniqueFilterName}-${labelFilter}` | |||
: labelFilter; | |||
// eslint-disable-next-line react-hooks/exhaustive-deps |
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.
Why was this needed?
@@ -11,6 +11,7 @@ export const useIsVisible = (ref) => { | |||
} | |||
}; | |||
|
|||
// eslint-disable-next-line react-hooks/exhaustive-deps |
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.
Why was this needed?
We'll need to solve this error:
|
|
|
I spoke to Kim and she suggested creating a branch based on glekner:ts4/a new PR and then close this. I'll take a look at the GH comments before I do that to make sure they have been addressed first. |
@rebeccaalpert I fixed the TS compilation error. The only remaining issue AFAIK is jest. I assume the current version of |
@glekner: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
@glekner: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Closing this per Kim. I will work on fixing tests and resolving open comments in this PR in the new PR. |
4.2.4
ts-loader
andForkTsCheckerWebpackPlugin
versions. cli logs about ts errors are now a lot clearer.i18n-parser
to support ts4@typescript-eslint/eslint-plugin
and@typescript-eslint/parser
from v2 to v5eslint-plugin-react-hooks
to v4 - Added lots of missinguseMemo
sReact
JSX
Chainable<Subject>
toChainable
(cypress). eslint would shout about unused vars, and since updating versionsSubject
is the default typeinterface Cypress.Chainable<Subject = any>
CLI Errors:
![Screen Shot 2021-11-10 at 19 42 18](https://user-images.githubusercontent.com/24938324/141165092-2448eec2-d8a1-4ce7-8c9a-8761df590e56.png)
Before
After
![Screen Shot 2021-11-10 at 19 35 50](https://user-images.githubusercontent.com/24938324/141165123-61731ab3-7355-4a1d-bc6f-fb945c5abc21.png)