Skip to content

Commit

Permalink
first pass
Browse files Browse the repository at this point in the history
  • Loading branch information
jhaaaa committed Jul 10, 2024
1 parent af2b62b commit bcafac1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
4 changes: 3 additions & 1 deletion docs/build/local-first.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.**

Expand Down
8 changes: 7 additions & 1 deletion docs/build/messages/reaction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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:
Expand Down
8 changes: 7 additions & 1 deletion docs/build/messages/reply.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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:
Expand Down

0 comments on commit bcafac1

Please sign in to comment.