Skip to content

Commit

Permalink
Sustainable Kibana Architecture: Move plugins owned by `@elastic/appe…
Browse files Browse the repository at this point in the history
…x-sharedux` (elastic#204959)

## Summary

Part of elastic#203163

Relocating only shared-ux-owned plugins for now

(cherry picked from commit 9215df9)

# Conflicts:
#	.github/CODEOWNERS
#	.i18nrc.json
#	docs/developer/plugin-list.asciidoc
#	package.json
#	src/platform/plugins/shared/saved_objects/tsconfig.json
#	x-pack/.gitignore
#	x-pack/.i18nrc.json
#	x-pack/platform/plugins/private/reporting/.gitignore
#	x-pack/platform/plugins/private/reporting/server/config/index.test.ts
#	x-pack/platform/plugins/private/reporting/server/deprecations/__snapshots__/reporting_role.test.ts.snap
#	x-pack/platform/plugins/private/reporting/server/deprecations/reporting_role.test.ts
#	x-pack/platform/plugins/private/reporting/server/deprecations/reporting_role.ts
#	x-pack/platform/plugins/private/reporting/server/routes/internal/generate/csv_searchsource_immediate.ts
  • Loading branch information
Dosant committed Jan 3, 2025
1 parent 07e09d1 commit 77d2b19
Show file tree
Hide file tree
Showing 2,032 changed files with 1,304 additions and 1,547 deletions.
6 changes: 3 additions & 3 deletions .buildkite/scripts/pipelines/pull_request/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,10 +326,10 @@ const getPipeline = (filename: string, removeSteps = true) => {
/^src\/platform\/plugins\/shared\/discover/,
/^src\/platform\/plugins\/shared\/field_formats/,
/^src\/platform\/plugins\/shared\/inspector/,
/^src\/plugins\/kibana_react/,
/^src\/plugins\/kibana_utils/,
/^src\/platform\/plugins\/shared\/kibana_react/,
/^src\/platform\/plugins\/shared\/kibana_utils/,
/^src\/platform\/plugins\/shared\/saved_search/,
/^src\/plugins\/ui_actions/,
/^src\/platform\/plugins\/shared\/ui_actions/,
/^src\/platform\/plugins\/shared\/unified_histogram/,
/^src\/plugins\/unified_search/,
/^x-pack\/platform\/packages\/shared\/kbn-elastic-assistant/,
Expand Down
4 changes: 2 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ snapshots.js
/x-pack/platform/plugins/private/canvas/canvas_plugin
/x-pack/platform/plugins/private/canvas/shareable_runtime/build
/x-pack/platform/plugins/private/canvas/storybook/build
/x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/**
/x-pack/plugins/reporting/server/export_types/printable_pdf_v2/server/lib/pdf/assets/**
/x-pack/platform/plugins/private/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/**
/x-pack/platform/plugins/private/reporting/server/export_types/printable_pdf_v2/server/lib/pdf/assets/**
/x-pack/plugins/cloud_integrations/cloud_full_story/server/assets/**

# package overrides
Expand Down
6 changes: 3 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,14 +283,14 @@ module.exports = {
* Temporarily disable some react rules for specific plugins, remove in separate PRs
*/
{
files: ['src/plugins/kibana_react/**/*.{js,mjs,ts,tsx}'],
files: ['src/platform/plugins/shared/kibana_react/**/*.{js,mjs,ts,tsx}'],
rules: {
'react-hooks/rules-of-hooks': 'off',
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['src/plugins/kibana_utils/**/*.{js,mjs,ts,tsx}'],
files: ['src/platform/plugins/shared/kibana_utils/**/*.{js,mjs,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
},
Expand Down Expand Up @@ -1926,7 +1926,7 @@ module.exports = {
'src/core/**',
'x-pack/plugins/features/**',
'x-pack/plugins/licensing/**',
'x-pack/plugins/global_search/**',
'x-pack/platform/plugins/shared/global_search/**',
'x-pack/plugins/cloud/**',
'packages/kbn-config-schema',
'src/plugins/status_page/**',
Expand Down
433 changes: 432 additions & 1 deletion .github/CODEOWNERS

Large diffs are not rendered by default.

29 changes: 14 additions & 15 deletions .i18nrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"paths": {
"advancedSettings": "src/plugins/advanced_settings",
"advancedSettings": "src/platform/plugins/private/advanced_settings",
"aiAssistantManagementSelection": "src/platform/plugins/shared/ai_assistant_management/selection",
"alerts": "packages/kbn-alerts/src",
"alertsUIShared": "src/platform/packages/shared/kbn-alerts-ui-shared/src",
Expand Down Expand Up @@ -60,15 +60,15 @@
"eventAnnotationComponents": "packages/kbn-event-annotation-components",
"fieldUtils": "src/platform/packages/shared/kbn-field-utils",
"fieldFormats": "src/platform/plugins/shared/field_formats",
"files": "src/plugins/files",
"filesManagement": "src/plugins/files_management",
"files": "src/platform/plugins/shared/files",
"filesManagement": "src/platform/plugins/private/files_management",
"flot": "packages/kbn-flot-charts/lib",
"generateCsv": "packages/kbn-generate-csv",
"grouping": "src/platform/packages/shared/kbn-grouping/src",
"alertsGrouping": "x-pack/solutions/observability/packages/kbn-alerts-grouping",
"guidedOnboarding": "src/plugins/guided_onboarding",
"guidedOnboarding": "src/platform/plugins/shared/guided_onboarding",
"guidedOnboardingPackage": "packages/kbn-guided-onboarding",
"home": "src/plugins/home",
"home": "src/platform/plugins/shared/home",
"homePackages": "packages/home",
"indexPatternEditor": "src/platform/plugins/shared/data_view_editor",
"indexPatternFieldEditor": "src/platform/plugins/shared/data_view_field_editor",
Expand All @@ -78,15 +78,14 @@
"inspectorViews": "src/legacy/core_plugins/inspector_views",
"interactiveSetup": "src/plugins/interactive_setup",
"interpreter": "src/legacy/core_plugins/interpreter",
"imageEmbeddable": "src/plugins/image_embeddable",
"imageEmbeddable": "src/platform/plugins/private/image_embeddable",
"kbn": "src/legacy/core_plugins/kibana",
"kbn-esql-validation-autocomplete": "src/platform/packages/shared/kbn-esql-validation-autocomplete/src",
"kbnConfig": "packages/kbn-config/src",
"kbnDocViews": "src/legacy/core_plugins/kbn_doc_views",
"kibana_react": "src/legacy/core_plugins/kibana_react",
"kibana_utils": "src/plugins/kibana_utils",
"kibana-react": "src/plugins/kibana_react",
"kibanaOverview": "src/plugins/kibana_overview",
"kibana_utils": "src/platform/plugins/shared/kibana_utils",
"kibana-react": "src/platform/plugins/shared/kibana_react",
"kibanaOverview": "src/platform/plugins/private/kibana_overview",
"lensFormulaDocs": "packages/kbn-lens-formula-docs",
"lists": "x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src",
"exceptionList-components": "x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src",
Expand All @@ -97,7 +96,7 @@
"packages/kbn-management"
],
"monaco": "packages/kbn-monaco/src",
"navigation": ["src/plugins/navigation", "packages/solution-nav"],
"navigation": ["src/platform/plugins/shared/navigation", "packages/solution-nav"],
"links": "src/platform/plugins/private/links",
"newsfeed": "src/plugins/newsfeed",
"presentationUtil": "src/platform/plugins/shared/presentation_util",
Expand All @@ -106,13 +105,13 @@
"esqlEditor": "src/platform/packages/private/kbn-esql-editor",
"esqlUtils": "src/platform/packages/shared/kbn-esql-utils",
"reporting": "packages/kbn-reporting",
"savedObjects": "src/plugins/saved_objects",
"savedObjects": "src/platform/plugins/shared/saved_objects",
"savedObjectsFinder": "src/platform/plugins/shared/saved_objects_finder",
"savedObjectsManagement": "src/plugins/saved_objects_management",
"searchConnectors": "src/platform/packages/shared/kbn-search-connectors",
"searchConnectorsPlugin": "x-pack/solutions/search/plugins/search_connectors",
"server": "src/legacy/server",
"share": ["src/plugins/share", "packages/kbn-reporting-share"],
"share": ["src/platform/plugins/shared/share", "packages/kbn-reporting-share"],
"sharedUXPackages": "packages/shared-ux",
"searchApiKeysComponents": "x-pack/solutions/search/packages/kbn-search-api-keys-components",
"searchApiPanels": "src/platform/packages/shared/kbn-search-api-panels/",
Expand Down Expand Up @@ -140,8 +139,8 @@
"telemetry": ["src/plugins/telemetry", "src/plugins/telemetry_management_section"],
"timelion": ["src/plugins/vis_types/timelion"],
"tryInConsole": "src/platform/packages/shared/kbn-try-in-console/",
"uiActions": ["src/plugins/ui_actions", "packages/kbn-ui-actions-browser"],
"uiActionsEnhanced": "src/plugins/ui_actions_enhanced",
"uiActions": ["src/platform/plugins/shared/ui_actions", "packages/kbn-ui-actions-browser"],
"uiActionsEnhanced": "src/platform/plugins/shared/ui_actions_enhanced",
"uiActionsExamples": "examples/ui_action_examples",
"usageCollection": "src/plugins/usage_collection",
"userProfileComponents": "packages/kbn-user-profile-components",
Expand Down
8 changes: 4 additions & 4 deletions docs/developer/architecture/add-data-tutorials.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ Each tutorial contains three sets of instructions:

[discrete]
=== Creating a new tutorial
1. Create a new directory in the link:https://github.com/elastic/kibana/tree/main/src/plugins/home/server/tutorials[tutorials directory].
1. Create a new directory in the link:https://github.com/elastic/kibana/tree/main/src/platform/plugins/shared/home/server/tutorials[tutorials directory].
2. In the new directory, create a file called `index.ts` that exports a function.
The function must return a function object that conforms to the `TutorialSchema` interface link:{kib-repo}tree/{branch}/src/plugins/home/server/services/tutorials/lib/tutorial_schema.ts[tutorial schema].
3. Register the tutorial in link:{kib-repo}tree/{branch}/src/plugins/home/server/tutorials/register.ts[register.ts] by adding it to the `builtInTutorials`.
The function must return a function object that conforms to the `TutorialSchema` interface link:{kib-repo}tree/{branch}/src/platform/plugins/shared/home/server/services/tutorials/lib/tutorial_schema.ts[tutorial schema].
3. Register the tutorial in link:{kib-repo}tree/{branch}/src/platform/plugins/shared/home/server/tutorials/register.ts[register.ts] by adding it to the `builtInTutorials`.
// TODO update path once assets are migrated
4. Add image assets to the `tutorial_resources` directory.
5. Run {kib} locally to preview the tutorial.
Expand All @@ -28,7 +28,7 @@ Then register the tutorial object by calling `home.tutorials.registerTutorial(tu
String values can contain variables that are substituted when rendered. Variables are specified by `{}`.
For example: `{config.docs.version}` is rendered as `6.2` when running the tutorial in {kib} 6.2.

link:{kib-repo}tree/{branch}/src/plugins/home/public/application/components/tutorial/replace_template_strings.js[Provided variables]
link:{kib-repo}tree/{branch}/src/platform/plugins/shared/home/public/application/components/tutorial/replace_template_strings.js[Provided variables]

[discrete]
==== Markdown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ export class MyPlugin implements Plugin {
}
----

For advanced use-cases, such as a search for specific objects, use the {kib-repo}blob/{branch}/x-pack/plugins/global_search/README.md[Global search plugin].
For advanced use-cases, such as a search for specific objects, use the {kib-repo}blob/{branch}/x-pack/platform/plugins/shared/global_search/README.md[Global search plugin].

10 changes: 5 additions & 5 deletions docs/developer/best-practices/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,17 @@ right advanced settings like whether to include frozen indices or not.
** Rendering maps, visualizations, dashboards in your application
** Register new widgets that will can be added to a dashboard or Canvas
workpad, or rendered in another plugin.
* {kib-repo}tree/{branch}/src/plugins/ui_actions/README.asciidoc[UiActions]
* {kib-repo}tree/{branch}/src/platform/plugins/shared/ui_actions/README.asciidoc[UiActions]
** Let other plugins inject functionality into your application
** Inject custom functionality into other plugins
* Stateless helper utilities
* {kib-repo}tree/{branch}/src/plugins/kibana_utils/docs/state_sync/README.md[state
* {kib-repo}tree/{branch}/src/platform/plugins/shared/kibana_utils/docs/state_sync/README.md[state
syncing] and
* {kib-repo}tree/{branch}/src/plugins/kibana_utils/docs/state_containers/README.md[state
* {kib-repo}tree/{branch}/src/platform/plugins/shared/kibana_utils/docs/state_containers/README.md[state
container] utilities provided by
* {kib-repo}tree/{branch}/src/plugins/kibana_utils/README.md[kibana_utils]
* {kib-repo}tree/{branch}/src/platform/plugins/shared/kibana_utils/README.md[kibana_utils]
if you want to sync your application state to the URL?
** {kib-repo}tree/{branch}/src/plugins/kibana_react/README.md[kibana_react]
** {kib-repo}tree/{branch}/src/platform/plugins/shared/kibana_react/README.md[kibana_react]
for react specific helpers

Re-using these services will help create a consistent experience across
Expand Down
6 changes: 3 additions & 3 deletions docs/developer/best-practices/navigation.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ console.log(discoverUrl); // http://localhost:5601/bpr/s/space/app/discover
const discoverUrlWithSomeState = core.http.basePath.prepend(`/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:'2020-09-10T11:39:50.203Z',to:'2020-09-10T11:40:20.249Z'))&_a=(columns:!(_source),filters:!(),index:'90943e30-9a47-11e8-b64d-95841ca0b247',interval:auto,query:(language:kuery,query:''),sort:!())`);
----

Instead, each app should expose {kib-repo}tree/{branch}/src/plugins/share/common/url_service/locators/README.md[a locator].
Instead, each app should expose {kib-repo}tree/{branch}/src/platform/plugins/shared/share/common/url_service/locators/README.md[a locator].
Other apps should use those locators for navigation or URL creation.

[source,typescript jsx]
Expand Down Expand Up @@ -222,7 +222,7 @@ There are utils to help you to implement such kind of state syncing.

* Adding a query param flag or simple key/value to the URL.

Follow {kib-repo}tree/{branch}/src/plugins/kibana_utils/docs/state_sync#state-syncing-utilities[these] docs to learn more.
Follow {kib-repo}tree/{branch}/src/platform/plugins/shared/kibana_utils/docs/state_sync#state-syncing-utilities[these] docs to learn more.


[[preserve-state]]
Expand All @@ -246,7 +246,7 @@ you'd notice that state is stored inside that link, and it also gets updated whe
image:images/state_inside_the_link.png[State is stored inside the navigation link]

This is where <<query-params, separation>> into `_a` and `_g` query params comes into play. What is considered a *global* state gets constantly updated in those navigation links. In the example above it was a time filter.
This is backed by {kib-repo}tree/{branch}/src/plugins/kibana_utils/public/state_management/url/kbn_url_tracker.ts#L57[KbnUrlTracker] util. You can use it to achieve similar behavior.
This is backed by {kib-repo}tree/{branch}/src/platform/plugins/shared/kibana_utils/public/state_management/url/kbn_url_tracker.ts#L57[KbnUrlTracker] util. You can use it to achieve similar behavior.

NOTE: After migrating to KP navigation works without page reloads and all plugins are loaded simultaneously.
Hence, likely there are simpler ways to preserve state of your application, unless you want to do it through URL.
Loading

0 comments on commit 77d2b19

Please sign in to comment.