Skip to content

Commit

Permalink
Add @kbn/react-kibana-context-* packages to shared bundle (#204794)
Browse files Browse the repository at this point in the history
## Summary

Part of #204761

These packages are meant to be used by each render tree.
`react-kibana-context-theme` was already part of a shared bundle and
most of them were already part of Bazel, let's add all of them for
consistency and to reduce bundle size
  • Loading branch information
Dosant authored Dec 30, 2024
1 parent 78a53cb commit 39d8d7d
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/kbn-ui-shared-deps-src/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ webpack_cli(
"//packages/shared-ux/error_boundary",
"//packages/kbn-rison",
"//packages/shared-ux/code_editor/impl:code_editor",
"//packages/react/kibana_context/common",
"//packages/react/kibana_context/root",
"//packages/react/kibana_context/render",
"//packages/react/kibana_context/theme",
],
output_dir = True,
Expand Down
3 changes: 3 additions & 0 deletions packages/kbn-ui-shared-deps-src/src/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ const externals = {
'@kbn/esql-ast': '__kbnSharedDeps__.KbnEsqlAst',
'@kbn/ebt-tools': '__kbnSharedDeps__.KbnEbtTools',
'@elastic/apm-rum-core': '__kbnSharedDeps__.ElasticApmRumCore',
'@kbn/react-kibana-context-common': '__kbnSharedDeps__.KbnReactKibanaContextCommon',
'@kbn/react-kibana-context-root': '__kbnSharedDeps__.KbnReactKibanaContextRoot',
'@kbn/react-kibana-context-render': '__kbnSharedDeps__.KbnReactKibanaContextRender',
'@kbn/react-kibana-context-theme': '__kbnSharedDeps__.KbnReactKibanaContextTheme',
};

Expand Down
3 changes: 3 additions & 0 deletions packages/kbn-ui-shared-deps-src/src/entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,7 @@ export const KbnCodeEditor = require('@kbn/code-editor');
export const KbnEsqlAst = require('@kbn/esql-ast');
export const KbnEbtTools = require('@kbn/ebt-tools');
export const ElasticApmRumCore = require('@elastic/apm-rum-core');
export const KbnReactKibanaContextCommon = require('@kbn/react-kibana-context-common');
export const KbnReactKibanaContextRoot = require('@kbn/react-kibana-context-root');
export const KbnReactKibanaContextRender = require('@kbn/react-kibana-context-render');
export const KbnReactKibanaContextTheme = require('@kbn/react-kibana-context-theme');
36 changes: 36 additions & 0 deletions packages/react/kibana_context/render/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
load("@build_bazel_rules_nodejs//:index.bzl", "js_library")

SRCS = glob(
[
"**/*.ts",
"**/*.tsx",
],
exclude = [
"**/test_helpers.ts",
"**/*.config.js",
"**/*.mock.*",
"**/*.test.*",
"**/*.stories.*",
"**/__snapshots__/**",
"**/integration_tests/**",
"**/mocks/**",
"**/scripts/**",
"**/storybook/**",
"**/test_fixtures/**",
"**/test_helpers/**",
],
)

DEPS = [
"@npm//react",
"//packages/react/kibana_context/common",
"//packages/react/kibana_context/root",
]

js_library(
name = "render",
package_name = "@kbn/react-kibana-context-render",
srcs = ["package.json"] + SRCS,
deps = DEPS,
visibility = ["//visibility:public"],
)

0 comments on commit 39d8d7d

Please sign in to comment.