Repository navigation
core-plugin-api: preserve legacy frontend compatibility APIs - #34694
Conversation
|
Important This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior. Changed Packages
|
c51ec48 to
73eef97
Compare
6a537ad to
a273adc
Compare
|
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! |
|
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! |
Signed-off-by: Patrik Oldsberg <[email protected]>
Signed-off-by: Patrik Oldsberg <[email protected]>
Signed-off-by: Patrik Oldsberg <[email protected]>
Signed-off-by: Patrik Oldsberg <[email protected]>
Signed-off-by: Patrik Oldsberg <[email protected]>
There was a problem hiding this comment.
🟡 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
IconComponentandwithApislocally incore-plugin-api. - Adds
useApimigration 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
left a comment
There was a problem hiding this comment.
A few things before this goes in:
docs/api/utility-apis.md:35still links tohttps://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-apiwithApis).- The new
withApisdeprecation in core-plugin-api points users touseApifrom@backstage/frontend-plugin-api. That's odd guidance for old-frontend-system users. The previous deprecation pointed towithApisin@backstage/core-compat-api, which is still exported, so it's probably worth mentioning that (or core-plugin-api's ownuseApi) instead. - Nit:
.changeset/remove-frontend-with-apis.mdis a breaking removal but lacks the**BREAKING**:prefix.
|
@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 |
Signed-off-by: Patrik Oldsberg <[email protected]>
|
Thank you for contributing to Backstage! The changes in this pull request will be part of the |

Hey, I just made a Pull Request!
This preserves the legacy
IconComponentandwithApisexports 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
withApisexport from@backstage/frontend-plugin-api; class components can receive APIs through a function component usinguseApi. 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
Signed-off-byline in the message. (more info)