Skip to content

Commit

Permalink
[8.x] Sustainable Kibana Architecture: Move packages under `packages/…
Browse files Browse the repository at this point in the history
…shared-ux/` (#205602) (#205696)

# Backport

This will backport the following commits from `main` to `8.x`:
- [Sustainable Kibana Architecture: Move packages under
`packages/shared-ux/`
(#205602)](#205602)

<!--- Backport version: 8.9.8 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Anton
Dosov","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-01-07T09:46:25Z","message":"Sustainable
Kibana Architecture: Move packages under `packages/shared-ux/`
(#205602)","sha":"175916ef23a09938833966de51ec8d674be28c06","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:SharedUX","backport:prev-minor","plugin
groups"],"number":205602,"url":"https://github.com/elastic/kibana/pull/205602","mergeCommit":{"message":"Sustainable
Kibana Architecture: Move packages under `packages/shared-ux/`
(#205602)","sha":"175916ef23a09938833966de51ec8d674be28c06"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/205602","number":205602,"mergeCommit":{"message":"Sustainable
Kibana Architecture: Move packages under `packages/shared-ux/`
(#205602)","sha":"175916ef23a09938833966de51ec8d674be28c06"}}]}]
BACKPORT-->

---------

Co-authored-by: kibanamachine <[email protected]>
  • Loading branch information
Dosant and kibanamachine authored Jan 7, 2025
1 parent d4eb8b4 commit 6d71d04
Show file tree
Hide file tree
Showing 608 changed files with 565 additions and 561 deletions.
100 changes: 50 additions & 50 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -869,56 +869,56 @@ packages/kbn-set-map @elastic/kibana-operations
examples/share_examples @elastic/appex-sharedux
src/platform/plugins/shared/share @elastic/appex-sharedux
src/platform/packages/shared/kbn-shared-svg @elastic/obs-ux-infra_services-team
packages/shared-ux/avatar/solution @elastic/appex-sharedux
packages/shared-ux/button/exit_full_screen @elastic/appex-sharedux
packages/shared-ux/button_toolbar @elastic/appex-sharedux
packages/shared-ux/card/no_data/impl @elastic/appex-sharedux
packages/shared-ux/card/no_data/mocks @elastic/appex-sharedux
packages/shared-ux/card/no_data/types @elastic/appex-sharedux
packages/shared-ux/chrome/navigation @elastic/appex-sharedux
packages/shared-ux/error_boundary @elastic/appex-sharedux
packages/shared-ux/file/context @elastic/appex-sharedux
packages/shared-ux/file/image/impl @elastic/appex-sharedux
packages/shared-ux/file/image/mocks @elastic/appex-sharedux
packages/shared-ux/file/mocks @elastic/appex-sharedux
packages/shared-ux/file/file_picker/impl @elastic/appex-sharedux
packages/shared-ux/file/types @elastic/appex-sharedux
packages/shared-ux/file/file_upload/impl @elastic/appex-sharedux
packages/shared-ux/file/util @elastic/appex-sharedux
packages/shared-ux/link/redirect_app/impl @elastic/appex-sharedux
packages/shared-ux/link/redirect_app/mocks @elastic/appex-sharedux
packages/shared-ux/link/redirect_app/types @elastic/appex-sharedux
packages/shared-ux/markdown/impl @elastic/appex-sharedux
packages/shared-ux/markdown/mocks @elastic/appex-sharedux
packages/shared-ux/markdown/types @elastic/appex-sharedux
packages/shared-ux/page/analytics_no_data/impl @elastic/appex-sharedux
packages/shared-ux/page/analytics_no_data/mocks @elastic/appex-sharedux
packages/shared-ux/page/analytics_no_data/types @elastic/appex-sharedux
packages/shared-ux/page/kibana_no_data/impl @elastic/appex-sharedux
packages/shared-ux/page/kibana_no_data/mocks @elastic/appex-sharedux
packages/shared-ux/page/kibana_no_data/types @elastic/appex-sharedux
packages/shared-ux/page/kibana_template/impl @elastic/appex-sharedux
packages/shared-ux/page/kibana_template/mocks @elastic/appex-sharedux
packages/shared-ux/page/kibana_template/types @elastic/appex-sharedux
packages/shared-ux/page/no_data/impl @elastic/appex-sharedux
packages/shared-ux/page/no_data_config/impl @elastic/appex-sharedux
packages/shared-ux/page/no_data_config/mocks @elastic/appex-sharedux
packages/shared-ux/page/no_data_config/types @elastic/appex-sharedux
packages/shared-ux/page/no_data/mocks @elastic/appex-sharedux
packages/shared-ux/page/no_data/types @elastic/appex-sharedux
packages/shared-ux/page/solution_nav @elastic/appex-sharedux
packages/shared-ux/prompt/no_data_views/impl @elastic/appex-sharedux
packages/shared-ux/prompt/no_data_views/mocks @elastic/appex-sharedux
packages/shared-ux/prompt/no_data_views/types @elastic/appex-sharedux
packages/shared-ux/prompt/not_found @elastic/appex-sharedux
packages/shared-ux/router/impl @elastic/appex-sharedux
packages/shared-ux/router/mocks @elastic/appex-sharedux
packages/shared-ux/router/types @elastic/appex-sharedux
packages/shared-ux/storybook/config @elastic/appex-sharedux
packages/shared-ux/storybook/mock @elastic/appex-sharedux
packages/shared-ux/modal/tabbed @elastic/appex-sharedux
packages/shared-ux/table_persist @elastic/appex-sharedux
packages/kbn-shared-ux-utility @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/avatar/solution @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/button/exit_full_screen @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/button_toolbar @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/card/no_data/impl @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/card/no_data/mocks @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/card/no_data/types @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/chrome/navigation @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/error_boundary @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/file/context @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/file/image/impl @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/file/image/mocks @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/file/mocks @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/file/file_picker/impl @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/file/types @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/file/file_upload/impl @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/file/util @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/link/redirect_app/impl @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/link/redirect_app/mocks @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/link/redirect_app/types @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/markdown/impl @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/markdown/mocks @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/markdown/types @elastic/appex-sharedux
src/platform/packages/private/shared-ux/page/analytics_no_data/impl @elastic/appex-sharedux
src/platform/packages/private/shared-ux/page/analytics_no_data/mocks @elastic/appex-sharedux
src/platform/packages/private/shared-ux/page/analytics_no_data/types @elastic/appex-sharedux
src/platform/packages/private/shared-ux/page/kibana_no_data/impl @elastic/appex-sharedux
src/platform/packages/private/shared-ux/page/kibana_no_data/mocks @elastic/appex-sharedux
src/platform/packages/private/shared-ux/page/kibana_no_data/types @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/page/kibana_template/impl @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/page/kibana_template/mocks @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/page/kibana_template/types @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/page/no_data/impl @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/page/no_data_config/impl @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/page/no_data_config/mocks @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/page/no_data_config/types @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/page/no_data/mocks @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/page/no_data/types @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/page/solution_nav @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/prompt/no_data_views/impl @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/prompt/no_data_views/mocks @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/prompt/no_data_views/types @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/prompt/not_found @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/router/impl @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/router/mocks @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/router/types @elastic/appex-sharedux
src/platform/packages/private/shared-ux/storybook/config @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/storybook/mock @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/modal/tabbed @elastic/appex-sharedux
src/platform/packages/shared/shared-ux/table_persist @elastic/appex-sharedux
src/platform/packages/shared/kbn-shared-ux-utility @elastic/appex-sharedux
x-pack/solutions/observability/plugins/slo @elastic/obs-ux-management-team
x-pack/platform/packages/shared/kbn-slo-schema @elastic/obs-ux-management-team
x-pack/platform/plugins/private/snapshot_restore @elastic/kibana-management
Expand Down
2 changes: 1 addition & 1 deletion .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
"searchConnectorsPlugin": "x-pack/solutions/search/plugins/search_connectors",
"server": "src/legacy/server",
"share": ["src/platform/plugins/shared/share", "packages/kbn-reporting-share"],
"sharedUXPackages": "packages/shared-ux",
"sharedUXPackages": ["packages/shared-ux", "src/platform/packages/shared/shared-ux", "src/platform/packages/private/shared-ux/"],
"searchApiKeysComponents": "x-pack/solutions/search/packages/kbn-search-api-keys-components",
"searchApiPanels": "src/platform/packages/shared/kbn-search-api-panels/",
"searchErrors": "src/platform/packages/shared/kbn-search-errors",
Expand Down
2 changes: 1 addition & 1 deletion dev_docs/key_concepts/navigation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const MySPALink = () =>
```

As it would be too much boilerplate to do this for each link in your app, there is a handy wrapper that helps with it:
[RedirectAppLinks](https://github.com/elastic/kibana/blob/main/packages/shared-ux/link/redirect_app/impl/src/redirect_app_links.tsx).
[RedirectAppLinks](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/shared-ux/link/redirect_app/impl/src/redirect_app_links.tsx).

```jsx
const MyApp = () =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ By converting each page to an async import, we were able to load each page async
### Other optimizations

- Registration of some `start` services were conditional, and contain their own async calls. I removed those from the register helper, (which itself was a brute-force offload of code from the plugin, but still loaded every time), and loaded them async if the conditions apply.
- I moved flyouts, modals, expanding rows, and other conditionally-rendered components to `React.lazy` async modules, (using [`dynamic`](https://github.com/elastic/kibana/tree/main/packages/kbn-shared-ux-utility/src/dynamic) from [@kbn/shared-ux-utility](https://github.com/elastic/kibana/tree/main/packages/kbn-shared-ux-utility)).
- I moved flyouts, modals, expanding rows, and other conditionally-rendered components to `React.lazy` async modules, (using `dynamic` from `@kbn/shared-ux-utility`).
- A lot of `export * from ...` exports were obscuring what code was actually being consumed. For example, [`public/shared.ts`](https://github.com/elastic/kibana/blob/bfc91b0cb035b39916a5efc64ace31e88a230ec5/x-pack/plugins/ml/public/shared.ts) was exporting everything from a lot of `common` files.
- By [refactoring these exports](https://github.com/clintandrewhall/kibana/blob/c4790b6315662b940d0794faca0ddafd8b6faedc/x-pack/plugins/ml/public/shared.ts) to accurately reflect what is being consumed outside the `ml` plugin, we are able to track their consumption, (and also reduce the size of _that_ bundle).

Expand Down
2 changes: 1 addition & 1 deletion docs/developer/best-practices/navigation.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const MySPALink = () =>
----

As it would be too much boilerplate to do this for each {kib} link in your app, there is a handy wrapper that helps with it:
{kib-repo}tree/{branch}/packages/shared-ux/link/redirect_app/impl/src/redirect_app_links.tsx[RedirectAppLinks].
{kib-repo}tree/{branch}/src/platform/packages/shared/shared-ux/link/redirect_app/impl/src/redirect_app_links.tsx[RedirectAppLinks].

[source,typescript jsx]
----
Expand Down
Loading

0 comments on commit 6d71d04

Please sign in to comment.