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

Allow chromeless applications to render via non-/app routes #51527

Merged
merged 4 commits into from
Dec 29, 2019

Conversation

eliperelman
Copy link
Contributor

@eliperelman eliperelman commented Nov 22, 2019

Summary

This PR allows applications to be rendered independently of using /app routes. Updates the frontend application service to make apps routable via appRoute during registration.

  • In order to utilize a custom appRoute in the routing components, we need to pass more than just a mount function. Going down this route made me realize that if we re-structured the order of when we load the necessary app service bits, and doing a state-lift with much of the data, we could co-locate all the business logic in the app service, make the implementation simpler, and also easier to test while expanding the test coverage.
  • The observables for holding the apps and legacy apps were only being used inside the app service class, and we weren't using any reactive functionality, only getValues, so I simplified to just unwrap them to their maps.
  • During my work on this, changes were landed that converted the app container component to FunctionComponent, so I took the opportunity to update the relevant components to follow suit.

Checklist

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

For maintainers

Dev Docs

Allow applications to routable from paths that do not start with /app. This is first enabled via the appRoute flag during UI application registration:

export class MyPlugin implements Plugin {
  setup({ application }) {
    application.register({
      id: 'my-app',
      // App can be accessed via the /my-app route
      appRoute: '/my-app',
      async mount(context, params) {
        const { renderApp } = await import('./application');
        return renderApp(context, params);
      },
    });
  }
}

@eliperelman eliperelman added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Feature:New Platform release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. v8.0.0 v7.6.0 labels Nov 22, 2019
@eliperelman eliperelman self-assigned this Nov 22, 2019
@elasticmachine
Copy link
Contributor

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

@elasticmachine
Copy link
Contributor

💔 Build Failed

@pgayvallet
Copy link
Contributor

retest

Copy link
Contributor

@mshustov mshustov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I haven't tested manually tho.
Could you create a separate issue to add the full set of functional tests after #52161 ?

@eliperelman
Copy link
Contributor Author

retest

@legrego
Copy link
Member

legrego commented Dec 17, 2019

Removing review request for @elastic/kibana-security since it doesn't look like this touches anything we own. Let me know if you'd still like a review!

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

  • 💚 Build #15778 succeeded 595b561611ae670d4fcb9fb23592e0c80c2acc66
  • 💚 Build #15556 succeeded c0eada90b6696520a80a56d36293ac3a9a50b670
  • 💔 Build #15520 failed 9d0199d3d8d5432bb4550db6df26e1821285f4c9
  • 💚 Build #15436 succeeded 5fc04ce2901d11502741031b5e0a8199e99a3251
  • 💔 Build #15362 failed 01349930bc79aac2813382b561243fb98580681d

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

@elastic elastic deleted a comment from elasticmachine Dec 29, 2019
@eliperelman eliperelman merged commit fdd87e0 into elastic:master Dec 29, 2019
eliperelman added a commit to eliperelman/kibana that referenced this pull request Dec 29, 2019
…51527)

* Allow chromeless applications to render via non-/app routes

* Address review nits

* Fix chrome:application integration tests

* Move extraneous application integration tests to unit tests
eliperelman added a commit that referenced this pull request Dec 29, 2019
…53833)

* Allow chromeless applications to render via non-/app routes

* Address review nits

* Fix chrome:application integration tests

* Move extraneous application integration tests to unit tests
gmmorris added a commit to gmmorris/kibana that referenced this pull request Dec 30, 2019
* master:
  Allow chromeless applications to render via non-/app routes (elastic#51527)
  Add server rendering service to enable standalone route rendering (elastic#52161)
jloleysens added a commit to jloleysens/kibana that referenced this pull request Dec 30, 2019
…le-saved-objects

* 'master' of github.com:elastic/kibana: (250 commits)
  Allow chromeless applications to render via non-/app routes (elastic#51527)
  Add server rendering service to enable standalone route rendering (elastic#52161)
  Possibility to filter when testing scripted fields (elastic#35379) (elastic#44220)
  Update maps telemetry mappings to account for recent updates (elastic#53803)
  [Maps] Only show legend when layer is visible (elastic#53781)
  remove use of experimental fs.promises api (elastic#53346)
  [APM] Add log statements for flaky test (elastic#53775)
  [APM] Transaction page throws unhandled exception if transactions doesn't have  `http.request` (elastic#53760)
  Licensing plugin functional tests (elastic#53580)
  [Lens] Disable saving visualization until there are no changes to the document (elastic#52982)
  [Monitoring] Added safeguard for some EUI components (elastic#53318)
  [Vega] Shim new platform - cleanup vega_visualization dependencies (elastic#53605)
  Display changed field formats without requiring hard page refresh. (elastic#53746)
  Upgrade EUI to v17.3.1 (elastic#53655)
  [APM] Fix missing apm indicies (elastic#53541)
  Disable inspector for timelion (elastic#53747)
  Clean up search servie (elastic#53701)
  [Dashboard] Grid: removing double handler (elastic#53707)
  Remove SavedObjectRegistryProvider from codebase (elastic#53455)
  Move ui/courier into data shim plugin (elastic#52359)
  ...
gmmorris added a commit to gmmorris/kibana that referenced this pull request Jan 2, 2020
…ris/kibana into alerting/created_at-and-updated_at

* 'alerting/created_at-and-updated_at' of github.com:gmmorris/kibana:
  Allow chromeless applications to render via non-/app routes (elastic#51527)
  Add server rendering service to enable standalone route rendering (elastic#52161)
jkelastic pushed a commit to jkelastic/kibana that referenced this pull request Jan 8, 2020
…51527)

* Allow chromeless applications to render via non-/app routes

* Address review nits

* Fix chrome:application integration tests

* Move extraneous application integration tests to unit tests
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 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants