refactor(font): expose stores via model segment, not the top barrel
Re-exporting the store singletons (fontCatalogStore, fontLifecycleManager, FontsByIdsStore) through entities/Font/index.ts meant every consumer of the barrel eager-instantiated stores and pulled @tanstack/query-core — in dev, test, and as retained code. Drop the store re-export from the top barrel; keep the pure surface (types, constants, domain, lib, ui) there for convenience. Consumers that need stores import $entities/Font/model. Aligns with the BaseQueryStore carve-out: barrel by default, segment path when it would drag a heavy or side-effectful dependency.
This commit is contained in:
@@ -1,8 +1,21 @@
|
||||
export * from './api';
|
||||
export * from './domain';
|
||||
export * from './lib';
|
||||
export * from './model';
|
||||
export * from './ui';
|
||||
|
||||
// Pure model surface (types + constants) is part of the convenient top-level
|
||||
// API. Stateful stores are deliberately excluded — see below.
|
||||
export * from './model/const/const';
|
||||
export * from './model/types';
|
||||
|
||||
/*
|
||||
* Stores (`fontCatalogStore`, `fontLifecycleManager`, `FontsByIdsStore`) are
|
||||
* intentionally NOT re-exported here. They instantiate module-level singletons
|
||||
* and pull `@tanstack/query-core`, so funneling them through this barrel would
|
||||
* make every consumer of `$entities/Font` eager-instantiate stores (and break
|
||||
* tree-shaking / test init-order). Import them via the model segment:
|
||||
* import { fontCatalogStore } from '$entities/Font/model';
|
||||
*/
|
||||
|
||||
// `./testing` is intentionally not re-exported: fixtures must not leak into the
|
||||
// production public API. Import them via `$entities/Font/testing`.
|
||||
|
||||
Reference in New Issue
Block a user