Skip to content

Commit

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

(cherry picked from commit 175916e)

# Conflicts:
#	.github/CODEOWNERS
  • Loading branch information
Dosant committed Jan 7, 2025
1 parent 567b237 commit 45e2d93
Show file tree
Hide file tree
Showing 607 changed files with 515 additions and 511 deletions.
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
100 changes: 50 additions & 50 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -876,56 +876,56 @@
"@kbn/share-examples-plugin": "link:examples/share_examples",
"@kbn/share-plugin": "link:src/platform/plugins/shared/share",
"@kbn/shared-svg": "link:src/platform/packages/shared/kbn-shared-svg",
"@kbn/shared-ux-avatar-solution": "link:packages/shared-ux/avatar/solution",
"@kbn/shared-ux-button-exit-full-screen": "link:packages/shared-ux/button/exit_full_screen",
"@kbn/shared-ux-button-toolbar": "link:packages/shared-ux/button_toolbar",
"@kbn/shared-ux-card-no-data": "link:packages/shared-ux/card/no_data/impl",
"@kbn/shared-ux-card-no-data-mocks": "link:packages/shared-ux/card/no_data/mocks",
"@kbn/shared-ux-card-no-data-types": "link:packages/shared-ux/card/no_data/types",
"@kbn/shared-ux-chrome-navigation": "link:packages/shared-ux/chrome/navigation",
"@kbn/shared-ux-error-boundary": "link:packages/shared-ux/error_boundary",
"@kbn/shared-ux-file-context": "link:packages/shared-ux/file/context",
"@kbn/shared-ux-file-image": "link:packages/shared-ux/file/image/impl",
"@kbn/shared-ux-file-image-mocks": "link:packages/shared-ux/file/image/mocks",
"@kbn/shared-ux-file-mocks": "link:packages/shared-ux/file/mocks",
"@kbn/shared-ux-file-picker": "link:packages/shared-ux/file/file_picker/impl",
"@kbn/shared-ux-file-types": "link:packages/shared-ux/file/types",
"@kbn/shared-ux-file-upload": "link:packages/shared-ux/file/file_upload/impl",
"@kbn/shared-ux-file-util": "link:packages/shared-ux/file/util",
"@kbn/shared-ux-link-redirect-app": "link:packages/shared-ux/link/redirect_app/impl",
"@kbn/shared-ux-link-redirect-app-mocks": "link:packages/shared-ux/link/redirect_app/mocks",
"@kbn/shared-ux-link-redirect-app-types": "link:packages/shared-ux/link/redirect_app/types",
"@kbn/shared-ux-markdown": "link:packages/shared-ux/markdown/impl",
"@kbn/shared-ux-markdown-mocks": "link:packages/shared-ux/markdown/mocks",
"@kbn/shared-ux-markdown-types": "link:packages/shared-ux/markdown/types",
"@kbn/shared-ux-page-analytics-no-data": "link:packages/shared-ux/page/analytics_no_data/impl",
"@kbn/shared-ux-page-analytics-no-data-mocks": "link:packages/shared-ux/page/analytics_no_data/mocks",
"@kbn/shared-ux-page-analytics-no-data-types": "link:packages/shared-ux/page/analytics_no_data/types",
"@kbn/shared-ux-page-kibana-no-data": "link:packages/shared-ux/page/kibana_no_data/impl",
"@kbn/shared-ux-page-kibana-no-data-mocks": "link:packages/shared-ux/page/kibana_no_data/mocks",
"@kbn/shared-ux-page-kibana-no-data-types": "link:packages/shared-ux/page/kibana_no_data/types",
"@kbn/shared-ux-page-kibana-template": "link:packages/shared-ux/page/kibana_template/impl",
"@kbn/shared-ux-page-kibana-template-mocks": "link:packages/shared-ux/page/kibana_template/mocks",
"@kbn/shared-ux-page-kibana-template-types": "link:packages/shared-ux/page/kibana_template/types",
"@kbn/shared-ux-page-no-data": "link:packages/shared-ux/page/no_data/impl",
"@kbn/shared-ux-page-no-data-config": "link:packages/shared-ux/page/no_data_config/impl",
"@kbn/shared-ux-page-no-data-config-mocks": "link:packages/shared-ux/page/no_data_config/mocks",
"@kbn/shared-ux-page-no-data-config-types": "link:packages/shared-ux/page/no_data_config/types",
"@kbn/shared-ux-page-no-data-mocks": "link:packages/shared-ux/page/no_data/mocks",
"@kbn/shared-ux-page-no-data-types": "link:packages/shared-ux/page/no_data/types",
"@kbn/shared-ux-page-solution-nav": "link:packages/shared-ux/page/solution_nav",
"@kbn/shared-ux-prompt-no-data-views": "link:packages/shared-ux/prompt/no_data_views/impl",
"@kbn/shared-ux-prompt-no-data-views-mocks": "link:packages/shared-ux/prompt/no_data_views/mocks",
"@kbn/shared-ux-prompt-no-data-views-types": "link:packages/shared-ux/prompt/no_data_views/types",
"@kbn/shared-ux-prompt-not-found": "link:packages/shared-ux/prompt/not_found",
"@kbn/shared-ux-router": "link:packages/shared-ux/router/impl",
"@kbn/shared-ux-router-mocks": "link:packages/shared-ux/router/mocks",
"@kbn/shared-ux-router-types": "link:packages/shared-ux/router/types",
"@kbn/shared-ux-storybook-config": "link:packages/shared-ux/storybook/config",
"@kbn/shared-ux-storybook-mock": "link:packages/shared-ux/storybook/mock",
"@kbn/shared-ux-tabbed-modal": "link:packages/shared-ux/modal/tabbed",
"@kbn/shared-ux-table-persist": "link:packages/shared-ux/table_persist",
"@kbn/shared-ux-utility": "link:packages/kbn-shared-ux-utility",
"@kbn/shared-ux-avatar-solution": "link:src/platform/packages/shared/shared-ux/avatar/solution",
"@kbn/shared-ux-button-exit-full-screen": "link:src/platform/packages/shared/shared-ux/button/exit_full_screen",
"@kbn/shared-ux-button-toolbar": "link:src/platform/packages/shared/shared-ux/button_toolbar",
"@kbn/shared-ux-card-no-data": "link:src/platform/packages/shared/shared-ux/card/no_data/impl",
"@kbn/shared-ux-card-no-data-mocks": "link:src/platform/packages/shared/shared-ux/card/no_data/mocks",
"@kbn/shared-ux-card-no-data-types": "link:src/platform/packages/shared/shared-ux/card/no_data/types",
"@kbn/shared-ux-chrome-navigation": "link:src/platform/packages/shared/shared-ux/chrome/navigation",
"@kbn/shared-ux-error-boundary": "link:src/platform/packages/shared/shared-ux/error_boundary",
"@kbn/shared-ux-file-context": "link:src/platform/packages/shared/shared-ux/file/context",
"@kbn/shared-ux-file-image": "link:src/platform/packages/shared/shared-ux/file/image/impl",
"@kbn/shared-ux-file-image-mocks": "link:src/platform/packages/shared/shared-ux/file/image/mocks",
"@kbn/shared-ux-file-mocks": "link:src/platform/packages/shared/shared-ux/file/mocks",
"@kbn/shared-ux-file-picker": "link:src/platform/packages/shared/shared-ux/file/file_picker/impl",
"@kbn/shared-ux-file-types": "link:src/platform/packages/shared/shared-ux/file/types",
"@kbn/shared-ux-file-upload": "link:src/platform/packages/shared/shared-ux/file/file_upload/impl",
"@kbn/shared-ux-file-util": "link:src/platform/packages/shared/shared-ux/file/util",
"@kbn/shared-ux-link-redirect-app": "link:src/platform/packages/shared/shared-ux/link/redirect_app/impl",
"@kbn/shared-ux-link-redirect-app-mocks": "link:src/platform/packages/shared/shared-ux/link/redirect_app/mocks",
"@kbn/shared-ux-link-redirect-app-types": "link:src/platform/packages/shared/shared-ux/link/redirect_app/types",
"@kbn/shared-ux-markdown": "link:src/platform/packages/shared/shared-ux/markdown/impl",
"@kbn/shared-ux-markdown-mocks": "link:src/platform/packages/shared/shared-ux/markdown/mocks",
"@kbn/shared-ux-markdown-types": "link:src/platform/packages/shared/shared-ux/markdown/types",
"@kbn/shared-ux-page-analytics-no-data": "link:src/platform/packages/private/shared-ux/page/analytics_no_data/impl",
"@kbn/shared-ux-page-analytics-no-data-mocks": "link:src/platform/packages/private/shared-ux/page/analytics_no_data/mocks",
"@kbn/shared-ux-page-analytics-no-data-types": "link:src/platform/packages/private/shared-ux/page/analytics_no_data/types",
"@kbn/shared-ux-page-kibana-no-data": "link:src/platform/packages/private/shared-ux/page/kibana_no_data/impl",
"@kbn/shared-ux-page-kibana-no-data-mocks": "link:src/platform/packages/private/shared-ux/page/kibana_no_data/mocks",
"@kbn/shared-ux-page-kibana-no-data-types": "link:src/platform/packages/private/shared-ux/page/kibana_no_data/types",
"@kbn/shared-ux-page-kibana-template": "link:src/platform/packages/shared/shared-ux/page/kibana_template/impl",
"@kbn/shared-ux-page-kibana-template-mocks": "link:src/platform/packages/shared/shared-ux/page/kibana_template/mocks",
"@kbn/shared-ux-page-kibana-template-types": "link:src/platform/packages/shared/shared-ux/page/kibana_template/types",
"@kbn/shared-ux-page-no-data": "link:src/platform/packages/shared/shared-ux/page/no_data/impl",
"@kbn/shared-ux-page-no-data-config": "link:src/platform/packages/shared/shared-ux/page/no_data_config/impl",
"@kbn/shared-ux-page-no-data-config-mocks": "link:src/platform/packages/shared/shared-ux/page/no_data_config/mocks",
"@kbn/shared-ux-page-no-data-config-types": "link:src/platform/packages/shared/shared-ux/page/no_data_config/types",
"@kbn/shared-ux-page-no-data-mocks": "link:src/platform/packages/shared/shared-ux/page/no_data/mocks",
"@kbn/shared-ux-page-no-data-types": "link:src/platform/packages/shared/shared-ux/page/no_data/types",
"@kbn/shared-ux-page-solution-nav": "link:src/platform/packages/shared/shared-ux/page/solution_nav",
"@kbn/shared-ux-prompt-no-data-views": "link:src/platform/packages/shared/shared-ux/prompt/no_data_views/impl",
"@kbn/shared-ux-prompt-no-data-views-mocks": "link:src/platform/packages/shared/shared-ux/prompt/no_data_views/mocks",
"@kbn/shared-ux-prompt-no-data-views-types": "link:src/platform/packages/shared/shared-ux/prompt/no_data_views/types",
"@kbn/shared-ux-prompt-not-found": "link:src/platform/packages/shared/shared-ux/prompt/not_found",
"@kbn/shared-ux-router": "link:src/platform/packages/shared/shared-ux/router/impl",
"@kbn/shared-ux-router-mocks": "link:src/platform/packages/shared/shared-ux/router/mocks",
"@kbn/shared-ux-router-types": "link:src/platform/packages/shared/shared-ux/router/types",
"@kbn/shared-ux-storybook-config": "link:src/platform/packages/private/shared-ux/storybook/config",
"@kbn/shared-ux-storybook-mock": "link:src/platform/packages/shared/shared-ux/storybook/mock",
"@kbn/shared-ux-tabbed-modal": "link:src/platform/packages/shared/shared-ux/modal/tabbed",
"@kbn/shared-ux-table-persist": "link:src/platform/packages/shared/shared-ux/table_persist",
"@kbn/shared-ux-utility": "link:src/platform/packages/shared/kbn-shared-ux-utility",
"@kbn/slo-plugin": "link:x-pack/solutions/observability/plugins/slo",
"@kbn/slo-schema": "link:x-pack/platform/packages/shared/kbn-slo-schema",
"@kbn/snapshot-restore-plugin": "link:x-pack/platform/plugins/private/snapshot_restore",
Expand Down
2 changes: 1 addition & 1 deletion packages/react/kibana_context/root/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ DEPS = [
"@npm//tslib",
"@npm//@elastic/eui",
"//src/core/packages/base/common:core-base-common",
"//packages/shared-ux/router/impl:shared-ux-router",
"//src/platform/packages/shared/shared-ux/router/impl:shared-ux-router",
]

js_library(
Expand Down
14 changes: 0 additions & 14 deletions packages/shared-ux/chrome/navigation/jest.config.js

This file was deleted.

14 changes: 0 additions & 14 deletions packages/shared-ux/error_boundary/jest.config.js

This file was deleted.

14 changes: 0 additions & 14 deletions packages/shared-ux/file/file_upload/impl/jest.config.js

This file was deleted.

15 changes: 0 additions & 15 deletions packages/shared-ux/markdown/impl/jest.config.js

This file was deleted.

14 changes: 0 additions & 14 deletions packages/shared-ux/modal/tabbed/jest.config.js

This file was deleted.

14 changes: 0 additions & 14 deletions packages/shared-ux/page/analytics_no_data/impl/jest.config.js

This file was deleted.

14 changes: 0 additions & 14 deletions packages/shared-ux/page/kibana_no_data/impl/jest.config.js

This file was deleted.

14 changes: 0 additions & 14 deletions packages/shared-ux/page/kibana_template/impl/jest.config.js

This file was deleted.

14 changes: 0 additions & 14 deletions packages/shared-ux/page/no_data/impl/jest.config.js

This file was deleted.

14 changes: 0 additions & 14 deletions packages/shared-ux/page/no_data_config/impl/jest.config.js

This file was deleted.

Loading

0 comments on commit 45e2d93

Please sign in to comment.