# Excalidraw: a (draft of a) collaborative drawing app

**URL:** <https://support.delta.chat/t/excalidraw-a-draft-of-a-collaborative-drawing-app/2810>\
**Category:** Mini Apps\
**Created:** [November 19, 2023, 12:34pm UTC](https://support.delta.chat/t/excalidraw-a-draft-of-a-collaborative-drawing-app/2810 "2023-11-19T12:34:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![WofWca](https://support.delta.chat/user_avatar/support.delta.chat/wofwca/32/1702_2.png) [@WofWca](https://support.delta.chat/u/WofWca)\
**Post date:** [November 19, 2023, 12:34pm UTC](https://support.delta.chat/t/excalidraw-a-draft-of-a-collaborative-drawing-app/2810/1 "2023-11-19T12:34:18Z")

</div>

![image](https://support.delta.chat/uploads/default/original/2X/6/6ea5025a790344546f54e8a97b41b19b566bde02.png)

[Download excalidraw.xdc](https://github.com/WofWca/loro-excalidraw/releases/latest/download/excalidraw.xdc)

[Source Code](https://github.com/WofWca/loro-excalidraw/)

@link2xt found this [new CRDT called Loro](https://www.loro.dev/blog/loro-now-open-source), and they have a convenient [Excalidraw](https://excalidraw.com/) example, which I forked and adapted to webxdc real quick.

This is similar to the [existing drawing webxdc app](https://github.com/webxdc/draw), except [with that one you can’t collaborate in real time](https://github.com/webxdc/draw/issues/2), and that this one has a lot more development effort put into it (i.e. thanks to Excalidraw).

## Why it’s a “draft”

- Because the build is too big: 1.36 MB Compressed WASM takes 571 kB, compressed JS – 758 kB, and [Delta Chat has a 640 kB limit on `.xdc` size](https://github.com/deltachat/deltachat-core-rust/blob/09d4b4354a3cd98f07ed5cd9b78f75fa24e8e244/src/webxdc.rs#L53-L63) (raise it?? 🥺👉👈 [Proposal: remove/bump `.xdc` file size cap](https://support.delta.chat/t/proposal-remove-bump-xdc-file-size-cap/2828)). This is without static assests. With them it’s ~2.5 MB
- I got a permission to fork it from the original devs, but the license is still missing: [License? · Issue #1 · loro-dev/loro-excalidraw · GitHub](https://github.com/loro-dev/loro-excalidraw/issues/1) .
- I simply hacked it up real quick, without giving it much thought and properly testing it. Also see TODO comments in the source code.
- That slider at the bottom of the page is not really a thing for end users

## Also

I also talked to the Loro devs and asked them if they’d like to incorporate the webxdc changes into their Excalidraw example, and they weren’t really enthusiastic about it. It was before I had written any code.

And if you’re wondering if we can make the app smaller than 640 kB by using a non-WASM CRDT like Yjs, the answer is “probably”. I analyzed the bundle with `rollup-plugin-visualizer` and it looked like that excalidraw is included twice. Though see this [comment](https://github.com/WofWca/loro-excalidraw/blob/c8729693f42f3b46b2bebde2c8e2d33e228967d0/src/App.tsx#L14-L18). I’m not sure these assets are actually required, and they’re quite big.

And just yesterday they posted a [tldraw example](https://github.com/loro-dev/loro-tldraw) (which is another whiteboard app).

---

<div class="post-metadata">

**Author:** ![Raiden](https://support.delta.chat/user_avatar/support.delta.chat/raiden/32/2544_2.png) [@Raiden](https://support.delta.chat/u/Raiden)\
**Post date:** [November 19, 2023, 1:01pm UTC](https://support.delta.chat/t/excalidraw-a-draft-of-a-collaborative-drawing-app/2810/2 "2023-11-19T13:01:27Z")

</div>

A good idea, but I’m not sure if it would take too many emails to sync the apps?

---

<div class="post-metadata">

**Author:** ![WofWca](https://support.delta.chat/user_avatar/support.delta.chat/wofwca/32/1702_2.png) [@WofWca](https://support.delta.chat/u/WofWca)\
**Post date:** [November 19, 2023, 1:08pm UTC](https://support.delta.chat/t/excalidraw-a-draft-of-a-collaborative-drawing-app/2810/3 "2023-11-19T13:08:49Z")

</div>

Why? We have [the editor app](https://codeberg.org/webxdc/editor), I think it’s extremely similar in terms of data throughput. Either way, there is a [rate limit of 6 messages per minute in Delta Chat](https://github.com/deltachat/deltachat-core-rust/blob/3748794048d6371ad775e75d589685ea0430f93b/src/context.rs#L382). If the limit is hit, the messages are batched together and sent few seconds later.

---

<div class="post-metadata">

**Author:** ![Raiden](https://support.delta.chat/user_avatar/support.delta.chat/raiden/32/2544_2.png) [@Raiden](https://support.delta.chat/u/Raiden)\
**Post date:** [November 19, 2023, 1:51pm UTC](https://support.delta.chat/t/excalidraw-a-draft-of-a-collaborative-drawing-app/2810/4 "2023-11-19T13:51:58Z")

</div>

In my experience, some providers block sending if too many emails are sent in a certain time because their systems interpret this as spam. A large proportion of users will not know how many emails are being sent in the background.

---

<div class="post-metadata">

**Author:** ![WofWca](https://support.delta.chat/user_avatar/support.delta.chat/wofwca/32/1702_2.png) [@WofWca](https://support.delta.chat/u/WofWca)\
**Post date:** [November 19, 2023, 3:02pm UTC](https://support.delta.chat/t/excalidraw-a-draft-of-a-collaborative-drawing-app/2810/5 "2023-11-19T15:02:23Z")

</div>

Well, idk. I don’t think it’s something that individual apps are supposed to care about. Perhaps an explicit “send updates” button would do, or the rate limit can be tightened.
