Skip to content
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

[8.x] Sustainable Kibana Architecture: Move packages under packages/shared-ux/ (#205602) #205696

Merged
merged 2 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
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
Loading