Rxova
Skip to content

Migrating to 1.0

What changes between the 0.x line and 1.0, written while the changes are still proposals rather than after they shipped — so that anyone on 0.x today can see the bill before it arrives.

If you are on 0.8 and you use the hooks by their documented names, the migration is four renames, all mechanical, all with a codemod. Nothing about how the library behaves changes.

From RFC 0001.

0.x1.0Reason
useMessageuseOnMessageIt subscribes; it does not return a message
useOpenedWindowuseWindowResultIt reads the result; openWindow opens
defineStorecreateStoreHooksCollides with Pinia, which means something else
StoreHooks.getStoreHooks.storeOne concept, one name

Every old name keeps working for the rest of 0.x, with a deprecation warning (UE2005) that fires once per name per session. They are removed in 1.0, so the failure is a compile error rather than a surprise at runtime.

Terminal window
npx use-everywhere-codemod rename-1.0 src/

Names that are not changing, in case you were bracing for them: useSharedState, useSharedReducer, useSharedStore, usePeers, useClientId, useLeader, useLeaderEffect, useChannel, useSend, useAsk, useAnswer, useHydrated, getSharedStore, createNamespace, defineChannel.

Stated because the honest question about a 1.0 is “what will bite me quietly”:

  • The wire protocol stays at version 1. A 1.0 tab and a 0.8 tab interoperate. This is the promise the stability policy makes and the reason the protocol is versioned separately from the package.
  • Last-writer-wins stays the default for useSharedState. If you want add-up semantics you still reach for useSharedReducer, exactly as today.
  • Persistence stays best-effort, and useHydrated stays the way to gate UI on a restore.
  • Nothing becomes stricter. Values that set() accepts today keep being accepted; making a value stricter is a major change under the policy, and 1.0 is not spending its major on one.

Not features. The contract: the stability policy takes effect, experimental_ becomes the only surface allowed to change under you, and every remaining breaking change goes through an RFC with a two-week comment period rather than a maintainer’s judgement call.

Use the current names. The codemod exists precisely so that starting on 0.8 does not mean starting behind.