Convert angular plugin into react on load using json

Is there a way to convert a grafana 7 or 8+ custom datasource plugin into a react without having to rebuild the whole dashboard?

The initial plan was using the json metadata to do the change but ideally I’d like to do that when the dashboard loads. Basically chack if the json has metadata related to the old datasource and update that info into the new datasource. But I can’t seem to programatically find that json metadata…

If is not possible, what is the approach in this cases?

thank in advance,

Hi @aramosvizcarra just to confirm, are you migrating the plugin (with the same plugin id) to react? or are you building a new react plugin with a different id?

Maybe what you are looking for is the setMigrationHandler (beware this method might not be available in some Grafana versions)

Take a look at an example here with the polystat plugin grafana-polystat-panel/module.ts at e7f548a74e0daa056db06933dca2667aeee9b8e2 · grafana/grafana-polystat-panel · GitHub and what the migration is doing here grafana-polystat-panel/migrations.ts at main · grafana/grafana-polystat-panel · GitHub

Thank you @grafanad404 , this seems promissing. And yes we are migrating same plugin from angular to react. And we are targeting only grafana 9+ for this. Do you hapen to know if setMigrationHandler is in all 9+ versions?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.