Skip to content

core-plugin-api: preserve legacy frontend compatibility APIs - #34694

Merged
Rugvip merged 8 commits into
masterfrom
rugvip/remove-deprecated-frontend-exports
Nov 3, 2026
Merged

Rugvip merged 8 commits into
masterfrom
rugvip/remove-deprecated-frontend-exports

Conversation

@Rugvip

@Rugvip Rugvip commented Jun 23, 2026 •

Copy link
Copy Markdown
Member

Hey, I just made a Pull Request!

This preserves the legacy IconComponent and withApis exports in @backstage/core-plugin-api, independently of their definitions in @backstage/frontend-plugin-api. Legacy and hybrid apps keep their existing APIs and icon behavior.

This removes the deprecated withApis export from @backstage/frontend-plugin-api; class components can receive APIs through a function component using useApi. The legacy helper is deprecated with the same migration example. It also prepares the legacy icon type for the icon API removal in #34794.

✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)
  • All your commits have a Signed-off-by line in the message. (more info)

@github-actions github-actions Bot added area:documentation Improvements or additions to documentation area:catalog Related to the Catalog Project Area area:techdocs Related to the TechDocs Project Area area:scaffolder Everything and all things related to the scaffolder project area area:home area:search labels Jun 23, 2026
@backstage-goalie

backstage-goalie Bot commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

Important

This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior.

Changed Packages

Package Name Package Path Changeset Bump Current Version
@backstage/core-plugin-api packages/core-plugin-api patch v1.12.12-next.0
@backstage/frontend-plugin-api packages/frontend-plugin-api minor v0.18.3-next.0

@backstage-goalie backstage-goalie Bot added size:large Large pull requests receive a slightly lower priority for reviews. waiting-for:review The PR needs a review and will be visible in the review queue unless already assigned an owner. labels Jun 23, 2026
@Rugvip
Rugvip force-pushed the rugvip/remove-deprecated-frontend-exports branch from c51ec48 to 73eef97 Compare June 26, 2026 13:54
@Rugvip Rugvip changed the title Remove deprecated new frontend system exports Preserve legacy frontend compatibility APIs Jul 8, 2026
@Rugvip
Rugvip force-pushed the rugvip/remove-deprecated-frontend-exports branch from 6a537ad to a273adc Compare July 8, 2026 09:08
@github-actions github-actions Bot removed area:catalog Related to the Catalog Project Area area:techdocs Related to the TechDocs Project Area area:scaffolder Everything and all things related to the scaffolder project area area:home area:search labels Jul 8, 2026
@backstage-goalie backstage-goalie Bot added size:medium Medium-sized pull requests receive no change in priority for reviews. and removed size:large Large pull requests receive a slightly lower priority for reviews. labels Jul 8, 2026
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

@github-actions github-actions Bot added the stale label Aug 7, 2026
@Rugvip Rugvip removed the stale label Aug 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

@github-actions github-actions Bot added the stale label Sep 14, 2026
@github-actions github-actions Bot closed this Sep 30, 2026
@github-actions github-actions Bot removed the area:documentation Improvements or additions to documentation label Oct 29, 2026
@Rugvip
Rugvip marked this pull request as ready for review October 30, 2026 09:11
@Rugvip
Rugvip requested a review from a team as a code owner October 30, 2026 09:11
Copilot AI balanced review requested due to automatic review settings October 30, 2026 09:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The consuming-APIs guide still recommends withApis and links to the API page removed by this change, so its guidance needs updating.

1 open issue
What changed in this PR

This PR keeps legacy frontend compatibility APIs in core-plugin-api while removing the deprecated withApis helper from frontend-plugin-api.

Changes:

  • Defines legacy IconComponent and withApis locally in core-plugin-api.
  • Adds useApi migration guidance and regression coverage for API injection and prop forwarding.
  • Updates public API reports and changesets for both packages.
File Description
packages/​frontend-plugin-api/​src/​apis/​system/​useApi.tsx Removes the deprecated withApis implementation.
packages/​frontend-plugin-api/​src/​apis/​system/​index.ts Removes the withApis export.
packages/​frontend-plugin-api/​report.api.md Records the removed public helper.
packages/​core-plugin-api/​src/​icons/​types.ts Defines the legacy icon type locally.
packages/​core-plugin-api/​src/​apis/​system/​useApi.tsx Preserves withApis locally with migration guidance.
packages/​core-plugin-api/​src/​apis/​system/​useApi.test.tsx Tests API injection, prop forwarding, and display naming.
packages/​core-plugin-api/​report.api.md Records the locally defined compatibility APIs.
.changeset/​remove-frontend-with-apis.md Documents the removal and migration path.
.changeset/​preserve-legacy-frontend-compatibility.md Documents legacy API preservation and deprecation.

Review effort: Balanced

*/

export { useApi, useApiHolder, withApis } from './useApi';
export { useApi, useApiHolder } from './useApi';

@freben freben left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few things before this goes in:

  • docs/api/utility-apis.md:35 still links to https://backstage.io/api/stable/functions/_backstage_frontend-plugin-api.index.withApis.html, which this PR removes. That link will break, so it should point somewhere else (e.g. the core-plugin-api or core-compat-api withApis).
  • The new withApis deprecation in core-plugin-api points users to useApi from @backstage/frontend-plugin-api. That's odd guidance for old-frontend-system users. The previous deprecation pointed to withApis in @backstage/core-compat-api, which is still exported, so it's probably worth mentioning that (or core-plugin-api's own useApi) instead.
  • Nit: .changeset/remove-frontend-with-apis.md is a breaking removal but lacks the **BREAKING**: prefix.

@backstage-goalie backstage-goalie Bot added waiting-for:author Changes have been requested and the PR will not receive a review until the changes are made. and removed waiting-for:review The PR needs a review and will be visible in the review queue unless already assigned an owner. labels Nov 2, 2026
@Rugvip

Rugvip commented Nov 2, 2026

Copy link
Copy Markdown
Member Author

@freben I went a bit back and forth on the deprecation guidance, but I think this is the best we can do really. Using the one from core-compat-api is kinda bad, plugins aren't supposed to depend on that library. Guiding users to anything but a solution on top of frontend-plugin-api seems unhelpful, since that's the target state.

@backstage-goalie backstage-goalie Bot added waiting-for:review The PR needs a review and will be visible in the review queue unless already assigned an owner. and removed waiting-for:author Changes have been requested and the PR will not receive a review until the changes are made. labels Nov 2, 2026
Copilot AI balanced review requested due to automatic review settings November 3, 2026 00:08
@Rugvip
Rugvip requested review from a team as code owners November 3, 2026 00:08
@github-actions github-actions Bot added the area:documentation Improvements or additions to documentation label Nov 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block approval of the legacy frontend compatibility changes.

1 open issue

Review effort: Balanced

@freben freben left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aight, makes sense

@backstage-goalie backstage-goalie Bot added waiting-for:merge The PR has been approved and is awaiting merge. and removed waiting-for:review The PR needs a review and will be visible in the review queue unless already assigned an owner. labels Nov 3, 2026
@Rugvip
Rugvip merged commit 3b55d6b into master Nov 3, 2026
32 checks passed
@Rugvip
Rugvip deleted the rugvip/remove-deprecated-frontend-exports branch November 3, 2026 12:51
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Thank you for contributing to Backstage! The changes in this pull request will be part of the 1.57.0 release, scheduled for Tue, 17 Nov 2026.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:documentation Improvements or additions to documentation size:medium Medium-sized pull requests receive no change in priority for reviews. waiting-for:merge The PR has been approved and is awaiting merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants