I have noticed some changes in the build process when switching to Grafana 4.6 while developing my own datasource plugin.
When building the front-end part of grafana from sources, I usually run grunt or npm run build - this used to generate the public_gen directory where I could find my compiled datasource files. But with the recent version I do not see any public_gen dir.
Later when I start grafana, it displays an error when it tries to use my datasource plugin :
Where there any changes to the build process (the grunt output definitely looks different)? And, is there something I need to change in my datasource plugin to be compliant to these latest updates?
I am testing this on the latest grafana sources (#2bc57d856c35864d407e7d20b587d56011f67fb5).
And it looks like all plugins included in app/plugins/datasource are now hardcoded in the public/app/features/plugins/plugin_loader.ts.
I am wondering, what is now the official way add a custom datasource plugin and have it built/compile? Is there some other directory where I need to put my datasource plugin?
External plugins shout be in the external plugins folder /var/lib/grafana/plugins on installed systems or) data/plugins (relative to repo) on dev setups.
The placement of plugins is not new it has always been the case, we have never recommended you place your own plugins inside grafanas code base (data folder is git ignored so is never considered part of repo so your plugin will never be mixed up it grafana code)
Well, most of the 3rd party datasource plugins and related documentation was lagging behind the latest grafana version and even the example-datasource plugin was not compiling at the time when we started with our own plugins (~6months ago).
So, it was easier to look at official datasource plugins and mimic their design. That got us up and running quickly while benefiting from the existing build system.
I will look into setting up a separate build/release pipeline for the plugin then. Thanks!