backend-common: deprecate hot reload helpers

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2023-09-23 17:04:27 +02:00
parent 7077dbf131
commit 1c3d6fa2b2
3 changed files with 9 additions and 2 deletions
+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.
+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));