feat: add a react 17 deprecation warning
Signed-off-by: Paul Schultz <pschultz@pobox.com>
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user