refactor(font): keep @tanstack out of the entity public API barrel
Extract NonRetryableError into its own tanstack-free module and drop the ./api re-export from the Font slice barrel. Importing $entities/Font no longer transitively loads @tanstack/query-core or constructs the QueryClient singleton via the ./api and ./lib (errors) chains — light consumers (domain, types, consts) and unit specs stop paying for TanStack. Note: ./ui still pulls the stores; addressed separately.
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
export * from './api';
|
||||
export * from './domain';
|
||||
export * from './lib';
|
||||
export * from './ui';
|
||||
@@ -8,6 +7,16 @@ export * from './ui';
|
||||
export * from './model/const/const';
|
||||
export * from './model/types';
|
||||
|
||||
/*
|
||||
* `./api` (proxy clients: `fetchProxyFonts`, `seedFontCache`, …) is intentionally
|
||||
* NOT re-exported here. Those clients import `$shared/api/queryClient`, whose
|
||||
* module eval runs `new QueryClient()` and loads `@tanstack/query-core`. Funneling
|
||||
* them through this barrel made every consumer of `$entities/Font` — including
|
||||
* pure-domain and type-only importers — eager-load TanStack and construct the
|
||||
* client (notably in unit specs). Import API clients via the segment:
|
||||
* import { fetchProxyFonts } from '$entities/Font/api';
|
||||
*/
|
||||
|
||||
/*
|
||||
* Stores (`fontCatalogStore`, `fontLifecycleManager`, `FontsByIdsStore`) are
|
||||
* intentionally NOT re-exported here. They instantiate module-level singletons
|
||||
|
||||
Reference in New Issue
Block a user