Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/ML-60015-transforms-filter-agg' …
Browse files Browse the repository at this point in the history
…into ML-60015-transforms-filter-agg
  • Loading branch information
darnautov committed Jun 4, 2020
2 parents a9723ed + 67a85e1 commit e2ce842
Show file tree
Hide file tree
Showing 716 changed files with 8,599 additions and 6,219 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [ApplicationStart](./kibana-plugin-core-public.applicationstart.md) &gt; [applications$](./kibana-plugin-core-public.applicationstart.applications_.md)

## ApplicationStart.applications$ property

Observable emitting the list of currently registered apps and their associated status.

<b>Signature:</b>

```typescript
applications$: Observable<ReadonlyMap<string, PublicAppInfo | PublicLegacyAppInfo>>;
```

## Remarks

Applications disabled by [Capabilities](./kibana-plugin-core-public.capabilities.md) will not be present in the map. Applications manually disabled from the client-side using an [application updater](./kibana-plugin-core-public.appupdater.md) are present, with their status properly set as `inaccessible`<!-- -->.

Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface ApplicationStart

| Property | Type | Description |
| --- | --- | --- |
| [applications$](./kibana-plugin-core-public.applicationstart.applications_.md) | <code>Observable&lt;ReadonlyMap&lt;string, PublicAppInfo &#124; PublicLegacyAppInfo&gt;&gt;</code> | Observable emitting the list of currently registered apps and their associated status. |
| [capabilities](./kibana-plugin-core-public.applicationstart.capabilities.md) | <code>RecursiveReadonly&lt;Capabilities&gt;</code> | Gets the read-only capabilities. |
| [currentAppId$](./kibana-plugin-core-public.applicationstart.currentappid_.md) | <code>Observable&lt;string &#124; undefined&gt;</code> | An observable that emits the current application id and each subsequent id update. |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import React from 'react';
import ReactDOM from 'react-dom';
import { BrowserRouter, Route } from 'react-router-dom';

import { CoreStart, AppMountParams } from 'src/core/public';
import { CoreStart, AppMountParameters } from 'src/core/public';
import { MyPluginDepsStart } from './plugin';

export renderApp = ({ element, history, onAppLeave }: AppMountParams) => {
export renderApp = ({ element, history, onAppLeave }: AppMountParameters) => {
const { renderApp, hasUnsavedChanges } = await import('./application');
onAppLeave(actions => {
if(hasUnsavedChanges()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [LegacyApp](./kibana-plugin-core-public.legacyapp.md) &gt; [appUrl](./kibana-plugin-core-public.legacyapp.appurl.md)

## LegacyApp.appUrl property

<b>Signature:</b>

```typescript
appUrl: string;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [LegacyApp](./kibana-plugin-core-public.legacyapp.md) &gt; [disableSubUrlTracking](./kibana-plugin-core-public.legacyapp.disablesuburltracking.md)

## LegacyApp.disableSubUrlTracking property

<b>Signature:</b>

```typescript
disableSubUrlTracking?: boolean;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [LegacyApp](./kibana-plugin-core-public.legacyapp.md) &gt; [linkToLastSubUrl](./kibana-plugin-core-public.legacyapp.linktolastsuburl.md)

## LegacyApp.linkToLastSubUrl property

<b>Signature:</b>

```typescript
linkToLastSubUrl?: boolean;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [LegacyApp](./kibana-plugin-core-public.legacyapp.md)

## LegacyApp interface


<b>Signature:</b>

```typescript
export interface LegacyApp extends AppBase
```
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [appUrl](./kibana-plugin-core-public.legacyapp.appurl.md) | <code>string</code> | |
| [disableSubUrlTracking](./kibana-plugin-core-public.legacyapp.disablesuburltracking.md) | <code>boolean</code> | |
| [linkToLastSubUrl](./kibana-plugin-core-public.legacyapp.linktolastsuburl.md) | <code>boolean</code> | |
| [subUrlBase](./kibana-plugin-core-public.legacyapp.suburlbase.md) | <code>string</code> | |
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [LegacyApp](./kibana-plugin-core-public.legacyapp.md) &gt; [subUrlBase](./kibana-plugin-core-public.legacyapp.suburlbase.md)

## LegacyApp.subUrlBase property

<b>Signature:</b>

```typescript
subUrlBase?: string;
```
3 changes: 3 additions & 0 deletions docs/development/core/public/kibana-plugin-core-public.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [IHttpResponseInterceptorOverrides](./kibana-plugin-core-public.ihttpresponseinterceptoroverrides.md) | Properties that can be returned by HttpInterceptor.request to override the response. |
| [ImageValidation](./kibana-plugin-core-public.imagevalidation.md) | |
| [IUiSettingsClient](./kibana-plugin-core-public.iuisettingsclient.md) | Client-side client that provides access to the advanced settings stored in elasticsearch. The settings provide control over the behavior of the Kibana application. For example, a user can specify how to display numeric or date fields. Users can adjust the settings via Management UI. [IUiSettingsClient](./kibana-plugin-core-public.iuisettingsclient.md) |
| [LegacyApp](./kibana-plugin-core-public.legacyapp.md) | |
| [LegacyCoreSetup](./kibana-plugin-core-public.legacycoresetup.md) | Setup interface exposed to the legacy platform via the <code>ui/new_platform</code> module. |
| [LegacyCoreStart](./kibana-plugin-core-public.legacycorestart.md) | Start interface exposed to the legacy platform via the <code>ui/new_platform</code> module. |
| [LegacyNavLink](./kibana-plugin-core-public.legacynavlink.md) | |
Expand Down Expand Up @@ -162,6 +163,8 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [NavType](./kibana-plugin-core-public.navtype.md) | |
| [PluginInitializer](./kibana-plugin-core-public.plugininitializer.md) | The <code>plugin</code> export at the root of a plugin's <code>public</code> directory should conform to this interface. |
| [PluginOpaqueId](./kibana-plugin-core-public.pluginopaqueid.md) | |
| [PublicAppInfo](./kibana-plugin-core-public.publicappinfo.md) | Public information about a registered [application](./kibana-plugin-core-public.app.md) |
| [PublicLegacyAppInfo](./kibana-plugin-core-public.publiclegacyappinfo.md) | Information about a registered [legacy application](./kibana-plugin-core-public.legacyapp.md) |
| [PublicUiSettingsParams](./kibana-plugin-core-public.publicuisettingsparams.md) | A sub-set of [UiSettingsParams](./kibana-plugin-core-public.uisettingsparams.md) exposed to the client-side. |
| [RecursiveReadonly](./kibana-plugin-core-public.recursivereadonly.md) | |
| [SavedObjectAttribute](./kibana-plugin-core-public.savedobjectattribute.md) | Type definition for a Saved Object attribute value |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [PublicAppInfo](./kibana-plugin-core-public.publicappinfo.md)

## PublicAppInfo type

Public information about a registered [application](./kibana-plugin-core-public.app.md)

<b>Signature:</b>

```typescript
export declare type PublicAppInfo = Omit<App, 'mount' | 'updater$'> & {
legacy: false;
};
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [PublicLegacyAppInfo](./kibana-plugin-core-public.publiclegacyappinfo.md)

## PublicLegacyAppInfo type

Information about a registered [legacy application](./kibana-plugin-core-public.legacyapp.md)

<b>Signature:</b>

```typescript
export declare type PublicLegacyAppInfo = Omit<LegacyApp, 'updater$'> & {
legacy: true;
};
```
2 changes: 1 addition & 1 deletion docs/setup/docker.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Some example translations are shown here:
[horizontal]
**Environment Variable**:: **Kibana Setting**
`SERVER_NAME`:: `server.name`
`KIBANA_DEFAULTAPPID`:: `kibana.defaultAppId`
`SERVER_BASEPATH`:: `server.basePath`
`MONITORING_ENABLED`:: `monitoring.enabled`

In general, any setting listed in <<settings>> can be
Expand Down
4 changes: 3 additions & 1 deletion docs/setup/settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,9 @@ on the {kib} index at startup. {kib} users still need to authenticate with
| Enables use of interpreter in Visualize. *Default: `true`*

| `kibana.defaultAppId:`
| The default application to load. *Default: `"home"`*
| *deprecated* This setting is deprecated and will get removed in Kibana 8.0.
Please use the `defaultRoute` advanced setting instead.
The default application to load. *Default: `"home"`*

| `kibana.index:`
| {kib} uses an index in {es} to store saved searches, visualizations, and
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
"@elastic/eui": "23.3.1",
"@elastic/filesaver": "1.1.2",
"@elastic/good": "8.1.1-kibana2",
"@elastic/numeral": "2.4.0",
"@elastic/numeral": "^2.5.0",
"@elastic/request-crypto": "1.1.4",
"@elastic/ui-ace": "0.2.3",
"@hapi/good-squeeze": "5.2.1",
Expand Down Expand Up @@ -365,7 +365,6 @@
"@types/node": ">=10.17.17 <10.20.0",
"@types/node-forge": "^0.9.0",
"@types/normalize-path": "^3.0.0",
"@types/numeral": "^0.0.26",
"@types/opn": "^5.1.0",
"@types/pegjs": "^0.10.1",
"@types/pngjs": "^3.3.2",
Expand Down
4 changes: 4 additions & 0 deletions packages/eslint-config-kibana/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ module.exports = {
to: false,
disallowedMessage: `Don't use 'mkdirp', use the new { recursive: true } option of Fs.mkdir instead`
},
{
from: 'numeral',
to: '@elastic/numeral',
},
{
from: '@kbn/elastic-idx',
to: false,
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-optimizer/src/optimizer/optimizer_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export class OptimizerConfig {
new Bundle({
type: 'entry',
id: 'core',
entry: './public/entry_point',
entry: './public/index',
sourceRoot: options.repoRoot,
contextDir: Path.resolve(options.repoRoot, 'src/core'),
outputDir: Path.resolve(options.repoRoot, 'src/core/target/public'),
Expand Down
66 changes: 39 additions & 27 deletions packages/kbn-optimizer/src/worker/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,32 @@ const IS_CODE_COVERAGE = !!process.env.CODE_COVERAGE;
const ISTANBUL_PRESET_PATH = require.resolve('@kbn/babel-preset/istanbul_preset');
const BABEL_PRESET_PATH = require.resolve('@kbn/babel-preset/webpack_preset');

const STATIC_BUNDLE_PLUGINS = [
{ id: 'data', dirname: 'data' },
{ id: 'kibanaReact', dirname: 'kibana_react' },
{ id: 'kibanaUtils', dirname: 'kibana_utils' },
{ id: 'esUiShared', dirname: 'es_ui_shared' },
const SHARED_BUNDLES = [
{
type: 'entry',
id: 'core',
rootRelativeDir: 'src/core/public',
},
{
type: 'plugin',
id: 'data',
rootRelativeDir: 'src/plugins/data/public',
},
{
type: 'plugin',
id: 'kibanaReact',
rootRelativeDir: 'src/plugins/kibana_react/public',
},
{
type: 'plugin',
id: 'kibanaUtils',
rootRelativeDir: 'src/plugins/kibana_utils/public',
},
{
type: 'plugin',
id: 'esUiShared',
rootRelativeDir: 'src/plugins/es_ui_shared/public',
},
];

/**
Expand All @@ -57,29 +78,24 @@ const STATIC_BUNDLE_PLUGINS = [
* @param request the request for a module from a commonjs require() call or import statement
*/
function dynamicExternals(bundle: Bundle, context: string, request: string) {
// ignore imports that have loaders defined
if (request.includes('!')) {
return;
}

// ignore requests that don't include a /{dirname}/public for one of our
// "static" bundles as a cheap way to avoid doing path resolution
// for paths that couldn't possibly resolve to what we're looking for
const reqToStaticBundle = STATIC_BUNDLE_PLUGINS.some((p) =>
request.includes(`/${p.dirname}/public`)
);
if (!reqToStaticBundle) {
// ignore imports that have loaders defined or are not relative seeming
if (request.includes('!') || !request.startsWith('.')) {
return;
}

// determine the most acurate resolution string we can without running full resolution
const rootRelative = normalizePath(
Path.relative(bundle.sourceRoot, Path.resolve(context, request))
);
for (const { id, dirname } of STATIC_BUNDLE_PLUGINS) {
if (rootRelative === `src/plugins/${dirname}/public`) {
return `__kbnBundles__['plugin/${id}']`;
for (const sharedBundle of SHARED_BUNDLES) {
if (
rootRelative !== sharedBundle.rootRelativeDir ||
`${bundle.type}/${bundle.id}` === `${sharedBundle.type}/${sharedBundle.id}`
) {
continue;
}

return `__kbnBundles__['${sharedBundle.type}/${sharedBundle.id}']`;
}

// import doesn't match a root public import
Expand Down Expand Up @@ -112,13 +128,9 @@ export function getWebpackConfig(bundle: Bundle, worker: WorkerConfig) {
info.absoluteResourcePath
)}${info.query}`,
jsonpFunction: `${bundle.id}_bundle_jsonpfunction`,
...(bundle.type === 'plugin'
? {
// When the entry point is loaded, assign it's exported `plugin`
// value to a key on the global `__kbnBundles__` object.
library: ['__kbnBundles__', `plugin/${bundle.id}`],
}
: {}),
// When the entry point is loaded, assign it's default export
// to a key on the global `__kbnBundles__` object.
library: ['__kbnBundles__', `${bundle.type}/${bundle.id}`],
},

optimization: {
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-ui-shared-deps/entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Moment.tz.load(require('moment-timezone/data/packed/latest.json'));
// big deps which are locked to a single version
export const Rxjs = require('rxjs');
export const RxjsOperators = require('rxjs/operators');
export const ElasticNumeral = require('@elastic/numeral');
export const ElasticCharts = require('@elastic/charts');
export const ElasticEui = require('@elastic/eui');
export const ElasticEuiLibServices = require('@elastic/eui/lib/services');
Expand Down
2 changes: 2 additions & 0 deletions packages/kbn-ui-shared-deps/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ exports.externals = {
*/
rxjs: '__kbnSharedDeps__.Rxjs',
'rxjs/operators': '__kbnSharedDeps__.RxjsOperators',
numeral: '__kbnSharedDeps__.ElasticNumeral',
'@elastic/numeral': '__kbnSharedDeps__.ElasticNumeral',
'@elastic/charts': '__kbnSharedDeps__.ElasticCharts',
'@elastic/eui': '__kbnSharedDeps__.ElasticEui',
'@elastic/eui/lib/services': '__kbnSharedDeps__.ElasticEuiLibServices',
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-ui-shared-deps/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"dependencies": {
"@elastic/charts": "19.2.0",
"@elastic/eui": "23.3.1",
"@elastic/numeral": "^2.5.0",
"@kbn/i18n": "1.0.0",
"abortcontroller-polyfill": "^1.4.0",
"angular": "^1.7.9",
Expand Down
8 changes: 0 additions & 8 deletions renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -715,14 +715,6 @@
'@types/normalize-path',
],
},
{
groupSlug: 'numeral',
groupName: 'numeral related packages',
packageNames: [
'numeral',
'@types/numeral',
],
},
{
groupSlug: 'object-hash',
groupName: 'object-hash related packages',
Expand Down
10 changes: 7 additions & 3 deletions src/core/CONVENTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,17 +167,21 @@ leverage this pattern.

import React from 'react';
import ReactDOM from 'react-dom';
import { CoreStart, AppMountParams } from '../../src/core/public';
import { CoreStart, AppMountParameters } from 'src/core/public';

import { MyAppRoot } from './components/app.ts';

/**
* This module will be loaded asynchronously to reduce the bundle size of your plugin's main bundle.
*/
export const renderApp = (core: CoreStart, deps: MyPluginDepsStart, { element, history }: AppMountParams) => {
export const renderApp = (
core: CoreStart,
deps: MyPluginDepsStart,
{ element, history }: AppMountParameters
) => {
ReactDOM.render(<MyAppRoot core={core} deps={deps} routerHistory={history} />, element);
return () => ReactDOM.unmountComponentAtNode(element);
}
};
```

```ts
Expand Down
8 changes: 6 additions & 2 deletions src/core/TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -475,10 +475,14 @@ The more interesting logic is in `renderApp`:
import React from 'react';
import ReactDOM from 'react-dom';

import { AppMountParams, CoreStart } from 'src/core/public';
import { AppMountParameters, CoreStart } from 'src/core/public';
import { AppRoot } from './components/app_root';

export const renderApp = ({ element, history }: AppMountParams, core: CoreStart, plugins: MyPluginDepsStart) => {
export const renderApp = (
{ element, history }: AppMountParameters,
core: CoreStart,
plugins: MyPluginDepsStart
) => {
// Hide the chrome while this app is mounted for a full screen experience
core.chrome.setIsVisible(false);

Expand Down
Loading

0 comments on commit e2ce842

Please sign in to comment.