Skip to content

feat: Upgrade to new Front End in Hybrid mode#347

Open
tfhartmann wants to merge 3 commits intomainfrom
new-front-end-phase1
Open

feat: Upgrade to new Front End in Hybrid mode#347
tfhartmann wants to merge 3 commits intomainfrom
new-front-end-phase1

Conversation

@tfhartmann
Copy link
Collaborator

This is phase 1 of a two phase migragtion

chore: update dependencies in yarn.lock for Backstage packages

  • Added new versions for core-app-api, core-compat-api, core-components, frontend-app-api, frontend-defaults, frontend-plugin-api, plugin-catalog-common, plugin-catalog-react, plugin-permission-common, plugin-permission-react, and others.
  • Updated zod and zod-to-json-schema versions.

This is phase 1 of a two phase migragtion

chore: update dependencies in yarn.lock for Backstage packages
- Added new versions for core-app-api, core-compat-api, core-components, frontend-app-api, frontend-defaults, frontend-plugin-api, plugin-catalog-common, plugin-catalog-react, plugin-permission-common, plugin-permission-react, and others.
- Updated zod and zod-to-json-schema versions.
@tfhartmann tfhartmann requested a review from a team as a code owner February 5, 2026 19:51
Copilot AI review requested due to automatic review settings February 5, 2026 19:51
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @tfhartmann, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request initiates the first phase of a two-phase migration to a new Backstage frontend architecture, specifically adopting a 'Hybrid mode'. The changes involve updating critical dependencies and refactoring the core application setup to integrate with the new frontend plugin API and compatibility layers. This foundational work enables a gradual transition to the modernized frontend, ensuring existing functionalities remain operational while new modular capabilities are introduced.

Highlights

  • Dependency Updates: Various @backstage packages, zod, and zod-to-json-schema have been updated to their latest versions. New core frontend packages like @backstage/frontend-plugin-api, @backstage/core-compat-api, and @backstage/frontend-defaults have been introduced.
  • Frontend Migration to Hybrid Mode: The application's main entry point (App.tsx) has been refactored to begin the migration to the new Backstage frontend system. This involves switching from @backstage/app-defaults to @backstage/frontend-defaults and utilizing convertLegacyAppOptions and convertLegacyAppRoot from @backstage/core-compat-api to integrate existing configurations and routes into the new modular architecture.
  • App Initialization Changes: The App.tsx file now exports an instantiated application object rather than a React component. This change is reflected in App.test.tsx and index.tsx, where the application is rendered directly as an object.
  • Routing Configuration Adjustment: The bindRoutes configuration has been removed from the createApp options in App.tsx, indicating a shift in how external routes are bound within the new frontend system.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • backstage/package.json
    • Added @backstage/frontend-plugin-api dependency.
  • backstage/packages/app/package.json
    • Added @backstage/core-compat-api, @backstage/frontend-defaults, and @backstage/frontend-plugin-api dependencies.
    • Updated versions for several existing @backstage packages.
  • backstage/packages/app/src/App.test.tsx
    • Updated the import statement for App from a default export to a named export (app).
    • Modified the render call to use the app object instead of the App component.
  • backstage/packages/app/src/App.tsx
    • Changed the import of createApp from @backstage/app-defaults to @backstage/frontend-defaults.
    • Introduced imports for convertLegacyAppOptions, convertLegacyAppRoot from @backstage/core-compat-api, and createFrontendModule.
    • Refactored the createApp call to use convertedOptionsModule and convertedRootFeatures for hybrid mode compatibility.
    • Removed the bindRoutes section from the app configuration.
    • Modified the export to app.createRoot() instead of app.createRoot(<JSX>).
    • Minor formatting adjustments for SkillExchangePage and Mermaid components.
  • backstage/packages/app/src/index.tsx
    • Updated the import statement for App from a default export to a named export (app).
    • Modified the ReactDOM.createRoot render call to use the app object.
Activity
  • No specific activity (comments, reviews, or progress updates) has been provided for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR implements phase 1 of a two-phase migration to upgrade the frontend architecture to Backstage's new frontend system in hybrid mode. The changes enable compatibility between the legacy and new frontend systems while maintaining existing functionality.

Changes:

  • Migrated from @backstage/app-defaults to @backstage/frontend-defaults for frontend initialization
  • Introduced compatibility layer using @backstage/core-compat-api to convert legacy app options and root components
  • Updated app initialization to use the new feature-based architecture with createApp accepting converted legacy features

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
backstage/packages/app/src/index.tsx Updated to import and render the app as a pre-created root instead of a React component
backstage/packages/app/src/App.tsx Refactored app initialization to use new frontend system with compatibility layer for legacy features
backstage/packages/app/src/App.test.tsx Updated test to render the app root directly instead of as a React component
backstage/packages/app/package.json Added dependencies for new frontend system and compatibility APIs
backstage/package.json Added frontend-plugin-api dependency at root level

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request begins the migration to the new Backstage frontend system in hybrid mode. The dependency updates in package.json files are appropriate for this migration. The main application file, App.tsx, is refactored to use the new frontend APIs and compatibility layers. While this is a good step forward, my review has identified a few significant issues. Most critically, the removal of the bindRoutes configuration could break navigation between plugins. Additionally, the InsightsSurveyLoader component has been removed, which may disable the user survey functionality. I've also noted some minor code quality improvements, such as removing unused imports and placeholder comments.

I am having trouble creating individual review comments. Click here to see my feedback.

backstage/packages/app/src/App.tsx (88-107)

critical

The bindRoutes configuration has been removed. This block was responsible for connecting different plugins (e.g., linking the Catalog to the Scaffolder). Its removal without a clear replacement will likely break these cross-plugin navigation flows, leading to a degraded user experience. How is this external route binding handled in the new hybrid setup? The new frontend system uses an extension-based approach, but it's not apparent from this change if a replacement has been implemented.

backstage/packages/app/src/App.tsx (206)

high

The InsightsSurveyLoader component has been removed from the application's root. This component is likely responsible for displaying surveys to users as part of the Insights plugin. Was its removal intentional? If this is an oversight, it could lead to the loss of the survey feature. If it's intentional, it would be good to understand how this functionality is being replaced or if it's being deprecated.

backstage/packages/app/src/App.tsx (53)

medium

The homePlugin is imported but not used within the file. To maintain code cleanliness and avoid potential confusion, this unused import should be removed.

backstage/packages/app/src/App.tsx (62)

medium

The createFrontendModule function is imported but is not being used. It's best to remove unused imports to keep the code tidy.

backstage/packages/app/src/App.tsx (209)

medium

This // ... comment appears to be a placeholder. If no additional features are intended to be added here at this time, it would be best to remove it to improve code clarity and avoid confusion for future developers.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 77 to 93
@@ -85,26 +90,6 @@ const app = createApp({
),
},
apis,
bindRoutes({ bind }) {
bind(catalogPlugin.externalRoutes, {
createComponent: scaffolderPlugin.routes.root,
viewTechDoc: techdocsPlugin.routes.docRoot,
createFromTemplate: scaffolderPlugin.routes.selectedTemplate,
});
bind(apiDocsPlugin.externalRoutes, {
registerApi: catalogImportPlugin.routes.importPage,
});
bind(scaffolderPlugin.externalRoutes, {
registerComponent: catalogImportPlugin.routes.importPage,
viewTechDoc: techdocsPlugin.routes.docRoot,
});
bind(orgPlugin.externalRoutes, {
catalogIndex: catalogPlugin.routes.catalogIndex,
});
bind(insightsPlugin.externalRoutes, {
searchPage: searchPlugin.routes.root,
});
},
});
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

The bindRoutes configuration was removed during the migration, but these route bindings are essential for plugin interoperability. The new frontend architecture still requires route binding configuration. You should use createFrontendModule (which is already imported) to create a module that configures these bindings using the new API, or verify that these bindings are handled elsewhere in the migration.

Copilot uses AI. Check for mistakes.
convertLegacyAppOptions,
convertLegacyAppRoot,
} from '@backstage/core-compat-api';
import { createFrontendModule } from '@backstage/frontend-plugin-api';
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

The createFrontendModule import is added but never used in the code. If this import was intended for creating route binding modules to replace the removed bindRoutes configuration, it should be utilized. Otherwise, remove this unused import.

Suggested change
import { createFrontendModule } from '@backstage/frontend-plugin-api';

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant