Notifications is the first Liveblocks product that works across multiple rooms, and this has required us to introduce breaking changes to ensure a consistent API for Comments and Notifications.
You can upgrade to 1.10 by downloading the latest version of each Liveblocks package you’re using, for example in a React app:
If you’re not using Comments or Notifications, there are no breaking changes for you! However, if you are using these, or intend to use them in future, keep reading.
Users must see the notifications across multiple rooms when they open their
inbox. This is the first time we must expose an API not associated with a single
room. It forced us to introduce a minor breaking change in our authentication
mechanism. Using
useInboxNotifications
will call your authentication endpoint without a room
.
If you use createClient
with authEndpoint
as a callback,
room
is now optional.
Notifications needs to resolve users, as well as Comments, so we’ve lifted the
resolver functions from createRoomContext
to createClient
.
Before:
After:
Because the resolvers are no longer room-based, you’ll notice that roomId
is
no longer in the parameters.
Because the resolvers have moved to the client
, the ResolveUsersArgs
and
ResolveMentionSuggestionsArgs
types are now exported from @liveblocks/client
instead of @liveblocks/react
.
Relatedly,
stringifyCommentBody
’s
CommentBodyResolveUsersArgs
no longer exists, and you should use
ResolveUsersArgs
instead.
Some elevation
and tooltip
CSS variables have been
removed:
--lb-tooltip-background
--lb-tooltip-foreground
--lb-tooltip-foreground-contrast
--lb-elevation-background
--lb-elevation-foreground
--lb-elevation-foreground-contrast
Because these no longer exist, we recommend using the basic --lb-*
variables
directly on .lb-elevation
or .lb-tooltip
.
Before:
After:
Comments overrides allows you to replace a string or node in default components, with another that you’ve specified. Some overrides have been changed.
SELF
is now USER_SELF
.UNKNOWN_USER
is now USER_UNKNOWN
.COMMENT_REACTION_REMAINING
no longer exists, and you should use the
LIST_REMAINING_USERS
instead.COMMENT_REACTION_TOOLTIP
is now COMMENT_REACTION_LIST
, and its arguments
have been changed to (list, emoji, count)
.Before:
After:
When upgrading, remember that overrides can be applied both globally with
<CommentsConfig>
, and per component, e.g. <Composer>
. Learn more in the
overrides API reference.
We use cookies to collect data to improve your experience on our site. Read our Privacy Policy to learn more.