* chore(grafana-ui): export prop types for queryfield, modal and field components
* docs(migration-guide): add notes for react peerdependencies and additional type exposure
* Update docs/sources/developers/plugins/migration-guide.md
Co-authored-by: Timur Olzhabayev <timur.olzhabayev@grafana.com>
Co-authored-by: Timur Olzhabayev <timur.olzhabayev@grafana.com>
(cherry picked from commit 24c04740e3)
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
This commit is contained in:
committed by
GitHub
parent
c639251ace
commit
9c9480dd0c
@@ -18,7 +18,9 @@ This guide helps you identify the steps required to update a plugin from the Gra
|
||||
- [Introduction](#introduction)
|
||||
- [Table of contents](#table-of-contents)
|
||||
- [From version 9.1.x to 9.2.x](#from-version-91x-to-92x)
|
||||
- [React and React-dom as peer dependencies](#react-and-react-dom-as-peer-dependencies)
|
||||
- [NavModelItem requires a valid icon name](#navmodelitem-requires-a-valid-icon-name)
|
||||
- [Additional type availability](#additional-type-availability)
|
||||
- [From version 8.x to 9.x](#from-version-8x-to-9x)
|
||||
- [9.0 breaking changes](#90-breaking-changes)
|
||||
- [theme.visualization.getColorByName replaces getColorForTheme](#themevisualizationgetcolorbyname-replaces-getcolorfortheme)
|
||||
@@ -64,6 +66,29 @@ This guide helps you identify the steps required to update a plugin from the Gra
|
||||
|
||||
## From version 9.1.x to 9.2.x
|
||||
|
||||
### React and React-dom as peer dependencies
|
||||
|
||||
In earlier versions of Grafana packages `react` and `react-dom` were installed during a `yarn install` regardless of a plugins dependencies. In 9.2.0 the `@grafana` packages declare these react packages as peerDependencies and will need adding to a plugins `package.json` file for test commands to continue to run successfully.
|
||||
|
||||
Example:
|
||||
|
||||
```json
|
||||
// before
|
||||
"dependencies": {
|
||||
"@grafana/data": "9.1.0",
|
||||
"@grafana/ui": "9.1.0",
|
||||
},
|
||||
|
||||
// after
|
||||
"dependencies": {
|
||||
"@grafana/data": "9.2.0",
|
||||
"@grafana/ui": "9.2.0",
|
||||
"react": "17.0.2",
|
||||
"react-dom": "17.0.2"
|
||||
},
|
||||
|
||||
```
|
||||
|
||||
### NavModelItem requires a valid icon name
|
||||
|
||||
The typings of the `NavModelItem` have improved to only allow a valid `IconName` for the icon property. You can find the complete list of valid icons [here](https://github.com/grafana/grafana/blob/v9.2.0-beta1/packages/grafana-data/src/types/icon.ts). The icons specified in the list will work for older versions of Grafana 9.
|
||||
@@ -88,6 +113,16 @@ const model: NavModelItem = {
|
||||
};
|
||||
```
|
||||
|
||||
### Additional type availability
|
||||
|
||||
FieldProps, ModalProps, and QueryFieldProps are now exposed from `@grafana/ui`. They can be imported in the same way as other types.
|
||||
|
||||
Example:
|
||||
|
||||
```ts
|
||||
import { FieldProps, ModalProps, QueryFieldProps } from '@grafana/ui';
|
||||
```
|
||||
|
||||
## From version 8.x to 9.x
|
||||
|
||||
### 9.0 breaking changes
|
||||
|
||||
Reference in New Issue
Block a user