Merge pull request #20123 from backstage/rugvip/start

cli: make the new backend start command the default
This commit is contained in:
Patrik Oldsberg
2023-09-26 13:29:58 +02:00
committed by GitHub
8 changed files with 23 additions and 4 deletions
+7
View File
@@ -0,0 +1,7 @@
---
'@backstage/cli': minor
---
The new backend start command that used to be enabled by setting `EXPERIMENTAL_BACKEND_START` is now the default. To revert to the old behavior, set `LEGACY_BACKEND_START` instead.
This new command is no longer based on Webpack, but instead uses Node.js loaders to transpile on the fly. Rather than hot reloading modules the entire backend is now restarted on change, but the SQLite database state is still maintained across restarts via a parent process.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/backend-common': patch
---
The `useHotCleanup` and `useHotMemoize` helpers are now deprecated, since hot module reloads for backend are being phased out.
+1
View File
@@ -401,6 +401,7 @@ tooltip
tooltips
touchpoint
transpilation
transpile
transpiled
transpiler
transpilers
+2 -2
View File
@@ -785,12 +785,12 @@ export type UrlReadersOptions = {
factories?: ReaderFactory[];
};
// @public
// @public @deprecated
export function useHotCleanup(
_module: NodeModule,
cancelEffect: () => void,
): void;
// @public
// @public @deprecated
export function useHotMemoize<T>(_module: NodeModule, valueFactory: () => T): T;
```
+2
View File
@@ -47,6 +47,7 @@ function findAllAncestors(_module: NodeModule): NodeModule[] {
* Useful for cleaning intervals, timers, requests etc
*
* @public
* @deprecated Hot module reloading is no longer supported for backends.
* @example
* ```ts
* const intervalId = setInterval(doStuff, 1000);
@@ -80,6 +81,7 @@ const CURRENT_HOT_MEMOIZE_INDEX_KEY = 'backstage.io/hmr-memoize-key';
* stateful parts of the backend, e.g. to retain a database.
*
* @public
* @deprecated Hot module reloading is no longer supported for backends.
* @example
* ```ts
* const db = useHotMemoize(module, () => createDB(dbParams));
+1 -1
View File
@@ -18,7 +18,7 @@
"backstage"
],
"scripts": {
"start": "EXPERIMENTAL_BACKEND_START=1 backstage-cli package start",
"start": "backstage-cli package start",
"build": "backstage-cli package build",
"lint": "backstage-cli package lint",
"test": "backstage-cli package test",
@@ -36,7 +36,7 @@ export async function startBackend(options: StartBackendOptions) {
});
await waitForExit();
} else if (process.env.EXPERIMENTAL_BACKEND_START) {
} else if (!process.env.LEGACY_BACKEND_START) {
const waitForExit = await startBackendExperimental({
entry: 'src/index',
checksEnabled: false, // not supported
+4
View File
@@ -463,6 +463,10 @@ async function testBackendStart(appDir: string, ...args: string[]) {
!l.includes('check the migration guide at https://a.co/7PzMCcy') &&
!l.includes(
'(Use `node --trace-warnings ...` to show where the warning was created)',
) &&
!l.includes('Custom ESM Loaders is an experimental feature') &&
!l.includes(
'ExperimentalWarning: `globalPreload` is planned for removal',
),
).length !== 0
);