Skip to content

[Discover] Remove services from component dependencies#121691

Merged
dimaanj merged 21 commits intoelastic:mainfrom
dimaanj:remove-services-from-component-props
Jan 28, 2022
Merged

[Discover] Remove services from component dependencies#121691
dimaanj merged 21 commits intoelastic:mainfrom
dimaanj:remove-services-from-component-props

Conversation

@dimaanj
Copy link
Copy Markdown
Contributor

@dimaanj dimaanj commented Dec 20, 2021

Summary

This PR removes unnecessary services instance propagation through components tree and enables useKibana hook.

@dimaanj dimaanj added Feature:Discover Discover Application release_note:skip Skip the PR/issue when compiling release notes v8.1.0 Team:DataDiscovery Discover, search (data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. t// labels Dec 20, 2021
@dimaanj dimaanj self-assigned this Dec 20, 2021
@dimaanj dimaanj added the technical debt Improvement of the software architecture and operational architecture label Dec 29, 2021
…services-from-component-props

# Conflicts:
#	src/plugins/discover/public/application/main/components/sidebar/__snapshots__/discover_index_pattern_management.test.tsx.snap
@dimaanj
Copy link
Copy Markdown
Contributor Author

dimaanj commented Jan 3, 2022

@elasticmachine merge upstream

@dimaanj dimaanj requested a review from kertal January 3, 2022 11:41
@dimaanj dimaanj marked this pull request as ready for review January 3, 2022 17:06
@dimaanj dimaanj requested a review from a team as a code owner January 3, 2022 17:06
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

…services-from-component-props

# Conflicts:
#	src/plugins/discover/public/application/context/context_app_content.tsx
#	src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx
#	src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table_saved_search_embeddable.tsx
#	src/plugins/discover/public/application/main/components/layout/discover_layout.test.tsx
#	src/plugins/discover/public/application/main/components/sidebar/__snapshots__/discover_index_pattern_management.test.tsx.snap
#	src/plugins/discover/public/application/main/components/sidebar/discover_index_pattern_management.tsx
#	src/plugins/discover/public/application/main/components/sidebar/discover_sidebar.tsx
#	src/plugins/discover/public/embeddable/saved_search_embeddable.tsx
#	src/plugins/discover/public/embeddable/saved_search_grid.tsx
@dimaanj
Copy link
Copy Markdown
Contributor Author

dimaanj commented Jan 14, 2022

@elasticmachine merge upstream

@dimaanj
Copy link
Copy Markdown
Contributor Author

dimaanj commented Jan 18, 2022

@elasticmachine merge upstream

…services-from-component-props

# Conflicts:
#	src/plugins/discover/public/application/main/components/chart/discover_chart.tsx
#	src/plugins/discover/public/components/discover_grid/get_render_cell_value.tsx
@dimaanj
Copy link
Copy Markdown
Contributor Author

dimaanj commented Jan 24, 2022

@elasticmachine merge upstream

@dimaanj dimaanj requested a review from kertal January 25, 2022 09:00
dimaanj and others added 2 commits January 25, 2022 16:10
Copy link
Copy Markdown
Member

@kertal kertal left a comment

Choose a reason for hiding this comment

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

This is a huge PR in every way, kudos @dmitriynj for simplifying our future life (might cause a few curses when back porting tough). Tested and works as expected. Found 2 more things in the code review, then it should be good to merge

@dimaanj
Copy link
Copy Markdown
Contributor Author

dimaanj commented Jan 26, 2022

@elasticmachine merge upstream

kibanamachine and others added 3 commits January 26, 2022 08:34
…services-from-component-props

# Conflicts:
#	src/plugins/discover/public/application/main/discover_main_route.tsx
#	src/plugins/discover/public/components/discover_grid/get_render_cell_value.tsx
@kibana-ci
Copy link
Copy Markdown

💚 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
discover 330.7KB 330.3KB -425.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
discover 51.5KB 51.6KB +90.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
discover 34 35 +1

Total ESLint disabled count

id before after diff
discover 36 37 +1

History

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

cc @dmitriynj

order: 10,
Component: (props) => {
component: (props) => {
// eslint-disable-next-line react-hooks/rules-of-hooks
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ah, I see, lint was complaining, got it :)

Copy link
Copy Markdown
Member

@kertal kertal left a comment

Choose a reason for hiding this comment

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

LGTM! Thx for applying the changes, didn't test again (small changes). Great refactoring 👍 thx for making our future work easier (which is more important then making or back port work harder )

@kertal
Copy link
Copy Markdown
Member

kertal commented Jan 28, 2022

🥳 Bildschirmfoto 2022-01-28 um 09 09 56

@dimaanj dimaanj merged commit 35f1c4d into elastic:main Jan 28, 2022
@kibanamachine kibanamachine added the backport:skip This PR does not require backporting label Jan 28, 2022
jloleysens added a commit to jloleysens/kibana that referenced this pull request Jan 28, 2022
…fix-potential-race-condition-when-screenshotting

* 'main' of github.com:elastic/kibana: (75 commits)
  [Reporting] Logging improvements while generating reports (elastic#123802)
  [Uptime] Default alert connectors email settings (elastic#123244)
  Update comparison series styles to match the main series (elastic#123858)
  [RAC][Uptime] remove extra dot from the uptime alert connector message (elastic#124000)
  [Exploratory view] Allow ability add extra actions in lens embeddable (elastic#123713)
  [SecuritySolution][Investigations] Add message about missing index in data view in analyzer (elastic#122859)
  [TSVB] Formatting in the left axis is not respected when I have two separate axis (elastic#123903)
  [Discover] Remove services from component dependencies (elastic#121691)
  Stop IM rule execution if there are no events (elastic#123811)
  [Security Solution][Endpoint] Update Fleet Trusted Apps and Host Isolation Exception cards to use exception list summary API (elastic#123900)
  [Security Solution][Exceptions] Switches modal to flyout component (elastic#123408)
  [Workplace Search] Fix bug where modal visible after deleting a group (elastic#123976)
  [Alerting] Remove state variables from action variable menu (elastic#123702)
  replace deprecated api usage (elastic#123970)
  Fix package policy merge logic for boolean values (elastic#123974)
  [Security Solution][Endpoint][Policy] Remove GET policy list api route (elastic#123873)
  Reenable alert_add test suite (elastic#123862)
  [Fleet] Remove usage of IFieldType in Fleet (elastic#123960)
  [Lists] Add an instance of `ExceptionListClient` with server extension points turned off to context object provided to callbacks (elastic#123885)
  [Maps] Add execution context (elastic#123651)
  ...

# Conflicts:
#	x-pack/plugins/screenshotting/server/browsers/chromium/driver_factory/index.ts
awahab07 pushed a commit to awahab07/kibana that referenced this pull request Jan 31, 2022
* [Discover] remove services from component dependencies

* [Discover] fix eslint

* [Discover] fix imports

* [Discover] fix build problems

* [Discover] get rid of getServices and setServices

* [Discover] fix unit tests, update services init process

* [Discover] fix redundant dependency

* [Discover] fix imports

* [Discover] fix test implementation

* Update src/plugins/discover/public/components/discover_grid/discover_grid.test.tsx

Co-authored-by: Matthias Wilhelm <ankertal@gmail.com>

* [Discover] apply suggestions

* [Discover] fix jest test

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Matthias Wilhelm <ankertal@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting Feature:Discover Discover Application release_note:skip Skip the PR/issue when compiling release notes Team:DataDiscovery Discover, search (data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. t// technical debt Improvement of the software architecture and operational architecture v8.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants