diff --git a/src/legacy/ui/public/new_platform/new_platform.karma_mock.js b/src/legacy/ui/public/new_platform/new_platform.karma_mock.js index 5ef1149146af..b8d48b784dba 100644 --- a/src/legacy/ui/public/new_platform/new_platform.karma_mock.js +++ b/src/legacy/ui/public/new_platform/new_platform.karma_mock.js @@ -221,17 +221,6 @@ export const npSetup = { registerFunction: sinon.fake(), registerRenderer: sinon.fake(), registerType: sinon.fake(), - __LEGACY: { - renderers: { - register: () => undefined, - get: () => null, - }, - getExecutor: () => ({ - interpreter: { - interpretAst: () => {}, - }, - }), - }, }, data: { autocomplete: { diff --git a/src/plugins/expressions/kibana.json b/src/plugins/expressions/kibana.json index 516333108810..67bbf4b6e545 100644 --- a/src/plugins/expressions/kibana.json +++ b/src/plugins/expressions/kibana.json @@ -3,9 +3,6 @@ "version": "kibana", "server": true, "ui": true, - "requiredPlugins": [ - "bfetch" - ], "extraPublicDirs": ["common", "common/fonts"], "requiredBundles": [ "kibanaUtils", diff --git a/src/plugins/expressions/public/loader.test.ts b/src/plugins/expressions/public/loader.test.ts index e07a22a5e1d6..bf8b44276956 100644 --- a/src/plugins/expressions/public/loader.test.ts +++ b/src/plugins/expressions/public/loader.test.ts @@ -20,7 +20,7 @@ import { first, skip, toArray } from 'rxjs/operators'; import { loader, ExpressionLoader } from './loader'; import { Observable } from 'rxjs'; -import { ExpressionAstExpression, parseExpression, IInterpreterRenderHandlers } from '../common'; +import { parseExpression, IInterpreterRenderHandlers } from '../common'; // eslint-disable-next-line const { __getLastExecution } = require('./services'); @@ -42,13 +42,6 @@ jest.mock('./services', () => { const moduleMock = { __execution: undefined, __getLastExecution: () => moduleMock.__execution, - getInterpreter: () => { - return { - interpretAst: async (expression: ExpressionAstExpression) => { - return { type: 'render', as: 'test' }; - }, - }; - }, getRenderersRegistry: () => ({ get: (id: string) => renderers[id], }), diff --git a/src/plugins/expressions/public/mocks.tsx b/src/plugins/expressions/public/mocks.tsx index 6e649c29ead7..3865b4d20620 100644 --- a/src/plugins/expressions/public/mocks.tsx +++ b/src/plugins/expressions/public/mocks.tsx @@ -21,7 +21,6 @@ import React from 'react'; import { ExpressionsSetup, ExpressionsStart, plugin as pluginInitializer } from '.'; import { coreMock } from '../../../core/public/mocks'; -import { bfetchPluginMock } from '../../bfetch/public/mocks'; export type Setup = jest.Mocked; export type Start = jest.Mocked; @@ -39,23 +38,6 @@ const createSetupContract = (): Setup => { registerRenderer: jest.fn(), registerType: jest.fn(), run: jest.fn(), - __LEGACY: { - functions: { - register: () => {}, - } as any, - renderers: { - register: () => {}, - } as any, - types: { - register: () => {}, - } as any, - getExecutor: () => ({ - interpreter: { - interpretAst: (() => {}) as any, - }, - }), - loadLegacyServerFunctionWrappers: () => Promise.resolve(), - }, }; return setupContract; }; @@ -84,9 +66,7 @@ const createPlugin = async () => { const coreSetup = coreMock.createSetup(); const coreStart = coreMock.createStart(); const plugin = pluginInitializer(pluginInitializerContext); - const setup = await plugin.setup(coreSetup, { - bfetch: bfetchPluginMock.createSetupContract(), - }); + const setup = await plugin.setup(coreSetup); return { pluginInitializerContext, @@ -94,10 +74,7 @@ const createPlugin = async () => { coreStart, plugin, setup, - doStart: async () => - await plugin.start(coreStart, { - bfetch: bfetchPluginMock.createStartContract(), - }), + doStart: async () => await plugin.start(coreStart), }; }; diff --git a/src/plugins/expressions/public/plugin.ts b/src/plugins/expressions/public/plugin.ts index ec60fbdf44c3..9768ece899dd 100644 --- a/src/plugins/expressions/public/plugin.ts +++ b/src/plugins/expressions/public/plugin.ts @@ -17,75 +17,19 @@ * under the License. */ -import { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from '../../../core/public'; -import { ExpressionExecutor } from './types'; +import { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from 'src/core/public'; import { - ExpressionRendererRegistry, - FunctionsRegistry, - serializeProvider, - TypesRegistry, ExpressionsService, ExpressionsServiceSetup, ExpressionsServiceStart, ExecutionContext, } from '../common'; -import { BfetchPublicSetup, BfetchPublicStart } from '../../bfetch/public'; -import { - setCoreStart, - setInterpreter, - setRenderersRegistry, - setNotifications, - setExpressionsService, -} from './services'; +import { setRenderersRegistry, setNotifications, setExpressionsService } from './services'; import { ReactExpressionRenderer } from './react_expression_renderer'; import { ExpressionLoader, loader } from './loader'; import { render, ExpressionRenderHandler } from './render'; -export interface ExpressionsSetupDeps { - bfetch: BfetchPublicSetup; -} - -export interface ExpressionsStartDeps { - bfetch: BfetchPublicStart; -} - -export interface ExpressionsSetup extends ExpressionsServiceSetup { - /** - * @todo Get rid of these `__LEGACY` APIs. - * - * `__LEGACY` APIs are used by Canvas. It should be possible to stop - * using all of them (except `loadLegacyServerFunctionWrappers`) and use - * Kibana Platform plugin contracts instead. - */ - __LEGACY: { - /** - * Use `registerType` and `getTypes` instead. - */ - types: TypesRegistry; - - /** - * Use `registerFunction` and `getFunctions` instead. - */ - functions: FunctionsRegistry; - - /** - * Use `registerRenderer` and `getRenderers`, and `getRenderer` instead. - */ - renderers: ExpressionRendererRegistry; - - /** - * Use `run` function instead. - */ - getExecutor: () => ExpressionExecutor; - - /** - * This function is used by Canvas to load server-side function and create - * browser-side "wrapper" for each one. This function can be removed once - * we enable expressions on server-side: https://github.com/elastic/kibana/issues/46906 - */ - loadLegacyServerFunctionWrappers: () => Promise; - }; -} +export type ExpressionsSetup = ExpressionsServiceSetup; export interface ExpressionsStart extends ExpressionsServiceStart { ExpressionLoader: typeof ExpressionLoader; @@ -95,9 +39,7 @@ export interface ExpressionsStart extends ExpressionsServiceStart { render: typeof render; } -export class ExpressionsPublicPlugin - implements - Plugin { +export class ExpressionsPublicPlugin implements Plugin { private readonly expressions: ExpressionsService = new ExpressionsService(); constructor(initializerContext: PluginInitializerContext) {} @@ -116,68 +58,21 @@ export class ExpressionsPublicPlugin }); } - public setup(core: CoreSetup, { bfetch }: ExpressionsSetupDeps): ExpressionsSetup { + public setup(core: CoreSetup): ExpressionsSetup { this.configureExecutor(core); const { expressions } = this; - const { executor, renderers } = expressions; + const { renderers } = expressions; setRenderersRegistry(renderers); - setExpressionsService(this.expressions); + setExpressionsService(expressions); - const expressionsSetup = expressions.setup(); - - // This is legacy. Should go away when we get rid of __LEGACY. - const getExecutor = (): ExpressionExecutor => { - return { interpreter: { interpretAst: expressionsSetup.run } }; - }; - - setInterpreter(getExecutor().interpreter); - - let cached: Promise | null = null; - const loadLegacyServerFunctionWrappers = async () => { - if (!cached) { - cached = (async () => { - const serverFunctionList = await core.http.get(`/api/interpreter/fns`); - const batchedFunction = bfetch.batchedFunction({ url: `/api/interpreter/fns` }); - const { serialize } = serializeProvider(executor.getTypes()); - - // For every sever-side function, register a client-side - // function that matches its definition, but which simply - // calls the server-side function endpoint. - Object.keys(serverFunctionList).forEach((functionName) => { - if (expressionsSetup.getFunction(functionName)) { - return; - } - const fn = () => ({ - ...serverFunctionList[functionName], - fn: (input: any, args: any) => { - return batchedFunction({ functionName, args, context: serialize(input) }); - }, - }); - expressionsSetup.registerFunction(fn); - }); - })(); - } - return cached; - }; - - const setup: ExpressionsSetup = { - ...expressionsSetup, - __LEGACY: { - types: executor.types, - functions: executor.functions, - renderers, - getExecutor, - loadLegacyServerFunctionWrappers, - }, - }; + const setup = expressions.setup(); return Object.freeze(setup); } - public start(core: CoreStart, { bfetch }: ExpressionsStartDeps): ExpressionsStart { - setCoreStart(core); + public start(core: CoreStart): ExpressionsStart { setNotifications(core.notifications); const { expressions } = this; diff --git a/src/plugins/expressions/public/services.ts b/src/plugins/expressions/public/services.ts index 016456c95666..e296566e661c 100644 --- a/src/plugins/expressions/public/services.ts +++ b/src/plugins/expressions/public/services.ts @@ -18,22 +18,15 @@ */ import { NotificationsStart } from 'kibana/public'; -import { createKibanaUtilsCore, createGetterSetter } from '../../kibana_utils/public'; -import { ExpressionInterpreter } from './types'; -import { ExpressionsSetup } from './plugin'; -import { ExpressionsService } from '../common'; +import { createGetterSetter } from '../../kibana_utils/public'; +import { ExpressionsService, ExpressionRendererRegistry } from '../common'; -export const { getCoreStart, setCoreStart } = createKibanaUtilsCore(); - -export const [getInterpreter, setInterpreter] = createGetterSetter( - 'Interpreter' -); export const [getNotifications, setNotifications] = createGetterSetter( 'Notifications' ); export const [getRenderersRegistry, setRenderersRegistry] = createGetterSetter< - ExpressionsSetup['__LEGACY']['renderers'] + ExpressionRendererRegistry >('Renderers registry'); export const [getExpressionsService, setExpressionsService] = createGetterSetter< diff --git a/src/plugins/expressions/server/index.ts b/src/plugins/expressions/server/index.ts index 9b2f0b794258..678545732159 100644 --- a/src/plugins/expressions/server/index.ts +++ b/src/plugins/expressions/server/index.ts @@ -17,7 +17,7 @@ * under the License. */ -import { PluginInitializerContext } from '../../../core/server'; +import { PluginInitializerContext } from 'src/core/server'; import { ExpressionsServerPlugin } from './plugin'; export { ExpressionsServerSetup, ExpressionsServerStart } from './plugin'; diff --git a/src/plugins/expressions/server/legacy.ts b/src/plugins/expressions/server/legacy.ts deleted file mode 100644 index 8ff08542f18f..000000000000 --- a/src/plugins/expressions/server/legacy.ts +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* eslint-disable max-classes-per-file */ - -// TODO: Remove this file once https://github.com/elastic/kibana/issues/46906 is complete. - -// @ts-ignore -import { register, registryFactory, Registry, Fn } from '@kbn/interpreter/common'; - -import Boom from 'boom'; -import { schema } from '@kbn/config-schema'; -import { CoreSetup, Logger, LegacyAPICaller } from 'src/core/server'; -import { ExpressionsServerSetupDependencies } from './plugin'; -import { typeSpecs, ExpressionType } from '../common'; -import { serializeProvider } from '../common'; - -export class TypesRegistry extends Registry { - wrapper(obj: any) { - return new (ExpressionType as any)(obj); - } -} - -export class FunctionsRegistry extends Registry { - wrapper(obj: any) { - return new Fn(obj); - } -} - -export const registries = { - types: new TypesRegistry(), - serverFunctions: new FunctionsRegistry(), -}; - -export interface LegacyInterpreterServerApi { - registries(): typeof registries; - register(specs: Record): typeof registries; -} - -export const createLegacyServerInterpreterApi = (): LegacyInterpreterServerApi => { - const api = registryFactory(registries); - - register(registries, { - types: typeSpecs, - }); - - return api; -}; - -export const createLegacyServerEndpoints = ( - api: LegacyInterpreterServerApi, - logger: Logger, - core: CoreSetup, - plugins: ExpressionsServerSetupDependencies -) => { - const router = core.http.createRouter(); - - /** - * Register the endpoint that returns the list of server-only functions. - */ - router.get( - { - path: `/api/interpreter/fns`, - validate: { - body: schema.any(), - }, - }, - async (context, request, response) => { - const functions = api.registries().serverFunctions.toJS(); - const body = JSON.stringify(functions); - return response.ok({ - body, - }); - } - ); - - /** - * Run a single Canvas function. - * - * @param {*} server - The Kibana server object - * @param {*} handlers - The Canvas handlers - * @param {*} fnCall - Describes the function being run `{ functionName, args, context }` - */ - async function runFunction( - handlers: { environment: string; elasticsearchClient: LegacyAPICaller }, - fnCall: any - ) { - const { functionName, args, context } = fnCall; - const { deserialize } = serializeProvider(registries.types.toJS()); - const fnDef = registries.serverFunctions.toJS()[functionName]; - if (!fnDef) throw Boom.notFound(`Function "${functionName}" could not be found.`); - const deserialized = deserialize(context); - const result = fnDef.fn(deserialized, args, handlers); - return result; - } - - /** - * Register an endpoint that executes a batch of functions, and streams the - * results back using ND-JSON. - */ - plugins.bfetch.addBatchProcessingRoute(`/api/interpreter/fns`, (request) => { - return { - onBatchItem: async (fnCall: any) => { - const [coreStart] = await core.getStartServices(); - const handlers = { - environment: 'server', - elasticsearchClient: coreStart.elasticsearch.legacy.client.asScoped(request) - .callAsCurrentUser, - }; - const result = await runFunction(handlers, fnCall); - if (typeof result === 'undefined') { - throw new Error(`Function ${fnCall.functionName} did not return anything.`); - } - return result; - }, - }; - }); -}; diff --git a/src/plugins/expressions/server/mocks.ts b/src/plugins/expressions/server/mocks.ts index e6b883e38f24..0512789d76ab 100644 --- a/src/plugins/expressions/server/mocks.ts +++ b/src/plugins/expressions/server/mocks.ts @@ -20,7 +20,6 @@ import { ExpressionsServerSetup, ExpressionsServerStart } from '.'; import { plugin as pluginInitializer } from '.'; import { coreMock } from '../../../core/server/mocks'; -import { bfetchPluginMock } from '../../bfetch/server/mocks'; export type Setup = jest.Mocked; export type Start = jest.Mocked; @@ -38,10 +37,6 @@ const createSetupContract = (): Setup => { registerRenderer: jest.fn(), registerType: jest.fn(), run: jest.fn(), - __LEGACY: { - register: jest.fn(), - registries: jest.fn(), - }, }; return setupContract; }; @@ -67,9 +62,7 @@ const createPlugin = async () => { const coreSetup = coreMock.createSetup(); const coreStart = coreMock.createStart(); const plugin = pluginInitializer(pluginInitializerContext); - const setup = await plugin.setup(coreSetup, { - bfetch: bfetchPluginMock.createSetupContract(), - }); + const setup = await plugin.setup(coreSetup); return { pluginInitializerContext, @@ -77,10 +70,7 @@ const createPlugin = async () => { coreStart, plugin, setup, - doStart: async () => - await plugin.start(coreStart, { - bfetch: bfetchPluginMock.createStartContract(), - }), + doStart: async () => await plugin.start(coreStart), }; }; diff --git a/src/plugins/expressions/server/plugin.ts b/src/plugins/expressions/server/plugin.ts index b99958262c54..9e412f9b3334 100644 --- a/src/plugins/expressions/server/plugin.ts +++ b/src/plugins/expressions/server/plugin.ts @@ -17,68 +17,30 @@ * under the License. */ -import { CoreStart, PluginInitializerContext, CoreSetup, Plugin } from 'src/core/server'; -import { BfetchServerSetup, BfetchServerStart } from '../../bfetch/server'; -import { - LegacyInterpreterServerApi, - createLegacyServerInterpreterApi, - createLegacyServerEndpoints, -} from './legacy'; +import { CoreStart, CoreSetup, Plugin, PluginInitializerContext } from 'src/core/server'; import { ExpressionsService, ExpressionsServiceSetup, ExpressionsServiceStart } from '../common'; -export interface ExpressionsServerSetupDependencies { - bfetch: BfetchServerSetup; -} - -export interface ExpressionsServerStartDependencies { - bfetch: BfetchServerStart; -} - -export interface ExpressionsServerSetup extends ExpressionsServiceSetup { - __LEGACY: LegacyInterpreterServerApi; -} +export type ExpressionsServerSetup = ExpressionsServiceSetup; export type ExpressionsServerStart = ExpressionsServiceStart; export class ExpressionsServerPlugin - implements - Plugin< - ExpressionsServerSetup, - ExpressionsServerStart, - ExpressionsServerSetupDependencies, - ExpressionsServerStartDependencies - > { + implements Plugin { readonly expressions: ExpressionsService = new ExpressionsService(); - constructor(private readonly initializerContext: PluginInitializerContext) {} + constructor(initializerContext: PluginInitializerContext) {} - public setup( - core: CoreSetup, - plugins: ExpressionsServerSetupDependencies - ): ExpressionsServerSetup { - const logger = this.initializerContext.logger.get(); - const { expressions } = this; - const { executor } = expressions; - - executor.extendContext({ + public setup(core: CoreSetup): ExpressionsServerSetup { + this.expressions.executor.extendContext({ environment: 'server', }); - const legacyApi = createLegacyServerInterpreterApi(); - createLegacyServerEndpoints(legacyApi, logger, core, plugins); - - const setup = { - ...this.expressions.setup(), - __LEGACY: legacyApi, - }; + const setup = this.expressions.setup(); return Object.freeze(setup); } - public start( - core: CoreStart, - plugins: ExpressionsServerStartDependencies - ): ExpressionsServerStart { + public start(core: CoreStart): ExpressionsServerStart { const start = this.expressions.start(); return Object.freeze(start); diff --git a/src/plugins/kibana_utils/public/core/create_kibana_utils_core.test.ts b/src/plugins/kibana_utils/public/core/create_kibana_utils_core.test.ts deleted file mode 100644 index c5b23bdf0055..000000000000 --- a/src/plugins/kibana_utils/public/core/create_kibana_utils_core.test.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { createKibanaUtilsCore } from './create_kibana_utils_core'; -import { CoreStart } from 'kibana/public'; - -describe('createKibanaUtilsCore', () => { - it('should allows to work with multiple instances', () => { - const core1 = {} as CoreStart; - const core2 = {} as CoreStart; - - const { setCoreStart: setCoreStart1, getCoreStart: getCoreStart1 } = createKibanaUtilsCore(); - const { setCoreStart: setCoreStart2, getCoreStart: getCoreStart2 } = createKibanaUtilsCore(); - - setCoreStart1(core1); - setCoreStart2(core2); - - expect(getCoreStart1()).toBe(core1); - expect(getCoreStart2()).toBe(core2); - - expect(getCoreStart1() !== getCoreStart2()).toBeTruthy(); - }); -}); diff --git a/src/plugins/kibana_utils/public/core/create_kibana_utils_core.ts b/src/plugins/kibana_utils/public/core/create_kibana_utils_core.ts deleted file mode 100644 index c528c68f29ed..000000000000 --- a/src/plugins/kibana_utils/public/core/create_kibana_utils_core.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { createGetterSetter, Get, Set } from '../../common'; -import { CoreStart } from '../../../../core/public'; -import { KUSavedObjectClient, createSavedObjectsClient } from './saved_objects_client'; - -interface Return { - getCoreStart: Get; - setCoreStart: Set; - savedObjects: KUSavedObjectClient; -} - -export const createKibanaUtilsCore = (): Return => { - const [getCoreStart, setCoreStart] = createGetterSetter('CoreStart'); - const savedObjects = createSavedObjectsClient(getCoreStart); - - return { - getCoreStart, - setCoreStart, - savedObjects, - }; -}; diff --git a/src/plugins/kibana_utils/public/core/index.ts b/src/plugins/kibana_utils/public/core/index.ts index 8bbb2129071f..5fb557f651e3 100644 --- a/src/plugins/kibana_utils/public/core/index.ts +++ b/src/plugins/kibana_utils/public/core/index.ts @@ -17,5 +17,4 @@ * under the License. */ -export * from './create_kibana_utils_core'; export * from './create_start_service_getter'; diff --git a/src/plugins/kibana_utils/public/core/saved_objects_client.ts b/src/plugins/kibana_utils/public/core/saved_objects_client.ts deleted file mode 100644 index 5262755a6a3a..000000000000 --- a/src/plugins/kibana_utils/public/core/saved_objects_client.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { CoreStart } from '../../../../core/public'; -import { Get } from '../../common'; - -type CoreSavedObjectClient = CoreStart['savedObjects']['client']; - -export interface KUSavedObjectClient { - get: CoreSavedObjectClient['get']; -} - -export const createSavedObjectsClient = (getCoreStart: Get) => { - const savedObjectsClient: KUSavedObjectClient = { - get: (...args) => getCoreStart().savedObjects.client.get(...args), - }; - - return savedObjectsClient; -}; diff --git a/src/plugins/kibana_utils/public/core/state.ts b/src/plugins/kibana_utils/public/core/state.ts deleted file mode 100644 index 52c4d166d737..000000000000 --- a/src/plugins/kibana_utils/public/core/state.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { createGetterSetter } from '../../common'; -import { CoreStart } from '../../../../core/public'; - -export const [getCoreStart, setCoreStart] = createGetterSetter('CoreStart'); diff --git a/x-pack/plugins/canvas/public/services/stubs/expressions.ts b/x-pack/plugins/canvas/public/services/stubs/expressions.ts index ee332e20c4ca..fd9b083964cb 100644 --- a/x-pack/plugins/canvas/public/services/stubs/expressions.ts +++ b/x-pack/plugins/canvas/public/services/stubs/expressions.ts @@ -12,9 +12,7 @@ import { renderFunctions } from '../../../canvas_plugin_src/renderers/core'; const placeholder = {} as any; const expressionsPlugin = plugin(placeholder); -const setup = expressionsPlugin.setup(placeholder, { - inspector: {}, -} as any); +const setup = expressionsPlugin.setup(placeholder); export const expressionsService: ExpressionsService = setup.fork();