-
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
TypeScript project references for infra plugin #90118
Conversation
@@ -9,67 +9,67 @@ | |||
"exclude": ["../typings/jest.d.ts"], | |||
"references": [ | |||
{ "path": "../../src/core/tsconfig.json" }, | |||
{ "path": "../../src/plugins/telemetry_management_section/tsconfig.json" }, |
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.
Alphabetized these.
Oh wow, thanks a ton for jumping in, @smith ❤️ |
@@ -285,7 +285,7 @@ export const ESTopHitsAggRT = rt.type({ | |||
top_hits: rt.object, | |||
}); | |||
|
|||
interface SnapshotTermsWithAggregation { | |||
export interface SnapshotTermsWithAggregation { |
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.
Because of TS4023 (microsoft/TypeScript#5711) some additional interfaces need to be exported because we're emitting declarations:
x-pack/plugins/infra/server/routes/snapshot/lib/get_metrics_aggregations.ts:29:14 - error TS4023: Exported variable 'metricToAggregation' has or is using name 'SnapshotTermsWithAggregation' from external module "/Users/smith/Code/kibana/x-pack/plugins/infra/common/inventory_models/types" but cannot be named.
@@ -47,19 +47,19 @@ const wrapWithSharedState = () => { | |||
return null; | |||
} | |||
|
|||
private getTitle(title: TitleProp) { | |||
public getTitle(title: TitleProp) { |
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 is returning an anonymous class expression so private
/protected
are not permitted if we're emitting declarations. (TS4094/microsoft/TypeScript#30355)
@@ -26,7 +26,7 @@ const initialState = { | |||
|
|||
type State = Readonly<typeof initialState>; | |||
|
|||
export const CustomFieldPanel = class extends React.PureComponent<Props, State> { | |||
export class CustomFieldPanel extends React.PureComponent<Props, State> { |
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.
Export a named class instead of expression. (TS4094/microsoft/TypeScript#30355)
This is almost working but we're getting some EUI-related errors:
In these errors the types are not exported from EUI. Looking at this to see if there's a workaround or if we need to export these from EUI. |
Another error we're getting is related to the string enum export of
I'm not sure string enums get emitted as you would expect, so this may need to be converted into an object to work correctly. |
jenkins test this |
The issues with EUI are resolved. Working on fixing the problem with the Comparator enum. |
jenkins test this |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
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.
Thanks again for driving this, @smith!
Co-authored-by: Felix Stürmer <stuermer@weltenwort.de>
Fixes #80995. References #81003. References #80508.