Skip to content

Upgrade typescript to 2.9.2#20757

Merged
weltenwort merged 3 commits intoelastic:masterfrom
weltenwort:enhancement-upgrade-typescript-2-9-2
Jul 16, 2018
Merged

Upgrade typescript to 2.9.2#20757
weltenwort merged 3 commits intoelastic:masterfrom
weltenwort:enhancement-upgrade-typescript-2-9-2

Conversation

@weltenwort
Copy link
Member

@weltenwort weltenwort commented Jul 13, 2018

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 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

@elasticmachine
Copy link
Contributor

💔 Build Failed

@weltenwort weltenwort force-pushed the enhancement-upgrade-typescript-2-9-2 branch from 6b5af5b to 0c41656 Compare July 13, 2018 12:06
@weltenwort weltenwort requested review from azasypkin and spalger July 13, 2018 12:07
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@spalger spalger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

tsconfig.json Outdated
Copy link
Contributor

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

certainly: elastic/eui#1016

Copy link
Contributor

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 ?

Copy link
Member Author

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!

Copy link
Contributor

@azasypkin azasypkin left a 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!

@elasticmachine
Copy link
Contributor

💚 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
@weltenwort weltenwort force-pushed the enhancement-upgrade-typescript-2-9-2 branch from 518ccb7 to d3aa6b5 Compare July 16, 2018 20:54
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@weltenwort weltenwort merged commit 4b255e9 into elastic:master Jul 16, 2018
weltenwort added a commit to weltenwort/kibana that referenced this pull request Jul 16, 2018
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
weltenwort added a commit that referenced this pull request Jul 17, 2018
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants