deprecate support for react-router beta
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
---
|
||||
'@backstage/core-app-api': patch
|
||||
'@backstage/cli': patch
|
||||
---
|
||||
|
||||
Added deprecation warning for React Router v6 beta, please make sure you have migrated your apps to use React Router v6 stable as support for the beta version will be removed. See the [migration tutorial](https://backstage.io/docs/tutorials/react-router-stable-migration) for more information.
|
||||
@@ -72,6 +72,20 @@ export async function serveBundle(options: ServeOptions) {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
if (
|
||||
targetPkg.dependencies?.['react-router']?.includes('beta') ||
|
||||
targetPkg.dependencies?.['react-router-dom']?.includes('beta')
|
||||
) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(
|
||||
chalk.yellow(`
|
||||
DEPRECATION WARNING: React Router Beta is deprecated and support for it will be removed in a future release.
|
||||
Please migrate to use React Router v6 stable.
|
||||
See https://backstage.io/docs/tutorials/react-router-stable-migration
|
||||
`),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
checkReactVersion();
|
||||
|
||||
@@ -240,11 +240,21 @@ export class AppManager implements BackstageApp {
|
||||
);
|
||||
|
||||
const { routing, featureFlags, routeBindings } = useMemo(() => {
|
||||
const usesReactRouterBeta = isReactRouterBeta();
|
||||
if (usesReactRouterBeta) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`
|
||||
DEPRECATION WARNING: React Router Beta is deprecated and support for it will be removed in a future release.
|
||||
Please migrate to use React Router v6 stable.
|
||||
See https://backstage.io/docs/tutorials/react-router-stable-migration
|
||||
`);
|
||||
}
|
||||
|
||||
const result = traverseElementTree({
|
||||
root: children,
|
||||
discoverers: [childDiscoverer, routeElementDiscoverer],
|
||||
collectors: {
|
||||
routing: isReactRouterBeta()
|
||||
routing: usesReactRouterBeta
|
||||
? routingV1Collector
|
||||
: routingV2Collector,
|
||||
collectedPlugins: pluginCollector,
|
||||
|
||||
Reference in New Issue
Block a user