-
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
introduce StartServicesAccessor type for CoreSetup.getStartServices
#60748
introduce StartServicesAccessor type for CoreSetup.getStartServices
#60748
Conversation
Pinging @elastic/kibana-platform (Team:Platform) |
| [registerMountContext(contextName, provider)](./kibana-plugin-core-public.applicationsetup.registermountcontext.md) | Register a context provider for application mounting. Will only be available to applications that depend on the plugin that registered this context. Deprecated, use [CoreSetup.getStartServices()](./kibana-plugin-core-public.coresetup.getstartservices.md)<!-- -->. | | ||
| [registerMountContext(contextName, provider)](./kibana-plugin-core-public.applicationsetup.registermountcontext.md) | Register a context provider for application mounting. Will only be available to applications that depend on the plugin that registered this context. Deprecated, use [CoreSetup.getStartServices](./kibana-plugin-core-public.coresetup.getstartservices.md)<!-- -->. | |
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.
Using a type makes the doc generator to consider it a property instead of a function and therefor generated a lot of ()
diff...
export type StartServicesAccessor<TPluginsStart extends object = object> = () => Promise< | ||
[CoreStart, TPluginsStart] | ||
>; |
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.
-
StartServicesAccessor
orCoreStartServicesAccessor
? Also open to other naming suggestion -
I used
<TPluginsStart extends object = object>
to be consistent withCoreSetup<TPluginsStart extends object = object>
, but maybe we want<TPluginsStart extends object = {}>
instead?
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.
security/spaces changes 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.
Great idea, code looks good.
Though I am a bit sad it's having to be used this much 🙁 |
Yea, I was a little surprise of the number of usages myself. PR still make sense, but we might want to take this PR's plugins code diff as a start to see if we can improve anything in our setup/start 'communication' |
…vice-accessor-type
I agree and we'll probably see more usage of this server-side with Elasticsearch moving to setup. |
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 owner changes LGTM
…vice-accessor-type
…vice-accessor-type
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
…elastic#60748) * create StartServicesAccessor type * update generated doc * update usages to use new type * add missing public annotation
* master: Updating our direct usage of https-proxy-agent to 5.0.0 (elastic#58296) allow users to unset the throttle of an alert (elastic#60964) [Lens] Fix bug in metric config panel (elastic#60982) [SearchProfiler] Minor fixes (elastic#60919) [ML] Renaming ML setup and start contracts (elastic#60980) introduce StartServicesAccessor type for `CoreSetup.getStartServices` (elastic#60748) [SIEM][Detection Engine] Add rule's notification alert type (elastic#60832) [APM] Re-revert "Collect telemetry about data/API performance" (elastic#61030) [NP] Graph: get rid of saved objects class wrapper (elastic#59917) [EPM] merge duplicate fields when creating index patterns (elastic#60957) [Uptime] Ml detection of duration anomalies (elastic#59785) [Alerting] removes unimplemented buttons from Alert Details page (elastic#60934) [skip-ci] Fix CODEOWNERS paths for the Pulse team (elastic#60944) [APM] Threshold alerts (elastic#59566) [ML] Add support for percentiles aggregation to Transform wizard (elastic#60763) Cahgen save object duplicate message (elastic#60901)
Summary
StartServicesAccessor
type to avoid referencing it byCoreSetup['getStartServices']
in plugin code. This is done both inpublic
andserver