Deprecating config.panels in @grafana/runtime package

The merge of PR #116918 (https://github.com/grafana/grafana/pull/116918) deprecates config.panels from GrafanaBootConfig. The removal of config.panels from the @grafana/runtime package is projected to occur in Grafana 13.2 and PR #116918 is targeted for the 12.4 release of Grafana.

What changed

The config.panels property from the @grafana/runtime package is now marked as deprecated.

Why we made this change

This deprecation is necessary to facilitate the asynchronous loading of plugin-related metadata, ensuring they are initialized only when Grafana requires them.

Who is affected

  • Affected: Plugins or core Grafana code that access config.panels property from the @grafana/runtime package
  • Not Affected: Plugins or core Grafana code that don’t access config.panels property from the @grafana/runtime package

Action required (for plugin authors)

Replace all accesses to the config.panels property with one of the following public alternatives from the @grafana/runtime package:

For checking if an panel plugin is installed (doesn’t check if the plugin is enabled):

  • Function: isPanelPluginInstalled
  • Hook: usePanelPluginInstalled

For getting an panel plugin’s version:

  • Function: getPanelPluginVersion
  • Hook: usePanelPluginVersion

For getting all listed panel plugin ids:

  • Function: getListedPanelPluginIds
  • Hook: useListedPanelPluginIds

To address this, your plugin must target Grafana version 12.4 or newer. Alternatively, you can implement runtime checks as detailed in the guide available at https://grafana.com/developers/plugin-tools/how-to-guides/runtime-checks.

Action required (for Grafana core maintainers)

Replace all accesses to the config.panels property with one of the following internal alternatives from the @grafana/runtime package:

For getting meta data for a specific plugin:

  • Function: getPanelPluginMeta
  • Hook: usePanelPluginMeta

For getting all meta data:

  • Function: getPanelPluginMetas
  • Hook: usePanelPluginMetas

More resources

Track the overall progress of decoupling plugins from boot data in this Epic: https://github.com/grafana/grafana/issues/114889

For the progress related to config.panels within core Grafana, see the Migrate away from config.panels Epic: https://github.com/grafana/grafana/issues/117467