-
Notifications
You must be signed in to change notification settings - Fork 710
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
Replace react-scripts-ts with official react-scripts #1823
Conversation
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.
Wow - great work Andres. A bunch of comments mainly to do with any
(which you mentioned was just temporary) and some other irregularities that aren't obvious. But we can deal with those in a followup if needed.
"last 1 chrome version", | ||
"last 1 firefox version", | ||
"last 1 safari version" | ||
] |
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 looks interesting!? https://create-react-app.dev/docs/supported-browsers-features/#configuring-supported-browsers
@@ -9,14 +9,14 @@ import SelectRepoForm from "../SelectRepoForm"; | |||
import UpgradeForm from "../UpgradeForm"; | |||
|
|||
export interface IAppUpgradeProps { | |||
app: IRelease; | |||
app?: IRelease; |
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.
Eek, why are these changing to optional props? (and then the bangs below saying they're always defined)
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.
they are undefined while the call to getAppWithUpdateInfo
is being executed, we can avoid the bangs though
@@ -27,7 +27,7 @@ export interface IAppUpgradeProps { | |||
values?: string, | |||
schema?: JSONSchema4, | |||
) => Promise<boolean>; | |||
fetchChartVersions: (namespace: string, id: string) => Promise<IChartVersion[]>; | |||
fetchChartVersions: (namespace: string, id: string) => Promise<any>; |
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.
Interested to test why this is needed too (though I trust that it is).
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.
well, actually is not any, but it could be undefined
@@ -33,7 +33,7 @@ describe("AppViewComponent", () => { | |||
namespace: "weee", | |||
}); | |||
|
|||
const validProps: IAppViewProps = { | |||
const validProps = { |
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.
Ditto (marking now so if I land this I can check these points myself).
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.
here is because if I let the IAppViewProps
, then validProps.app
may be undefined (according to ts) but if I don't set the type, validProps.app
is always defined and I don't need to change any test.
@@ -19,7 +19,7 @@ import ResourceTable from "./ResourceTable"; | |||
export interface IAppViewProps { | |||
namespace: string; | |||
releaseName: string; | |||
app: IRelease; | |||
app?: IRelease; |
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.
Ditto
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 reason, app will be undefined while fetching
handleBasicFormParamChange: ( | ||
p: IBasicFormParam, | ||
) => (e: React.FormEvent<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>) => void; | ||
handleBasicFormParamChange: (param: IBasicFormParam) => (e: React.FormEvent<any>) => void; |
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.
Check.
import LoadingWrapper, { ILoadingWrapperProps, LoaderType } from "./LoadingWrapper"; | ||
export { ILoadingWrapperProps, LoaderType }; | ||
import LoadingWrapper, { LoaderType } from "./LoadingWrapper"; | ||
export { LoaderType }; |
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.
Ah - related to one of my questions above.
@@ -19,7 +19,7 @@ interface IOperatorViewProps { | |||
namespace: string; | |||
error?: Error; | |||
push: (location: string) => RouterAction; | |||
getCSV: (namespace: string, name: string) => Promise<IClusterServiceVersion>; | |||
getCSV: (namespace: string, name: string) => Promise<any>; |
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.
Check.
@@ -33,7 +33,7 @@ export interface IUpgradeFormProps { | |||
) => Promise<boolean>; | |||
push: (location: string) => RouterAction; | |||
goBack: () => RouterAction; | |||
fetchChartVersions: (namespace: string, id: string) => Promise<IChartVersion[]>; | |||
fetchChartVersions: (namespace: string, id: string) => Promise<any>; |
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.
Check
@@ -31,7 +31,6 @@ describe("Config", () => { | |||
}); | |||
|
|||
it("does not returns the overriden namespace if NODE_ENV=production", async () => { | |||
process.env.NODE_ENV = "production"; |
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.
Guessing there was some other reason for removing this, but it appears to make this contradict the previous one above, yet they both pass?
Description of the change
The official
react-scripts
package supports TS so we don't need to keep using the outdatedreact-script-ts
. I based the migration in the steps described here: https://joshblog.net/2018/upgrading-a-react-and-typescript-app-from-react-scripts-ts-to-create-react-app-v2-1/. For that I had to:package.json
andtsconfig.json
with some new properties/config options.Applicable issues