Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Advanced settings component registry ⇒ kibana platform plugin #55940
Advanced settings component registry ⇒ kibana platform plugin #55940
Changes from 7 commits
be0e773
9e7d525
f3b467b
380838c
b13abeb
ffdf36e
7b225aa
4a00882
5ef28a5
fdacef1
095efaf
f10a154
ff96574
863cb0f
01689f3
f7390f4
823a0c3
5b0caf9
8ddbcc7
66215ef
335a8e8
832b1c4
44df84b
5ae8a5e
65e7b7b
b0b2d13
ea8c1bf
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API right here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels like these should be static exports instead of part of the runtime contract, WDYT?
Perhaps in
public/index.ts
as:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like thats likely one more import. Changed to an enum which seems to make code a little more compact. Past that I don't have a strong opinion.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably don't want these interfaces to be the same since it is a registry, right?
i.e. on Setup maybe only
register
should be available, and on Start onlyget
, so that nobody is trying to register after setupThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like its sufficient to provide
register
access in the setup lifecycle although it doesn't seem necessary to me - but I might be missing something. That said, I'm a little uncertain how this relates to legacy code - I'd be usingregister
after setup is complete, correct?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reasoning behind doing it this way in other registries has been that, if you only allow registering in the
setup
lifecycle, by the time you get tostart
you can guaranteed that all items that are going to be registered are already present, and can then safely useget
to retrieve anything from the registry.This avoids the scenario where you may try to do something with the items in a registry which has not been fully populated yet.
It's a little weird in this case because I believe the only place the registry is being read from is in the advanced settings UI itself, which means new registry items will likely just re-render in React if they come in late. So I'm not sure if it would have a material impact in this particular plugin or not; I'm mostly bringing it up for the sake of consistency with how we've dealt with registries in other plugins. Examples of places where we've done this are expressions, inspector, management.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, what about license changes? How does that play with the setup / start, register / get pattern?