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

Migrate share registry #50137

Merged
merged 20 commits into from
Nov 19, 2019
Merged

Conversation

flash1293
Copy link
Contributor

@flash1293 flash1293 commented Nov 11, 2019

This PR moves the share registry and surrounding functionality into a separate Kibana platform plugin.

Dev docs

The ui/share registry is removed in favor of the share plugin which exposes a register method in the setup contract. The interface of share menu providers does not change except for the removal of angular dependency injection. The function to render the menu also moves into a function exposed by the share plugin in the start phase instead of a function which has to be called with the menu item providers. The following items have also been renamed:

  • ShowProps -> ShowShareMenuOptions
  • ShareMenuItemProps -> ShareContext
  • showShareContextMenu -> toggleShareContextMenu

@flash1293 flash1293 added release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. Feature:SharingURLs Short URLs and Share URL features v8.0.0 Feature:NP Migration v7.6.0 labels Nov 11, 2019
@elasticmachine
Copy link
Contributor

💔 Build Failed

Copy link
Member

@lukeelmers lukeelmers left a comment

Choose a reason for hiding this comment

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

Thanks for starting on this -- I took a look at it today, and overall this makes sense to me. TBH I am not sure why we had listed kibana_react as a destination for this functionality in our migration meta issue. Presumably because there was an idea that some of that static components could be shared from there? I prefer your approach of exposing the minimal possible API surface area as a start, especially as this is likely to evolve during migration still. (For example, there's the url shortening REST API src/legacy/server/url_shortening, which still hasn't been migrated and we will eventually need a plan for).

The only thing I'm going back and forth on is whether share is a wide enough domain to justify a standalone plugin. Since this functionality doesn't neatly fit as a service inside of one our existing plugins, I think this makes sense for the time being. I'll mull this over a little bit, and will also do some testing on this PR tomorrow.

src/plugins/share/public/types.ts Show resolved Hide resolved
src/plugins/share/public/types.ts Show resolved Hide resolved
@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 Failed

@flash1293
Copy link
Contributor Author

Jenkins, test this

@flash1293 flash1293 marked this pull request as ready for review November 14, 2019 16:08
@flash1293 flash1293 requested a review from a team as a code owner November 14, 2019 16:08
@flash1293
Copy link
Contributor Author

Marking this ready for review because I'm 99% certain the build failures are just infrastructure/flaky test ones at this point.

@flash1293 flash1293 requested a review from kertal November 14, 2019 16:09
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Member

@lukeelmers lukeelmers left a comment

Choose a reason for hiding this comment

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

Tested locally (Chrome OSX) and everything LGTM! Thanks for doing this.

One favor to ask - Would you mind also adding ui/share to the table in MIGRATION.md so we have its new location documented there too?

@flash1293 flash1293 requested a review from a team as a code owner November 15, 2019 13:21
@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded


this.isOpen = true;

document.body.appendChild(this.container);
Copy link
Contributor

Choose a reason for hiding this comment

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

I was going to say that direct document access should probably be avoided in plugins in favor of core's rootDomElement, but it seems we are not actually exposing it. What are the recommended guidelines for this @joshdover ? As this seems quite common, should we provide an API for plugins to create that kind of containers?

@kertal
Copy link
Member

kertal commented Nov 18, 2019

@elasticmachine merge upstream

Copy link
Member

@kertal kertal left a comment

Choose a reason for hiding this comment

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

Code LGTM, looking forward to use it in my Discover PR!

@flash1293
Copy link
Contributor Author

@cchaos Can you take another look? I removed the unnecessary classes and it looks all good AFAICT.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@cchaos cchaos left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM!

@flash1293 flash1293 merged commit 600862e into elastic:master Nov 19, 2019
@flash1293 flash1293 deleted the migrate-share-registry branch November 19, 2019 08:51
flash1293 added a commit to flash1293/kibana that referenced this pull request Nov 20, 2019
flash1293 added a commit that referenced this pull request Nov 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:NP Migration Feature:SharingURLs Short URLs and Share URL features release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. v7.6.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants