Skip to content

Remove Material-UI dependencies from grafana plugin#7529

Closed
andreahlert wants to merge 1 commit intobackstage:mainfrom
andreahlert:refactor/grafana-mui-to-bui
Closed

Remove Material-UI dependencies from grafana plugin#7529
andreahlert wants to merge 1 commit intobackstage:mainfrom
andreahlert:refactor/grafana-mui-to-bui

Conversation

@andreahlert
Copy link
Contributor

Summary

  • Removes @material-ui/core and @material-ui/lab from the grafana plugin dependencies
  • Replaces <Alert severity="error"> (MUI lab) with <ResponseErrorPanel> from @backstage/core-components
  • Replaces <Tooltip> + <Typography> (MUI core) with a plain <span> using the native title attribute

Contributes to #7023.

Test plan

  • yarn tsc:full passes with zero errors
  • All 6 existing tests pass (4 suites)
  • No changes to test files required
  • Verified ResponseErrorPanel provides consistent error display with other Backstage plugins

Replace MUI components with lighter alternatives:
- Alert (MUI lab) replaced with ResponseErrorPanel (core-components)
- Tooltip + Typography (MUI core) replaced with native span + title attribute

This removes @material-ui/core and @material-ui/lab from the grafana
plugin dependencies, contributing to the ongoing MUI migration (backstage#7023).

Signed-off-by: André Ahlert <andre@aex.partners>
@andreahlert andreahlert requested a review from a team as a code owner February 8, 2026 12:50
@andreahlert andreahlert requested review from 04kash and removed request for a team February 8, 2026 12:50
@backstage-goalie
Copy link
Contributor

Missing Changesets

The following package(s) are changed by this PR but do not have a changeset:

  • @backstage-community/plugin-grafana

See CONTRIBUTING.md for more information about how to add changesets.

Changed Packages

Package Name Package Path Changeset Bump Current Version
@backstage-community/plugin-grafana workspaces/grafana/plugins/grafana none v0.15.0

Copy link
Contributor

@awanlin awanlin left a comment

Choose a reason for hiding this comment

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

Hi @andreahlert, while we appreciate your contributions these aren't changes that really move us forward in the MUI to BUI migration. You actually never use any of the component from Backstage UI in this change at all!

Once again you wipe out the PR template and I think it would be valuable for you to read our upstream AI Policy: https://github.com/backstage/backstage/blob/master/CONTRIBUTING.md#ai-use-policy-and-guidelines

return <Progress />;
} else if (error) {
return <Alert severity="error">{error.message}</Alert>;
return <ResponseErrorPanel error={error} />;
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you actually test this? This panel will show up for any error as it's part of the base framework.

This is an Alert component in Backstage UI but it hasn't been released yet, that will happen on February 17th.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tested it and it works, but yeah I see your point, it's a full error panel, not a simple inline alert like the original. Didn't think much about the UX difference.

Will wait for the BUI Alert on the 17th.

thanks for the advice

<Typography variant="h5">{opts.title || 'Dashboards'}</Typography>
</Tooltip>
{opts.title || 'Dashboards'}
</span>
Copy link
Contributor

Choose a reason for hiding this comment

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

Backstage UI has a tooltip, did you take a look? https://ui.backstage.io/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not really, I was more focused on getting rid of the MUI deps first. I'll check it properly for the next version.

return <Progress />;
} else if (error) {
return <Alert severity="error">{error.message}</Alert>;
return <ResponseErrorPanel error={error} />;
Copy link
Contributor

Choose a reason for hiding this comment

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

Again, not the right direction.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as above, got it.

@andreahlert
Copy link
Contributor Author

andreahlert commented Feb 8, 2026

Hi @andreahlert, while we appreciate your contributions these aren't changes that really move us forward in the MUI to BUI migration. You actually never use any of the component from Backstage UI in this change at all!

Once again you wipe out the PR template and I think it would be valuable for you to read our upstream AI Policy: https://github.com/backstage/backstage/blob/master/CONTRIBUTING.md#ai-use-policy-and-guidelines

About the template: I had this ready before your feedback and pushed it without adapting. My bad.

My idea was to do it in two steps, removing MUI first, then add BUI. but I ended up making a mess of it. Thanks for the guidance, I'll close this and redo it properly with the BUI components once the Alert is out on the 17th.

@andreahlert andreahlert closed this Feb 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants