backend-common: deprecate hot reload helpers
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -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.
|
||||
@@ -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;
|
||||
```
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user