Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to react-router@6 #979

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

leventebalogh
Copy link
Contributor

@leventebalogh leventebalogh commented Nov 26, 2024

Fixes #608

What changed?

Updating the scenes packages to use react-router v6.
This probably requires a major version bump, as it's going to be a breaking change for plugins that depend on scenes.

Why?

We are in the process of migrating Grafana core and also internal plugins to use react-router v6, however any plugin that is depending on scenes cannot easily do it (or at least it's a complicated task). Scenes still using react-router v5 is a blocker for plugins that would like to update.

@leventebalogh leventebalogh self-assigned this Nov 26, 2024
@leventebalogh leventebalogh added the dependencies Update one or more dependencies version label Nov 26, 2024
@torkelo
Copy link
Member

torkelo commented Nov 27, 2024

Pushed an update to get SceneAppPage and most demos to work

Scene apps needs a big update

  • add routePath to all SceneAppPage definitions (with * wildcard if they have drilldowns) this needs to be relative not absolute
  • the url property on SceneAppPage needs to remain and be absolute as it's used to create breadcrumbs and tab links
  • routePath on all drilldowns needs to be relative and end in wildcard

<Route path={`${ROUTES.Demos}/*`} Component={DemoListPage} />
<Route path={`${ROUTES.GrafanaMonitoring}/*`} Component={GrafanaMonitoringApp} />
<Route path={`${ROUTES.ReactDemo}/*`} Component={ReactDemoPage} />
{/* <Redirect to={prefixRoute(ROUTES.Demos)} /> */}
Copy link
Member

Choose a reason for hiding this comment

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

Need to add a v6 redirect here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Update one or more dependencies version
Projects
Status: 🔬 In review
Development

Successfully merging this pull request may close these issues.

Migrate react-router from v5 to v6
3 participants