SoulCache

PluginManager

Internal architecture - Plugin lifecycle management

PluginManager (Internal)

Internal Implementation

PluginManager is an internal class of @soulcache/core. It is not exported from the package root and is not wired into QueryClient configuration (there is no plugins option on QueryClientConfig). It is a standalone internal module.

The PluginManager coordinates plugin registration, validation, lifecycle management, and hook execution. It is used internally by the runtime to manage plugin state machines.

Public Availability

The plugin types (Plugin, PluginContext, PluginHooks) and the PluginManager class are internal to @soulcache/core and are not exported from the package root. The @soulcache/core/plugin subpath does not resolve. There is no public plugin registration API in the current release.

Plugin Lifecycle

Plugins go through well-defined states:

StateDescription
discoveredPlugin found
validatedMetadata valid
registeredAdded to manager
initializedonBeforeInit/onAfterInit called
activeHooks running
suspendedTemporarily disabled
resumingBeing resumed from suspension
stoppingDisposal in progress
disposedCleaned up
removedUnregistered from manager
errorInitialization failed

Hooks

HookWhen
onBeforeInitBefore initialization
onAfterInitAfter initialization
onBeforeQueryBefore query execution
onAfterQueryAfter query completion
onBeforeMutationBefore mutation
onAfterMutationAfter mutation
onCacheUpdatedCache entry updated
onCacheInvalidatedCache entry invalidated
onShutdownRuntime shutdown
onSuspendPlugin suspended
onResumePlugin resumed
onDisposePlugin disposed

On this page