diff --git a/docs/build/local-first.md b/docs/build/local-first.md index 963121b2..48e11f6a 100644 --- a/docs/build/local-first.md +++ b/docs/build/local-first.md @@ -8,7 +8,9 @@ description: "If you're building a production-grade app, be sure to use a local- If you're building a production-grade app, be sure to use a local-first architecture to help you build a performant app. Using this local-first architecture, the client prioritizes using the local cache on the device where it’s running. -For example, use the XMTP SDK to initially retrieve existing message data from the XMTP network and place it in the local cache. Asynchronously load new and updated message data as needed. Build your app to get message data from the local cache. +Use the XMTP SDK to initially retrieve existing message data from the XMTP network and place it in the local cache. Asynchronously load new and updated message data as needed. Build your app to get message data from the local cache. + +For example, using a local cache to store [reactions](./messages/reaction) and [replies](./messages/reply) is key to performantly displaying them with their referenced messages when rendering message lists. **When building a web app with the [React SDK](https://github.com/xmtp/xmtp-web/tree/main/packages/react-sdk), the local-first architecture is automatically provided by the SDK.** diff --git a/docs/build/messages/reaction.mdx b/docs/build/messages/reaction.mdx index ae46cbbc..eecd8100 100644 --- a/docs/build/messages/reaction.mdx +++ b/docs/build/messages/reaction.mdx @@ -9,7 +9,7 @@ import TabItem from "@theme/TabItem"; # Support reactions in your app built with XMTP -![Status](https://img.shields.io/badge/Content_type_status-Standards--track-yellow) ![Status](https://img.shields.io/badge/Reference_implementation_status-Beta-yellow) +![Status](https://img.shields.io/badge/Content_type_status-Standards--track-yellow) ![Status](https://img.shields.io/badge/Reference_implementation_status-Stable-31CA54) Use the reaction content type to support reactions in your app. A reaction is a quick and often emoji-based way to respond to a message. Reactions are usually limited to a predefined set of emojis or symbols provided by the messaging app. @@ -19,6 +19,12 @@ You're welcome to provide feedback by commenting on the [Proposal for emoji reac ::: +## Use a local database for performance + +Use a local database to store reactions. This will enable your app to performantly display a reaction with its [referenced message](#send-a-reaction) when rendering message lists. + +To learn more about using a local database, see [Use local-first architecture](/docs/build/local-first). + ## Configure the content type In some SDKs, the `ReactionCodec` is already included in the SDK. If not, you can install the package using the following command: diff --git a/docs/build/messages/reply.mdx b/docs/build/messages/reply.mdx index eee3e968..7f53b64f 100644 --- a/docs/build/messages/reply.mdx +++ b/docs/build/messages/reply.mdx @@ -9,7 +9,7 @@ import TabItem from "@theme/TabItem"; # Support replies in your app built with XMTP -![Status](https://img.shields.io/badge/Content_type_status-Standards--track-yellow) ![Status](https://img.shields.io/badge/Reference_implementation_status-Beta-yellow) +![Status](https://img.shields.io/badge/Content_type_status-Standards--track-yellow) ![Status](https://img.shields.io/badge/Reference_implementation_status-Stable-31CA54) Use the reply content type to support quote replies in your app. A reply is a method to directly respond to a specific message in a conversation. Users can select and reply to a particular message instead of sending a new one. @@ -19,6 +19,12 @@ You're welcome to provide feedback by commenting on the [Proposal for Reply cont ::: +## Use a local database for performance + +Use a local database to store replies. This will enable your app to performantly display a reply with its [referenced message](#send-a-reply) when rendering message lists. + +To learn more about using a local database, see [Use local-first architecture](/docs/build/local-first). + ## Configure the content type In some SDKs, the `ReplyCodec` is already included in the SDK. If not, you can install the package using the following command: