Docs: Plugin migration guide - chunk 9 (#69420)

* Initial commit

Signed-off-by: Joe Perez <joseph.perez@grafana.com>

* Prettier fixes

Signed-off-by: Joe Perez <joseph.perez@grafana.com>

* Fixes from doc review

---------

Signed-off-by: Joe Perez <joseph.perez@grafana.com>
This commit is contained in:
Joseph Perez
2023-06-05 14:21:35 -07:00
committed by GitHub
parent a0dd981f85
commit 1a9bc9ca1a
8 changed files with 142 additions and 98 deletions

View File

@ -6,18 +6,20 @@ keywords:
- migration
- plugin
- documentation
title: Migrating plugins from Grafana version 6.x to 7.x
title: Migrate plugins from Grafana version 6.x to 7.x
menutitle: v6.x to v7.x
weight: 2500
---
# Migrating plugins from Grafana version 6.x to 7.0
# Migrate plugins from Grafana version 6.x to 7.0
Follow the instructions in this section to upgrade Grafana from version 6.x to 7.0.
## What's new in Grafana 7.0?
Grafana 7.0 introduced a whole new plugin platform based on React. The new platform supersedes the previous Angular-based plugin platform.
Grafana 7.0 introduced a whole new plugin platform based on React. This new platform supersedes the previous Angular-based plugin platform.
Plugins built using Angular still work for the foreseeable future, but we encourage new plugin authors to develop with the new platform.
Plugins built using Angular still work in the near term, but we strongly encourage new plugin authors to develop with the new platform.
### New data format
@ -27,7 +29,7 @@ Previously, data source plugins could send data either as time series or tables.
### Improved TypeScript support
While the previous Angular-based plugin SDK did support TypeScript, for the React platform, weve greatly improved the support. All our APIs are now TypeScript, which might require existing code to update to the new stricter type definitions. Grafana 7.0 also introduced several new APIs for plugin developers that take advantage of many of the new features in Grafana 7.0.
Although the previous Angular-based plugin SDK supported TypeScript, weve greatly improved the support for the React platform. All our APIs are now written in TypeScript, which might require existing code to update to the new stricter type definitions. Grafana 7.0 also introduced several new APIs for plugin developers that take advantage of many of the new features in Grafana 7.0.
### Grafana Toolkit
@ -35,6 +37,8 @@ With Grafana 7.0, we released a new tool for making it easier to develop plugins
For more information, refer to [@grafana/toolkit](https://www.npmjs.com/package/@grafana/toolkit).
{{% admonition type="note" %}} As of Grafana 10.0, `@grafana/toolkit` is deprecated. It is replaced by the [`create-plugin`](https://grafana.github.io/plugin-tools/docs/creating-a-plugin) tool. %}}
### Field options
Grafana 7.0 introduced the concept of _field options_, a new way of configuring your data before it gets visualized. Since this was not available in previous versions, any plugin that enables field-based configuration will not work in previous versions of Grafana.
@ -43,7 +47,7 @@ For plugins prior to Grafana 7.0, all options are considered _Display options_.
### Backend plugins
While backend plugins were available as an experimental feature in previous versions of Grafana, the support has been greatly improved for Grafana 7. Backend plugins for Grafana 7.0 are backwards-compatible and will continue to work. However, the old backend plugin system has been deprecated, and we recommend that you use the new SDK for backend plugins.
While backend plugins were available as an experimental feature in previous versions of Grafana, their support has been greatly improved for Grafana 7. Backend plugins for Grafana 7.0 are backwards-compatible and will continue to work. However, the old backend plugin system has been deprecated, and we recommend that you use the new SDK for backend plugins.
Since Grafana 7.0 introduced signing of backend plugins, community plugins wont load by default if theyre unsigned.
@ -78,6 +82,8 @@ As of Grafana 7.0, backend plugins can now be cryptographically signed to verify
## From version 6.5.x to 7.3.0
Follow the instructions in this section to upgrade Grafana from version 6.5.x to 7.3.0.
### getColorForTheme changes
The `getColorForTheme` function arguments have changed from `(color: ColorDefinition, theme?: GrafanaThemeType)` to `(color: string, theme: GrafanaTheme)`.
@ -104,6 +110,8 @@ const themeColor = getColorForTheme(color, theme);
## From 6.2.x to v7.4.x
Follow the instructions in this section to upgrade Grafana from version 6.2.x to v7.4.x.
### Legend components
The Legend components have been refactored and introduced the following changes within the `@grafana/ui` package.
@ -116,5 +124,5 @@ import { LegendItem, LegendOptions, GraphLegend } from '@grafana/ui';
import { VizLegendItem, VizLegendOptions, VizLegend } from '@grafana/ui';
```
- `LegendPlacement` has been updated from `'under' | 'right' | 'over'` to `'bottom' | 'right'` so you can not place the legend above the visualization anymore.
- The `isVisible` in the `LegendItem` has been renamed to `disabled` in `VizLegendItem`.
- `LegendPlacement` has been updated from `'under' | 'right' | 'over'` to `'bottom' | 'right'`, so you can't place the legend above the visualization anymore.
- The `isVisible` attribute in the `LegendItem` has been renamed to `disabled` in `VizLegendItem`.