From 1ff7d88c57c271864cbcdb590d97fb54314481bb Mon Sep 17 00:00:00 2001 From: blam Date: Thu, 3 Jun 2021 11:10:04 +0200 Subject: [PATCH] chore: reword the changeset Signed-off-by: blam --- .changeset/proud-bottles-dream.md | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/.changeset/proud-bottles-dream.md b/.changeset/proud-bottles-dream.md index 42cff9db46..d9c7259758 100644 --- a/.changeset/proud-bottles-dream.md +++ b/.changeset/proud-bottles-dream.md @@ -2,4 +2,31 @@ '@backstage/plugin-tech-radar': minor --- -Migrating the Tech Radar to support using `ApiRefs` to go fetch data +Migrating the Tech Radar to support using `ApiRefs` to load custom data. + +If you had a `getData` function, you'll now need to encapsulate that logic in a class that can override the `techRadarApiRef`. + +```ts +// app/src/lib/MyClient.ts +import { + TechRadarApi, + TechRadarLoaderResponse, +} from '@backstage/plugin-tech-radar'; + +class MyOwnClient implements TechRadarApi { + async load(): Promise { + // here's where you would put you logic to load the response that was previously passed into getData + } +} + +// app/src/apis.ts +import { MyOwnClient } from './lib/MyClient'; +import { techRadarApiRef } from '@backstage/plugin-tech-radar'; + +export const apis: AnyApiFactory[] = [ + /* + ... + */ + createApiFactory(techRadarApiRef, new MyOwnClient()), +]; +```