Product updates

What’s new in Liveblocks: October edition

We’ve released pagination for Comments & Notifications, a way to revalidate user & room data, added further support for attachments, and are now offering new discounts for startups.

What’s new in Liveblocks: October edition

This October we’ve added much requested features, and offer new discounts.

Upgrade now

To use the latest features, update your packages with the following command.

$npx create-liveblocks-app@latest --upgrade

If you were previously on Liveblocks 2.8 or below, make sure to follow our upgrade guides before updating.

Pagination for threads & notifications

We’ve added pagination when fetching threads and inbox notifications in React, making it easy to add a “Load more” button when building your application. This is the new default behavior, and can make initial load times quicker, as only 50 threads/notifications are loaded at once.

Threads pagination example

In the code, this change applies to useThreads and useInboxNotifications, and pagination works in the same way for both.

function Threads() {  const {    threads,
// New pagination properties fetchMore, isFetchingMore, hasFetchedAll, } = useThreads();
return ( <div> {threads.map((thread) => ( <Thread key={thread.id} thread={thread} /> ))}
{hasFetchedAll ? ( <div>🎉 You're all caught up!</div> ) : ( <button disabled={isFetchingMore} onClick={fetchMore}> Load more </button> )} </div> );}

To learn more and upgrade your app, make sure to read our pagination upgrade guide.

Revalidate user & room data

In our React components, it’s now possible to revalidate user, mention, and room data without refreshing this page. This is helpful in a number of ways—for example if a user changes their avatar, you can tell Liveblocks to revalidate its user cache, and you’ll see the new avatar in Comments.

function SubmitAvatar() {  const client = useClient();
function handleClick() { __updateUserAvatar__();
// Refresh user cache and get new avatar client.resolvers.invalidateUsers(); }
return <button onClick={handleClick}>Submit avatar</button>;}

We’ve introduced three new functions for this, allowing you to:

// Refreshing user infoclient.resolvers.invalidateUsers(); // All usersclient.resolvers.invalidateUsers(["user-0", "user-1"]);
// Refreshing room infoclient.resolvers.invalidateRoomsInfo(); // All roomsclient.resolvers.invalidateRoomsInfo(["room-0", "room-1"]);
// Refreshing all mention suggestionsclient.resolvers.invalidateMentionSuggestions();

When using React, you can retrieve client with useClient. Learn more under resolver methods in our docs.

Expanded attachments support

Recently we introduced attachments for Comments, allowing you to upload media and files to individual comments. We’ve expanded support for this into other parts of our product, for example you can now see attachments in the dashboard and in our Figma collaboration kit

Attachments in the Figma kit

Discounts for startups & nonprofits

We now offer pre-negotiated discounts for startups and nonprofits, helping you to build and grow your company.

Apply for discounts

Apply and learn more on our new startups page.

Upgrade now

To use the latest features, update your packages with the following command.

$npx create-liveblocks-app@latest --upgrade

If you were previously on Liveblocks 2.8 or below, make sure to follow our upgrade guides before updating.

Contributors

Contributors include:marcbouchenoiresugardariuspierrelevaillantnvienimeshnayajuofoucherotstevenfabrekaf-lamed-beytctnicholas

9 authors

We use cookies to collect data to improve your experience on our site. Read our Privacy Policy to learn more.