Skip to content

[monitoring] fixup types#114342

Merged
spalger merged 3 commits intoelastic:masterfrom
spalger:fix/monitoring-types
Oct 11, 2021
Merged

[monitoring] fixup types#114342
spalger merged 3 commits intoelastic:masterfrom
spalger:fix/monitoring-types

Conversation

@spalger
Copy link
Copy Markdown
Contributor

@spalger spalger commented Oct 7, 2021

In #114295 I'm working on re-enabling type checking for .d.ts files, which was disabled previously but folks have taken issue with this because we're apparently still using .d.ts files in a large number of places. Monitoring uses .d.ts files in a large number of places to deal with a legacy codebase still written in JavaScript, many of which are new since we disabled checking these files.

This PR fixes all the type errors in a couple different ways:

  • when the module being typed by a .d.ts file was simple enough, the source file was just converted to TypeScript
  • import necessary types, or replace un-imported Props types with Record<any, any>
  • in some cases a sub-set of the exports were typed by an index.d.ts file, so I converted those index.js files to index.ts and typed the imports, making it easier to remove .d.ts files in the future as components are converted to TS and now new .js exports will trigger type failures to encourage gradual migration to TS

The functionality of the monitoring plugin shouldn't be effected by these changes, though please double check that they all make sense to you.

[skip ci]

@spalger spalger added Team:Monitoring Stack Monitoring team v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.16.0 labels Oct 7, 2021
@spalger spalger force-pushed the fix/monitoring-types branch from 3dcdba5 to c96fd7c Compare October 7, 2021 19:27
@spalger spalger force-pushed the fix/monitoring-types branch from c96fd7c to 34f87ba Compare October 7, 2021 19:28
@elastic elastic deleted a comment from kibanamachine Oct 7, 2021
@spalger spalger marked this pull request as ready for review October 8, 2021 00:04
@spalger spalger requested a review from a team as a code owner October 8, 2021 00:04
@spalger spalger requested review from a team October 8, 2021 00:04
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/stack-monitoring (Team:Monitoring)

Copy link
Copy Markdown
Contributor

@matschaffer matschaffer left a comment

Choose a reason for hiding this comment

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

All looks reasonable to me. I'm sure if this causes issues with the angular removal work we'll notice fairly soon since we've started on sorting out the functional tests last week.

@spalger
Copy link
Copy Markdown
Contributor Author

spalger commented Oct 11, 2021

@elasticmachine merge upstream

@kibanamachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
monitoring 1.1MB 1.1MB +29.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@spalger spalger added the auto-backport Deprecated - use backport:version if exact versions are needed label Oct 11, 2021
@spalger spalger merged commit 9667edf into elastic:master Oct 11, 2021
@spalger spalger deleted the fix/monitoring-types branch October 11, 2021 17:30
@kibanamachine
Copy link
Copy Markdown
Contributor

💔 Backport failed

Status Branch Result
7.x Commit could not be cherrypicked due to conflicts

To backport manually run:
node scripts/backport --pr 114342

spalger added a commit to spalger/kibana that referenced this pull request Oct 11, 2021
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	x-pack/plugins/monitoring/public/application/setup_mode/setup_mode_renderer.d.ts
spalger added a commit that referenced this pull request Oct 12, 2021
* [monitoring] fixup types (#114342)

Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	x-pack/plugins/monitoring/public/application/setup_mode/setup_mode_renderer.d.ts

* fix import

Co-authored-by: spalger <spalger@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Deprecated - use backport:version if exact versions are needed buildkite-ci release_note:skip Skip the PR/issue when compiling release notes Team:Monitoring Stack Monitoring team v7.16.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants