-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Upgrade typescript to 2.9.2 #20757
Upgrade typescript to 2.9.2 #20757
Conversation
💔 Build Failed |
6b5af5b
to
0c41656
Compare
💚 Build Succeeded |
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.
LGTM
"forceConsistentCasingInFileNames": true | ||
"forceConsistentCasingInFileNames": true, | ||
|
||
// Disable the breaking keyof behaviour introduced in TS 2.9.2 until EUI is updated to support that too |
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.
question: could you please file an issue in eui repo for that?
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.
certainly: elastic/eui#1016
@@ -146,7 +147,7 @@ function siblingRef<T>(key: string): SiblingReference<T> { | |||
return new SiblingReference(key); | |||
} | |||
|
|||
function conditional<A, B, C>( | |||
function conditional<A extends SchemaLike, B, C>( |
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.
issue: hmm, I don't really like the signature of SchemaLike
: string | number | boolean | object | null | Schema | SchemaMap
since it exposes internal Schema
and SchemaMap
to the outside.
At this stage I'd rather prefer if we have something like export type ConditionalTypeValue = string | number | boolean | object | null;
inside of conditional_type.ts
that is re-exported in src/core/server/config/schema/types/index.ts
and used here.
What do you think @weltenwort ?
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.
Good catch, fixed in the latest commit - thanks!
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.
LGTM once CI is green. Briefly tested locally, haven't noticed any issues. Thanks!
💚 Build Succeeded |
This resolves problems arising from breaking changes in the new TypeScript version by... * setting the `keyofStringsOnly` option until impacted code has been future-proofed * Restricting some joi-related generics
518ccb7
to
d3aa6b5
Compare
💚 Build Succeeded |
This upgrades TypeScript to version 2.9.2. My main motivation is the support for generic type arguments in JSX elements and tagged templates (e.g. for `styled-components`). Problems arising from breaking changes in the new TypeScript version have been mitigated by: * setting the `keyofStringsOnly` option until impacted code has been future-proofed * Restricting some joi-related generics See the [release notes](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-9.html) for details. Some follow-up tasks should be: * Update EUI to support the new `keyof` behaviour * Update new platform TypeScript code to support new `keyof` behaviour * Remove `keyofStringsOnly` setting
This upgrades TypeScript to version 2.9.2. My main motivation is the support for generic type arguments in JSX elements and tagged templates (e.g. for `styled-components`). Problems arising from breaking changes in the new TypeScript version have been mitigated by: * setting the `keyofStringsOnly` option until impacted code has been future-proofed * Restricting some joi-related generics See the [release notes](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-9.html) for details. Some follow-up tasks should be: * Update EUI to support the new `keyof` behaviour * Update new platform TypeScript code to support new `keyof` behaviour * Remove `keyofStringsOnly` setting
This upgrades TypeScript to version 2.9.2. My main motivation is the support for generic type arguments in JSX elements and tagged templates (e.g. for
styled-components
).Problems arising from breaking changes in the new TypeScript version have been mitigated by:
keyofStringsOnly
option until impacted code has beenfuture-proofed
See the release notes for details.
Some follow-up tasks should be:
keyof
behaviourkeyof
behaviourkeyofStringsOnly
setting