pinia-plugin-subscription 1.0.0-beta.16 → 1.0.0-beta.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
24
24
  - Added unit tests covering the tracing system and the leak detection logic
25
25
 
26
26
  ### Changed
27
+ - Subscribers now execute in ascending `execution.order` order (default `9`), preserving declaration order for equal priorities; `PluginSubscriber.tracer` exposes the tracer created for that subscriber and passes the same instance to its `Store` factory.
27
28
  - Trace groups follow the lifecycles of a store: `groupId` is now a `/` separated path (`<storeId>/plugin`, `<storeId>/onAction:<name>#<n>`, with `/after` and `/onError` sub-groups, `<storeId>/onMutation#<n>`, `<storeId>/reset#<n>`, `<storeId>/plugin/deferred:<subscriber>#<n>`). Every trace emitted for a store while a group is open, including those of subscribers and `Store` subclasses, joins the innermost one. `traceGroups` builders take the call counter; `TraceGroupId` is removed, and `groupId` is lifted from the payload to the event like `actionId`
28
29
  - `storeMutationSubscription` now supports several subscribers per store, like `storeOnActionSubscription`: a single `$subscribe` is registered per store and dispatches to every callback. A failing callback is reported through `traceError` without blocking the others, subscriber names are tracked, and the hook is unsubscribed when the store is disposed
29
30
  - `storeOnActionSubscription` now receives the Pinia plugin context; action trace labels include the invoked action name
@@ -44,7 +45,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
44
45
 
45
46
  ### Changed (breaking)
46
47
  - Move automatic and manual rollback, including their types, to `pinia-plugin-state-snapshots`; register its subscriber explicitly.
47
- - Move `$reset` ownership and `resetStoreCallback` execution to `StateSnapshotsSubscriber`; `PluginSubscription` only provides the reset lifecycle hook.
48
+ - Move `$reset` ownership and reset callback execution to `StateSnapshotsSubscriber`; callbacks are registered with `$onResetStore()`, while `PluginSubscription` only orchestrates subscribers.
48
49
  - Allow store-event subscribers to opt in to error propagation; critical before-action failures abort the action and emit an error event for cleanup.
49
50
  - removed the built-in console output of traces (`createConsoleGroupTraceListener`, `ConsoleTraceGroupListener`, `TraceGroupListener`, `TraceListenerGroupBy`, the `groupBy` option of `addListener()`, and the internal console printers). Listeners now only forward events to their own `handler` (a no-op when omitted); `startGroup` / `closeGroup` only maintain the open-group stack that sets `groupId`. Fixed `tracerHandler.journal` not being exposed by the registry
50
51
  - The tracing solution moved to the new `pinia-plugin-subscription-devtools` package (`packages/devtools/`, same repository). `pinia-plugin-subscription` now only emits trace events through the `Tracer` / `TracerHandler` contract exported from `pinia-plugin-subscription/types`; without a `tracerHandler` it emits nothing. The compressed package drops from about 117 kB to about 50 kB, and the new package weighs about 19 kB.
package/README.md CHANGED
@@ -68,7 +68,7 @@ app.mount('#app')
68
68
  ## Advanced Features
69
69
 
70
70
  - **Structured tracing:** the plugin and `Store` emit typed trace events through an optional `tracerHandler`. Tracing itself (listeners, journal, redaction, in-page panel) lives in the separate [`pinia-plugin-subscription-devtools`](packages/devtools/) package, so apps that do not debug stay lean — see [Tracing](#tracing).
71
- - **Reset callbacks:** Define `resetStoreCallback` to run custom logic when the registered [`StateSnapshotsSubscriber`](packages/state-snapshots/README.md) resets a store. `PluginSubscription` itself does not replace or reset the store's `$reset` method.
71
+ - **Reset callbacks:** The separate [`pinia-plugin-state-snapshots`](packages/state-snapshots/README.md) package owns reset behavior. Register callbacks with the store's `$onResetStore()` method; `PluginSubscription` itself does not replace or reset `$reset`.
72
72
  - **SSR and hydration control:** Configure whether each subscribed plugin runs on the server, the client, or only after client hydration.
73
73
  - **Lifecycle safety:** Internal hydration ordering is now guarded so `hydrate()` completes before `afterHydration()` and disposed stores do not retain stale subscriber metadata.
74
74