You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make DialCacheConfig modes discriminated and explicit #19
P2 — Medium — completed by the observability and Redis-ownership simplifications.
Original problem
Earlier versions exposed overlapping constructor modes: Redis accepted either a direct client or lazy factory, while core metrics mixed disabled/custom modes with Prometheus-specific configuration.
Resolution
The ambiguous modes no longer exist:
feat: decouple Prometheus metrics adapter #56 reduced core observability to one optional caller-supplied DialCacheMetricsAdapter. Omission disables instrumentation; vendor configuration lives in dialcache/prometheus and dialcache/datadog.
Plain JavaScript/untyped callers receive explicit runtime migration errors for the removed Redis factory and key-prefix modes, where silently changing resource ownership or cache identity would be unsafe.
TypeScript and packed ESM/CommonJS declaration consumers reject the removed metrics options and assert the direct-client requirement, backend-neutral metrics shape, and absence of vendor factories from the root package.
No further discriminated-union layer is needed: the remaining constructor properties are orthogonal optional capabilities, and Redis itself has one unambiguous required client mode.
Activity