-
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
[APM] Remove dependency on ui/chrome in favor of newer core APIs #41868
[APM] Remove dependency on ui/chrome in favor of newer core APIs #41868
Conversation
💔 Build Failed |
|
||
const CoreContext = createContext<InternalCoreStart>({} as InternalCoreStart); | ||
const CoreProvider: React.SFC<{ core: InternalCoreStart }> = props => { | ||
const { core, ...restProps } = props; |
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 think we should omit ...restProps
until we need.
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.
Oh, it's used for children
? Maybe make that explicit?
@@ -6,9 +6,9 @@ | |||
|
|||
import { npStart } from 'ui/new_platform'; |
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.
Is this still allowed in NP?
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 hack pattern will go away eventually, but the npStart
import is valid until we get to that point. This is how legacy plugins import the new platform core at the top-level.
import { CoreProvider } from './context/CoreContext'; | ||
|
||
const { core } = npStart; | ||
// console.log(npStart); |
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.
console.log
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
6f4bf36
to
dccb5cf
Compare
💔 Build Failed |
retest |
💚 Build Succeeded |
…stic#41868) * [APM] Remove dependency on ui/chrome in favor of newer core APIs * [APM] fix broken tests by mocking useCore hook
) (#41947) * [APM] Remove dependency on ui/chrome in favor of newer core APIs * [APM] fix broken tests by mocking useCore hook
Closes #34444
Created
useCore
/CoreContext
to pass down a single instance ofcore
to components which were previously usingui/chrome
. Those components were updated to usecore
APIs instead ofui/chrome
.