introduce StartServicesAccessor type for CoreSetup.getStartServices#60748
Conversation
|
Pinging @elastic/kibana-platform (Team:Platform) |
| | [register(app)](./kibana-plugin-core-public.applicationsetup.register.md) | Register an mountable application to the system. | | ||
| | [registerAppUpdater(appUpdater$)](./kibana-plugin-core-public.applicationsetup.registerappupdater.md) | Register an application updater that can be used to change the [AppUpdatableFields](./kibana-plugin-core-public.appupdatablefields.md) fields of all applications at runtime.<!-- -->This is meant to be used by plugins that needs to updates the whole list of applications. To only updates a specific application, use the <code>updater$</code> property of the registered application instead. | | ||
| | [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.
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.
-
StartServicesAccessororCoreStartServicesAccessor? 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?
joshdover
left a comment
There was a problem hiding this comment.
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. |
…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
StartServicesAccessortype to avoid referencing it byCoreSetup['getStartServices']in plugin code. This is done both inpublicandserver