Skip to content

Use more complete implementation of Omit in TypeScript definitions#322

Merged
weltenwort merged 3 commits intoelastic:masterfrom
weltenwort:enhancement/ts-types-2
Jan 26, 2018
Merged

Use more complete implementation of Omit in TypeScript definitions#322
weltenwort merged 3 commits intoelastic:masterfrom
weltenwort:enhancement/ts-types-2

Conversation

@weltenwort
Copy link
Member

The TypeScript definitions for EuiContextMenu caused errors that seemed to result from usage of the Omit<> helper. It might be fixed with microsoft/TypeScript#21148, which is expected to be included in 2.7.1.

The types in EuiContextMenu caused errors that seemed to result from
usage of the `Omit<>` helper. It might be fixed with
microsoft/TypeScript#21148, which is expected
to be included in 2.7.1.
@weltenwort weltenwort added the breaking change PRs with breaking changes. (Don't delete - used for automation) label Jan 19, 2018
@weltenwort weltenwort self-assigned this Jan 19, 2018
@weltenwort weltenwort removed the breaking change PRs with breaking changes. (Don't delete - used for automation) label Jan 19, 2018
Copy link
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

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

@weltenwort Would you like a real review or were you just pinging me so I'm aware of this? If the former then I'll need some hand-holding because I have a toddler's understanding of TS.

@weltenwort
Copy link
Member Author

I guess it was more for awareness. I just didn't know whom else to tag, who is familiar with the inner workings of EUI. How do we want to handle upcoming TS PRs?

@snide
Copy link
Contributor

snide commented Jan 19, 2018 via email

The previous implementation of the `Omit` type did not support optional
and readonly fields, which led to type errors when using the
components.
@weltenwort weltenwort force-pushed the enhancement/ts-types-2 branch from bfb86ab to 9b769e7 Compare January 19, 2018 18:51
@weltenwort weltenwort changed the title Work around errors in the EuiContextMenu TypeScript definitions Use more complete implementation of Omit in TypeScript definitions Jan 19, 2018
@weltenwort
Copy link
Member Author

Ok, I seem to have found the root cause: The previous implementation of Omit did not preserve the readonly and ? (optional) characteristics of properties. The new implementation apparently does not have that problem.

@weltenwort weltenwort merged commit f362777 into elastic:master Jan 26, 2018
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