No answer, bumping the thread.
I would be ok with being answered with alternatives on how to share code between plugins, and how to access the redux store (since the store file is in public/app as well).
Hi @flockofflames can you clarify what you mean by this? I have utility functions in the public app folder that I would like all my plugins to have access to.
Are you talking about the public folder of grafana or the public folder of your plugin?
Generally speaking when you work in a plugin and bundle it. webpack takes care of putting everything together, so in terms of JS code there are not folders, all (after bundling) is a single module.js file.
If you have an app plugin that has several plugins inside, you should be able to simply include the modules from each of your own plugin files and webpack will generate the correct module.js for each of the plugins. There won’t be a “shared” file to load, rather it’ll put the code on each plugin independently. You don’t need to do any special setup for this, this is the way it already works.
Hello @estebanbeltran and thank you for responding.
I’m talking about the public folder of Grafana, I cloned the whole thing to make changes to some core functions, and now I’d like to develop plugins that use what I developed in Grafana’s core basically.
Most notably I’m looking for a way to make panels (plugins) communicate with one another so that a click on one can trigger a zoom on another. Using Grafana’s redux store seemed like a good way to do this but unfortunately I can’t seem to access the store that is located in Grafana’s public folder in my plugins and they are isolated from one another.
Regarding how you can communicate across several panels. Perhaps you can start emitting custom events that bubble up to a common element and then you can listen to them?