-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
「AppArch」Interpreter 👉 New Platform #39329
Conversation
Error when running
Contents of test bundle: Above error is caused when NP plugin imports from |
Pinging @elastic/kibana-app-arch |
💔 Build Failed |
💔 Build Failed |
Please re-request review once this is ready |
💚 Build Succeeded |
💚 Build Succeeded |
💔 Build Failed |
|
||
export function interpreterProvider(config) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another problem with any
- I often don't understand it is just a temporary mock or I can use any
for real
💚 Build Succeeded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, things seem to work well and requested changes are addressed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed to unify Setup & Start Interfaces in followup
* under the License. | ||
*/ | ||
|
||
export const mockNewPlatformBackdoor = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name and location of this file suggests that it's a generic New Platform mock so other developers might also use this in their tests although the plugins.data
mock is very specific to your unit tests. We'd rather want them to use #39351
Can you move this mock file into your plugin so that the code is more local?
Optional: Use / adapt #39351 for your tests. You'll have to add an empty plugins
mock to https://github.com/elastic/kibana/pull/39351/files#diff-a0d66a99cc197c9ae8a0956f8df3bbdeR28
and then in your tests:
import { pluginsMock } from '../../../../../../../../core/public/ui_new_platform.test.mocks';
pluginsMock.mockReturnValue({
data: {
expressions: {...}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created PR #40123 to address this.
* 「AppArch」Interpreter 👉 New Platform (#39329) * feat: 🎸 set-up NP data plugin * refactor: 💡 move interpreter functions registry to NP * refactor: 💡 move interpreter renderer registry to NP plugin * refactor: 💡 move interpreter typesRegistry to NP * refactor: 💡 move interpreter types to NP * chore: 🤖 import typeRegistry from NP and change TS type folder * refactor: 💡 move interpreter expression types to NP * refactor: 💡 move rest of interpreter common folder to NP plugin * fix: 🐛 fix TypeScript errors * test: 💍 improve typings and test mocks * refactor: 💡 make Interpreter internal registry impl private * test: 💍 inline NP backdoor mock creation in test suites * chore: 🤖 change @kbn/interpreter import paths to try fix errors * fix: 🐛 improve core Plugin interfaces * feat: 🎸 add stop() lifecycle to NP data plugins * refactor: 💡 move interpreter into expressions service data NP * refactor: 💡 inline Registry @kbn/interpreter class * refactor: 💡 remove dependency on @kbn/interpreter in data pub * refactor: 💡 move interpreter common dir into expressions dir * fix: 🐛 use TS types in kibana_context * feat: 🎸 add types suggested in PR review * feat: 🎸 add semantic interpreter registration functions * refactor: 💡 use require for all @kbn/interpreter imports * test: 💍 add Karma test mocks, thx @spalger 🙏 * docs: ✏️ update Core docs * test: 💍 add Sinon stubs for registries * chore: 🤖 change import syntax in hopes CI will work * chore: 🤖 set App Architecture as owners of data plugin * docs: ✏️ add README * chore: 🤖 change import in hopes to fix optimizer * fix: 🐛 make stop() plugin life-cycle optional * docs: ✏️ update Core API docs * test: 💍 remove unnecessary Jest mock * chore: 🤖 don't import from deeply inside a plugin * refactor: 💡 try different interpreter import * fix: 🐛 fix Karma mocking * fix: 🐛 fix TypeScript type imports * test: 💍 fix broken test * fix: 🐛 use "kibana" version to make it work everywhere * style: 💄 fix linter error
Summary
This moves about half of the Interpreter plugin to new platform.
Interpreter has two major parts: (1) registries; (2) the
run()
function. This PR moves the registries to the NP, a subsequent PR will move therun
function.Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.This was checked for cross-browser compatibility, including a check against IE11Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n supportDocumentation was added for features that require explanation or tutorialsUnit or functional tests were updated or added to match the most common scenariosThis was checked for keyboard-only and screenreader accessibilityFor maintainers
This was checked for breaking API changes and was labeled appropriatelyThis includes a feature addition or change that requires a release note and was labeled appropriately