travels3.0
Integrations

Framework Integrations

Choose immutable, mutable, official-binding, or externally owned history for your state architecture.

Travels’ core does not depend on a UI framework. The right integration depends on who owns state and whether your reactive system expects a new reference or stable object identity.

Choose an integration

Framework or ownerRecommended starting pointHistory mode
ReactuseSyncExternalStore or use-travel@3Immutable
Vue composableshallowRef/ref subscriptionImmutable
Vue reactive store / PiniaPass the observed object directlymutable: true
Zustandzustand-travel@3 or manual external-store syncImmutable / binding-owned
MobXPass observable state directlymutable: true
Form managerDetached values with manual archive, or an external journalDepends on owner
State machine / existing patch producercreateTravelJournal()Externally owned

Official v3 bindings

Use travels@^3.0.1 with either v3 binding: use-travel@3 accepts travels@^3.0.0, and zustand-travel@3 requires travels@^3.0.1. Both bindings support mutative@^2.0.0. Use matching majors so factory overloads, read-only views, and snapshot restoration share one contract.

Integration invariants

Regardless of framework:

  1. Create one timeline per logical document or editing session.
  2. Keep its identity stable for as long as subscribers depend on it.
  3. Update through exactly one authoritative state path.
  4. Re-render on timeline revision as well as state changes.
  5. Unsubscribe when the owner is disposed.
  6. Flush pending persistence before controlled shutdown points.

Runnable source examples are linked from Examples.

On this page