-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Add ApplicationService Mounting #41007
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
2b9d376
to
e081514
Compare
This comment has been minimized.
This comment has been minimized.
e081514
to
85c36ec
Compare
This comment has been minimized.
This comment has been minimized.
85c36ec
to
8c32728
Compare
This comment has been minimized.
This comment has been minimized.
8c32728
to
7ffe664
Compare
This comment has been minimized.
This comment has been minimized.
7ffe664
to
e6c4287
Compare
This comment has been minimized.
This comment has been minimized.
e6c4287
to
adcb6cc
Compare
This comment has been minimized.
This comment has been minimized.
adcb6cc
to
52ece80
Compare
This comment has been minimized.
This comment has been minimized.
52ece80
to
a521c54
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
a521c54
to
0c0fd8b
Compare
This comment has been minimized.
This comment has been minimized.
aed2a1c
to
0908cfc
Compare
@elastic/kibana-platform With the EUI update in, I've updated this to support "open in new tab" correctly. This should be 100% ready now, just looking for approvals. |
💔 Build Failed |
💚 Build Succeeded |
core.application.register({ | ||
id: 'bar', | ||
title: 'Bar', | ||
async mount(context, params) { |
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.
we need to create recommendation how to declare additional properties on context
. if we delete this import https://github.com/elastic/kibana/pull/41007/files#diff-73111fdf9de323e24d3cf6695ad53aafR21 context
doesn't contain methods provided by dependency. because dependency declaration is not imported
declare module 'kibana/public' {
interface AppMountContext {...}
}
probably we should recommend declaring context type manually, as we do for deps. in this case plugin will always import a type from dependency and read module declaration.
application: { | ||
capabilities: mockStartDeps.application.capabilities, | ||
}, | ||
application: expect.any(Object), |
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.
what we want to test here?
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.
Yeah I'm starting to find these tests useless. We're basically just testing that the interface is right...which TS already does. What do you think about removing these assertions completely?
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.
- I'm not sure assertion works outside of expect. https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/jest/index.d.ts#L547-L563 this test uses it when creates a new object
- In other places when we test interfaces it's excessive, because TS performs the same check
}; | ||
} | ||
|
||
function isModifiedEvent(event: MouseEvent) { |
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.
no tests. I'm not sure that our testing framework supports keyDown + click
tho
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.
This entire UI has no tests when I copied it from legacy. I plan to refactor and cleanup all of this header UI code after this is done.
💔 Build Failed |
ae41a8c
to
65e64c3
Compare
💔 Build Failed |
💔 Build Failed |
💚 Build Succeeded |
* Add core-only bundle * Add ApplicationService mounting * Add LegacyCore{Setup,Start} * Fix PR comments * Add functional tests * Fix PR comments * Fix PR comments * Remove other usages of rootRoute * Use state field notation * Add support for open in new tab * Fix PR comments * Fix pesky await from the dead * Update docs * Bump @types/history
@joshdover can you please add a DevDocs section? |
@rayafratkina Done. |
💔 Build Failed |
Summary
Implements RFC-0004
Related to #18843
Depends on #41251
This adds support for UI applications in the New Platform. With this change, CoreSystem on the frontend now has a "legacy mode" and normal mode.
This mode is toggled by the legacy
renderApp
function, which serves the bootstrapping page and bundles. When rendering a UI app that is unknown to the legacy platform, this function will instead serve the "core-only" bundle which does not include any legacy code or applications.New Platform applications currently have some caveats:
Nav links for NP apps do not support "open in new window". To support this, we need EUI to support links with bothhref
andonClick
props (Allow href and onClick in ListGroupItem eui#1933)Testing
To test the NP application service yourself, unzip these plugins into your
plugins
directory, runyarn kbn bootstrap
, and start Kibana.Alternatively, you can also start the functional test server with the config that loads some test applications:
Dev Docs
Kibana Platform plugins may now register UI applications to display in the global navigation and be mounted inside Kibana as a single-page application. Example:
For more details, see the Application Mounting RFC.
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.For maintainers