feat: add a react 17 deprecation warning

Signed-off-by: Paul Schultz <pschultz@pobox.com>
This commit is contained in:
Paul Schultz
2025-05-13 17:00:20 -05:00
parent 10b3b28116
commit 3f45861646
2 changed files with 12 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/cli': minor
---
Add a warning for React 17 deprecation that triggers when frontend packages and plugins start.
@@ -22,6 +22,7 @@ import {
} from '../../../../build/lib/bundler';
import { paths } from '../../../../../lib/paths';
import { BackstagePackageJson } from '@backstage/cli-node';
import { hasReactDomClient } from '../../../../build/lib/bundler/hasReactDomClient';
interface StartAppOptions {
verifyVersions?: boolean;
@@ -40,6 +41,12 @@ export async function startFrontend(options: StartAppOptions) {
resolvePath(options.targetDir ?? paths.targetDir, 'package.json'),
)) as BackstagePackageJson;
if (!hasReactDomClient()) {
console.warn(
'React 17 is now deprecated! Please follow the Backstage migration guide to update to React 18: https://backstage.io/docs/tutorials/react18-migration/',
);
}
const waitForExit = await serveBundle({
entry: options.entry,
targetDir: options.targetDir,