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:
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Marker base class for errors that retrying will never fix — schema-validation
|
||||
* failures, unauthorized responses, contract violations, etc.
|
||||
*
|
||||
* The queryClient retry handler short-circuits when it sees this; without it,
|
||||
* a non-transient backend bug pins the UI through the full retry budget
|
||||
* (default 3× exponential backoff ≈ 7s).
|
||||
*
|
||||
* Lives in its own module — free of `@tanstack/query-core` — so error types that
|
||||
* extend it (e.g. `FontResponseError`) can be imported without dragging the
|
||||
* TanStack client and its eager `new QueryClient()` instantiation into the
|
||||
* importer's module graph. See the barrel-coupling notes in the FSD audit.
|
||||
*/
|
||||
export class NonRetryableError extends Error {}
|
||||
@@ -1,14 +1,5 @@
|
||||
import { QueryClient } from '@tanstack/query-core';
|
||||
|
||||
/**
|
||||
* Marker base class for errors that retrying will never fix — schema-validation
|
||||
* failures, unauthorized responses, contract violations, etc.
|
||||
*
|
||||
* The queryClient retry handler short-circuits when it sees this; without it,
|
||||
* a non-transient backend bug pins the UI through the full retry budget
|
||||
* (default 3× exponential backoff ≈ 7s).
|
||||
*/
|
||||
export class NonRetryableError extends Error {}
|
||||
import { NonRetryableError } from './nonRetryableError';
|
||||
|
||||
/**
|
||||
* Data remains fresh for this long after fetch. Stores that override
|
||||
|
||||
Reference in New Issue
Block a user