Skip to content

Add getStartServices API#50231

Merged
joshdover merged 3 commits intoelastic:masterfrom
joshdover:np/bind-services
Dec 12, 2019
Merged

Add getStartServices API#50231
joshdover merged 3 commits intoelastic:masterfrom
joshdover:np/bind-services

Conversation

@joshdover
Copy link
Copy Markdown
Contributor

@joshdover joshdover commented Nov 11, 2019

Summary

Fixes #49691

This adds a new API to the client-side CoreSetup type for accessing start contracts. This is intended to eventually replace the context pattern which will be removed in the future.

The name of this API method is up for discussion: #49691 (comment)

Dev Docs

Context is being deprecated on the front-end and replaced by the core.getStartServices() API.

class Plugin {
  setup(core, plugins) {
    core.application.register({
      id: 'myApp',
      title: 'My App',
      // `mount` functions with just one argument will only receive `params`
      async mount(params) {
        const [coreStart, depsStart] = await core.getStartServices();
        const { renderApp } = await import('./application');
        return renderApp(coreStart, depsStart, params);
      }
    });
  }
}

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@joshdover joshdover force-pushed the np/bind-services branch 2 times, most recently from f77672c to a63355a Compare December 4, 2019 22:47
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@joshdover joshdover added Feature:New Platform release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. Team:Core Platform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t// v7.6.0 labels Dec 5, 2019
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-platform (Team:Platform)

@joshdover joshdover marked this pull request as ready for review December 5, 2019 15:19
@joshdover joshdover requested a review from a team as a code owner December 5, 2019 15:19
@joshdover joshdover force-pushed the np/bind-services branch 2 times, most recently from 7594850 to cabb09f Compare December 9, 2019 22:49
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature:New Platform release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. Team:Core Platform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t// v7.6.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace client-side context with getStartServices API

3 participants