Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: grafana/plugin-tools
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: @grafana/plugin-e2e@1.18.3
Choose a base ref
...
head repository: grafana/plugin-tools
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: @grafana/plugin-e2e@1.19.0
Choose a head ref

Commits on Feb 25, 2025

  1. fix(deps): update dependency semver to v7.7.1 (#1572)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 25, 2025
    Copy the full SHA
    b709576 View commit details
  2. Copy the full SHA
    b314f5c View commit details
  3. chore(deps): update dependency tsup to ^8.4.0 (#1576)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 25, 2025
    Copy the full SHA
    e0d0afe View commit details

Commits on Feb 26, 2025

  1. Copy the full SHA
    f18f21a View commit details
  2. Docs: Enhance page about build automation with github workflows (#1534)

    Co-authored-by: Joseph Perez <45749060+josmperez@users.noreply.github.com>
    academo and josmperez authored Feb 26, 2025
    Copy the full SHA
    dd7cf44 View commit details
  3. fix(deps): update dependency semver to v7.7.1 (#1577)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 26, 2025
    Copy the full SHA
    53a36b6 View commit details
  4. chore(deps): update dependency eslint-config-prettier to ^10.0.2 (#1578)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 26, 2025
    Copy the full SHA
    8111aff View commit details

Commits on Feb 27, 2025

  1. fix(deps): update dependency semver to v7.7.1 (#1579)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 27, 2025
    Copy the full SHA
    ffd5d39 View commit details
  2. chore(deps): update dependency @swc/core to ^1.11.4 (#1581)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 27, 2025
    Copy the full SHA
    6d19557 View commit details

Commits on Feb 28, 2025

  1. fix(deps): update dependency semver to v7.7.1 (#1582)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 28, 2025
    Copy the full SHA
    ed2cc5b View commit details

Commits on Mar 1, 2025

  1. fix(deps): update dependency @types/node to v22.13.8 (#1586)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Mar 1, 2025
    Copy the full SHA
    3c9fba1 View commit details
  2. fix(deps): update auto-merged patch dependencies (#1587)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Mar 1, 2025
    Copy the full SHA
    398668d View commit details

Commits on Mar 3, 2025

  1. Copy the full SHA
    727ee2f View commit details
  2. Copy the full SHA
    df19daf View commit details
  3. Bump independent versions [skip ci]

     - @grafana/create-plugin@5.18.4
     - @grafana/eslint-plugin-plugins@0.2.3
     - @grafana/plugin-types-bundler@0.2.7
    grafanabot committed Mar 3, 2025
    Copy the full SHA
    aac915a View commit details
  4. fix(deps): update auto-merged patch dependencies (#1589)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Mar 3, 2025
    Copy the full SHA
    3a4b58b View commit details
  5. chore(deps): update auto-merged devdependencies (#1585)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Mar 3, 2025
    Copy the full SHA
    b9ca8c9 View commit details

Commits on Mar 4, 2025

  1. chore(deps): update dependency @swc/core to ^1.11.6 (#1591)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Mar 4, 2025
    Copy the full SHA
    6b8b41a View commit details
  2. Copy the full SHA
    1b5d9ae View commit details
  3. fix(deps): update dependency semver to v7.7.1 (#1590)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Mar 4, 2025
    Copy the full SHA
    11ad91b View commit details
  4. chore(deps): update dependency @swc/core to ^1.11.7 (#1595)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Mar 4, 2025
    Copy the full SHA
    a4398a0 View commit details

Commits on Mar 6, 2025

  1. Add documentation, license, raise and issue links to the docs (#1584)

    Co-authored-by: Timur Olzhabayev <timur.olzhabayev@grafana.com>
    Ukochka and tolzhabayev authored Mar 6, 2025
    Copy the full SHA
    f307c5f View commit details
  2. Copy the full SHA
    5bccb60 View commit details
  3. chore(deps): update dependency vitest to ^3.0.8 (#1604)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Mar 6, 2025
    Copy the full SHA
    3fa1341 View commit details

Commits on Mar 7, 2025

  1. Copy the full SHA
    565b8db View commit details
  2. Copy the full SHA
    3924a64 View commit details
  3. Bump independent versions [skip ci]

     - website@3.6.1
     - @grafana/create-plugin@5.18.5
     - @grafana/eslint-plugin-plugins@0.2.4
     - @grafana/plugin-meta-extractor@0.4.2
    grafanabot committed Mar 7, 2025
    Copy the full SHA
    1c47039 View commit details

Commits on Mar 10, 2025

  1. fix(deps): update dependency @types/node to v22.13.10 (#1608)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Mar 10, 2025
    Copy the full SHA
    3060e7d View commit details

Commits on Mar 11, 2025

  1. Docs: Externally shared dashboard datasource plugin support (#1496)

    Co-authored-by: David Harris <david.harris@grafana.com>
    juanicabanas and sympatheticmoose authored Mar 11, 2025
    Copy the full SHA
    d10c206 View commit details

Commits on Mar 12, 2025

  1. Copy the full SHA
    4c5b0d9 View commit details
  2. Copy the full SHA
    f2621e7 View commit details
  3. Copy the full SHA
    35c7baf View commit details
  4. Copy the full SHA
    a230277 View commit details
  5. chore(deps): update auto-merged devdependencies (#1605)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Mar 12, 2025
    Copy the full SHA
    641717d View commit details

Commits on Mar 13, 2025

  1. Copy the full SHA
    be95850 View commit details
  2. Copy the full SHA
    e3b051c View commit details
  3. Copy the full SHA
    75d99eb View commit details
  4. Bump independent versions [skip ci]

     - @grafana/create-plugin@5.19.0
     - @grafana/eslint-plugin-plugins@0.3.0
     - @grafana/plugin-e2e@1.19.0
     - @grafana/plugin-meta-extractor@0.5.0
     - @grafana/plugin-types-bundler@0.3.0
     - @grafana/sign-plugin@3.1.0
    grafanabot committed Mar 13, 2025
    Copy the full SHA
    b622bca View commit details
Showing with 2,402 additions and 6,953 deletions.
  1. +9 −0 .all-contributorsrc
  2. +3 −2 .github/workflows/ci.yml
  3. +2 −2 .github/workflows/playwright.yml
  4. +19 −0 .github/workflows/stale-branches.yml
  5. +45 −0 CHANGELOG.md
  6. +1 −0 README.md
  7. +1 −1 docusaurus/docs/get-started/set-up-development-environment.mdx
  8. +2 −2 docusaurus/docs/how-to-guides/data-source-plugins/add-migration-handler-for-backend.md
  9. +61 −0 docusaurus/docs/how-to-guides/data-source-plugins/add-support-for-externally-shared-dashboards.md
  10. +9 −9 docusaurus/docs/how-to-guides/data-source-plugins/add-support-for-variables.md
  11. +1 −1 docusaurus/docs/how-to-guides/data-source-plugins/convert-a-frontend-datasource-to-backend.md
  12. +28 −0 docusaurus/docs/migration-guides/update-from-grafana-versions/v11.5.x-v11.6.x.md
  13. +108 −19 docusaurus/docs/publish-a-plugin/build-automation.md
  14. +4 −4 docusaurus/docs/reference/metadata.md
  15. +2 −2 docusaurus/website/package.json
  16. +14 −0 libs/README.md
  17. +55 −0 libs/output/README.md
  18. +167 −0 libs/output/src/index.mts
  19. +14 −0 libs/version/README.md
  20. +18 −0 libs/version/src/index.mts
  21. +1,327 −6,490 package-lock.json
  22. +19 −13 package.json
  23. +36 −0 packages/create-plugin/CHANGELOG.md
  24. +4 −21 packages/create-plugin/package.json
  25. +7 −3 packages/create-plugin/src/bin/run.ts
  26. +26 −14 packages/create-plugin/src/commands/generate.command.ts
  27. +27 −26 packages/create-plugin/src/commands/generate/print-success-message.ts
  28. +87 −28 packages/create-plugin/src/commands/migrate.command.ts
  29. +19 −8 packages/create-plugin/src/commands/provisioning.command.ts
  30. +20 −15 packages/create-plugin/src/commands/update.command.ts
  31. +12 −8 packages/create-plugin/src/commands/update.migrate.command.ts
  32. +33 −17 packages/create-plugin/src/commands/update.standard.command.ts
  33. +2 −16 packages/create-plugin/src/commands/version.command.ts
  34. +0 −48 packages/create-plugin/src/constants.ts
  35. +5 −5 packages/create-plugin/src/utils/tests/utils.config.test.ts
  36. +11 −10 packages/create-plugin/src/utils/utils.config.ts
  37. +6 −70 packages/create-plugin/src/utils/utils.console.ts
  38. +2 −2 packages/create-plugin/src/utils/utils.templates.ts
  39. +3 −13 packages/create-plugin/src/utils/utils.version.ts
  40. +3 −3 packages/create-plugin/templates/common/.config/webpack/webpack.config.ts
  41. +1 −1 packages/create-plugin/templates/common/_package.json
  42. +4 −4 packages/eslint-plugin-plugins/package.json
  43. +12 −0 packages/plugin-e2e/CHANGELOG.md
  44. +14 −11 packages/plugin-e2e/package.json
  45. +0 −1 packages/plugin-e2e/tests/as-admin-user/datasource/alerting/alerting.advancedMode.spec.ts
  46. +0 −1 packages/plugin-e2e/tests/as-admin-user/datasource/alerting/alerting.basicMode.spec.ts
  47. +4 −5 packages/plugin-e2e/tests/as-admin-user/datasource/annotations/annotationQueryRunner.spec.ts
  48. +0 −1 packages/plugin-e2e/tests/as-admin-user/datasource/config-editor/configEditor.spec.ts
  49. +1 −1 packages/plugin-e2e/tests/as-admin-user/datasource/data-assertions/dataAssertion.spec.ts
  50. +2 −2 packages/plugin-e2e/tests/as-admin-user/datasource/explore/queryEditor.integration.spec.ts
  51. +0 −1 packages/plugin-e2e/tests/as-admin-user/datasource/query-editor/queryEditor.integration.spec.ts
  52. +1 −1 packages/plugin-e2e/tests/as-admin-user/datasource/variables/variableInterpolation.spec.ts
  53. +0 −1 packages/plugin-e2e/tests/as-admin-user/page-loading/goto.spec.ts
  54. +9 −8 packages/plugin-e2e/tests/as-admin-user/panel/panelEdit.spec.ts
  55. +1 −1 packages/plugin-e2e/tests/as-admin-user/panel/panelMenu.spec.ts
  56. +2 −2 packages/plugin-meta-extractor/package.json
  57. +12 −0 packages/plugin-types-bundler/CHANGELOG.md
  58. +4 −4 packages/plugin-types-bundler/package.json
  59. +12 −0 packages/sign-plugin/CHANGELOG.md
  60. +5 −12 packages/sign-plugin/package.json
  61. +27 −10 packages/sign-plugin/src/commands/sign.command.ts
  62. +2 −2 packages/sign-plugin/src/commands/version.command.ts
  63. +0 −15 packages/sign-plugin/src/utils/getVersion.ts
  64. +33 −16 packages/sign-plugin/src/utils/manifest.ts
  65. +4 −0 packages/sign-plugin/src/utils/utils.output.ts
  66. +3 −0 packages/sign-plugin/src/utils/utils.version.ts
  67. +5 −1 tsconfig.base.json
  68. +22 −0 tsup.config.ts
  69. +10 −0 vitest.config.base.ts
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -346,6 +346,15 @@
"test",
"code"
]
},
{
"login": "juanicabanas",
"name": "Juan Cabanas",
"avatar_url": "https://avatars.githubusercontent.com/u/11707172?v=4",
"profile": "https://github.com/juanicabanas",
"contributions": [
"doc"
]
}
],
"contributorsPerLine": 7
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -195,12 +195,12 @@ jobs:
range=$(jq -r .dependencies.grafanaDependency < ${{ matrix.workingDir }}/src/plugin.json)
# Use node-semver to get the min version of the range
min_version=$(node -e "console.log(require('semver').minVersion('${range}')?.toString())")
echo "::set-output name=MIN_VERSION::$min_version"
export MIN_VERSION=$min_version
echo "MIN_VERSION=${MIN_VERSION}" >> $GITHUB_OUTPUT
- name: Start grafana server for e2e tests (${{ steps.min-version.outputs.MIN_VERSION }})
run: |
docker compose pull
docker compose pull
ANONYMOUS_AUTH_ENABLED=false GRAFANA_VERSION=${{ steps.min-version.outputs.MIN_VERSION }} docker compose build --no-cache
docker compose up -d
working-directory: ./${{ matrix.workingDir }}
@@ -280,6 +280,7 @@ jobs:
uses: grafana/plugin-actions/playwright-gh-pages/deploy-report-pages@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
retention-days: 7

release:
runs-on: ubuntu-latest
4 changes: 2 additions & 2 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -69,9 +69,8 @@ jobs:
password: ${{ env.DOCKERHUB_PASSWORD }}

- name: Start Grafana
working-directory: ./packages/plugin-e2e
run: |
cd packages/plugin-e2e
docker compose pull
ANONYMOUS_AUTH_ENABLED=false GRAFANA_IMAGE=${{ matrix.GRAFANA_IMAGE.NAME }} GRAFANA_VERSION=${{ matrix.GRAFANA_IMAGE.VERSION }} docker compose up -d
- name: Wait for grafana server
@@ -101,3 +100,4 @@ jobs:
uses: grafana/plugin-actions/playwright-gh-pages/deploy-report-pages@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
retention-days: 7
19 changes: 19 additions & 0 deletions .github/workflows/stale-branches.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Stale Branches

on:
schedule:
- cron: '0 11 * * 1-5'

permissions:
issues: write
contents: write

jobs:
stale_branches:
runs-on: ubuntu-latest
steps:
- name: Stale Branches
uses: crs-k/stale-branches@v7.0.0
with:
dry-run: true
pr-check: true
45 changes: 45 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,48 @@
# (Thu Mar 13 2025)

:tada: This release contains work from a new contributor! :tada:

Thank you, Juan Cabanas ([@juanicabanas](https://github.com/juanicabanas)), for all your work!

#### 🚀 Enhancement

- Docs: Externally shared dashboard datasource plugin support [#1496](https://github.com/grafana/plugin-tools/pull/1496) ([@juanicabanas](https://github.com/juanicabanas))
- `@grafana/create-plugin@5.19.0`, `@grafana/plugin-e2e@1.19.0`, `@grafana/plugin-types-bundler@0.3.0`, `@grafana/sign-plugin@3.1.0`
- Feature: Consistent CLI output [#1597](https://github.com/grafana/plugin-tools/pull/1597) ([@jackw](https://github.com/jackw))

#### Authors: 2

- Jack Westbrook ([@jackw](https://github.com/jackw))
- Juan Cabanas ([@juanicabanas](https://github.com/juanicabanas))

---

# (Fri Mar 07 2025)

#### 🐛 Bug Fix

- `@grafana/create-plugin@5.18.5`
- Create Plugin: Fix timeouts with canary e2e tests [#1606](https://github.com/grafana/plugin-tools/pull/1606) ([@jackw](https://github.com/jackw))

#### Authors: 1

- Jack Westbrook ([@jackw](https://github.com/jackw))

---

# (Mon Mar 03 2025)

#### 🐛 Bug Fix

- `@grafana/create-plugin@5.18.4`
- Create Plugin: Externalise unstable entrypoints [#1580](https://github.com/grafana/plugin-tools/pull/1580) ([@jackw](https://github.com/jackw))

#### Authors: 1

- Jack Westbrook ([@jackw](https://github.com/jackw))

---

# (Tue Feb 25 2025)

#### 🐛 Bug Fix
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -96,6 +96,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center"><a href="https://github.com/jalevin"><img src="https://avatars.githubusercontent.com/u/1669620?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jeff Levin</b></sub></a><br /><a href="https://github.com/grafana/plugin-tools/commits?author=jalevin" title="Documentation">📖</a> <a href="https://github.com/grafana/plugin-tools/commits?author=jalevin" title="Code">💻</a></td>
<td align="center"><a href="http://matyax.com/"><img src="https://avatars.githubusercontent.com/u/1069378?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Matias Chomicki</b></sub></a><br /><a href="https://github.com/grafana/plugin-tools/commits?author=matyax" title="Documentation">📖</a></td>
<td align="center"><a href="http://www.hugohaggmark.com/"><img src="https://avatars.githubusercontent.com/u/562238?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Hugo Häggmark</b></sub></a><br /><a href="https://github.com/grafana/plugin-tools/commits?author=hugohaggmark" title="Documentation">📖</a> <a href="#infra-hugohaggmark" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="https://github.com/grafana/plugin-tools/commits?author=hugohaggmark" title="Tests">⚠️</a> <a href="https://github.com/grafana/plugin-tools/commits?author=hugohaggmark" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/juanicabanas"><img src="https://avatars.githubusercontent.com/u/11707172?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Juan Cabanas</b></sub></a><br /><a href="https://github.com/grafana/plugin-tools/commits?author=juanicabanas" title="Documentation">📖</a></td>
</tr>
</table>

Original file line number Diff line number Diff line change
@@ -118,7 +118,7 @@ The CI (`ci.yml`) workflow is designed to lint, type check, and build the fronte

### The release workflow

The release (`release.yml`) workflow is designed to build, test, package and sign your plugin whenever you're ready to release a new version. This automates the process of creating releases in GitHub and provides instructions for submitting the plugin to the Grafana plugin catalog.
To learn how to automate the release process and set up the release workflow, refer to our documentation on [Automate packaging and signing with GitHub CI](../publish-a-plugin/build-automation).

:::warning

Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ To ensure compatibility and maintain seamless performance, query migration handl

Depending on the approach you take for performing [one of the steps](#step-5-use-migration-code-from-the-frontend-using-experimental-apis) in this guide, you may need to fulfill certain prerequisites. These prerequisites are:

1. Grafana must be configured to run data sources as standalone API servers, a behavior which is behind the feature flag [grafanaAPIServerWithExperimentalAPIs](https://github.com/grafana/grafana/blob/3457f219be1c8bce99f713d7a907ee339ef38229/pkg/services/featuremgmt/registry.go#L519).
1. Grafana must be configured to run data sources as standalone API servers, a behavior which is behind the feature flag [grafanaAPIServerWithExperimentalAPIs](https://github.com/grafana/grafana/blob/7773c658bb3280f0432fc9742109f8eb324c83a3/pkg/services/featuremgmt/registry.go#L474).
1. The plugin must be run on a Grafana version 11.4 or later.

More information about these prerequisites is found in [step 5](#step-5-use-migration-code-from-the-frontend-using-experimental-apis), but if your plugin can't adhere to these requirements, there is an [alternative approach](#step-5-alternative-run-migrations-using-legacy-apis) using existing APIs.
@@ -156,7 +156,7 @@ func (d *Datasource) query(ctx context.Context, pCtx backend.PluginContext, quer

:::note

This feature depends on the feature flag [grafanaAPIServerWithExperimentalAPIs](https://github.com/grafana/grafana/blob/build-go-fast/pkg/services/featuremgmt/registry.go#L528). It also requires the package **@grafana/runtime > 11.4** (still experimental functionality). If your plugin implements this feature, bump its **grafanaDepencency to ">=11.4.0"**. If your plugin can't adhere to these requirements, refer to [Run migrations using legacy APIs](#step-5-alternative-run-migrations-using-legacy-apis).
This feature depends on the feature flag [grafanaAPIServerWithExperimentalAPIs](https://github.com/grafana/grafana/blob/7773c658bb3280f0432fc9742109f8eb324c83a3/pkg/services/featuremgmt/registry.go#L474). It also requires the package **@grafana/runtime > 11.4** (still experimental functionality). If your plugin implements this feature, bump its **grafanaDepencency to ">=11.4.0"**. If your plugin can't adhere to these requirements, refer to [Run migrations using legacy APIs](#step-5-alternative-run-migrations-using-legacy-apis).

:::

Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
id: add-support-for-externally-shared-dashboards
title: Add support for externally shared dashboards
description: How to add support for externally share dashboards (previously called Public dashboards).
keywords:
- grafana
- plugins
- plugin
- externally shared dashboards
- public dashboards
- data source
- datasource
---

[Externally shared dashboards](https://grafana.com/docs/grafana/latest/dashboards/share-dashboards-panels/shared-dashboards/#externally-shared-dashboards) (previously called Public dashboards) allow Grafana users to share access to their dashboards with anyone, without needing to add them to their Grafana organization as a user. When a dashboard is accessed in this way, it retrieves the query from the backend, instead of receiving it from the frontend. This is to avoid exposing sensitive data and performing unauthorized queries.

Because of this, it's necessary to not pass any frontend-transformed body to the request, as it won't be used in the externally shared dashboard panel request.

:::note

Frontend data sources are not compatible with externally shared dashboards.
To convert a frontend data source plugin into a backend plugin, refer to
[convert a frontend data source to backend](./convert-a-frontend-datasource-to-backend).

:::

## Support externally shared dashboards in your data source plugin

To make your data source plugin work in an externally shared dashboard scope, follow these steps:

1. Extend your DataSource class from `DataSourceWithBackend`

```ts
export class MyDataSourceClass extends DataSourceWithBackend<TQuery, TOptions> {
// your logic
}
```

2. Implement the `query` method with your customized code, if necessary. Don't transform the request body if this will change the backend query response (targets property). This body won't be passed as argument when calling the shared externally dashboard endpoint.

Then, call `super.query(request)`.
This is where the externally shared dashboard endpoint is called.

```ts
export class MyDataSourceClass extends DataSourceWithBackend<TQuery, TOptions> {
query(request: DataQueryRequest<TQuery>): Observable<DataQueryResponse> {
// your logic
return super.query(request).pipe(
map((response) => {
// your logic
})
);
}
}
3. Add `"backend": true` to your `plugin.json`
```json title="src/plugin.json"
"backend": true
```
Original file line number Diff line number Diff line change
@@ -203,15 +203,15 @@ That's it! You can now try out the plugin by adding a [query variable](https://g

To interpolate template variables, you need to import the `getTemplateSrv()` function from the `@grafana/runtime` package:

```
```ts
import { getTemplateSrv } from '@grafana/runtime';
```

The `getTemplateSrv()` function returns an instance of `TemplateSrv` which provides methods for working with template variables. The most important one, `replace()`, accepts a string containing variables as input and returns an interpolated string, where the variables have been replaced with the values that the users have selected.

For example, if you have a variable called `instance`, the following code replaces the variable with its corresponding value:

```
```ts
getTemplateSrv().replace("I'd like $instance, please!");

// I'd like server-1, please!
@@ -234,16 +234,16 @@ In the previous example, the variables only had one value, `server-1`. However,

For example, which of these different formats would suit your use case?

```
```ts
{server-1, server-2, server-3} (Graphite)
["server-1", "server-2", "server-3"] (JSON)
("server-1" OR "server-2" OR "server-3") (Lucene)
```

Fortunately, the `replace()` method lets you pass a third argument to allow you to choose from a set of predefined formats, such as the CSV format:

```
getTemplateSrv().replace("I'd like $instance, please!", {}, "csv");
```ts
getTemplateSrv().replace("I'd like $instance, please!", {}, 'csv');

// I'd like server-1, server-2, server-3, please!
```
@@ -262,7 +262,7 @@ After reviewing the advanced variable format options, you may find that you want

You can pass an interpolation function to `replace()` instead of a string as the third argument. The following example uses a custom formatter function to add an `and` before the last element:

```
```ts
const formatter = (value: string | string[]): string => {
if (typeof value == 'string') {
return value;
@@ -289,7 +289,7 @@ There may be a case where you want to use a variable outside of a template. For

This helper function uses the `replace()` method to return the values as an array:

```
```ts
function getValuesForVariable(name: string): string[] {
const values: string[] = [];

@@ -307,7 +307,7 @@ function getValuesForVariable(name: string): string[] {

return values;
}
const instances = getValuesForVariable("instance");
const instances = getValuesForVariable('instance');

for (var instance of instances) {
console.log(instance);
@@ -320,7 +320,7 @@ for (var instance of instances) {

You can even go a step further and create an object that neatly contains all variables and their values:

```
```ts
function getAllVariables(): Record<string, string[]> {
const entries = getTemplateSrv()
.getVariables()
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ To convert the frontend data source, we recommend scaffolding a new backend data

## Why

There are multiple features available only in backend plugins, such as Grafana Alerting or Recorded queries. See the use cases for implementing a backend plugin in the [backend plugins introduction](../../key-concepts/backend-plugins/#use-cases-for-implementing-a-backend-plugin).
There are multiple features available only in backend plugins, such as Grafana Alerting, Recorded queries, or externally shared dashboards (previously called Public dashboards). Refer to the use cases for implementing a backend plugin in the [backend plugins introduction](../../key-concepts/backend-plugins/#use-cases-for-implementing-a-backend-plugin).

## Before you begin

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
id: migrate-11_5_x-to-11_6_x
title: 11.5.x to 11.6.x
sidebar_position: 2
description: How to migrate plugins from Grafana version 11.5.x to 11.6.x.
keywords:
- grafana
- plugins
- plugin
- upgrading
- updating
- migration
---

# Migrate plugins from Grafana version 11.5.x to 11.6.x

Follow these instructions to migrate plugins from Grafana version 11.5.x to 11.6.x.

## usePluginComponents options changed in @grafana/runtime

We updated the hook's options TypeScript type due to accidentally using an incorrect deprecated type. This change was delivered to the core `grafana` repo with [PR 100949](https://github.com/grafana/grafana/pull/100949).

**Recommended actions:**

- Remove the `context` property when calling the `usePluginComponents`. The `context` should be passed to each Component as props.

**Please note:**
This is a build time error and won't have any effect during the runtime of Grafana.
Loading