-
Notifications
You must be signed in to change notification settings - Fork 11.6k
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
Plugins: Share the plugin context with apps and ui-extensions #77933
Plugins: Share the plugin context with apps and ui-extensions #77933
Conversation
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.
LGTM!!
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.
Lovely stuff! 🚀
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.
This is neat! Didn't know we had a usePluginContext
hook. I wonder if plugin authors in general are aware of this?
Probably not, something we added a while back but without any proper documentation. It is being used under the hood by the tracking hook. We should probably improve the docs around this. |
@leventebalogh we should probably also add a wrapper around the components being shared via |
75d6a9c
to
b310e22
Compare
Previously it was referenced by `pluginRoot.props.path`, which stops working in case the `pluginRoot` element is wrapped with anything.
b310e22
to
9e7c5a4
Compare
What changed?
This PR is basically sharing the
PluginContext
with app plugins and UI-extension modal components, so they can get hold of the plugin meta information in the following way:Also introduced new hooks:
Notes for the reviewer
GrafanaBootConfig
, so that would be the other option, to have app plugin meta on the config instead.