Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions docs/pages/api-reference/liveblocks-react-ui.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3653,7 +3653,7 @@ threads:
Here's a list of all available override names, their descriptions, and default
values.

##### Localization
##### Localization [#Overrides-Localization]

Localization overrides can only be set on
[`LiveblocksUiConfig`](/docs/api-reference/liveblocks-react-ui#LiveblocksUiConfig).
Expand All @@ -3663,7 +3663,7 @@ Localization overrides can only be set on
| `locale` | Locale code | `"en"` |
| `dir` | Text direction | `"ltr"` |

##### Global
##### Global [#Overrides-Global]

Global overrides can only be set on
[`LiveblocksUiConfig`](/docs/api-reference/liveblocks-react-ui#LiveblocksUiConfig).
Expand All @@ -3683,7 +3683,7 @@ Global overrides can only be set on
| `ATTACHMENT_ERROR` | Upload error | `"The file couldn't be uploaded."` |
| `COPY_TO_CLIPBOARD` | Copy button label | `"Copy"` |

##### Composer
##### Composer [#Overrides-Composer]

Composer overrides can be set on both
[`Composer`](/docs/api-reference/liveblocks-react-ui#Composer) and
Expand All @@ -3699,7 +3699,7 @@ Composer overrides can be set on both
| `COMPOSER_SEND` | Send button label | `"Send"` |
| `COMPOSER_TOGGLE_MARK` | Format toggle labels | `"Bold"`, `"Italic"`, etc. |

##### Comment
##### Comment [#Overrides-Comment]

Comment overrides can be set on both
[`Comment`](/docs/api-reference/liveblocks-react-ui#Comment) and
Expand All @@ -3720,7 +3720,7 @@ Comment overrides can be set on both
| `COMMENT_REACTION_LIST` | Reaction list text | `"X reacted with Y"` |
| `COMMENT_REACTION_DESCRIPTION` | Reaction description | `"X reactions, react with Y"` |

##### Thread
##### Thread [#Overrides-Thread]

Thread overrides can be set on both
[`Thread`](/docs/api-reference/liveblocks-react-ui#Thread) and
Expand All @@ -3738,7 +3738,7 @@ Thread overrides can be set on both
| `THREAD_COMPOSER_PLACEHOLDER` | Reply placeholder | `"Reply to thread…"` |
| `THREAD_COMPOSER_SEND` | Reply button label | `"Reply"` |

##### Inbox notification
##### Inbox notification [#Overrides-Inbox-notification]

Inbox notification overrides can be set on both
[`InboxNotification`](/docs/api-reference/liveblocks-react-ui#InboxNotification)
Expand All @@ -3754,7 +3754,7 @@ and
| `INBOX_NOTIFICATION_THREAD_MENTION` | Thread mention text | `"X mentioned you in Y"` |
| `INBOX_NOTIFICATION_TEXT_MENTION` | Text mention text | `"X mentioned you in Y"` |

##### History version preview
##### History version preview [#Overrides-History-version-preview]

History version preview overrides can be set on both
[`HistoryVersionSummary`](/docs/api-reference/liveblocks-react-ui#HistoryVersionSummary)
Expand All @@ -3768,7 +3768,7 @@ and
| `HISTORY_VERSION_PREVIEW_EMPTY` | Empty state text | `"No content."` |
| `HISTORY_VERSION_PREVIEW_ERROR` | Error message | `"There was an error…"` |

##### AI composer
##### AI composer [#Overrides-AI-composer]

AI composer overrides can be set on both
[`AiChat`](/docs/api-reference/liveblocks-react-ui#AiChat) and
Expand All @@ -3780,7 +3780,7 @@ AI composer overrides can be set on both
| `AI_COMPOSER_SEND` | Send button label | `"Send"` |
| `AI_COMPOSER_ABORT` | Abort button label | `"Abort response"` |

##### AI chat message
##### AI chat message [#Overrides-AI-chat-message]

AI chat message overrides can be set on both
[`AiChat`](/docs/api-reference/liveblocks-react-ui#AiChat) and
Expand All @@ -3793,7 +3793,7 @@ AI chat message overrides can be set on both
| `AI_CHAT_MESSAGE_REASONING` | Reasoning indicator | `"Reasoning…"` / `"Reasoned for X"` |
| `AI_CHAT_MESSAGE_RETRIEVAL` | Retrieval indicator | `"Searching X…"` / `"Searched X"` |

##### AI chat
##### AI chat [#Overrides-AI-chat]

AI chat overrides can be set on both
[`AiChat`](/docs/api-reference/liveblocks-react-ui#AiChat) and
Expand All @@ -3803,7 +3803,7 @@ AI chat overrides can be set on both
| ------------------------ | -------------- | ----------------------- |
| `AI_CHAT_MESSAGES_ERROR` | Messages error | `"There was an error…"` |

##### AI tool confirmation
##### AI tool confirmation [#Overrides-AI-tool-confirmation]

AI tool confirmation overrides can be set on both
[`AiTool`](/docs/api-reference/liveblocks-react-ui#AiTool) and
Expand Down
8 changes: 4 additions & 4 deletions docs/pages/api-reference/liveblocks-react.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2366,10 +2366,10 @@ function App() {
</PropertiesListItem>
<PropertiesListItem name="engine" type="1 | 2">
Preferred storage engine version to use when creating the room. Only takes
effect if the room doesn’t exist yet. This value is ignored after the first
render. The v2 Storage engine supports larger documents, is more performant,
has native streaming support, and will become the default in the future.
[Learn more](/docs/guides/about-the-new-storage-engine).
effect if the room doesn’t exist yet. The v2 Storage engine supports larger
documents, is more performant, has native streaming support, and will become
the default in the future. [Learn
more](/docs/guides/about-the-new-storage-engine).
</PropertiesListItem>
</PropertiesList>

Expand Down
14 changes: 5 additions & 9 deletions examples/nextjs-comments-emails-sendgrid/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 23 additions & 22 deletions guides/pages/about-the-new-storage-engine.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,23 @@ meta:
description: "Learn about our improved v2 Storage engine and how to enable it"
---

Since v3.14, rooms can be powered by our new b2 Storage engine. Switching is
**seamless and requires no code changes**. Rooms on v1 or v2 behave identically
from your app’s perspective—Presence, Broadcasts, Liveblocks Storage, and Yjs
Storage all work the same way.
Since v3.14, rooms can be powered by our new v2 Storage engine—a ground-up
rearchitecture that removes server-side memory limits, enabling faster initial
loads and support for much larger documents. Switching is **seamless and
requires no code changes**. Rooms on v1 or v2 behave identically from your app's
perspective—Presence, Broadcasts, Liveblocks Storage, and Yjs Storage all work
the same way.

If you switch, you may notice faster initial loads and support for larger
documents. We’re enabling opting-in to v2 now for those eager to try it out and
give us feedback. Soon it will become the default for everyone.
You can now opt in to v2 to try it out and give us feedback. Soon it will become
the default for everyone.

## What are the benefits?

The main architectural leap of v2 is that the Liveblocks server no longer needs
to keep the entire document in memory. Historically, large documents put memory
to keep the entire document in memory. In v1, large documents put memory
pressure on our edge workers, which are limited in capacity. A 50 MiB document,
including its overhead, could easily cause an OOM crash in an edge worker on
engine v1, causing the room to become inaccessible.
including its overhead, could easily cause an OOM crash in an edge worker on the
v1 engine, in turn causing the room to become inaccessible.

Rooms on the v2 Storage engine now stream their document data directly from our
persisted storage layer, keeping only minimal data in memory. Conflict
Expand All @@ -33,27 +34,26 @@ Initial load time will be faster, especially for larger documents: the server
can start streaming immediately without buffering, and our wire protocol has
been compacted to reduce transmission overhead.

Lastly, v2 enables us to ship future Liveblocks features not possible on v1.

## How to enable it

The engine is assigned at room creation time and cannot be changed afterward.

1. Upgrade to the latest release candidate: `npx liveblocks@latest upgrade rc`
(it will put you on 3.14.0-rc1 or later)
1. Upgrade to the latest release candidate:
`npx create-liveblocks-app@latest --upgrade=rc` (it will put you on
3.14.0-rc1 or later)
2. Opt-in to v2 (see options below)

### Per-room opt-in

Specify the `engine` option when entering a room. This only affects new rooms—if
the room already exists, the flag has no effect.
the room already exists, the room stays on its original engine version.

With `LiveblocksProvider`:
With `RoomProvider`:

```tsx
<LiveblocksProvider id="my-new-room" engine={2}>
<RoomProvider id="my-new-room" engine={2}>
{children}
</LiveblocksProvider>
</RoomProvider>
```

With vanilla client:
Expand All @@ -70,7 +70,8 @@ option when v3.14 is officially released.

### Migrating existing rooms

Eventually, we will transparently migrate all existing room data from engine v1
to engine v2, and the explicit opt-in `engine` option will no longer have an
effect, but we will announce this ahead of time. This process will be a seamless
and uninterrupted continuation for rooms, and require no action on your part.
Eventually, we will transparently migrate all existing room data from the v1 to
the v2 Storage engine, and the explicit opt-in `engine` option will no longer
have an effect, but we will announce this ahead of time. This process will be a
seamless and uninterrupted continuation for rooms, and require no action on your
part.
Loading