diff --git a/.changeset/lazy-deers-dance.md b/.changeset/lazy-deers-dance.md new file mode 100644 index 0000000000..80adcbaa14 --- /dev/null +++ b/.changeset/lazy-deers-dance.md @@ -0,0 +1,5 @@ +--- +'@backstage/frontend-plugin-api': minor +--- + +**BREAKING**: Removed deprecated variant of `createExtensionDataRef` where the ID is passed directly. diff --git a/packages/frontend-plugin-api/report.api.md b/packages/frontend-plugin-api/report.api.md index 52d0276952..f18826785a 100644 --- a/packages/frontend-plugin-api/report.api.md +++ b/packages/frontend-plugin-api/report.api.md @@ -610,11 +610,6 @@ export type CreateExtensionBlueprintOptions< dataRefs?: TDataRefs; } & VerifyExtensionFactoryOutput; -// @public @deprecated (undocumented) -export function createExtensionDataRef( - id: string, -): ConfigurableExtensionDataRef; - // @public (undocumented) export function createExtensionDataRef(): { with(options: { diff --git a/packages/frontend-plugin-api/src/wiring/createExtensionDataRef.test.ts b/packages/frontend-plugin-api/src/wiring/createExtensionDataRef.test.ts index 4b652298f1..b5acf78384 100644 --- a/packages/frontend-plugin-api/src/wiring/createExtensionDataRef.test.ts +++ b/packages/frontend-plugin-api/src/wiring/createExtensionDataRef.test.ts @@ -29,15 +29,6 @@ describe('createExtensionDataRef', () => { expect(String(refOptional)).toBe('ExtensionDataRef{id=foo,optional=true}'); }); - it('can be created and read in the deprecated way', () => { - const ref = createExtensionDataRef('foo'); - expect(ref.id).toBe('foo'); - expect(String(ref)).toBe('ExtensionDataRef{id=foo,optional=false}'); - const refOptional = ref.optional(); - expect(refOptional.id).toBe('foo'); - expect(String(refOptional)).toBe('ExtensionDataRef{id=foo,optional=true}'); - }); - it('can be used to encapsulate a value', () => { const ref = createExtensionDataRef().with({ id: 'foo' }); const val: ExtensionDataValue = ref('hello'); diff --git a/packages/frontend-plugin-api/src/wiring/createExtensionDataRef.ts b/packages/frontend-plugin-api/src/wiring/createExtensionDataRef.ts index 80413c1688..94acb192a8 100644 --- a/packages/frontend-plugin-api/src/wiring/createExtensionDataRef.ts +++ b/packages/frontend-plugin-api/src/wiring/createExtensionDataRef.ts @@ -60,26 +60,12 @@ export interface ConfigurableExtensionDataRef< (t: TData): ExtensionDataValue; } -/** - * @public - * @deprecated Use the following form instead: `createExtensionDataRef().with({ id: 'core.foo' })` - */ -export function createExtensionDataRef( - id: string, -): ConfigurableExtensionDataRef; /** @public */ export function createExtensionDataRef(): { with(options: { id: TId; }): ConfigurableExtensionDataRef; -}; -export function createExtensionDataRef(id?: string): - | ConfigurableExtensionDataRef - | { - with(options: { - id: TId; - }): ConfigurableExtensionDataRef; - } { +} { const createRef = (refId: TId) => Object.assign( (value: TData): ExtensionDataValue => ({ @@ -103,9 +89,6 @@ export function createExtensionDataRef(id?: string): }, } as ConfigurableExtensionDataRef, ); - if (id) { - return createRef(id); - } return { with(options: { id: TId }) { return createRef(options.id);