@liveblocks/yjs
Advanced tools
Changelog
v1.5.0
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 instead
const { room, leave } = client.enterRoom("my-room", options);
leave();
@liveblocks/client
backgroundKeepAliveTimeout
(a numeric value in
milliseconds). See
docs.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.LiveList.clone()
– see
docs.LiveMap.clone()
– see
docs.LiveObject.clone()
– see
docs.client.enter(roomId, options)
client.leave(roomId)
shouldInitiallyConnect
→ autoConnect
. Its meaning or
working did not change.Cannot set parent: node already has a parent
error when
initializing storage with Live datastructures that are already tied to a
Storage tree.@liveblocks/react
RoomProvider
components in your component tree for
the same room ID.RoomProvider
prop: shouldInitiallyConnect
→ autoConnect
. Its
meaning or working did not change.useOthersListener({ type, user, others })
, see
docs@liveblocks/redux
leaveRoom()
function no longer accepts a roomId
. It will
always leave the currently joined room.@liveblocks/zustand
enterRoom()
function will now return a leave callback function.leaveRoom()
function no longer accepts a roomId
. It will
always leave the currently joined room.Changelog
v1.4.8
create-liveblocks-app
--init
command.@liveblocks/client
CommentBody
-related types.@liveblocks/react-comments
.lb-root
instead of :root
to improve cascading tokens
(overriding --lb-accent
on body
for example, didn't create the expected
results), and to work within shadow DOMs.Changelog
v1.4.7
@liveblocks/react
userIds
type in ResolveUsersArgs
.Changelog
v1.4.6
@liveblocks/react
useStatus
return value on SSR responses.resolveUser
option in createRoomContext
is now
called resolveUsers
and it receives a list of user IDs (via the userIds
property, replacing userId
) instead of a single one. Instead of returning
user info of a single user ID, this function will now expect a list of users'
info matching the provided list of user IDs.ResolveUserOptions
and
ResolveMentionSuggestionsOptions
types were renamed to ResolveUsersArgs
and ResolveMentionSuggestionsArgs
respectively.resolveUsers
and resolveMentionSuggestions
now accept synchronous
functions.resolveUsers
now also provides the current room ID.editThreadMetadata
now correctly allows null
to be set on a property.
Doing so deletes existing metadata properties.@liveblocks/react-comments
ComposerSubmitComment
type from root too, in addition to
/primitives
.onThreadDelete
to Thread
.metadata
to Composer
to attach custom metadata to new threads.ThreadMetadata
type on Thread
and
Composer
.Comment
’s onEdit
and onDelete
were renamed to
onEditComment
and onDeleteComment
respectively.