Skip to content

Commit 22c3ed6

Browse files
committed
Merge remote-tracking branch 'upstream/master' into bjoiner/lodashClean
2 parents a807767 + d571358 commit 22c3ed6

File tree

194 files changed

+4384
-4118
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

194 files changed

+4384
-4118
lines changed

.github/CODEOWNERS

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
/src/plugins/vis_type_vislib/ @elastic/kibana-app
2626
/src/plugins/vis_type_xy/ @elastic/kibana-app
2727
/src/plugins/visualize/ @elastic/kibana-app
28+
/src/plugins/visualizations/ @elastic/kibana-app
2829

2930
# App Architecture
3031
/examples/bfetch_explorer/ @elastic/kibana-app-arch
@@ -51,7 +52,6 @@
5152
/src/plugins/navigation/ @elastic/kibana-app-arch
5253
/src/plugins/share/ @elastic/kibana-app-arch
5354
/src/plugins/ui_actions/ @elastic/kibana-app-arch
54-
/src/plugins/visualizations/ @elastic/kibana-app-arch
5555
/x-pack/examples/ui_actions_enhanced_examples/ @elastic/kibana-app-arch
5656
/x-pack/plugins/data_enhanced/ @elastic/kibana-app-arch
5757
/x-pack/plugins/embeddable_enhanced/ @elastic/kibana-app-arch
@@ -246,6 +246,8 @@ x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json @elastic/kib
246246
/x-pack/plugins/upgrade_assistant/ @elastic/es-ui
247247
/x-pack/plugins/watcher/ @elastic/es-ui
248248
/x-pack/plugins/ingest_pipelines/ @elastic/es-ui
249+
/packages/kbn-ace/ @elastic/es-ui
250+
/packages/kbn-monaco/ @elastic/es-ui
249251

250252
# Endpoint
251253
/x-pack/plugins/endpoint/ @elastic/endpoint-app-team @elastic/siem

.telemetryrc.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@
66
"src/plugins/kibana_react/",
77
"src/plugins/testbed/",
88
"src/plugins/kibana_utils/",
9-
"src/plugins/kibana_usage_collection/server/collectors/kibana/kibana_usage_collector.ts",
10-
"src/plugins/kibana_usage_collection/server/collectors/management/telemetry_management_collector.ts",
11-
"src/plugins/kibana_usage_collection/server/collectors/ui_metric/telemetry_ui_metric_collector.ts",
12-
"src/plugins/telemetry/server/collectors/usage/telemetry_usage_collector.ts"
9+
"src/plugins/kibana_usage_collection/server/collectors/ui_metric/telemetry_ui_metric_collector.ts"
1310
]
1411
}
1512
]
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
[[ci-metrics]]
2+
== CI Metrics
3+
4+
In addition to running our tests, CI collects metrics about the Kibana build. These metrics are sent to an external service to track changes over time, and to provide PR authors insights into the impact of their changes.
5+
6+
7+
[[ci-metric-types]]
8+
=== Metric types
9+
10+
11+
[[ci-metric-types-bundle-size-metrics]]
12+
==== Bundle size
13+
14+
These metrics help contributors know how they are impacting the size of the bundles Kibana creates, and help make sure that Kibana loads as fast as possible.
15+
16+
[[ci-metric-page-load-bundle-size]] `page load bundle size` ::
17+
The size of the entry file produced for each bundle/plugin. This file is always loaded on every page load, so it should be as small as possible. To reduce this metric you can put any code that isn't necessary on every page load behind an https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#Dynamic_Imports[`async import()`].
18+
+
19+
Code that is shared statically with other plugins will contribute to the `page load bundle size` of that plugin. This includes exports from the `public/index.ts` file and any file referenced by the `extraPublicDirs` manifest property.
20+
21+
[[ci-metric-async-chunks-size]] `async chunks size` ::
22+
An "async chunk" is created for the files imported by each https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#Dynamic_Imports[`async import()`] statement. This metric tracks the sum size of these chunks, in bytes, broken down by plugin/bundle id. You can think of this as the amount of code users will have to download if they access all the components/applications within a bundle.
23+
24+
[[ci-metric-misc-asset-size]] `miscellaneous assets size` ::
25+
A "miscellaneous asset" is anything that isn't an async chunk or entry chunk, often images. This metric tracks the sum size of these assets, in bytes, broken down by plugin/bundle id.
26+
27+
[[ci-metric-bundle-module-count]] `@kbn/optimizer bundle module count` ::
28+
The number of separate modules included in each bundle/plugin. This is the best indicator we have for how long a specific bundle will take to be built by the `@kbn/optimizer`, so we report it to help people know when they've imported a module which might include a surprising number of sub-modules.
29+
30+
31+
[[ci-metric-types-distributable-size]]
32+
==== Distributable size
33+
34+
The size of the Kibana distributable is an essential metric as it not only contributes to the time it takes to download, but it also impacts time it takes to extract the archive once downloaded.
35+
36+
There are several metrics that we don't report on PRs because gzip-compression produces different file sizes even when provided the same input, so this metric would regularly show changes even though PR authors hadn't made any relevant changes.
37+
38+
All metrics are collected from the `tar.gz` archive produced for the linux platform.
39+
40+
[[ci-metric-distributable-file-count]] `distributable file count` ::
41+
The number of files included in the default distributable.
42+
43+
[[ci-metric-oss-distributable-file-count]] `oss distributable file count` ::
44+
The number of files included in the OSS distributable.
45+
46+
[[ci-metric-distributable-size]] `distributable size` ::
47+
The size, in bytes, of the default distributable. _(not reported on PRs)_
48+
49+
[[ci-metric-oss-distributable-size]] `oss distributable size` ::
50+
The size, in bytes, of the OSS distributable. _(not reported on PRs)_
51+
52+
53+
[[ci-metric-types-saved-object-field-counts]]
54+
==== Saved Object field counts
55+
56+
Elasticsearch limits the number of fields in an index to 1000 by default, and we want to avoid raising that limit.
57+
58+
[[ci-metric-saved-object-field-count]] `Saved Objects .kibana field count` ::
59+
The number of saved object fields broken down by saved object type.
60+
61+
62+
[[ci-metric-adding-new-metrics]]
63+
=== Adding new metrics
64+
65+
You can report new metrics by using the `CiStatsReporter` class provided by the `@kbn/dev-utils` package. This class is automatically configured on CI and its methods noop when running outside of CI. For more details checkout the {kib-repo}blob/{branch}/packages/kbn-dev-utils/src/ci_stats_reporter[`CiStatsReporter` readme].

docs/developer/contributing/index.asciidoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Read <<development-getting-started>> to get your environment up and running, the
99
* <<development-tests>>
1010
* <<development-github>>
1111
* <<interpreting-ci-failures>>
12+
* <<ci-metrics>>
1213
* <<development-documentation>>
1314
* <<development-pull-request>>
1415
* <<kibana-issue-reporting>>
@@ -78,6 +79,8 @@ include::development-tests.asciidoc[leveloffset=+1]
7879

7980
include::interpreting-ci-failures.asciidoc[leveloffset=+1]
8081

82+
include::development-ci-metrics.asciidoc[leveloffset=+1]
83+
8184
include::development-documentation.asciidoc[leveloffset=+1]
8285

8386
include::development-pull-request.asciidoc[leveloffset=+1]

package.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@
138138
"@kbn/telemetry-tools": "1.0.0",
139139
"@kbn/test-subj-selector": "0.2.1",
140140
"@kbn/ui-framework": "1.0.0",
141+
"@kbn/ace": "1.0.0",
142+
"@kbn/monaco": "1.0.0",
141143
"@kbn/ui-shared-deps": "1.0.0",
142144
"@types/yauzl": "^2.9.1",
143145
"JSONStream": "1.3.5",
@@ -248,8 +250,11 @@
248250
"@microsoft/api-documenter": "7.7.2",
249251
"@microsoft/api-extractor": "7.7.0",
250252
"@percy/agent": "^0.26.0",
251-
"@testing-library/react": "^9.3.2",
252-
"@testing-library/react-hooks": "^3.2.1",
253+
"@testing-library/dom": "^7.24.2",
254+
"@testing-library/jest-dom": "^5.11.4",
255+
"@testing-library/react": "^11.0.4",
256+
"@testing-library/react-hooks": "^3.4.1",
257+
"@testing-library/user-event": "^12.1.6",
253258
"@types/accept": "3.1.1",
254259
"@types/angular": "^1.6.56",
255260
"@types/angular-mocks": "^1.7.0",
@@ -329,10 +334,8 @@
329334
"@types/supertest": "^2.0.5",
330335
"@types/supertest-as-promised": "^2.0.38",
331336
"@types/tar": "^4.0.3",
332-
"@types/testing-library__dom": "^6.10.0",
333-
"@types/testing-library__jest-dom": "^5.7.0",
334-
"@types/testing-library__react": "^9.1.2",
335-
"@types/testing-library__react-hooks": "^3.1.0",
337+
"@types/testing-library__jest-dom": "^5.9.2",
338+
"@types/testing-library__react-hooks": "^3.4.0",
336339
"@types/type-detect": "^4.0.1",
337340
"@types/uuid": "^3.4.4",
338341
"@types/vinyl": "^2.0.4",

packages/kbn-ace/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# @kbn/ace
2+
3+
Contains all Kibana-specific brace related code. Excluding the code that still inside of Console because that code is only used inside of console at the moment.
4+
5+
This package enables plugins to use this functionality and import it as needed -- behind an async import so that brace does not bloat the JS code needed for first page load of Kibana.

packages/kbn-ace/package.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "@kbn/ace",
3+
"version": "1.0.0",
4+
"private": true,
5+
"main": "./target/index.js",
6+
"license": "Apache-2.0",
7+
"scripts": {
8+
"build": "node ./scripts/build.js",
9+
"kbn:bootstrap": "yarn build --dev"
10+
},
11+
"dependencies": {
12+
"brace": "0.11.1"
13+
},
14+
"devDependencies": {
15+
"@kbn/dev-utils": "1.0.0",
16+
"@kbn/babel-preset": "1.0.0",
17+
"raw-loader": "3.1.0",
18+
"typescript": "4.0.2"
19+
}
20+
}

packages/kbn-ace/scripts/build.js

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
const path = require('path');
21+
const del = require('del');
22+
const fs = require('fs');
23+
const supportsColor = require('supports-color');
24+
const { run } = require('@kbn/dev-utils');
25+
26+
const TARGET_BUILD_DIR = path.resolve(__dirname, '../target');
27+
const ROOT_DIR = path.resolve(__dirname, '../');
28+
const WORKER_PATH_SECTION = 'ace/modes/x_json/worker/x_json.ace.worker.js';
29+
30+
run(
31+
async ({ procRunner, log }) => {
32+
log.info('Deleting old output');
33+
34+
await del(TARGET_BUILD_DIR);
35+
36+
const cwd = ROOT_DIR;
37+
const env = { ...process.env };
38+
39+
if (supportsColor.stdout) {
40+
env.FORCE_COLOR = 'true';
41+
}
42+
43+
await procRunner.run('tsc ', {
44+
cmd: 'tsc',
45+
args: [],
46+
wait: true,
47+
env,
48+
cwd,
49+
});
50+
51+
log.success('Copying worker file to target.');
52+
53+
fs.copyFileSync(
54+
path.resolve(__dirname, '..', 'src', WORKER_PATH_SECTION),
55+
path.resolve(__dirname, '..', 'target', WORKER_PATH_SECTION)
56+
);
57+
58+
log.success('Complete');
59+
},
60+
{
61+
flags: {
62+
boolean: ['dev'],
63+
},
64+
}
65+
);

0 commit comments

Comments
 (0)