Debug event reference
Diagnostic notifications emitted by vuqs. Reporters observe these events; they do not control or cancel the operation that produced them.
Experimental protocol
Event codes and payloads are governed by DEBUG_PROTOCOL_VERSION, outside normal semver. The typed map is exported from @vuqs/core/debug-protocol.
import { addDebugReporter } from '@vuqs/core'
const stop = addDebugReporter((event) => {
console.log(event.code, event.data)
})For activation, filtering, console output, and SSR isolation, see the debugging guide.
Events
Expand a payload to see its property types and meanings. A ? marks an optional property. Events without payloads carry undefined.
Bindings
| Event | Payload | Emitted when | Level |
|---|---|---|---|
binding:created | A query binding is created. | debug | |
binding:disposed | A query binding leaves its Vue effect scope. | debug | |
binding:set | A binding requests a patch or replacement transaction. | debug |
Transactions and navigation
| Event | Payload | Emitted when | Level |
|---|---|---|---|
tx:start | The adapter runtime assigns an id to a query transaction. | debug | |
gtq:enqueue | Serialized path changes enter the adapter write queue. | debug | |
gtq:coalesce | Another write joins the current queue batch and its options are merged. | debug | |
gtq:schedule | The queue schedules its next flush. | debug | |
gtq:flush | A queue batch materializes the next query and begins navigation. | debug | |
gtq:flush-skip | A scheduled queue flush finds no pending paths. | debug | |
gtq:settle | Committed URL paths are removed from the optimistic overlay. | debug | |
gtq:reset | None | The adapter write queue is reset. | debug |
adapter:navigate | The core or a standalone adapter requests URL navigation. | debug | |
adapter:commit | The adapter confirms a managed navigation or the query changes externally. | debug | |
adapter:error | An adapter navigation throws or rejects. | warn | |
adapter:missing | None | useQueryAdapter() finds no adapter in the current injection scope. | debug |
A managed adapter:commit is emitted after successful navigation, before queue settlement. Its source distinguishes managed writes from external query changes. A testing adapter without memory does not emit a managed commit when simulation leaves its query unchanged.
Parsing and defaults
| Event | Payload | Emitted when | Level |
|---|---|---|---|
engine:clear-on-default | The engine omits a value that equals its resolved default. | debug | |
engine:parse-miss | A value present in the URL cannot be decoded by its query param. | warn |
Module coordination
| Event | Payload | Emitted when | Level |
|---|---|---|---|
hooks:subscribe | A module subscribes to a query hook. | debug | |
hooks:emit | A query hook synchronously dispatches to its subscribers. | debug | |
pipeline:tap | A module registers one or more query pipeline transforms. | debug |
Runtime defaults
| Event | Payload | Emitted when | Level |
|---|---|---|---|
rd:set | A runtime-default layer sets one or more values. | debug | |
rd:clear | None | The runtime-default layer is cleared explicitly. | debug |
rd:reset | A query context change resets the runtime-default layer. | debug | |
rd:register | The runtime-default layer is registered or disposed. | debug |
Context
| Event | Payload | Emitted when | Level |
|---|---|---|---|
ctx:build | The context module builds a query for another context. | debug | |
ctx:switch | switchTo() requests navigation to another query context. | debug | |
ctx:change | The active query context changes. | debug |
Storage
| Event | Payload | Emitted when | Level |
|---|---|---|---|
storage:restore-start | The storage module starts its initialization policy. | debug | |
storage:restore | Storage initialization reaches a terminal outcome. | debug | |
storage:write | A storage revision starts saving or removing a snapshot. | debug | |
storage:coalesce | A newer storage revision replaces one that has not started yet. | debug | |
storage:error | A storage load, validation, serialization, save, removal, or restore operation fails. | warn |
Serialization
| Event | Payload | Emitted when | Level |
|---|---|---|---|
serializer:clear-on-default | The standalone serializer omits a value equal to its default. | debug | |
serializer:build | The standalone serializer finishes building a query object. | debug |
Custom module logs
| Event | Payload | Emitted when | Level |
|---|---|---|---|
module:log | A third-party module writes through createDebugLogger(). | debug | |
module:warn | A third-party module warns through createDebugLogger(). | warn |
Event shape @vuqs/core
Every reporter receives the same frozen envelope. DebugEvent, DebugContext, and DebugLevel are exported from @vuqs/core:
interface DebugContext {
readonly runtimeId?: string
readonly bindingId?: string
readonly transactionIds?: readonly number[]
readonly batchId?: number
}
interface DebugEvent {
readonly code: string
readonly scope: string
readonly level: DebugLevel
readonly seq: number
readonly timestamp: number
readonly monotonicTime?: number
readonly context?: DebugContext
readonly data: unknown
}Properties
| Property | Type | Description |
|---|---|---|
code | string | The event code. |
scope | string | The event's scope. |
level | 'debug' | 'warn' | The diagnostic level. |
seq | number | The global monotonic event sequence. |
timestamp | number | Epoch milliseconds from Date.now(). |
monotonicTime | number | Optional high-resolution time from performance.now(). |
context | DebugContext | Optional runtime, binding, transaction and batch identifiers. |
data | unknown | The payload for the event code. |
The strict KnownDebugEvent union narrows data from code. Import it and the complete DebugEventMap from @vuqs/core/debug-protocol when building protocol-aware tooling.
DebugEmissionContext
type DebugEmissionContext = Omit<DebugContext, 'runtimeId'>The context supplied by an emitter. The channel supplies runtimeId. This type is exported from @vuqs/core.
Correlation
seq orders events across the global debug stream. Context identifiers relate events to an adapter runtime, binding, transaction, or navigation batch. Context fields are optional because not every event belongs to each of those operations.
A batchId identifies one write window, and every queue event in that window shares it. gtq:enqueue lists its own transaction. gtq:flush, adapter:navigate, adapter:commit and gtq:settle list every observed transaction in the batch in ascending order.
- A navigation keeps the context captured when it flushed. Its
gtq:settlecarries that context even when observation detaches and resumes before the navigation completes. A later batch on the same path does not inherit it. - A
gtq:settlecaused by an external query change carries the open batch's context, when one exists.transactionIdslists every transaction in that batch, not the writers of each settled path. - A
gtq:settlelists every path it removes, including paths written while no reporter was attached. - Writes made without an attached reporter are recorded in no batch, and attaching later does not recover their transaction ids. The flush of such a write that is still queued when a reporter attaches has a
batchIdwithouttransactionIds. The settlement of a navigation invoked before a reporter attached has neither.
For operation sequences and their console results, see Write lifecycle.
Summary policies and console examples are documented in Summary and trace.