Updating the typescript version, brings compiler errors with it. Currently we have a lot to do in Apollon, so this ticket is used to describe the changes which need to be done at a later point.
stricter checks on intersections and optional properties
more type inference, so that previously made type annotations are not correct anymore
Examples
Example 1: stricter checks on intersections and optional properties
This brings some problems, e.g. multiline.tsx:
The problem here is, that we have the property x and y coming multiple times in the tsx, one time from textProps and directly specified in the tsx. This should be easily solvable by manually handling the default value
The same problem applies to various places, where we have intersection types which include properties from different types with different type annotations for certain properties
Example 2: more type inference / different type inference
Also the types of event annotations have changed:
so e.g. FormEvent<HTMLInputElement> -> ChangeEvent<HTMLTextAreaElement> for onChange of text input fields
Example 2: more type inference / different type inference
in StyledTextfield
we now have to give a manual type declaration, because the inferred is marked as a compiler error . Be careful, just using type any will not solve the issue, because we want to achieve type safety and not disable typechecking use something like props: Props & { theme: Styles }
Is your feature request related to a problem?
Updating the typescript version, brings compiler errors with it. Currently we have a lot to do in Apollon, so this ticket is used to describe the changes which need to be done at a later point.
Describe the problems
For breaking changes, see: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-9.html#breaking-changes Especially relevant for us: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-9.html#stricter-checks-on-intersections-and-optional-properties With this change we have 56 compiler errors at first sight related to transpiling typescript to javascript. There are more issues, because fixing one of the issues resolves often in a chain of issues which need to be resolved
Causes:
Examples
Example 1: stricter checks on intersections and optional properties
This brings some problems, e.g. multiline.tsx:
The problem here is, that we have the property x and y coming multiple times in the tsx, one time from textProps and directly specified in the tsx. This should be easily solvable by manually handling the default value
The same problem applies to various places, where we have intersection types which include properties from different types with different type annotations for certain properties
Example 2: more type inference / different type inference
Also the types of event annotations have changed:
so e.g.
FormEvent<HTMLInputElement>
->ChangeEvent<HTMLTextAreaElement>
for onChange of text input fieldsExample 2: more type inference / different type inference
in StyledTextfield
we now have to give a manual type declaration, because the inferred is marked as a compiler error . Be careful, just using type
any
will not solve the issue, because we want to achieve type safety and not disable typechecking use something likeprops: Props & { theme: Styles }