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:
| State | Description |
|---|---|
discovered | Plugin found |
validated | Metadata valid |
registered | Added to manager |
initialized | onBeforeInit/onAfterInit called |
active | Hooks running |
suspended | Temporarily disabled |
resuming | Being resumed from suspension |
stopping | Disposal in progress |
disposed | Cleaned up |
removed | Unregistered from manager |
error | Initialization failed |
Hooks
| Hook | When |
|---|---|
onBeforeInit | Before initialization |
onAfterInit | After initialization |
onBeforeQuery | Before query execution |
onAfterQuery | After query completion |
onBeforeMutation | Before mutation |
onAfterMutation | After mutation |
onCacheUpdated | Cache entry updated |
onCacheInvalidated | Cache entry invalidated |
onShutdown | Runtime shutdown |
onSuspend | Plugin suspended |
onResume | Plugin resumed |
onDispose | Plugin disposed |