Skip to content
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 getStartServices API #50231

Merged
merged 3 commits into from
Dec 12, 2019
Merged

Add getStartServices API #50231

merged 3 commits into from
Dec 12, 2019

Conversation

joshdover
Copy link
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
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
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
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
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 Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v7.6.0 labels Dec 5, 2019
@elasticmachine
Copy link
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
src/core/public/application/types.ts Outdated Show resolved Hide resolved
src/core/public/legacy/legacy_service.ts Show resolved Hide resolved
src/core/public/plugins/plugin.ts Outdated Show resolved Hide resolved
@joshdover joshdover force-pushed the np/bind-services branch 3 times, most recently from 7594850 to cabb09f Compare December 9, 2019 22:49
@elasticmachine
Copy link
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 Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc 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