Support multiple RoomProviders, or mixing and matching our React package in the
same app with a Redux and/or Zustand instance.
At the client level, there is a new API for entering/leaving rooms, which we’re
now recommending over the old APIs. (The old APIs remain working exactly how
they are today, however.)
// Old APIs we'll no longer be recommending (but that will remain working)const room = client.enter("my-room", options);client.getRoom("my-room");client.leave("my-room");
// New API we'll be recommending insteadconst{ room, leave }= client.enterRoom("my-room", options);leave();
New client config option: backgroundKeepAliveTimeout (a numeric value in
milliseconds). See
docs.
New APIs:
Client.enterRoom(roomId, options) – enters the room and return both the
room and an "unsubscribe function" to leave that room again. This newer API
supports entering/leaving the same room multiple times, making it possible
to connect to the same room from different parts of your application. See
docs.
Client.logout() – Call this on the Liveblocks client when you log out a
user in your application. It will purge all auth tokens and force-leave any
rooms, if any are still connected. See
docs.
Renamed enter option: shouldInitiallyConnect → autoConnect. Its meaning or
working did not change.
Fixes a potential Cannot set parent: node already has a parent error when
initializing storage with Live datastructures that are already tied to a
Storage tree.