<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Automerge</title>
    <link>https://automerge.org/</link>
    <description>Automerge is a library for building collaborative, local-first applications.</description>
    <lastBuildDate>Mon, 09 Nov 2026 19:28:47 GMT</lastBuildDate>
    <atom:link href="https://automerge.org/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title><![CDATA[This Month in Automerge: November '26]]></title>
      <link>https://automerge.org/blog/2026-november/</link>
      <guid isPermaLink="true">https://automerge.org/blog/2026-november/</guid>
      <pubDate>Mon, 09 Nov 2026 00:00:00 GMT</pubDate>
      <description><![CDATA[Our Q4 community call, masking changes by author, an alpha of automerge-repo 3.0 on Subduction, a big month for Keyhive (Keyline, causal encryption, a canonical codec), Automerge in Go, and Keyhive at J On The Beach.]]></description>
      <content:encoded><![CDATA[<p><em>A quick note on naming: starting with this edition, each issue is named for the month it comes out, not the month it covers. This one covers October, picking up right where the <a href="/blog/2026-september/">September edition</a> left off, so nothing was skipped.</em></p>
<p>As always, the community hangs out in <a href="https://discord.gg/zKGe4DCfgR">the Automerge Discord</a>. Come say hi, and let us know if you’d like something included in next month’s edition!</p>
<h2 id="highlights"><a class="plain" href="#highlights">✨ Highlights</a></h2>
<ul>
<li><a href="https://github.com/inkandswitch/keyhive">Keyhive</a> had a big month: a streamlined authority graph (Keyline), causal encryption, and a canonical codec all landed in Keyhive 0.6.</li>
<li><a href="https://github.com/automerge/automerge-repo">automerge-repo</a> 3.0, rebuilt on <a href="https://github.com/inkandswitch/subduction">Subduction</a>, is now out as an alpha.</li>
</ul>
<h2 id="community-call"><a class="plain" href="#community-call">📺 Community Call</a></h2>
<p>On October 8, <a href="https://github.com/expede">Brooke Zelenka</a> and <a href="https://github.com/alexjg">Alex Good</a> hosted our Q4 community call, and the <a href="https://www.youtube.com/watch?v=0rpfOFVDr7g">recording is up on YouTube</a>.</p>
<iframe
  style="aspect-ratio: 16 / 9; border: 0;"
  src="https://www.youtube.com/embed/0rpfOFVDr7g"
  title="2026 Q4 Automerge Community Call"
  allow="accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
  referrerpolicy="strict-origin-when-cross-origin"
  allowfullscreen
  loading="lazy"
></iframe>
<p>Want to join the next one? Follow <a href="https://luma.com/automerge">the Automerge calendar on Luma</a> to hear when it’s scheduled.</p>
<h2 id="include-logo-icon-automerge"><a class="plain" href="#include-logo-icon-automerge"><svg viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg" style="height: 1em; width: 1em; vertical-align: -0.12em;" role="img" aria-label="Automerge logo">
  <path d="M28.2485 0.806161L1.00094 28.0537C-0.0739441 29.1286 -0.0739441 30.8714 1.00094 31.9463L28.2485 59.1938C29.3234 60.2687 31.0661 60.2687 32.141 59.1938L59.3886 31.9463C60.4635 30.8714 60.4635 29.1286 59.3886 28.0537L32.141 0.806163C31.0661 -0.268724 29.3234 -0.268725 28.2485 0.806161Z M28.5447 5.25803L5.4522 28.3505C4.54122 29.2615 4.54122 30.7385 5.4522 31.6495L28.5447 54.742C29.4557 55.6529 30.9327 55.6529 31.8436 54.742L54.9361 31.6495C55.8471 30.7385 55.8471 29.2615 54.9361 28.3505L31.8436 5.25803C30.9327 4.34705 29.4557 4.34705 28.5447 5.25803Z" fill="#FFCC33"/>
  <path d="M30.1945 56.3914C29.6656 56.3914 29.137 56.1904 28.7347 55.7879L4.40639 31.4595C3.60152 30.6547 3.60152 29.3453 4.40639 28.5405L28.7347 4.21219C29.1247 3.82214 29.6429 3.60742 30.1942 3.60742C30.7458 3.60742 31.264 3.82214 31.654 4.21219L55.9823 28.5405C56.7872 29.3453 56.7872 30.6547 55.9823 31.4595L31.654 55.7878C31.2518 56.1904 30.7232 56.3914 30.1945 56.3914ZM30.1942 4.98363C30.0105 4.98363 29.8379 5.05532 29.7077 5.18523L5.37943 29.5135C5.11122 29.7817 5.11122 30.2184 5.37943 30.4865L29.7077 54.8148C29.9682 55.0746 30.4206 55.0743 30.681 54.8148L55.0093 30.4865C55.1392 30.3566 55.2106 30.1837 55.2106 30C55.2106 29.8163 55.1392 29.6434 55.0093 29.5135L30.681 5.18523C30.5508 5.05532 30.3782 4.98363 30.1942 4.98363Z" fill="#222" stroke="#222"/>
  <path d="M37.7723 22.9132L30.1948 12.4836L22.6173 22.9132C21.8364 23.988 22.8812 25.436 24.1474 25.0337L27.4426 23.9869V26.1274C27.4426 28.5163 26.5122 30.7625 24.8227 32.4518L19.9766 37.298L22.8962 40.2176L27.4426 35.6713V44.7637H32.9474V23.9871L36.2423 25.0337C37.5085 25.436 38.5532 23.988 37.7723 22.9132Z" fill="#222"/>
</svg>
 Automerge</a></h2>
<h3 id="masking-changes-by-author"><a class="plain" href="#masking-changes-by-author">Masking Changes by Author</a></h3>
<p>In <a href="/blog/2026-september/">September</a>, Automerge learned to record an <em>author</em> for each change. In October, <a href="https://github.com/FintanH">Fintan Halpenny</a> built the next step on top of that: hiding an author’s changes from your view of a document (<a href="https://github.com/automerge/automerge/pull/1581">#1581</a>). It’s on <code>main</code> now and will ship in the next release.</p>
<pre><code class="language-js"><div class="code-line"><span class="token keyword">import</span> <span class="token operator">*</span> <span class="token keyword">as</span> Automerge <span class="token keyword">from</span> <span class="token string">"@automerge/automerge"</span></div><div class="code-line"> </div><div class="code-line"><span class="token comment">// Hide everything `author` wrote after `heads`</span></div><div class="code-line">doc <span class="token operator">=</span> Automerge<span class="token punctuation">.</span><span class="token function">maskAuthor</span><span class="token punctuation">(</span>doc<span class="token punctuation">,</span> author<span class="token punctuation">,</span> heads<span class="token punctuation">)</span></div><div class="code-line"> </div><div class="code-line">Automerge<span class="token punctuation">.</span><span class="token function">isAuthorMasked</span><span class="token punctuation">(</span>doc<span class="token punctuation">,</span> author<span class="token punctuation">)</span> <span class="token comment">// true</span></div><div class="code-line"> </div><div class="code-line"><span class="token comment">// ...and bring it back</span></div><div class="code-line">doc <span class="token operator">=</span> Automerge<span class="token punctuation">.</span><span class="token function">revealAuthor</span><span class="token punctuation">(</span>doc<span class="token punctuation">,</span> author<span class="token punctuation">)</span></div></code></pre><p>The point at which the author is cut off is called a <em>write frontier</em>. Changes from that author up to the frontier stay visible, and anything after it is hidden. Masking doesn’t delete anything or move the document’s heads. It only changes what <em>your</em> replica shows, so you can undo it with <code>revealAuthor</code>.</p>
<p>We built this for <a href="https://github.com/inkandswitch/keyhive">Keyhive</a> revocation. When Keyhive revokes someone’s access to a document, Automerge can stop showing the changes they made after that point, even if those changes still reach you through sync.</p>
<p>We think masking is useful well beyond access control. For example, you could hide edits from a misbehaving bot or AI agent, review someone’s changes before accepting them, or see what a document looks like without one collaborator’s contributions. If you have other ideas, we’d love to hear them!</p>
<p><a href="https://github.com/alexjg">Alex Good</a> also made masking work when you only have part of the write frontier (<a href="https://github.com/automerge/automerge/pull/1595">#1595</a>). Your replica no longer has to wait for every head before it can show the changes you <em>do</em> have.</p>
<p>Fintan made this fast too. Masked reads use Automerge’s indexes instead of scanning the whole document, and loading skips the reindex step when the mask hides nothing. Property tests check that patches and hydrated documents agree under every mask.</p>
<h3 id="fixes-and-polish"><a class="plain" href="#fixes-and-polish">Fixes &amp; Polish</a></h3>
<ul>
<li><a href="https://github.com/aran">Aran Donohue</a> fixed <code>list_range</code> on text, which returned the start and end of each mark as if they were characters (<a href="https://github.com/automerge/automerge/pull/1608">#1608</a>). For <code>&quot;hello world&quot;</code> with one mark, you now get eleven characters instead of thirteen items. Aran also added CI coverage for the <code>utf16-indexing</code> feature (<a href="https://github.com/automerge/automerge/pull/1630">#1630</a>).</li>
<li>Thanks to first-time contributor <a href="https://github.com/Wahaj18">Wahaj18</a>, looking up a cursor against the wrong object now returns <code>InvalidCursor</code> instead of panicking (<a href="https://github.com/automerge/automerge/pull/1597">#1597</a>).</li>
<li><a href="https://github.com/FintanH">Fintan Halpenny</a> migrated another benchmark (<code>load_actors</code>) from Criterion into the <a href="https://github.com/automerge/automerge/tree/main/rust/benchmark-battery">benchmark battery</a>.</li>
</ul>
<h2 id="automerge-repo"><a class="plain" href="#automerge-repo">📦 automerge-repo</a></h2>
<p><a href="https://github.com/darcyparker">Darcy Parker</a> kept up the steady stream of fixes:</p>
<ul>
<li>Sync state is now saved per document, and removing <code>DocHandle</code> listeners now works correctly (<a href="https://github.com/automerge/automerge-repo/pull/773">#773</a>).</li>
<li><code>react-hooks</code> and <code>solid-primitives</code> no longer bundle their dependencies (<a href="https://github.com/automerge/automerge-repo/pull/758">#758</a>).</li>
<li>The minimum versions of <code>cbor-x</code> and <code>ws</code> were raised to pick up upstream fixes (<a href="https://github.com/automerge/automerge-repo/pull/756">#756</a>).</li>
<li>Importing an older copy of a document under the same ID can no longer delete newer stored changes during compaction (<a href="https://github.com/automerge/automerge-repo/pull/774">#774</a>).</li>
</ul>
<h3 id="automerge-repo-v3-0-alpha"><a class="plain" href="#automerge-repo-v3-0-alpha">automerge-repo v3.0 (Alpha)</a></h3>
<p><a href="https://github.com/acurrieclark">Alex Currie-Clark</a> spent much of October rebuilding automerge-repo on top of <a href="https://github.com/inkandswitch/subduction">Subduction</a>. Instead of plugging network and storage adapters straight into the <code>Repo</code>, automerge-repo 3.0 talks to a <em>Sedimentree backend</em> that owns them, and the first one is built on Subduction. The work went out early in the month as <a href="https://github.com/automerge/automerge-repo/releases"><code>v3.0.0-experimental.1</code> and <code>.2</code></a>, on npm under the <code>experimental</code> tag, and continued on its branch through the rest of October. In early November it graduated to a proper alpha: <a href="https://github.com/automerge/automerge-repo/releases"><code>v3.0.0-alpha.1</code></a> is on npm under the <code>next</code> tag.</p>
<p>What’s new:</p>
<ul>
<li><strong>A simpler core.</strong> The old scheduler is gone. Each document now owns its own state, and the <code>Repo</code> just maps document IDs to documents.</li>
<li><strong>New APIs.</strong> <code>Repo.query()</code> returns an observable you can subscribe to, and <code>DocHandle.hasHeads</code> checks whether a document has reached some heads. <code>DocHandle.changeAt</code> now returns a <code>Promise</code> of the new heads.</li>
<li><strong>32-byte document IDs.</strong> Existing 16-byte IDs still work in URLs.</li>
<li><strong>Faster loading.</strong> Each document loads with a single storage read, and many documents load in parallel. New benchmarks cover large imports, long text histories, and documents with many authors.</li>
<li><strong>Clearer failures.</strong> If a write fails, the repo stops and reports it, instead of retrying silently. Edits are now stored as loose commits and compacted later.</li>
</ul>
<p>This is an alpha: it’s not ready for production yet, and the API may still change. If you try it, we’d love to hear how it goes in <a href="https://discord.gg/zKGe4DCfgR">the Discord</a>!</p>
<h2 id="keyhive"><a class="plain" href="#keyhive">🗝️🐝 Keyhive</a></h2>
<p><a href="https://github.com/inkandswitch/keyhive">Keyhive</a> is our access control and encryption layer for Automerge and other CRDTs. This was a big month for Keyhive: a lot of work that’s been happening behind the scenes finally landed!</p>
<p>In short: a new authority graph (Keyline), sturdier group keys, causal encryption, a canonical custom codec (heading for a stable format), no more “World Public” user, and Keyhive 0.6 running in automerge-repo-keyhive. Everything below ships in <a href="https://www.npmjs.com/package/@keyhive/keyhive"><code>@keyhive/keyhive</code> v0.6.0</a> and <a href="https://crates.io/crates/keyhive_core"><code>keyhive_core</code> v0.10.0</a>.</p>
<h3 id="keyline"><a class="plain" href="#keyline">Keyline</a></h3>
<p><strong>Keyline is Keyhive’s new authority graph.</strong> It used to live directly in <code>keyhive_core</code>, but we split it out into its own crate for symmetry with BeeKEM (<a href="https://github.com/inkandswitch/keyhive/pull/230">#230</a>), and Keyhive’s membership now runs on it (<a href="https://github.com/inkandswitch/keyhive/pull/288">#288</a>).</p>
<p>As before, it is a set of signed certificates over keys: <em>delegations</em> that give a key some power over a subject, and <em>revocations</em> that withdraw a delegation. There’s <a href="https://github.com/inkandswitch/keyhive/blob/main/design/keyline/README.md">a detailed design</a>, including the alternatives we rejected and the edge cases. Unlike the prior authority graph, capabilities are now bound late (when they’re used) rather than early (at delegation time). That idea was inspired by <a href="https://ucan.xyz">UCAN</a>, and it’s a natural fit for a causally consistent system.</p>
<p>Keyline also replaces our old answer to the “dueling admins” problem. Previously, when two admins revoked each other concurrently, Keyhive broke the tie with a deterministic but arbitrary order (seniority, then causal depth, then hash), which was hard to predict. Keyline’s rules are simpler and explicit: you can never revoke the branch of the graph you’re standing on, and when peers revoke each other, both revocations stand. Below the root role, you recover by rotating the role. A duel inside the root role can’t be undone, so keep that role small.</p>
<p>One of the interesting things about Keyline is that it has clear semantics and can be implemented in terms of SQL, Datalog, or DBSP. The first version is a fully in-memory implementation, but we plan to use databases for things like sync servers in the future. Keyline is also <code>no_std</code> and builds for Wasm. Its interface is async, so a backend can use a database, and signing can happen behind WebCrypto or a hardware key.</p>
<p>Expect an <a href="https://www.inkandswitch.com/keyhive/notebook/">Ink &amp; Switch lab note</a> all about Keyline in the near future!</p>
<h3 id="cgka-hardening"><a class="plain" href="#cgka-hardening">CGKA Hardening</a></h3>
<p><a href="https://github.com/jtfmumm">John Mumm</a> continued hardening <a href="https://crates.io/crates/beekem">BeeKEM</a>, Keyhive’s group key agreement, building on the work from <a href="/blog/2026-september/">September</a>. For apps, that means membership changes made concurrently by different people now merge cleanly (<a href="https://github.com/inkandswitch/keyhive/pull/252">#252</a>, <a href="https://github.com/inkandswitch/keyhive/pull/256">#256</a>, <a href="https://github.com/inkandswitch/keyhive/pull/305">#305</a>, <a href="https://github.com/inkandswitch/keyhive/pull/306">#306</a>), every key operation is checked against the certificates that authorize it (<a href="https://github.com/inkandswitch/keyhive/pull/295">#295</a>, <a href="https://github.com/inkandswitch/keyhive/pull/302">#302</a>, <a href="https://github.com/inkandswitch/keyhive/pull/303">#303</a>), and newly invited members can decrypt a document right away (<a href="https://github.com/inkandswitch/keyhive/pull/262">#262</a>). BeeKEM also stays consistent when signing fails or a secret is wrong, and refuses to record secrets it hasn’t verified (<a href="https://github.com/inkandswitch/keyhive/pull/263">#263</a>, <a href="https://github.com/inkandswitch/keyhive/pull/293">#293</a>).</p>
<h3 id="causal-encryption"><a class="plain" href="#causal-encryption">Causal Encryption</a></h3>
<p><a href="https://github.com/jtfmumm">John Mumm</a> moved content encryption into its own crate, <code>keyhive_content</code> (<a href="https://github.com/inkandswitch/keyhive/pull/313">#313</a>), and exposed causal encryption to both Rust and JS clients (<a href="https://github.com/inkandswitch/keyhive/pull/317">#317</a>).</p>
<p>Every encrypted block carries the keys of its direct causal ancestors. If you can open one point in a document’s history, you can walk back from there and open everything before it, so a new member can read the full history without anyone having to hand over a pile of old keys. In JS, that’s <code>tryEncrypt</code> (passing the predecessors) and <code>tryCausalDecrypt</code>. The <a href="https://github.com/inkandswitch/keyhive/blob/main/design/causal_encryption.md">design doc</a> covers the trade-offs, including why this gives post-compromise security but not forward secrecy.</p>
<svg viewBox="0 0 680 380" role="img" aria-labelledby="causal-title causal-desc" xmlns="http://www.w3.org/2000/svg" style="display: block; width: 100%; max-width: 680px; margin: 1.5rem auto; color: var(--fg); font-family: inherit;" fill="currentColor">
<title id="causal-title">Causal encryption</title>
<desc id="causal-desc">Four encrypted blocks, each holding some content. Block D also holds the keys for blocks B and C, which each hold the key for block A, which has no ancestors. Holding the key for D is enough to open B and C, and through them A.</desc>
<defs><marker id="causal-arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="8" markerHeight="8" orient="auto-start-reverse"><path d="M0 0L10 5L0 10z" fill="currentColor"/></marker></defs>
<rect x="25" y="124" width="140" height="112" rx="8" fill="var(--bg)" stroke="currentColor" stroke-width="1.5"/><text x="95" y="148" text-anchor="middle" font-size="15" font-weight="600">Block A</text><rect x="35" y="160" width="120" height="32" rx="5" fill="var(--current)"/><rect x="45" y="168" width="78" height="4" rx="2" fill="var(--inactive)" opacity="0.7"/><rect x="45" y="176" width="55.00000000000001" height="4" rx="2" fill="var(--inactive)" opacity="0.7"/><rect x="45" y="184" width="68" height="4" rx="2" fill="var(--inactive)" opacity="0.7"/>
<rect x="250" y="26" width="140" height="112" rx="8" fill="var(--bg)" stroke="currentColor" stroke-width="1.5"/><text x="320" y="50" text-anchor="middle" font-size="15" font-weight="600">Block B</text><rect x="260" y="62" width="120" height="32" rx="5" fill="var(--current)"/><rect x="270" y="70" width="78" height="4" rx="2" fill="var(--inactive)" opacity="0.7"/><rect x="270" y="78" width="55.00000000000001" height="4" rx="2" fill="var(--inactive)" opacity="0.7"/><rect x="270" y="86" width="68" height="4" rx="2" fill="var(--inactive)" opacity="0.7"/>
<rect x="250" y="222" width="140" height="112" rx="8" fill="var(--bg)" stroke="currentColor" stroke-width="1.5"/><text x="320" y="246" text-anchor="middle" font-size="15" font-weight="600">Block C</text><rect x="260" y="258" width="120" height="32" rx="5" fill="var(--current)"/><rect x="270" y="266" width="78" height="4" rx="2" fill="var(--inactive)" opacity="0.7"/><rect x="270" y="274" width="55.00000000000001" height="4" rx="2" fill="var(--inactive)" opacity="0.7"/><rect x="270" y="282" width="68" height="4" rx="2" fill="var(--inactive)" opacity="0.7"/>
<rect x="445" y="108" width="140" height="144" rx="8" fill="var(--bg)" stroke="currentColor" stroke-width="1.5"/><text x="515" y="132" text-anchor="middle" font-size="15" font-weight="600">Block D</text><rect x="455" y="144" width="120" height="32" rx="5" fill="var(--current)"/><rect x="465" y="152" width="78" height="4" rx="2" fill="var(--inactive)" opacity="0.7"/><rect x="465" y="160" width="55.00000000000001" height="4" rx="2" fill="var(--inactive)" opacity="0.7"/><rect x="465" y="168" width="68" height="4" rx="2" fill="var(--inactive)" opacity="0.7"/>
<text x="95" y="218" text-anchor="middle" font-size="12" fill="var(--inactive)">no ancestors</text>
<line x1="260" y1="116" x2="168" y2="162" stroke="currentColor" stroke-width="1.5" stroke-dasharray="5 4" marker-end="url(#causal-arrow)"/>
<line x1="260" y1="312" x2="168" y2="198" stroke="currentColor" stroke-width="1.5" stroke-dasharray="5 4" marker-end="url(#causal-arrow)"/>
<line x1="455" y1="198" x2="393" y2="102" stroke="currentColor" stroke-width="1.5" stroke-dasharray="5 4" marker-end="url(#causal-arrow)"/>
<line x1="455" y1="230" x2="393" y2="258" stroke="currentColor" stroke-width="1.5" stroke-dasharray="5 4" marker-end="url(#causal-arrow)"/>
<line x1="618" y1="140" x2="588" y2="140" stroke="currentColor" stroke-width="1.5" stroke-dasharray="5 4" marker-end="url(#causal-arrow)"/>
<rect x="260" y="104" width="54" height="24" rx="6" fill="var(--yellow)" stroke="var(--slate)"/><text x="273" y="121.5" text-anchor="middle" font-size="15">🗝️</text><text x="300" y="120.5" text-anchor="middle" font-size="13" font-weight="700" fill="var(--slate)">A</text>
<rect x="260" y="300" width="54" height="24" rx="6" fill="var(--yellow)" stroke="var(--slate)"/><text x="273" y="317.5" text-anchor="middle" font-size="15">🗝️</text><text x="300" y="316.5" text-anchor="middle" font-size="13" font-weight="700" fill="var(--slate)">A</text>
<rect x="455" y="186" width="54" height="24" rx="6" fill="var(--yellow)" stroke="var(--slate)"/><text x="468" y="203.5" text-anchor="middle" font-size="15">🗝️</text><text x="495" y="202.5" text-anchor="middle" font-size="13" font-weight="700" fill="var(--slate)">B</text>
<rect x="455" y="218" width="54" height="24" rx="6" fill="var(--yellow)" stroke="var(--slate)"/><text x="468" y="235.5" text-anchor="middle" font-size="15">🗝️</text><text x="495" y="234.5" text-anchor="middle" font-size="13" font-weight="700" fill="var(--slate)">C</text>
<rect x="618" y="128" width="54" height="24" rx="6" fill="var(--yellow)" stroke="var(--slate)"/><text x="631" y="145.5" text-anchor="middle" font-size="15">🗝️</text><text x="658" y="144.5" text-anchor="middle" font-size="13" font-weight="700" fill="var(--slate)">D</text>
<text x="645" y="118" text-anchor="middle" font-size="12" fill="var(--inactive)">your key</text>
<g transform="translate(155 358)"><rect x="0" y="-11" width="34" height="14" rx="3" fill="var(--current)"/><rect x="5" y="-8" width="22" height="3" rx="1.5" fill="var(--inactive)" opacity="0.7"/><rect x="5" y="-2" width="16" height="3" rx="1.5" fill="var(--inactive)" opacity="0.7"/><text x="42" y="0" font-size="12" fill="var(--inactive)">content</text><rect x="110" y="-11" width="34" height="14" rx="4" fill="var(--yellow)" stroke="var(--slate)"/><text x="124" y="1.5" text-anchor="middle" font-size="12">🗝️</text><text x="152" y="0" font-size="12" fill="var(--inactive)">a parent's key</text><line x1="270" y1="-4" x2="300" y2="-4" stroke="currentColor" stroke-width="1.5" stroke-dasharray="5 4" marker-end="url(#causal-arrow)"/><text x="308" y="0" font-size="12" fill="var(--inactive)">unlocks</text></g>
</svg>
<p>The format got stricter along the way. Encrypted content is now chunked with a checked nonce (<a href="https://github.com/inkandswitch/keyhive/pull/297">#297</a>), every block body is an envelope (<a href="https://github.com/inkandswitch/keyhive/pull/322">#322</a>), and an ancestor key must actually be able to decrypt the content it’s listed with (<a href="https://github.com/inkandswitch/keyhive/pull/323">#323</a>).</p>
<h3 id="canonical-encoding"><a class="plain" href="#canonical-encoding">Canonical Encoding</a></h3>
<p><a href="https://github.com/expede">Brooke Zelenka</a> has been finalizing Keyhive’s custom codec, with two goals: dropping bincode and serde (<a href="https://github.com/inkandswitch/keyhive/pull/299">#299</a>, <a href="https://github.com/inkandswitch/keyhive/pull/310">#310</a>, <a href="https://github.com/inkandswitch/keyhive/pull/311">#311</a>), and reaching a stable byte format we can commit to, since Keyhive data is signed, hashed, synced, and stored for the long term.</p>
<p>Getting the bytes right matters for security too. <a href="https://github.com/inkandswitch/keyhive/blob/main/keyhive_codec/src/lib.rs"><code>keyhive_codec</code></a> guarantees that each value has exactly one valid encoding, so a peer can’t send the same certificate under two different hashes and slip past a revocation that names one of them. Every key derivation and every signed piece of application data also gets its own context now (<a href="https://github.com/inkandswitch/keyhive/pull/296">#296</a>, <a href="https://github.com/inkandswitch/keyhive/pull/309">#309</a>), so a key or signature made for one purpose can’t be passed off as another.</p>
<h3 id="no-more-world-public-user"><a class="plain" href="#no-more-world-public-user">No More “World Public” User</a></h3>
<p>The “World Public” user was always a bit of a hack that we knew we wanted to get rid of. Public documents used to be modeled as a well-known member whose secret any replica could hold. We removed it (<a href="https://github.com/inkandswitch/keyhive/pull/284">#284</a>) for two reasons:</p>
<ul>
<li><strong>It was special-cased throughout the code.</strong> BeeKEM, <code>keyhive_core</code>, and the JS API all had to know about it, and the new approach doesn’t need any of that.</li>
<li><strong>It was a denial-of-service vector.</strong> Anyone could act as the “World Public” user and ask a sync server for <em>every</em> public document it held.</li>
</ul>
<p>Public documents are now handled one layer up, with ordinary <code>read</code> and <code>relay</code> capabilities: instead of a global “world” key, each app ships its own keys for the content it treats as public.</p>
<p>Here’s the pattern for an “app-public” document. The app creates two principals and ships one key for each of them, so anyone running the app can read the document:</p>

<svg viewBox="0 0 600 600" role="img" aria-labelledby="app-public-title app-public-desc" xmlns="http://www.w3.org/2000/svg" style="display: block; width: 100%; max-width: 600px; margin: 1.5rem auto; color: var(--fg); font-family: inherit;" fill="currentColor">
<title id="app-public-title">An app-public document</title>
<desc id="app-public-desc">The document grants admin to its owner. Through some chain of delegations, read access is granted to an App Reader, and the App Reader grants relay to an App Fetcher. The app ships the App Reader's X25519 secret key, to decrypt with, and the App Fetcher's Ed25519 signing key, to fetch with.</desc>
<defs><marker id="app-public-arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="8" markerHeight="8" orient="auto-start-reverse"><path d="M0 0L10 5L0 10z" fill="currentColor"/></marker></defs>
<line x1="150" y1="50" x2="150" y2="128" stroke="currentColor" stroke-width="1.5" marker-end="url(#app-public-arrow)"/><rect x="120.75" y="79" width="58.5" height="22" rx="11" fill="var(--bg)" stroke="var(--inactive)"/><text x="150" y="94" text-anchor="middle" font-family="'Overpass Mono', monospace" font-size="12">admin</text>
<line x1="150" y1="170" x2="150" y2="240" stroke="currentColor" stroke-width="1.5" stroke-dasharray="5 4" marker-end="url(#app-public-arrow)"/>
<rect x="110" y="242" width="80" height="36" rx="8" fill="var(--bg)" stroke="currentColor" stroke-width="1.5" stroke-dasharray="5 4"/>
<text x="150" y="266" text-anchor="middle" font-size="18" font-weight="700">…</text>
<line x1="150" y1="280" x2="150" y2="378" stroke="currentColor" stroke-width="1.5" marker-end="url(#app-public-arrow)"/><rect x="125" y="319" width="50" height="22" rx="11" fill="var(--bg)" stroke="var(--inactive)"/><text x="150" y="334" text-anchor="middle" font-family="'Overpass Mono', monospace" font-size="12">read</text>
<line x1="150" y1="420" x2="150" y2="518" stroke="currentColor" stroke-width="1.5" marker-end="url(#app-public-arrow)"/><rect x="120.75" y="459" width="58.5" height="22" rx="11" fill="var(--bg)" stroke="var(--inactive)"/><text x="150" y="474" text-anchor="middle" font-family="'Overpass Mono', monospace" font-size="12">relay</text>
<rect x="80" y="10" width="140" height="40" rx="8" fill="var(--bg)" stroke="currentColor" stroke-width="1.5"/><text x="150" y="35" text-anchor="middle" font-size="15" font-weight="600">Document</text>
<rect x="75" y="130" width="150" height="40" rx="8" fill="var(--bg)" stroke="currentColor" stroke-width="1.5"/><text x="150" y="155" text-anchor="middle" font-size="15" font-weight="600">Owner</text>
<rect x="75" y="380" width="150" height="40" rx="8" fill="var(--bg)" stroke="currentColor" stroke-width="1.5"/><text x="150" y="405" text-anchor="middle" font-size="15" font-weight="600">App Reader</text>
<rect x="75" y="520" width="150" height="40" rx="8" fill="var(--bg)" stroke="currentColor" stroke-width="1.5"/><text x="150" y="545" text-anchor="middle" font-size="15" font-weight="600">App Fetcher</text>
<line x1="225" y1="397" x2="325" y2="397" stroke="currentColor" stroke-width="1.5"/><line x1="225" y1="403" x2="325" y2="403" stroke="currentColor" stroke-width="1.5"/>
<line x1="225" y1="537" x2="325" y2="537" stroke="currentColor" stroke-width="1.5"/><line x1="225" y1="543" x2="325" y2="543" stroke="currentColor" stroke-width="1.5"/>
<rect x="309" y="354" width="242" height="232" rx="12" fill="none" stroke="var(--inactive)" stroke-dasharray="6 5"/>
<text x="430" y="346" text-anchor="middle" font-family="'Overpass Mono', monospace" font-size="12" fill="var(--inactive)">shipped with the app</text>
<rect x="325" y="374" width="210" height="52" rx="8" fill="var(--yellow)" stroke="var(--slate)" stroke-width="1.5"/><text x="430" y="397" text-anchor="middle" font-size="15" font-weight="600" fill="var(--slate)">X25519 secret key</text><text x="430" y="415" text-anchor="middle" font-size="12" fill="var(--slate)">to decrypt with</text>
<rect x="325" y="514" width="210" height="52" rx="8" fill="var(--yellow)" stroke="var(--slate)" stroke-width="1.5"/><text x="430" y="537" text-anchor="middle" font-size="15" font-weight="600" fill="var(--slate)">Ed25519 signing key</text><text x="430" y="555" text-anchor="middle" font-size="12" fill="var(--slate)">to fetch with</text>
</svg>
<p>Anyone with read access to the document can set this up, not just its owner. They give the <em>reader</em> read access, and the reader passes relay access on to the <em>fetcher</em>. The app ships the reader’s X25519 secret key, so anyone with the app can decrypt as the reader, but not its signing key, so nobody can use it to change the document or its membership. It also ships the fetcher’s Ed25519 signing key, so anyone with the app can sign in to the sync server as the fetcher and pull ciphertext, which on its own they can’t read. Put the two together and you get read-only access for that app’s users.</p>
<p>These keys aren’t really secret: anyone who downloads the app can extract them. What you get is read-only access that’s opt-in and scoped to one app. Unlike the old “World Public” user, the fetcher can only pull the documents that were made public to that app, and sync servers still only ever see ciphertext.</p>
<p>Today this is set up by hand, but we plan to add an API for it.</p>
<h3 id="automerge-repo-keyhive"><a class="plain" href="#automerge-repo-keyhive">automerge-repo-keyhive</a></h3>
<p><a href="https://www.npmjs.com/package/@automerge/automerge-repo-keyhive"><code>automerge-repo-keyhive</code> v0.8.0-alpha.1</a> (on the <code>next</code> npm tag) moves onto <code>@keyhive/keyhive</code> 0.6.0, thanks to <a href="https://github.com/jtfmumm">John Mumm</a>. Its hand-rolled encryption is gone, replaced by Keyhive’s causal encryption. Earlier in the month, v0.7.0-alpha.1 removed the old “nudge edit” machinery.</p>
<p><strong>This is a breaking change:</strong> with the “World Public” user gone, automerge-repo-keyhive no longer has <code>setPublicAccess</code> or <code>getPublicAccess</code>. Public access is now up to your application (see the app-public pattern above). As always with automerge-repo-keyhive, pin an exact version, since the <code>latest</code> npm tag still points at a much older alpha.</p>
<h2 id="subduction"><a class="plain" href="#subduction">🏔️ Subduction</a></h2>
<p>A new batch of <a href="https://github.com/inkandswitch/subduction">Subduction</a> releases is out, including <a href="https://github.com/inkandswitch/subduction"><code>subduction_core</code> v0.20.0</a>, <a href="https://www.npmjs.com/package/@automerge/subduction"><code>@automerge/subduction</code> v0.26.0</a>, and <code>@automerge/automerge-subduction</code> v0.21.0. Each package is now released and tagged on its own (<a href="https://github.com/inkandswitch/subduction/pull/318">#318</a>), which is why the version numbers no longer move together.</p>
<ul>
<li><a href="https://github.com/alexjg">Alex Good</a> fixed two Sedimentree sync bugs. Minimization now keeps fragment boundaries (<a href="https://github.com/inkandswitch/subduction/pull/325">#325</a>), and boundaries are no longer wrongly advertised as held (<a href="https://github.com/inkandswitch/subduction/pull/326">#326</a>). That second bug could make a peer skip sending a commit because it thought the other side already had it.</li>
<li><code>subduction_keyhive</code> now tracks <code>keyhive_core</code> v0.7.0, thanks to <a href="https://github.com/jtfmumm">John Mumm</a> (<a href="https://github.com/inkandswitch/subduction/pull/323">#323</a>). It doesn’t include the later Keyhive changes above yet.</li>
<li>The Wasm storage API gained <code>get_head(id)</code>, and storage errors now carry the backend’s original error as their <code>cause</code> (<a href="https://github.com/inkandswitch/subduction/pull/317">#317</a>).</li>
<li>Later in the month, <a href="https://github.com/alexjg">Alex Good</a> made relays wait for upstream fetches before answering, so downstream peers don’t wrongly conclude that a document is unavailable (<a href="https://github.com/inkandswitch/subduction/pull/334">#334</a>). Metadata that exceeds the wire format’s limits now returns an error instead of panicking (<a href="https://github.com/inkandswitch/subduction/pull/348">#348</a>).</li>
</ul>
<h2 id="around-the-ecosystem"><a class="plain" href="#around-the-ecosystem">🌱 Around the Ecosystem</a></h2>
<h3 id="automerge-in-go"><a class="plain" href="#automerge-in-go">Automerge in Go</a></h3>
<p><a href="https://github.com/gearnode">Bryan Frimin</a> at <a href="https://github.com/getprobo/probo">Probo</a>, an open-source compliance platform, wrote <a href="https://github.com/getprobo/probo/pull/1757">a pure-Go implementation of Automerge</a> to add real-time collaboration to its document editor. The PR reports full V2 wire and state interoperability with the Rust and JS implementations, checked by a differential parity and fuzzing suite that runs against both. It also includes an automerge-repo protocol client and a ProseMirror bridge. A <a href="https://github.com/getprobo/probo/pull/1758">follow-up PR</a> wired it into the editor, with the official <code>@automerge/automerge-repo</code> client in the browser talking to a Go gateway on the server.</p>
<h3 id="a-repo-for-python"><a class="plain" href="#a-repo-for-python">A Repo for Python</a></h3>
<p><a href="https://github.com/automerge/automerge-py"><code>automerge-py</code></a> has an async <code>automerge.repo</code> API (in its 0.2.0.dev pre-releases) that interoperates with the JavaScript <code>automerge-repo</code>. This month <a href="https://github.com/alexjg">Alex Good</a> added authors and commit metadata, ephemeral messages, read-only sync, and <a href="https://github.com/automerge/automerge-py/blob/main/docs/share-policy.md">per-peer share policies</a>. These are on <code>main</code> and haven’t been released yet.</p>
<h3 id="pushwork"><a class="plain" href="#pushwork">Pushwork</a></h3>
<p><a href="https://github.com/inkandswitch/pushwork">Pushwork</a> syncs a directory through Automerge, a bit like Git without the merge conflicts. It’s also becoming a good way to try Keyhive for real. <a href="https://github.com/chee">chee rabbits</a>’s work on Subduction and Keyhive support is on npm as <a href="https://www.npmjs.com/package/pushwork"><code>pushwork@3.0.0-sk.0</code></a>, under the <code>experimental</code> tag:</p>
<pre><code class="language-sh"><div class="code-line"><span class="token comment"># Only you can read or write this repo</span></div><div class="code-line">$ pushwork init <span class="token parameter variable">--keyhive</span></div><div class="code-line">INITIALIZED automerge:xtVWLeMLftzvzpw4yA2J4yomix8j</div><div class="code-line"> </div><div class="code-line"><span class="token comment"># Save collaborators' contact cards under names, then list your contacts</span></div><div class="code-line">$ pushwork keyhive contacts <span class="token function">add</span> alice ./alice-card.json</div><div class="code-line">saved alice <span class="token punctuation">(</span>iN8BYtCAVQ+R1MHpcK7KMQPy4dqY3qmvZDLtBoWc1g8<span class="token operator">=</span><span class="token punctuation">)</span></div><div class="code-line"> </div><div class="code-line">$ pushwork keyhive contacts <span class="token function">add</span> bob ./bob-card.json</div><div class="code-line">saved bob <span class="token punctuation">(</span>6vJtwT8fpanJsZ0TiXIikn9m7CJA29Nc3xxbJv7fNu8<span class="token operator">=</span><span class="token punctuation">)</span></div><div class="code-line"> </div><div class="code-line">$ pushwork keyhive contacts <span class="token function">ls</span></div><div class="code-line">alice  iN8BYtCAVQ+R1MHpcK7KMQPy4dqY3qmvZDLtBoWc1g8<span class="token operator">=</span></div><div class="code-line">bob    <span class="token assign-left variable">6vJtwT8fpanJsZ0TiXIikn9m7CJA29Nc3xxbJv7fNu8</span><span class="token operator">=</span></div><div class="code-line"> </div><div class="code-line"><span class="token comment"># Share with a contact, see who has access, or take access away</span></div><div class="code-line">$ pushwork keyhive access alice edit</div><div class="code-line">alice can now edit</div><div class="code-line"> </div><div class="code-line">$ pushwork keyhive access</div><div class="code-line">you             admin</div><div class="code-line">keyhive server  relay</div><div class="code-line">alice           edit</div><div class="code-line"> </div><div class="code-line">$ pushwork keyhive access alice none</div><div class="code-line">alice's access revoked</div></code></pre><p>By default, the sync server only gets <code>relay</code> access: it stores and forwards your documents, but can’t read them. This release predates this month’s Keyhive changes, so it still runs on automerge-repo-keyhive 0.5 and 0.6 under the hood.</p>
<h2 id="presentations"><a class="plain" href="#presentations">🎤 Presentations</a></h2>
<h3 id="keyhive-at-j-on-the-beach"><a class="plain" href="#keyhive-at-j-on-the-beach">Keyhive at J On The Beach</a></h3>
<p>On October 30, <a href="https://github.com/expede">Brooke Zelenka</a> gave a talk at <a href="https://www.jonthebeach.com">J On The Beach</a> in Málaga: <a href="https://expede.tngl.io/jotb-2026/"><em>Keyhive: End-to-end Encrypted Applications</em></a>. It asks what “Signal for documents” would look like, and walks through Keyhive’s answer: capabilities that travel inside the data, causal encryption that follows a document’s history, BeeKEM group keys without a central server, and sync servers that only ever see ciphertext. The video isn’t up yet, but you can <a href="https://expede.tngl.io/jotb-2026/">flip through the slides</a> (some of them are interactive):</p>
<iframe
  style="aspect-ratio: 16 / 9; border: 0; margin-bottom: 3rem;"
  src="https://expede.tngl.io/jotb-2026/"
  title="Keyhive: End-to-end Encrypted Applications (slides)"
  loading="lazy"
  allowfullscreen
></iframe>
<h1>📬 Get in Touch</h1>
<p>Are you building something with Automerge? We’d love to hear about it! Drop us a line in <a href="https://discord.gg/zKGe4DCfgR">the Discord</a>. Knowing how Automerge is used in the wild is how we decide what to build next.</p>
<p>If Automerge is important to your product or organization, consider sponsoring its development: reach out to the team at <a href="mailto:hello@inkandswitch.com">hello@inkandswitch.com</a>.</p>
<hr>
<p>Until next time 👋</p>
<p>— The Automerge Core Team</p>
<!-- External Links -->]]></content:encoded>
    </item>
    <item>
      <title><![CDATA[This Month in Automerge: September '26]]></title>
      <link>https://automerge.org/blog/2026-september/</link>
      <guid isPermaLink="true">https://automerge.org/blog/2026-september/</guid>
      <pubDate>Wed, 30 Sep 2026 00:00:00 GMT</pubDate>
      <description><![CDATA[Authorship lands in Automerge v3.5.0, a much sturdier BeeKEM, smarter Subduction relays, and Livelymerge learns to stream.]]></description>
      <content:encoded><![CDATA[<p>As always, the community hangs out in <a href="https://discord.gg/zKGe4DCfgR">the Automerge Discord</a>. Come say hi, and let us know if you’d like something included in next month’s edition!</p>
<h2 id="include-logo-icon-automerge"><a class="plain" href="#include-logo-icon-automerge"><svg viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg" style="height: 1em; width: 1em; vertical-align: -0.12em;" role="img" aria-label="Automerge logo">
  <path d="M28.2485 0.806161L1.00094 28.0537C-0.0739441 29.1286 -0.0739441 30.8714 1.00094 31.9463L28.2485 59.1938C29.3234 60.2687 31.0661 60.2687 32.141 59.1938L59.3886 31.9463C60.4635 30.8714 60.4635 29.1286 59.3886 28.0537L32.141 0.806163C31.0661 -0.268724 29.3234 -0.268725 28.2485 0.806161Z M28.5447 5.25803L5.4522 28.3505C4.54122 29.2615 4.54122 30.7385 5.4522 31.6495L28.5447 54.742C29.4557 55.6529 30.9327 55.6529 31.8436 54.742L54.9361 31.6495C55.8471 30.7385 55.8471 29.2615 54.9361 28.3505L31.8436 5.25803C30.9327 4.34705 29.4557 4.34705 28.5447 5.25803Z" fill="#FFCC33"/>
  <path d="M30.1945 56.3914C29.6656 56.3914 29.137 56.1904 28.7347 55.7879L4.40639 31.4595C3.60152 30.6547 3.60152 29.3453 4.40639 28.5405L28.7347 4.21219C29.1247 3.82214 29.6429 3.60742 30.1942 3.60742C30.7458 3.60742 31.264 3.82214 31.654 4.21219L55.9823 28.5405C56.7872 29.3453 56.7872 30.6547 55.9823 31.4595L31.654 55.7878C31.2518 56.1904 30.7232 56.3914 30.1945 56.3914ZM30.1942 4.98363C30.0105 4.98363 29.8379 5.05532 29.7077 5.18523L5.37943 29.5135C5.11122 29.7817 5.11122 30.2184 5.37943 30.4865L29.7077 54.8148C29.9682 55.0746 30.4206 55.0743 30.681 54.8148L55.0093 30.4865C55.1392 30.3566 55.2106 30.1837 55.2106 30C55.2106 29.8163 55.1392 29.6434 55.0093 29.5135L30.681 5.18523C30.5508 5.05532 30.3782 4.98363 30.1942 4.98363Z" fill="#222" stroke="#222"/>
  <path d="M37.7723 22.9132L30.1948 12.4836L22.6173 22.9132C21.8364 23.988 22.8812 25.436 24.1474 25.0337L27.4426 23.9869V26.1274C27.4426 28.5163 26.5122 30.7625 24.8227 32.4518L19.9766 37.298L22.8962 40.2176L27.4426 35.6713V44.7637H32.9474V23.9871L36.2423 25.0337C37.5085 25.436 38.5532 23.988 37.7723 22.9132Z" fill="#222"/>
</svg>
 Automerge</a></h2>
<p><strong>New this month:</strong> <a href="https://github.com/automerge/automerge/releases">Automerge v3.5.0</a> for JavaScript and <a href="https://crates.io/crates/automerge"><code>automerge</code> v0.12.0</a> for Rust. The Rust stack followed with <a href="https://github.com/automerge/autosurgeon"><code>autosurgeon</code> v0.14.0</a> and <a href="https://github.com/alexjg/samod"><code>samod</code> v0.15.0</a>, which also adds the ability to bind a transport to an authenticated peer ID.</p>
<h3 id="authors"><a class="plain" href="#authors">Authors</a></h3>
<p><strong>Automerge changes can now record an <em>author</em>.</strong> Automerge has always tracked <em>actors</em>, which are fresh random ID for each editing session. An actor tells you that two changes came from the same session, but not that they came from the same <em>person</em>. On the other hand, an “author” is some unique identifier which you can use to specify a user account, Keyhive identity, or anything else. Automerge stores it in the first change of each actor, and it survives merging, saving, and loading.</p>
<pre><code class="language-js"><div class="code-line"><span class="token keyword">import</span> <span class="token operator">*</span> <span class="token keyword">as</span> Automerge <span class="token keyword">from</span> <span class="token string">"@automerge/automerge"</span></div><div class="code-line"> </div><div class="code-line"><span class="token keyword">let</span> doc <span class="token operator">=</span> Automerge<span class="token punctuation">.</span><span class="token function">init</span><span class="token punctuation">(</span><span class="token punctuation">{</span> <span class="token literal-property property">author</span><span class="token operator">:</span> <span class="token string">"f0cacc1a"</span> <span class="token punctuation">}</span><span class="token punctuation">)</span></div><div class="code-line">doc <span class="token operator">=</span> Automerge<span class="token punctuation">.</span><span class="token function">change</span><span class="token punctuation">(</span>doc<span class="token punctuation">,</span> <span class="token parameter">d</span> <span class="token operator">=></span> <span class="token punctuation">{</span> d<span class="token punctuation">.</span>title <span class="token operator">=</span> <span class="token string">"Hello"</span> <span class="token punctuation">}</span><span class="token punctuation">)</span></div><div class="code-line"> </div><div class="code-line">Automerge<span class="token punctuation">.</span><span class="token function">getAuthors</span><span class="token punctuation">(</span>doc<span class="token punctuation">)</span> <span class="token comment">// ["f0cacc1a"]</span></div></code></pre><p>This was the first half of the work <a href="/blog/2026-july/">we teased in July</a>. The second half (which builds on authors) will be signatures for <em>provenance</em> and <em>revocation</em>. Once you know who wrote each change, you can stop accepting changes from someone whose access you’ve revoked.</p>
<h3 id="faster-marks"><a class="plain" href="#faster-marks">Faster Marks</a></h3>
<p>Thanks to <a href="https://github.com/aran">Aran Donohue</a>, <code>get_marks</code> now reads from the mark index instead of scanning the text (<a href="https://github.com/automerge/automerge/pull/1571">#1571</a>). This speeds up reading marks at the end of a 100k-character run of text from <strong>9.05ms to 1.6µs</strong>. This is on <code>main</code> now and will ship in the next release.</p>
<h3 id="fixes-and-polish"><a class="plain" href="#fixes-and-polish">Fixes &amp; Polish</a></h3>
<ul>
<li>Large list insertions no longer fail with “Maximum call stack size exceeded”. The Wasm bindings now apply them in bounded chunks.</li>
<li><code>applyPatch</code> and <code>applyPatches</code> now handle embedded rich-text blocks, and patches that restore deleted rich text include its marks and blocks.</li>
<li><a href="https://github.com/automerge/automerge/pull/1529">Vincent Liu</a> added <code>i32</code> column support to <a href="https://crates.io/crates/hexane">Hexane</a>. Vincent works on <a href="https://github.com/coln-project/Coln">Coln</a>, which uses Hexane — it’s great to see contributions coming upstream!</li>
</ul>
<h2 id="automerge-repo"><a class="plain" href="#automerge-repo">📦 automerge-repo</a></h2>
<p><a href="https://github.com/automerge/automerge-repo/releases">automerge-repo v2.6.0-alpha.4 and alpha.5</a> shipped this month:</p>
<ul>
<li><strong>Ephemeral messages are more reliable.</strong> <a href="https://github.com/alexwarth">Alex Warth</a> fixed two ways that presence- and cursor-style messages could quietly stop flowing in one direction through a sync server (<a href="https://github.com/automerge/automerge-repo/pull/742">#742</a>). The fix came straight out of Livelymerge, which streams a <em>lot</em> of ephemeral traffic (more on that <a href="#livelymerge-streams-its-hands">below</a>).</li>
<li><a href="https://github.com/automerge/automerge-repo/commits?author=tanya.shukla@flexcompute.com">Tanya Shukla</a> fixed a race where a peer asking for a document could get a “don’t have it” reply before storage had been checked.</li>
<li><a href="https://github.com/dmaretskyi">Dmytro Maretskyi</a> stopped the Repo from writing to storage just because it loaded a document (<a href="https://github.com/automerge/automerge-repo/pull/712">#712</a>).</li>
<li><a href="https://github.com/darcyparker">Darcy Parker</a> continued the memory work with groundwork for garbage-collecting documents that nobody is using: weak caches, plus test infrastructure that can actually observe collection happening (<a href="https://github.com/automerge/automerge-repo/pull/736">#736</a>).</li>
</ul>
<h2 id="keyhive"><a class="plain" href="#keyhive">🗝️🐝 Keyhive</a></h2>
<p><a href="https://github.com/inkandswitch/keyhive">Keyhive</a> is our access control and encryption layer for Automerge and other CRDTs.</p>
<h3 id="a-much-sturdier-beekem"><a class="plain" href="#a-much-sturdier-beekem">A Much Sturdier BeeKEM</a></h3>
<p><a href="https://github.com/jtfmumm">John Mumm</a> improved <a href="https://eprint.iacr.org/2026/1434">BeeKEM</a> (Keyhive’s group key agreement) performance and correctlness, especially where peers make membership changes concurrently. None of this changes the API, but it’s exactly the kind of work that turns a research prototype into something you can trust.</p>
<h3 id="threat-model"><a class="plain" href="#threat-model">Threat Model</a></h3>
<p>Keyhive now has a written <a href="https://github.com/inkandswitch/keyhive/blob/main/design/threat_model.md">threat model</a> and <a href="https://github.com/inkandswitch/keyhive/blob/main/design/glossary.md">glossary</a>. The threat model sets out who Keyhive defends against, which assets it protects (and which it doesn’t), the trust assumptions, and the known gaps between the design and today’s code. If you’re evaluating Keyhive for your app, it’s the place to start.</p>
<h2 id="subduction"><a class="plain" href="#subduction">🏔️ Subduction</a></h2>
<p><a href="https://github.com/expede">Brooke Zelenka</a> and <a href="https://github.com/alexjg">Alex Good</a> continued work on making <a href="https://github.com/inkandswitch/subduction">Subduction</a> behave well in more complex deployments. <a href="https://github.com/inkandswitch/subduction">Subduction v0.17.x</a> and <a href="https://www.npmjs.com/package/@automerge/subduction"><code>@automerge/subduction</code> v0.23.0</a> are out.</p>
<h3 id="smarter-relays"><a class="plain" href="#smarter-relays">Smarter Relays</a></h3>
<p>Subscriptions now propagate only <em>upstream</em> (<a href="https://github.com/inkandswitch/subduction/pull/298">#298</a>), where “upstream” is who accepted (as opposed to initiated) a connection. This means that a hub like a sync server no longer fans subscriptions out to every client connected to it. A relay in a chain forwards each subscription one hop further up. Whatever a relay learns from upstream, it pushes to its own subscribers. This makes the network behave more efficiently.</p>
<h3 id="bring-your-own-server"><a class="plain" href="#bring-your-own-server">Bring Your Own Server</a></h3>
<p>New crate: <a href="https://github.com/inkandswitch/subduction/pull/292"><code>subduction_hyper</code></a> accepts Subduction WebSocket connections from any HTTP server built on <a href="https://hyper.rs/">hyper</a>, with an <a href="https://github.com/tokio-rs/axum">axum</a> extractor behind a feature flag. If you already have a Rust web server, you can now mount Subduction inside it instead of running a separate listener.</p>
<h3 id="fixes"><a class="plain" href="#fixes">Fixes</a></h3>
<ul>
<li><a href="https://github.com/alexjg">Alex Good</a> fixed a bug where Sedimentree included a fragment’s <em>boundary</em> in the heads it reported, instead of the fragment’s heads. It’s a subtle naming confusion with real consequences!</li>
<li>Many thanks to <a href="https://github.com/LilithSilver">Lilith Silver</a> for adding remote heads to the connection builder (<a href="https://github.com/inkandswitch/subduction/pull/271">#271</a>).</li>
<li><code>subduction_keyhive</code> now tracks the latest Keyhive, thanks to <a href="https://github.com/jtfmumm">John Mumm</a> (<a href="https://github.com/inkandswitch/subduction/pull/308">#308</a>).</li>
</ul>
<h2 id="around-the-ecosystem"><a class="plain" href="#around-the-ecosystem">🌱 Around the Ecosystem</a></h2>
<h3 id="livelymerge-streams-its-hands"><a class="plain" href="#livelymerge-streams-its-hands">Livelymerge Streams Its Hands</a></h3>
<p><a href="https://www.inkandswitch.com/livelymerge/notebook/">Livelymerge</a> (the live programming environment whose heap is an Automerge document) published three more lab notes in September:</p>
<ul>
<li><a href="https://www.inkandswitch.com/livelymerge/notebook/lm-06/"><em>A Morphic Programming Kernel</em></a>: Dan Ingalls’s tour of the Morphic kernel at the heart of the system.</li>
<li><a href="https://www.inkandswitch.com/livelymerge/notebook/lm-07/"><em>Improving the Multi-User Experience</em></a>: what to do when dragging a shape writes ~120 Automerge ops per second. In short, keep rapidly changing state in an ephemeral object during the gesture, broadcast it with automerge-repo’s <a href="/docs/reference/repositories/ephemeral/">ephemeral messages</a>, and commit to the document once at the end. This is useful advice for <em>any</em> Automerge app with drag or resize interactions, and it’s the workload that led to <a href="#automerge-repo">the ephemeral message fixes above</a>.</li>
<li><a href="https://www.inkandswitch.com/livelymerge/notebook/lm-08/"><em>Early Experiments with AI Programming</em></a>: since Livelymerge already supports multiple users, the easiest way to give an LLM agent live access was to make it… another user.</li>
</ul>
<p><a href="https://github.com/alexwarth">Alex Warth</a> also wrote a short note on <a href="https://www.inkandswitch.com/malleable-software/effective-expressiveness/"><em>effective expressiveness</em></a>: not what a language <em>can</em> express, but what kinds of problems make you want to reach for it.</p>
<h3 id="byzantine-eventual-consistency-at-srds"><a class="plain" href="#byzantine-eventual-consistency-at-srds">Byzantine Eventual Consistency at SRDS</a></h3>
<p><a href="https://martin.kleppmann.com/">Martin Kleppmann</a> gave the keynote at <a href="https://martin.kleppmann.com/2026/09/24/srds-keynote.html">SRDS 2026</a> in Rome on September 24: <a href="https://speakerdeck.com/ept/byzantine-eventual-consistency-for-reliable-local-first-software"><em>Byzantine Eventual Consistency for Reliable Local-first Software</em></a>. The question is how collaborative apps without a central server can still converge when some participants are actively malicious, and it uses Automerge as the example of a library that makes this approach efficient in practice. If you’ve ever wondered why Automerge’s change history is a hash graph, this talk is a great answer.</p>
<h3 id="linxiv-local-first-research-papers"><a class="plain" href="#linxiv-local-first-research-papers">linXiv: Local-First Research Papers</a></h3>
<p><a href="https://linxiv.dev">linXiv</a> is a local-first desktop app for researchers. It helps you search arXiv, organize papers into projects, and annotate PDFs, with a graph view to see how it all connects, using Automerge (via <a href="https://github.com/automerge/autosurgeon">autosurgeon</a>) under the hood!</p>
<h1>📬 Get in Touch</h1>
<p>Are you building something with Automerge? We’d love to hear about it! Drop us a line in <a href="https://discord.gg/zKGe4DCfgR">the Discord</a>. Knowing how Automerge is used in the wild is how we decide what to build next.</p>
<p>If Automerge is important to your product or organization, consider sponsoring its development: reach out to the team at <a href="mailto:hello@inkandswitch.com">hello@inkandswitch.com</a>.</p>
<hr>
<p>Until next time 👋</p>
<p>— The Automerge Core Team</p>
<!-- External Links -->]]></content:encoded>
    </item>
    <item>
      <title><![CDATA[This Month in Automerge: August '26]]></title>
      <link>https://automerge.org/blog/2026-august/</link>
      <guid isPermaLink="true">https://automerge.org/blog/2026-august/</guid>
      <pubDate>Mon, 31 Aug 2026 00:00:00 GMT</pubDate>
      <description><![CDATA[Automerge 3.4.1, sturdier sync servers, a new access control guide, and news from around the ecosystem.]]></description>
      <content:encoded><![CDATA[<p>Welcome to the second edition of This Month in Automerge! Last month we <a href="/blog/2026-july/">started posting written updates</a> in between our <a href="https://luma.com/automerge">quarterly community calls</a>.</p>
<p>As always, the community hangs out in <a href="https://discord.gg/zKGe4DCfgR">the Automerge Discord</a> — come say hi, and let us know if you’d like something included in next month’s edition!</p>
<h2 id="include-logo-icon-automerge"><a class="plain" href="#include-logo-icon-automerge"><svg viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg" style="height: 1em; width: 1em; vertical-align: -0.12em;" role="img" aria-label="Automerge logo">
  <path d="M28.2485 0.806161L1.00094 28.0537C-0.0739441 29.1286 -0.0739441 30.8714 1.00094 31.9463L28.2485 59.1938C29.3234 60.2687 31.0661 60.2687 32.141 59.1938L59.3886 31.9463C60.4635 30.8714 60.4635 29.1286 59.3886 28.0537L32.141 0.806163C31.0661 -0.268724 29.3234 -0.268725 28.2485 0.806161Z M28.5447 5.25803L5.4522 28.3505C4.54122 29.2615 4.54122 30.7385 5.4522 31.6495L28.5447 54.742C29.4557 55.6529 30.9327 55.6529 31.8436 54.742L54.9361 31.6495C55.8471 30.7385 55.8471 29.2615 54.9361 28.3505L31.8436 5.25803C30.9327 4.34705 29.4557 4.34705 28.5447 5.25803Z" fill="#FFCC33"/>
  <path d="M30.1945 56.3914C29.6656 56.3914 29.137 56.1904 28.7347 55.7879L4.40639 31.4595C3.60152 30.6547 3.60152 29.3453 4.40639 28.5405L28.7347 4.21219C29.1247 3.82214 29.6429 3.60742 30.1942 3.60742C30.7458 3.60742 31.264 3.82214 31.654 4.21219L55.9823 28.5405C56.7872 29.3453 56.7872 30.6547 55.9823 31.4595L31.654 55.7878C31.2518 56.1904 30.7232 56.3914 30.1945 56.3914ZM30.1942 4.98363C30.0105 4.98363 29.8379 5.05532 29.7077 5.18523L5.37943 29.5135C5.11122 29.7817 5.11122 30.2184 5.37943 30.4865L29.7077 54.8148C29.9682 55.0746 30.4206 55.0743 30.681 54.8148L55.0093 30.4865C55.1392 30.3566 55.2106 30.1837 55.2106 30C55.2106 29.8163 55.1392 29.6434 55.0093 29.5135L30.681 5.18523C30.5508 5.05532 30.3782 4.98363 30.1942 4.98363Z" fill="#222" stroke="#222"/>
  <path d="M37.7723 22.9132L30.1948 12.4836L22.6173 22.9132C21.8364 23.988 22.8812 25.436 24.1474 25.0337L27.4426 23.9869V26.1274C27.4426 28.5163 26.5122 30.7625 24.8227 32.4518L19.9766 37.298L22.8962 40.2176L27.4426 35.6713V44.7637H32.9474V23.9871L36.2423 25.0337C37.5085 25.436 38.5532 23.988 37.7723 22.9132Z" fill="#222"/>
</svg>
 Automerge</a></h2>
<p><strong>New this month:</strong> <a href="https://github.com/automerge/automerge/releases">Automerge 3.4.1</a> for JavaScript and <a href="https://crates.io/crates/automerge"><code>automerge</code> 0.11.0</a> for Rust. The wider Rust stack followed the same day — <a href="https://github.com/automerge/autosurgeon"><code>autosurgeon</code> 0.13.0</a> (derive-based structs backed by Automerge documents) and <a href="https://github.com/alexjg/samod"><code>samod</code> 0.13.0</a> (the Rust automerge-repo implementation, wire-compatible with the JavaScript one) both track 0.11.0.</p>
<h3 id="under-the-hood"><a class="plain" href="#under-the-hood">Under the Hood</a></h3>
<p><strong><code>automerge</code> 0.11.0 no longer exposes Hexane types in its public API.</strong></p>
<p>Previously, Hexane’s types leaked through Automerge’s surface, which meant any change to the storage engine was potentially a breaking change to Automerge. Now the boundary is sealed. Hexane can keep evolving quickly toward a stable v1, and you don’t need to worry about it in your application.</p>
<p><a href="/blog/2026-july/#hexane">July brought Hexane v1</a>, the rewritten columnar storage engine that made saving and loading documents <a href="/blog/2026-july/#hexane">2–9× faster</a>. <a href="https://github.com/orionz">Orion Henry</a> spent August hardening the edge cases: overflow safety, boundary conditions, and encoder invariants that reject malformed data up front rather than writing bytes nothing can read back.</p>
<p>None of that changes the public Automerge API, but it makes a huge difference in performance and raises the ceiling on what kinds of applications can use Automerge, how many documents they can have open at once, and so on.</p>
<h3 id="haunted-documents-wanted"><a class="plain" href="#haunted-documents-wanted">👻 Haunted Documents Wanted!</a></h3>
<p><a href="https://github.com/alexjg">Alex Good</a> added a <a href="https://github.com/automerge/automerge/tree/main/rust/benchmark-battery">benchmark battery</a> to the Rust workspace: a standard set of documents and operations we can run against every change.</p>
<p>Combined with the <a href="https://github.com/automerge/automerge/tree/main/rust/automerge-cli#anonymize-a-document">document anonymizer</a>, you can now submit documents without having to worry that you’re publishing your data to the entire internet. The anonymizer strips your content while preserving the exact structure that causes the problem, so you can share a pathological document without sharing anything private.</p>
<p><strong>Please send us your slow, buggy, or haunted documents.</strong> <a href="https://discord.gg/zKGe4DCfgR">The Discord</a> or <a href="https://github.com/automerge/automerge/issues">an issue</a>, whichever you prefer. Real-world documents that behave badly are incredibly useful as they let us focus on the optimizations that will actually help in the wild!</p>
<h3 id="easier-contribution"><a class="plain" href="#easier-contribution">Easier Contribution</a></h3>
<p>A big thank you to <a href="https://github.com/FintanH">Fintan Halpenny</a>, who has been documenting Automerge’s internals — op set, clocks, visibility, and change tracking now have prose explaining what they’re for and why they work the way they do.</p>
<p>Also for the Nix users out there: Fintan got the JavaScript test suite and CI running under Nix, so <code>nix develop</code> now gets you a working environment for the whole project.</p>
<h2 id="automerge-repo"><a class="plain" href="#automerge-repo">📦 automerge-repo</a></h2>
<p>Thanks once again to <a href="https://github.com/darcyparker">Darcy Parker</a>, who has been continuing his push for better stability. There’s also a <strong>memory profiling harness</strong> in the repo now, so the next leak gets measured instead of guessed at.</p>
<p>Thanks also to <a href="https://github.com/msakrejda">Maciek Sakrejda</a> for tightening up the storage adapter contract, and to <a href="https://github.com/alexjg">Alex Good</a> for rebuilding the release process so that publishing a new version no longer requires a ceremony.</p>
<h2 id="keyhive"><a class="plain" href="#keyhive">🗝️🐝 Keyhive</a></h2>
<p><a href="https://github.com/inkandswitch/keyhive">Keyhive</a> is our access control and encryption layer (for Automerge and other CRDTs).</p>
<h3 id="new-the-ark-api-guide"><a class="plain" href="#new-the-ark-api-guide">New: The ARK API Guide</a></h3>
<p><a href="https://www.npmjs.com/package/@automerge/automerge-repo-keyhive"><code>@automerge/automerge-repo-keyhive</code></a> (also known as “ARK”) adds access control and end-to-end encryption to <code>automerge-repo</code>. There’s now <a href="/docs/keyhive/ark-api-guide/">a proper API guide</a>, covering initialization, identity, creating protected documents, granting and revoking access, querying who has access to what, and the lower-level pieces you need for custom setups.</p>
<p>For a worked example, see the <a href="https://github.com/inkandswitch/keyhive-todo-app-demo">Keyhive Todo MVC demo</a>:</p>
<figure>
  <a href="https://github.com/inkandswitch/keyhive-todo-app-demo">
    <img src="keyhive-demo.png" width="1835" height="1026" alt="The Keyhive Todo MVC demo, showing a shared todo list with per-document access control" />
  </a>
</figure>
<h2 id="around-the-ecosystem"><a class="plain" href="#around-the-ecosystem">🌱 Around the Ecosystem</a></h2>
<p>The best part of this work is watching what people build. A few things that we’d like to highlight this month:</p>
<h3 id="automerge-is-on-cran"><a class="plain" href="#automerge-is-on-cran">Automerge Is on CRAN</a></h3>
<p><strong>Automerge has <a href="https://posit-dev.github.io/automerge-r/">R bindings</a>, they’re on CRAN, and they’re largely community-maintained.</strong> Version 0.5.0 no longer needs CMake to build from source, and this month brought a Windows ARM64 build fix. Thanks to <a href="https://github.com/jeroen">Jeroen Ooms</a> and <a href="https://github.com/shikokuchuo">Charlie Gao</a>.</p>
<h3 id="livelymerge-convergence-isnt-correctness"><a class="plain" href="#livelymerge-convergence-isnt-correctness">Livelymerge: Convergence Isn’t Correctness</a></h3>
<p><a href="https://www.inkandswitch.com/livelymerge/notebook/">Livelymerge</a> is an Ink &amp; Switch research project by <a href="https://github.com/alexwarth">Alex Warth</a>, <a href="https://en.wikipedia.org/wiki/Dan_Ingalls">Dan Ingalls</a>, and <a href="https://github.com/pvh">Peter van Hardenberg</a> that uses an Automerge document as the <strong>heap of a live programming environment</strong>. Every object, class, and method is CRDT data. They published three lab notes in August, on <a href="https://www.inkandswitch.com/livelymerge/notebook/lm-03/">the object model</a>, <a href="https://www.inkandswitch.com/livelymerge/notebook/lm-04/">local state</a>, and <a href="https://www.inkandswitch.com/livelymerge/notebook/lm-05/">performance</a>.</p>
<p>We’d particularly point you at the note just before those, <a href="https://www.inkandswitch.com/livelymerge/notebook/lm-02/"><em>Convergence Is Not Enough</em></a>, because it’s a property we talk about a great deal internally. Automerge guarantees convergence: exchange changes, and every peer deterministically reaches the same state. Livelymerge points out that convergence is not the same as correctness. This is a good criticism! It doesn’t have a widely agreed upon general solution today. In some ways it’s an argument for merge-aware data types that encode what the programmer <em>meant</em> rather than the structure they happened to use.</p>
<h3 id="prototype-using-keyhive-with-atproto"><a class="plain" href="#prototype-using-keyhive-with-atproto">Prototype Using Keyhive with ATProto</a></h3>
<p><a href="https://github.com/jediwright">Jedi Wright</a> has been prototyping <a href="https://github.com/jediwright/employment-seam/tree/main/substrate-crossing">governed publishing from a Keyhive-protected Automerge document to Bluesky</a>. The Keyhive grant acts as the gate: before a post goes out, an intent record (with a hash of the authorized content) is written into the document itself; the post is published as a <a href="https://whtwnd.com">WhiteWind</a> blog entry carrying a back-pointer to the source document; and a completion record closes the loop. If the document changes between intent and publish, the hash mismatch blocks the publish, and every step is auditable from the Automerge side. It’s an early prototype against the ARK alpha, but it’s the first thing we’ve seen combining Keyhive with ATProto, and the <a href="https://github.com/jediwright/employment-seam/tree/main/substrate-crossing">implementation notes</a> surfaced some useful rough edges in our packaging along the way.</p>
<h1>📬 Get in Touch</h1>
<p>Are you building something with Automerge? We’d love to hear about it — drop us a line in <a href="https://discord.gg/zKGe4DCfgR">the Discord</a>. Knowing how Automerge gets used in the wild is genuinely how we decide what to build next.</p>
<p>If Automerge is important to your product or organization, consider sponsoring its development: reach out to the team at <a href="mailto:hello@inkandswitch.com">hello@inkandswitch.com</a>.</p>
<hr>
<p>Until next time 👋</p>
<p>— The Automerge Core Team</p>
<!-- External Links -->]]></content:encoded>
    </item>
    <item>
      <title><![CDATA[This Month in Automerge: July '26]]></title>
      <link>https://automerge.org/blog/2026-july/</link>
      <guid isPermaLink="true">https://automerge.org/blog/2026-july/</guid>
      <pubDate>Fri, 31 Jul 2026 00:00:00 GMT</pubDate>
      <description><![CDATA[Hexane v1 lands in Automerge, Subduction sync server hardening, a BeeKEM paper preprint, and more.]]></description>
      <content:encoded><![CDATA[<p>In our ongoing attempts to keep everyone in the loop, we’re trying something new!</p>
<p>We’ve been doing <a href="https://www.youtube.com/@automerge-org">community calls</a> on and off for a while. These are moving to a <a href="https://luma.com/automerge">quarterly cadence</a>, and in between we’ll post written updates like this one more frequently. The community still hangs out in <a href="https://discord.gg/zKGe4DCfgR">the Automerge Discord</a> — come say hi!</p>
<p>Here’s what we’ve been up to over the past few weeks, broken down roughly by project:</p>
<h2 id="include-logo-icon-automerge"><a class="plain" href="#include-logo-icon-automerge"><svg viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg" style="height: 1em; width: 1em; vertical-align: -0.12em;" role="img" aria-label="Automerge logo">
  <path d="M28.2485 0.806161L1.00094 28.0537C-0.0739441 29.1286 -0.0739441 30.8714 1.00094 31.9463L28.2485 59.1938C29.3234 60.2687 31.0661 60.2687 32.141 59.1938L59.3886 31.9463C60.4635 30.8714 60.4635 29.1286 59.3886 28.0537L32.141 0.806163C31.0661 -0.268724 29.3234 -0.268725 28.2485 0.806161Z M28.5447 5.25803L5.4522 28.3505C4.54122 29.2615 4.54122 30.7385 5.4522 31.6495L28.5447 54.742C29.4557 55.6529 30.9327 55.6529 31.8436 54.742L54.9361 31.6495C55.8471 30.7385 55.8471 29.2615 54.9361 28.3505L31.8436 5.25803C30.9327 4.34705 29.4557 4.34705 28.5447 5.25803Z" fill="#FFCC33"/>
  <path d="M30.1945 56.3914C29.6656 56.3914 29.137 56.1904 28.7347 55.7879L4.40639 31.4595C3.60152 30.6547 3.60152 29.3453 4.40639 28.5405L28.7347 4.21219C29.1247 3.82214 29.6429 3.60742 30.1942 3.60742C30.7458 3.60742 31.264 3.82214 31.654 4.21219L55.9823 28.5405C56.7872 29.3453 56.7872 30.6547 55.9823 31.4595L31.654 55.7878C31.2518 56.1904 30.7232 56.3914 30.1945 56.3914ZM30.1942 4.98363C30.0105 4.98363 29.8379 5.05532 29.7077 5.18523L5.37943 29.5135C5.11122 29.7817 5.11122 30.2184 5.37943 30.4865L29.7077 54.8148C29.9682 55.0746 30.4206 55.0743 30.681 54.8148L55.0093 30.4865C55.1392 30.3566 55.2106 30.1837 55.2106 30C55.2106 29.8163 55.1392 29.6434 55.0093 29.5135L30.681 5.18523C30.5508 5.05532 30.3782 4.98363 30.1942 4.98363Z" fill="#222" stroke="#222"/>
  <path d="M37.7723 22.9132L30.1948 12.4836L22.6173 22.9132C21.8364 23.988 22.8812 25.436 24.1474 25.0337L27.4426 23.9869V26.1274C27.4426 28.5163 26.5122 30.7625 24.8227 32.4518L19.9766 37.298L22.8962 40.2176L27.4426 35.6713V44.7637H32.9474V23.9871L36.2423 25.0337C37.5085 25.436 38.5532 23.988 37.7723 22.9132Z" fill="#222"/>
</svg>
 Automerge</a></h2>
<h3 id="core-package"><a class="plain" href="#core-package">Core Package</a></h3>
<p><a href="https://github.com/alexjg">Alex Good</a> and others have been running a sustained correctness campaign across patches, diffs, and sync:</p>
<ul>
<li>Many fixes to patch generation and historical diffs: conflict handling in maps and registers, multi-unit text replacements, text-encoding preservation on load, isolated-transaction scoping, and correct handling of diamond-shaped dependency graphs in <code>apply_changes</code>.</li>
<li>On the Wasm side: an upgrade to <code>wasm-bindgen</code> with the new <code>panic=unwind</code> support, so Rust panics now surface as proper JavaScript exceptions instead of taking down the Wasm instance (<a href="https://github.com/automerge/automerge/pull/1485">#1485</a>). This is a much bigger deal than it sounds: it means that everyone can get real errors out of wasm when it crashes.</li>
<li>In the C API, a memory-leak fix for <code>sync()</code> — thanks to <a href="https://github.com/jkankiewicz">Jason Kankiewicz</a>!</li>
</ul>
<p>All of this shipped in <a href="https://github.com/automerge/automerge/releases">Automerge v3.3.0 through v3.3.2</a>, plus <code>automerge</code> 0.10.0 on crates.io for Rust users.</p>
<h3 id="document-anonymizer"><a class="plain" href="#document-anonymizer">Document Anonymizer</a></h3>
<p>We have a new document <a href="https://github.com/automerge/automerge/tree/main/rust/automerge-cli#anonymize-a-document"><em>anonymizer</em></a> tool (available from Rust, JS, and the CLI): if you have a document with a performance problem you can’t share because of its contents, you can now strip the contents while preserving the <em>exact</em> structure. Please anonymize and <strong>send us your pathological documents</strong> (in <a href="https://discord.gg/zKGe4DCfgR">the Discord</a> or <a href="https://github.com/automerge/automerge/issues">an issue</a>) so that we can add them to the test and bench suites!</p>
<h3 id="hexane"><a class="plain" href="#hexane">Hexane</a></h3>
<p><strong>Hexane v1 has landed in Automerge</strong>. <a href="https://crates.io/crates/hexane">Hexane</a> is the columnar storage engine that underpins Automerge, and this v1 is a major rewrite by <a href="https://github.com/orionz">Orion Henry</a> with a much cleaner public interface and better performance. Depending on the benchmark, it runs around <strong>2–9× faster</strong>. A few highlights from the benchmarks:</p>
<table>
<thead>
<tr>
<th>Benchmark</th>
<th>v0</th>
<th>v1</th>
<th>Speedup</th>
</tr>
</thead>
<tbody>
<tr>
<td>Get: <code>u64</code>, 10k values</td>
<td>291ns</td>
<td>80ns</td>
<td>3.6×</td>
</tr>
<tr>
<td>Save: delta, 100k</td>
<td>2.92ms</td>
<td>372µs</td>
<td>7.8×</td>
</tr>
<tr>
<td>Save: delta mono, 10k</td>
<td>310µs</td>
<td>33µs</td>
<td>9.3×</td>
</tr>
<tr>
<td>Load: string, 100k</td>
<td>4.01ms</td>
<td>1.44ms</td>
<td>2.8×</td>
</tr>
<tr>
<td>Splice: <code>bool</code> replace</td>
<td>651ns</td>
<td>152ns</td>
<td>4.3×</td>
</tr>
<tr>
<td>Iterate: <code>bool</code>, 100k</td>
<td>779µs</td>
<td>105µs</td>
<td>7.4×</td>
</tr>
</tbody>
</table>
<p>The <a href="https://crates.io/crates/automerge">Automerge crate</a> has been fully migrated to the new Hexane API, and follow-up work has already landed:</p>
<ul>
<li>An optimization pass on <code>text()</code> and faster mark-index actor remapping.</li>
<li>Streaming loaders, which make validating documents on load easy and flexible.</li>
<li>Compile-time support for the <code>bijoux</code> codec (see the <a href="#bijoux">Bijoux section below</a>).</li>
</ul>
<h3 id="automerge-repo"><a class="plain" href="#automerge-repo">automerge-repo</a></h3>
<p>A huge community thanks to <a href="https://github.com/darcyparker">Darcy Parker</a>, who has been on a tear hardening automerge-repo for long-running sync servers: catching errors from malformed peer messages that could previously crash a Node process, bounding storage and sync fan-out with configurable concurrency limits, fixing adapter teardown leaks, and modernizing the whole toolchain (TypeScript 6, Vite 8, pnpm 11 with supply-chain controls). Thanks also to <a href="https://github.com/simleb">Simon Leblanc</a> for the new injectable logging interface.</p>
<p>Much of this work is available now in the <a href="https://github.com/automerge/automerge-repo/releases">automerge-repo v2.6.0 alphas</a>.</p>
<h2 id="keyhive"><a class="plain" href="#keyhive">🗝️🐝 Keyhive</a></h2>
<p>Keyhive is our work-in-progress access control layer for Automerge. It’s actually larger than that: it will work with any hash graph, including CRDTs. Here’s what we’ve been up to on the access control side:</p>
<p><a href="https://github.com/jtfmumm">John Mumm</a> has been <strong>refactoring <code>automerge-repo</code> to support end-to-end encryption with <a href="https://github.com/inkandswitch/keyhive">Keyhive</a></strong>: blob interceptor delivery and application secret chain support, paving the way for Keyhive-encrypted documents in JS/TS apps. On the developer-experience side, John has also been making Keyhive-enabled apps easier to build: streamlining the Keyhive integration API, updating the <a href="https://github.com/inkandswitch/keyhive-todo-app-demo">Keyhive Todo MVC app demo</a> as a worked example, and writing documentation for both.</p>
<p><a href="https://github.com/alexjg">Alex Good</a> has also begun initial work adding author provenance to Automerge. Automerge will be able to tell you who wrote which commit, and combined with Keyhive this allows for revoking permissions, which has historically been a surprisingly thorny issue for CRDTs.</p>
<h3 id="beekem-paper"><a class="plain" href="#beekem-paper">BeeKEM Paper</a></h3>
<p>BeeKEM is the concurrent TreeKEM variant at the heart of <a href="https://github.com/inkandswitch/keyhive">Keyhive</a>’s continuous group key agreement. It’s the bit that lets you share content with only who you want to and no one else, even if it’s intercepted.</p>
<p>We’re happy to announce that the <strong>BeeKEM paper is now available as a preprint</strong> on the Cryptology ePrint Archive: <a href="https://eprint.iacr.org/2026/1434"><em>BeeKEM: Decentralized, Secure and Efficient Group Key Agreement</em></a>. — The paper covers how it stays secure and efficient without a central server mediating group membership. It also covers some interesting underlying theory if you’re into decentralized communications. If you’ve been curious about how Keyhive’s encryption groups work under the hood, this is the place to start.</p>
<h2 id="subduction"><a class="plain" href="#subduction">🏔️ Subduction</a></h2>
<p><a href="https://github.com/expede">Brooke Zelenka</a> has been hard at work making our new sync system — <a href="https://github.com/inkandswitch/subduction">Subduction</a> — both fast and boring to operate in production. The past few months, our focus on scale has been driven by requirements in <a href="https://www.inkandswitch.com/patchwork/notebook/">Patchwork</a>, in which users can load low thousands of Automerge documents at a time.</p>
<h3 id="improved-server-storage-backend"><a class="plain" href="#improved-server-storage-backend">Improved Server Storage Backend</a></h3>
<p>On the sync server, we were running out of inodes and running into issues with how <code>ext4</code> pads out blocks, so we’ve switched to an actual database (novel, we know). After weighing several options, we landed on a new <a href="https://github.com/cberner/redb"><code>redb</code></a>-backed storage backend with write batching. We also reworked the filesystem backend — split trees, lazy tree minimisation, and so on — for (much) better performance.</p>
<h3 id="performance-and-observability"><a class="plain" href="#performance-and-observability">Performance &amp; Observability</a></h3>
<ul>
<li><strong>Server performance</strong>: a more aggressively parallel server core, nonblocking sends and pings, fire-and-forget subscriptions, cancellation-based timeouts, and per-peer rate limiting.</li>
<li><strong>Observability</strong>: a richer logging strategy and substantially improved metrics and Grafana dashboards, so we can see exactly what a busy server is doing.</li>
</ul>
<h3 id="iroh-v1-0-support"><a class="plain" href="#iroh-v1-0-support">iroh v1.0 Support</a></h3>
<p>A big thanks to <a href="https://github.com/b5">Brendan O’Brien</a> for upgrading the Subduction <a href="https://www.iroh.computer/">iroh</a> sync transport to <a href="https://github.com/inkandswitch/subduction/pull/257">use iroh v1.0</a>. We’re excited about the possibilities of iroh for peer-to-peer sync in addition to sync servers. Sadly iroh doesn’t support the browser well yet, but our early tests for desktop and mobile applications have been very promising.</p>
<h3 id="cloudflare-workers"><a class="plain" href="#cloudflare-workers">Cloudflare Workers</a></h3>
<p>We’ve seen a couple of teams put Subduction on <a href="https://developers.cloudflare.com/durable-objects/">Cloudflare Durable Objects</a>. There are a couple of contributions to review to make this a reality, <a href="https://github.com/inkandswitch/subduction/pull/270">including one</a> from <a href="https://github.com/threepointone">Sunil Pai</a>. This is very much an ongoing area of interest, but we wanted to note that it’s a thing on our minds in case you too want this in Durable Objects.</p>
<h2 id="bijoux"><a class="plain" href="#bijoux">💎 Bijoux</a></h2>
<p>A surprising amount of movement for a small dependency this month!</p>
<p>We’ve (very) recently consolidated our canonical varint formats into a single crate: <a href="https://crates.io/crates/bijoux"><code>bijoux</code></a>. The “bijouX” family of varints are canonical-by-construction variable-length integers, which is a fancy way of saying “fast, hard to mess up, and space efficient numbers”.</p>
<p>We also needed signed integers, so we’ve designed and implemented variants for <code>i32</code>, <code>i64</code>, and <code>i128</code>. We were able to reuse most of the unsigned version by using a zigzag encoding before bijou-ing. We also explored two’s complement and a mirror encoding, but ultimately zigzag hit a sweet spot between speed, size, and unsurprising behavior.</p>
<p>If you’re curious about the original design and motivation, check out <a href="https://www.inkandswitch.com/tangents/bijou64/">the Ink &amp; Switch post about <code>bijou64</code></a>. In <a href="https://github.com/inkandswitch/bijou/blob/main/bijoux/benches/SHOOTOUT_ANALYSIS.md">the crate’s benchmark shootout</a> it’s the fastest decoder of the varint crates tested on every value distribution, by margins of roughly 2–4× over the next-best, with canonical decoding coming “for free”.</p>
<p>It’s already in use in Sedimentree, Subduction, and Hexane. We expect it to land in Keyhive shortly as part of our move away from Bincode to a bespoke encoding based on Subduction’s.</p>
<h2 id="around-the-ecosystem"><a class="plain" href="#around-the-ecosystem">🌱 Around the Ecosystem</a></h2>
<p>One of the best parts of this work is watching what people build with it. A few projects (from outside the core team) that caught our eye recently:</p>
<h3 id="backstitch-collaboration-for-game-dev"><a class="plain" href="#backstitch-collaboration-for-game-dev">Backstitch: Collaboration for Game Dev</a></h3>
<p><a href="https://backstitch.dev/">Backstitch</a> enables fast collaboration for dev teams, game jams, and classrooms: real-time sync for <a href="https://godotengine.org/">Godot</a> projects, with branching, merging, and reverting powered by Automerge. It’s local-first (changes and history live on your machine), works alongside Git, and lets you share a playable build of your game via URL. Backstitch is built by our friends at <a href="https://www.inkandswitch.com/">Ink &amp; Switch</a> — <a href="https://ashlinduncan.com">Lilith Duncan</a>, <a href="https://github.com/nikitalita">Nikita Zatkovich</a>, and <a href="https://github.com/paulsonnentag">Paul Sonnentag</a> — with support from the <a href="https://endlessglobal.com/the-endless-foundation">Endless Foundation</a>.</p>
<p>Lilith gave <a href="https://www.youtube.com/watch?v=CAJ_iIedx_I">a great talk about it at GodotCon 2026</a>.</p>
<h3 id="braid-issue-tracking-for-llm-agents"><a class="plain" href="#braid-issue-tracking-for-llm-agents">Braid: Issue Tracking for LLM Agents</a></h3>
<p><a href="https://github.com/cscheid/braid">Braid</a> is an Automerge-centric <strong>issue tracker for LLM agents</strong> (and the humans they work with). A project’s issues live in a single Automerge document — a “skein” — so any number of agents across machines, branches, and worktrees can create, edit, and close issues in parallel. It’s been Automerge-native since its first commit, uses both the Rust and JS stacks, and recently grew its own standalone sync server.</p>
<h3 id="coln-a-data-oriented-proof-assistant"><a class="plain" href="#coln-a-data-oriented-proof-assistant">Coln: A Data-Oriented Proof Assistant</a></h3>
<p><a href="https://github.com/coln-project/Coln">Coln</a> is a (heavily pre-alpha) <strong>data-oriented proof assistant</strong> that builds its storage layer directly on Hexane v1 and syncs over Subduction. One of the ways its authors describe it: “Automerge for acsets” (categorical databases — think relational data with precise mathematical semantics). We love seeing the internals reused in new domains!</p>
<h3 id="teamtype-collaborate-across-editors"><a class="plain" href="#teamtype-collaborate-across-editors">Teamtype: Collaborate Across Editors</a></h3>
<p><a href="https://github.com/teamtype/teamtype">Teamtype</a> (formerly Ethersync) continues to ship: real-time co-editing of local text files from any editor, with Automerge underneath. They recently picked up Automerge 0.10 and made the same jump to iroh v1.0 that Subduction did — within the same week, no less.</p>
<h1>📬 Get in Touch</h1>
<p>Are you building something with Automerge? We’d love to hear about it! Drop us a line in <a href="https://discord.gg/zKGe4DCfgR">the Discord</a>! Knowing how Automerge is being used in the wild helps us understand what the community would find most valuable.</p>
<p>If Automerge is important to your product or organization, consider sponsoring its development: reach out to the team at <a href="mailto:hello@inkandswitch.com">hello@inkandswitch.com</a>.</p>
<hr>
<p>Until next time 👋</p>
<p>— The Automerge Core Team</p>
<!-- External Links -->]]></content:encoded>
    </item>
    <item>
      <title><![CDATA[Automerge 3.0]]></title>
      <link>https://automerge.org/blog/automerge-3/</link>
      <guid isPermaLink="true">https://automerge.org/blog/automerge-3/</guid>
      <pubDate>Mon, 14 Jul 2025 00:00:00 GMT</pubDate>
      <description><![CDATA[A new major version of Automerge, which cuts down memory usage by more than 10x while preserving backwards compatability.]]></description>
      <content:encoded><![CDATA[<p>Automerge is a local-first data sync engine that makes it easy to build collaborative apps. Today we’re excited to announce version 3.0 of Automerge!</p>
<p>The main update is a dramatic reduction in memory usage. Automerge stores the full history of documents to facilitate offline collaboration and version control workflows; in previous versions of the library, this could lead to gigabytes of memory usage when working with documents that had long histories. Now, in Automerge 3.0, <strong>we’ve cut that down memory usage by over 10x</strong>, sometimes dramatically more, making Automerge feasible to use in a much wider range of scenarios.</p>
<p>In addition to the memory usage improvements, we’ve also cleaned up some redundant APIs, particularly around the dealing with text strings.</p>
<p>If you’re using Automerge already, you should upgrade today. Automerge 3.0 uses the same file format as Automerge 2 and the API is nearly fully backwards compatible. See <a href="/docs/guides/migrating-from-automerge-2-to-automerge-3">the migration guide</a> for more details.</p>
<p>If you’re not using Automerge yet, now’s a great time to take another look, as things have come a long way in performance and reliability.</p>
<p>To learn more about how we achieved these improvements, read on.</p>
<h2 id="improved-memory-use"><a class="plain" href="#improved-memory-use">Improved Memory Use</a></h2>
<p>Automerge is a data sync engine. As an application developer you work with plain-old-JavaScript-objects and Automerge takes care of persistence, and networking. Unlike most sync engines, Automerge is designed for local-first applications, which means that we need to support working offline, or using multiple independent sync servers, or not having a server at all and doing everything peer-to-peer.</p>
<p>Automerge achieves local first sync by storing every change you make to a document and then when concurrent changes are made - as they will be in a local-first application - we can provide good version control tools for detecting conflicts and reviewing history.  The downside is that we have to store a lot of metadata about changes - we assign a unique ID to every keystroke for example. Most of the technical work in Automerge is making it possible to store and manipulate these increasingly large histories.</p>
<p>Previous versions of Automerge already used a compressed columnar format to store and transmit this metadata. This format achieved a reasonably small metadata overhead “at rest” —  over the raw data for most documents. However, when a document was actually <em>loaded</em> for editing, we used an uncompressed format for the history, so the memory usage would balloon to a significantly larger overhead.</p>
<p>In Automerge 3.0, we’ve rearchitected the library so that it also uses the compressed representation at runtime. This has achieved huge memory savings. For example, pasting Moby Dick into an Automerge 2 document consumes 700Mb of memory, in Automerge 3 it only consumes 1.3Mb!</p>
<p>Beyond the obvious benefits of avoiding high memory usage on client devices, we’ve also seen that reduced memory usage can make it easier to reliably operate busy sync servers that can hold many large documents in memory at once.</p>
<p>Finally, for documents with large histories load times can be much much faster (we recently had an example of a document which hadn’t loaded after 17 hours loading in 9 seconds!).</p>
<h2 id="api-paper-cuts"><a class="plain" href="#api-paper-cuts">API Paper Cuts</a></h2>
<p>We’ve also cleaned up several APIs in this release, particularly around handling text.</p>
<p>Automerge can manage two kinds of strings: “collaborative strings” that can merge edits from multiple users, and “non-collaborative strings” where edits from different users cannot be merged.</p>
<p>In Automerge 1.0, we used native JavaScript strings to represent non-collaborative strings, and a special <code>Text</code> class to represent collaborative strings. In Automerge 2.0, we released an experimental API under the <code>next</code> namespace, making collaborative text the default case—using <code>string</code>s to represent collaborative text, and a special <code>RawString</code> class to represent the less common case of non-collaborative text.</p>
<p>In Automerge 3.0, we’re fully committing to the new API—we’ve removed the <code>Text</code> API, and made the <code>next</code> API the default behavior of the library. (We’ve also renamed <code>RawString</code> to <code>ImmutableString</code> as a more descriptive name.)</p>
<h2 id="try-it-out"><a class="plain" href="#try-it-out">Try it out</a></h2>
<p>Automerge 3.0 is used by default when installing the latest version (<code>2.1.0</code>) of <code>@automerge/automerge-repo</code> or <code>@automerge/react</code>. If you’re new to Automerge take a look at the <a href="/docs/tutorial/">tutorial</a> to get started.</p>
<p>If you already have an Automerge codebase take a look at the <a href="/docs/guides/migrating-from-automerge-2-to-automerge-3">migration guide</a> to see if you need to change anything other than the version number of Automerge you depend on. If you just depend on <code>@automerge/automerge-repo</code> you’ll need to run <code>npm update @automerge/automerge</code> (or your package manager’s equivalent) to pull in the new version.</p>
<p>If things aren’t working, please <a href="https://github.com/automerge/automerge-repo/issues/new">create an issue</a> or if you have questions <a href="https://discord.gg/zKGe4DCfgR">join our Discord</a>.</p>]]></content:encoded>
    </item>
    <item>
      <title><![CDATA[Automerge Repo 2.0]]></title>
      <link>https://automerge.org/blog/automerge-repo-2/</link>
      <guid isPermaLink="true">https://automerge.org/blog/automerge-repo-2/</guid>
      <pubDate>Tue, 13 May 2025 00:00:00 GMT</pubDate>
      <description><![CDATA[A new major release of our library for building local-first applications.]]></description>
      <content:encoded><![CDATA[<p>Automerge Repo was built to improve the developer experience of building Automerge applications by taking common patterns in Automerge applications and packaging them as a reusable library. This has worked really well, getting storage and networking up and running with Automerge Repo is very quick. We wanted to repeat the trick.</p>
<p>Over the last year we’ve been working on taking advantage of the rich history which Automerge records in order to build sophisticated version control workflows for general data types. In doing this we encountered a variety of common tasks related to examining the history of a document which have to be done in userland - so we’ve added these methods to Automerge Repo.</p>
<p>At the same time, we’ve also noticed a number of papercuts which lead to extra boilerplate in Automerge Repo applications. Firstly <code>Repo.find</code> returns a <code>DocHandle</code> immediately and the caller is responsible for waiting until it is ready. Secondly, there are a lot of different packages to install in order to get up and running with common network and storage setups. We’ve tried to address all of these, read on for more details.</p>
<h2 id="find-and-findwithprogress"><a class="plain" href="#find-and-findwithprogress"><code>find</code> and <code>findWithProgress</code></a></h2>
<p>One of the biggest changes is that <code>Repo.find</code> is now asynchronous, returning a <code>Promise&lt;DocHandle&lt;T&gt;&gt;</code> which resolves to a <code>DocHandle</code> which is ready to use. This is in contrast to the 1.0 API which immediately returned a <code>DocHandle&lt;T&gt;</code>, but then required you to wait until the <code>DocHandle</code> was ready before actually trying to access the document the handle represents. This simplifies a lot of code and removes some footguns.</p>
<p>This</p>
<pre><code class="language-typescript"><div class="code-line"><span class="token keyword">const</span> handle <span class="token operator">=</span> repo<span class="token punctuation">.</span><span class="token function">find</span><span class="token punctuation">(</span><span class="token operator">&lt;</span>url<span class="token operator">></span><span class="token punctuation">)</span></div><div class="code-line"><span class="token keyword">await</span> handle<span class="token punctuation">.</span><span class="token function">whenReady</span><span class="token punctuation">(</span><span class="token punctuation">)</span></div><div class="code-line"><span class="token builtin">console</span><span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span>handle<span class="token punctuation">.</span><span class="token function">docSync</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span></div></code></pre><p>becomes</p>
<pre><code class="language-typescript"><div class="code-line"><span class="token keyword">const</span> handle <span class="token operator">=</span> <span class="token keyword">await</span> repo<span class="token punctuation">.</span><span class="token function">find</span><span class="token punctuation">(</span><span class="token operator">&lt;</span>url<span class="token operator">></span><span class="token punctuation">)</span></div><div class="code-line"><span class="token builtin">console</span><span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span>handle<span class="token punctuation">.</span><span class="token function">doc</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span></div></code></pre><p>Sometimes though, you don’t want to await the result of <code>find</code>. Maybe you are not in an asynchronous context, or maybe you want to have some indication of the progress a request is making. For this you can use the new <code>Repo.findWithProgress</code>. This method returns a <code>FindProgress&lt;T&gt;</code> which is a little state machine that steps through the various stages of looking for a document (loading from storage, requesting from the network, ready, unavailable, etc.). This allows you to build more complex loading UIs.</p>
<h2 id="dochandle-version-control-methods"><a class="plain" href="#dochandle-version-control-methods">DocHandle version control methods</a></h2>
<p>Automerge records the entire history of a document at a granular level and this is what allows us to build sophisticated version control on top of it. To date, the API to achieve these things has been a little low level. In Automerge Repo 2.0 we implement a few routines which are common to most applications.</p>
<ul>
<li><code>DocHandle.view(&lt;heads&gt;)</code> returns a <code>DocHandle</code> which is “frozen” at the point in time represented by <code>heads</code></li>
<li><code>DocHandle.history()</code> returns an array of Automerge URLs which can be passed to <code>DocHandle.view(&lt;url&gt;)</code></li>
<li><code>DocHandle.diff(&lt;url | DocHandle&gt;)</code> takes either a URL returned by <code>history</code> or another <code>DocHandle</code> and produces a set of patches representing the diff.</li>
</ul>
<p>This can be used like so:</p>
<pre><code class="language-typescript"><div class="code-line"><span class="token keyword">const</span> current <span class="token operator">=</span> repo<span class="token punctuation">.</span><span class="token function">find</span><span class="token punctuation">(</span><span class="token operator">&lt;</span>url<span class="token operator">></span><span class="token punctuation">)</span></div><div class="code-line"><span class="token keyword">const</span> history <span class="token operator">=</span> current<span class="token punctuation">.</span><span class="token function">history</span><span class="token punctuation">(</span><span class="token punctuation">)</span></div><div class="code-line"><span class="token comment">// now go back one step in history</span></div><div class="code-line"><span class="token keyword">const</span> lastVersion <span class="token operator">=</span> current<span class="token punctuation">.</span><span class="token function">view</span><span class="token punctuation">(</span>history<span class="token punctuation">[</span>history<span class="token punctuation">.</span><span class="token function">len</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">-</span> <span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">)</span></div><div class="code-line"><span class="token comment">// Get the diff</span></div><div class="code-line"><span class="token keyword">const</span> diff <span class="token operator">=</span> lastVersion<span class="token punctuation">.</span><span class="token function">diff</span><span class="token punctuation">(</span>original<span class="token punctuation">)</span></div><div class="code-line"><span class="token comment">// Now visualise the diff somehow (in a text editor you might do a line based diff for example)</span></div><div class="code-line"><span class="token function">visualiseDiff</span><span class="token punctuation">(</span>diff<span class="token punctuation">)</span></div></code></pre><p>For an example of how to use these APIs to build a “rewind” bar, take a look at <a href="https://github.com/automerge/automerge-repo-quickstart/tree/rewind">the <code>rewind</code> branch of the quickstart repo</a></p>
<h2 id="suspense-support-for-react"><a class="plain" href="#suspense-support-for-react">Suspense Support for React</a></h2>
<p>The React hooks now have support for suspense. To use it, simply pass <code>{ suspense: true }</code> as the second argument to the hook. One nice benefit of this approach is that you don’t need to worry about checking if the document is initialized: if</p>
<ul>
<li><code>useHandle</code> is now called <code>useDocHandle</code> and integrates with React suspense.</li>
<li>Added <code>useHandles</code> to load many handles at once</li>
<li><code>useDocument</code> and <code>useDocuments</code> now integrate with React suspense so you don’t need to have special code to handle the loading state</li>
</ul>
<h2 id="react-and-vanilla-js-meta-packages"><a class="plain" href="#react-and-vanilla-js-meta-packages">React and Vanilla JS meta packages</a></h2>
<p>Automerge is designed for modularity; a powerful CRDT at the core and an extensible document management system built to allow you to bring your own storage and networking.</p>
<p>There are a bunch of packages in the <code>automerge-repo</code> ecosystem which most applications need. For example, a typical react application will start with this code:</p>
<pre><code class="language-typescript"><div class="code-line"><span class="token keyword">import</span> <span class="token punctuation">{</span> Repo <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">"@automerge/automerge-repo"</span></div><div class="code-line"><span class="token keyword">import</span> <span class="token punctuation">{</span> BrowserWebSocketClientAdapter <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">"@automerge/automerge-repo-network-websocket"</span></div><div class="code-line"><span class="token keyword">import</span> <span class="token punctuation">{</span> BroadcastChannelNetworkAdapter <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">"@automerge/automerge-repo-network-broadcastchannel"</span></div><div class="code-line"><span class="token keyword">import</span> <span class="token punctuation">{</span> IndexedDbStorageAdapter <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">"@automerge/automerge-repo-storage-indexeddb"</span></div><div class="code-line"><span class="token keyword">import</span> <span class="token punctuation">{</span> useDocument<span class="token punctuation">,</span> useDocuments<span class="token punctuation">,</span> useHandle<span class="token punctuation">,</span> useHandles <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">"@automerge/automerge-repo-react-hooks"</span></div></code></pre><p>This is a lot of boilerplate and a lot of separate packages to install and update. To reduce this noise we’ve created two packages which just re-export these names - one for React applications and one for vanilla JS applications.</p>
<p>A react application now looks a bit like this:</p>
<pre><code class="language-typescript"><div class="code-line"><span class="token keyword">import</span> <span class="token punctuation">{</span></div><div class="code-line">    Repo<span class="token punctuation">,</span></div><div class="code-line">    WebSocketClientAdapter<span class="token punctuation">,</span></div><div class="code-line">    IndexedDbStorageAdapter<span class="token punctuation">,</span></div><div class="code-line">    useDocument</div><div class="code-line"><span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">"@automerge/react"</span></div><div class="code-line"> </div><div class="code-line"><span class="token comment">// Create a pre-configured repo instance</span></div><div class="code-line"><span class="token keyword">const</span> repo <span class="token operator">=</span> <span class="token function">Repo</span><span class="token punctuation">(</span><span class="token punctuation">{</span></div><div class="code-line">  network<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token keyword">new</span> <span class="token class-name">WebSocketClientAdapter</span><span class="token punctuation">(</span><span class="token string">"ws://localhost:8080"</span><span class="token punctuation">)</span><span class="token punctuation">]</span></div><div class="code-line">  storage<span class="token operator">:</span> <span class="token keyword">new</span> <span class="token class-name">IndexedDbStorageAdapter</span><span class="token punctuation">(</span><span class="token punctuation">)</span></div><div class="code-line"><span class="token punctuation">}</span><span class="token punctuation">)</span></div><div class="code-line"> </div><div class="code-line"><span class="token comment">// Use in your React components</span></div><div class="code-line"><span class="token keyword">function</span> <span class="token function">MyComponent</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span></div><div class="code-line">  <span class="token keyword">const</span> doc <span class="token operator">=</span> <span class="token function">useDocument</span><span class="token punctuation">(</span>repo<span class="token punctuation">,</span> <span class="token string">"my-doc-id"</span><span class="token punctuation">)</span></div><div class="code-line"> </div><div class="code-line">  <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token operator">!</span>doc<span class="token punctuation">)</span> <span class="token keyword">return</span> <span class="token operator">&lt;</span>div<span class="token operator">></span>Loading<span class="token operator">...</span><span class="token operator">&lt;</span><span class="token operator">/</span>div<span class="token operator">></span></div><div class="code-line"> </div><div class="code-line">  <span class="token keyword">return</span> <span class="token operator">&lt;</span>div<span class="token operator">></span><span class="token punctuation">{</span>doc<span class="token punctuation">.</span>content<span class="token punctuation">}</span><span class="token operator">&lt;</span><span class="token operator">/</span>div<span class="token operator">></span></div><div class="code-line"><span class="token punctuation">}</span></div></code></pre><p>Whilst a vanilla app would look like</p>
<pre><code class="language-typescript"><div class="code-line"><span class="token keyword">import</span> <span class="token punctuation">{</span></div><div class="code-line">  Repo<span class="token punctuation">,</span></div><div class="code-line">  MessageChannelNetworkAdapter<span class="token punctuation">,</span></div><div class="code-line">  IndexedDBStorageAdapter<span class="token punctuation">,</span></div><div class="code-line">  WebSocketClientAdapter<span class="token punctuation">,</span></div><div class="code-line"><span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">"@automerge/vanillajs"</span></div><div class="code-line"> </div><div class="code-line"><span class="token comment">// Create a repo with your chosen adapters</span></div><div class="code-line"><span class="token keyword">const</span> repo <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">Repo</span><span class="token punctuation">(</span><span class="token punctuation">{</span></div><div class="code-line">  network<span class="token operator">:</span> <span class="token punctuation">[</span></div><div class="code-line">    <span class="token keyword">new</span> <span class="token class-name">MessageChannelNetworkAdapter</span><span class="token punctuation">(</span><span class="token comment">/* your message channel to another repo here */</span><span class="token punctuation">)</span><span class="token punctuation">,</span></div><div class="code-line">    <span class="token keyword">new</span> <span class="token class-name">IndexedDBStorageAdapter</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span></div><div class="code-line">    <span class="token keyword">new</span> <span class="token class-name">WebSocketClientAdapter</span><span class="token punctuation">(</span><span class="token string">"wss://sync.automerge.org"</span><span class="token punctuation">)</span><span class="token punctuation">,</span></div><div class="code-line">  <span class="token punctuation">]</span><span class="token punctuation">,</span></div><div class="code-line"><span class="token punctuation">}</span><span class="token punctuation">)</span></div><div class="code-line"> </div><div class="code-line"><span class="token comment">// rest of the application</span></div></code></pre><h2 id="papercuts"><a class="plain" href="#papercuts">Papercuts</a></h2>
<ul>
<li>The <code>BrowserWebSocketClientAdapter</code> and <code>NodeWSServerAdapter</code>s are now called <code>WebSocketClientAdapter</code> and <code>WebSocketServerAdpater</code> respectively</li>
<li>Updated the svelte integration to Svelte 5</li>
</ul>]]></content:encoded>
    </item>
    <item>
      <title><![CDATA[Automerge Anywhere]]></title>
      <link>https://automerge.org/blog/automerge-anywhere/</link>
      <guid isPermaLink="true">https://automerge.org/blog/automerge-anywhere/</guid>
      <pubDate>Fri, 23 Aug 2024 00:00:00 GMT</pubDate>
      <description><![CDATA[A new approach to WASM packaging means Automerge can be loaded anywhere: with no bundler, in React-Native, in cloud workers, and more.]]></description>
      <content:encoded><![CDATA[<p>One of Automerge’s key strengths is its portability. The core of the CRDT is written in Rust, which allows us to bind it into a wide variety of languages including JavaScript, Swift, Kotlin, C, Go, and Python. In the browser, we compile the Rust code to WebAssembly to load it there.</p>
<p>Unfortunately, native browser support for WebAssembly modules has remained quite a subtle art: different runtimes, package managers, bundlers, and browsers have all settled on different approaches and have different constraints. It’s a real mess out there.</p>
<p>In the last few weeks, we returned to the problem of WASM packaging with some determination and some new ideas courtesy of <a href="https://nickb.dev/blog/recommendations-when-publishing-a-wasm-library/">Nick Babrock</a>. The result is a set of new packaging options that should make loading Automerge possible anywhere, including quite a few places where it was difficult or impossible before.</p>
<h2 id="anywhere"><a class="plain" href="#anywhere">Anywhere?</a></h2>
<p>If you’re already using Automerge successfully in your environment, nothing will change. The new features are strictly additive. What we have done is introduce a few new ways to load Automerge by including the option for manual initialization of the WASM object and a base64 encoded string version as well.</p>
<p>This means you should be able to conveniently use Automerge in vanilla JS applications with no bundler, in React-Native applications on mobile devices, within cloud services like Cloudflare Workers or on Val.town, and probably anywhere else you can think of.</p>
<p>If you find a place where none of our approaches work for you then please let us know by inquring <a href="https://discord.gg/TrgN9FkYSa">in our Discord</a> or by filing a (GitHub issue)[https://github.com/automerge/automerge].</p>
<h2 id="how-to-use-it"><a class="plain" href="#how-to-use-it">How to use it</a></h2>
<p>We’ve collected of examples showing how to initialize Automerge in specific environments in <a href="/docs/reference/library-initialization/">a new documentation page</a>. If you had trouble with Automerge in your environment before, try again without changing anything first. This new release improved support for a few edge cases within the old API, so you might find everything just starts working on its own.</p>
<p>If you do need to use the new manual initialization code you’ll need to to make a couple of small changes:</p>
<ol>
<li>Import the <code>/slim</code> variant of Automerge and separately, the WebAssembly blob.</li>
<li>Await the result of calling <code>Automerge.initializeWasm(wasm)</code>.</li>
</ol>
<p>For example, here’s how to perform initialization in a Vite app without importing WebAssembly modules:</p>
<pre><code class="language-javascript"><div class="code-line"><span class="token keyword">import</span> <span class="token punctuation">{</span> next <span class="token keyword">as</span> Automerge <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'@automerge/automerge/slim'</span></div><div class="code-line"><span class="token keyword">import</span> wasm <span class="token keyword">from</span> <span class="token string">"@automerge/automerge/automerge.wasm?url"</span></div><div class="code-line"><span class="token comment">// note here the ?url suffix mean that the wasm is loaded as a URL</span></div><div class="code-line"> </div><div class="code-line"><span class="token comment">// initializeWasm accepts a URL, Request, UInt8Array, or a WebAssembly.Module.</span></div><div class="code-line"><span class="token keyword">await</span> Automerge<span class="token punctuation">.</span><span class="token function">initializeWasm</span><span class="token punctuation">(</span>wasm<span class="token punctuation">)</span></div><div class="code-line"> </div><div class="code-line"><span class="token comment">// Now you can use Automerge</span></div><div class="code-line"><span class="token keyword">let</span> doc <span class="token operator">=</span> Automerge<span class="token punctuation">.</span><span class="token function">init</span><span class="token punctuation">(</span><span class="token punctuation">)</span></div></code></pre><p>This also applies for applications using <code>automerge-repo</code>, in that case you would import <code>@automerge/automerge-repo/slim</code>. Like so:</p>
<pre><code class="language-javascript"><div class="code-line"><span class="token keyword">import</span> <span class="token punctuation">{</span> Repo <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'@automerge/automerge-repo/slim'</span></div><div class="code-line"><span class="token keyword">import</span> <span class="token punctuation">{</span> next <span class="token keyword">as</span> Automerge <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'@automerge/automerge/slim'</span></div><div class="code-line"><span class="token keyword">import</span> wasm <span class="token keyword">from</span> <span class="token string">"@automerge/automerge/wasm_blob.wasm?url"</span></div><div class="code-line"> </div><div class="code-line"><span class="token keyword">await</span> Automerge<span class="token punctuation">.</span><span class="token function">initializeWasm</span><span class="token punctuation">(</span>wasm<span class="token punctuation">)</span></div><div class="code-line"> </div><div class="code-line"><span class="token comment">// Now you can use the Repo</span></div><div class="code-line"><span class="token keyword">let</span> repo <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">Repo</span><span class="token punctuation">(</span><span class="token punctuation">{</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">}</span><span class="token punctuation">)</span></div><div class="code-line"><span class="token keyword">let</span> handle <span class="token operator">=</span> repo<span class="token punctuation">.</span><span class="token function">create</span><span class="token punctuation">(</span><span class="token punctuation">)</span></div></code></pre><p>If you can’t even load a binary file, we’ve even included a base64 encoded version of the WASM blob. This will be somewhat slower and large than a binary object but it’s available as the ultimate fallback and you can use it like this:</p>
<pre><code class="language-javascript"><div class="code-line"><span class="token keyword">import</span> <span class="token punctuation">{</span> automergeWasmBase64 <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">"@automerge/automerge/automerge.wasm.base64.js"</span><span class="token punctuation">;</span></div><div class="code-line"><span class="token comment">// Note the `/slim` suffixes</span></div><div class="code-line"><span class="token keyword">import</span> <span class="token punctuation">{</span> next <span class="token keyword">as</span> Automerge <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">"@automerge/automerge/slim"</span><span class="token punctuation">;</span></div><div class="code-line"><span class="token keyword">import</span> <span class="token punctuation">{</span> Repo <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token template-string"><span class="token template-punctuation string">`</span><span class="token string">@automerge/automerge-repo/slim</span><span class="token template-punctuation string">`</span></span><span class="token punctuation">;</span></div><div class="code-line"> </div><div class="code-line"><span class="token keyword">await</span> next<span class="token punctuation">.</span><span class="token function">initializeBase64Wasm</span><span class="token punctuation">(</span>automergeWasmBase64<span class="token punctuation">)</span></div><div class="code-line"> </div><div class="code-line"><span class="token comment">// Now we can get on with our lives</span></div><div class="code-line"><span class="token keyword">const</span> repo <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">Repo</span><span class="token punctuation">(</span><span class="token punctuation">{</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">}</span><span class="token punctuation">)</span></div></code></pre><h3 id="for-libraries-which-depend-on-automerge"><a class="plain" href="#for-libraries-which-depend-on-automerge">For libraries which depend on Automerge</a></h3>
<p>If you are writing a library which depends on Automerge that other applications might use, please be sure to only import the <code>@automerge/automerge/slim</code> package. Doing so will ensure other users retain the option of</p>]]></content:encoded>
    </item>
    <item>
      <title><![CDATA[Automerge 2.2: Rich Text]]></title>
      <link>https://automerge.org/blog/rich-text/</link>
      <guid isPermaLink="true">https://automerge.org/blog/rich-text/</guid>
      <pubDate>Sat, 06 Apr 2024 00:00:00 GMT</pubDate>
      <description><![CDATA[Realtime and asynchronous editing of rich text including inline formatting, block elements, and more.]]></description>
      <content:encoded><![CDATA[<p>We are delighted to announce the release of rich text support in Automerge, including a fully supported ProseMirror binding as the initial reference implementation. This means that you can now build collaborative applications on Automerge with realtime and asynchronous editing of rich text including inline formatting, block elements, and more.</p>
<p>If you want to get started building right away, check out the library here: <a href="https://github.com/automerge/automerge-prosemirror">automerge-prosemirror</a></p>
<p>For everyone else, let’s start with a demo, before moving on to discuss what rich text is and how Automerge helps you use it.</p>
<h2 id="demo"><a class="plain" href="#demo">Demo</a></h2>
<iframe style="height:440px" src="https://automerge.org/automerge-prosemirror"></iframe>
<p>On its own, this should seem pretty boring: it’s a rich text editor which  supports most of the features users typically expect from a rich text editor. What makes this demo interesting is the support for real time collaboration which means that we can manage concurrent changes to complex formatting, like this:</p>
<video controls playsinline autoplay muted loop>
  <source src="automerge-formatting-change.webm" type="video/webm" />
  Merging formatting and structure changes in Automerge
</video>
<p>The Automerge-ProseMirror binding is designed to be easy to integrate into any ProseMirror editor you might want to build.  To see how it works, refer to <a href="/docs/cookbook/rich-text-prosemirror-vanilla">the cookbook</a>, but the short story is that it takes just a few lines of code.</p>
<h2 id="why-is-rich-text-a-custom-datatype-in-automerge"><a class="plain" href="#why-is-rich-text-a-custom-datatype-in-automerge">Why is rich text a custom datatype in Automerge?</a></h2>
<p>Automerge aims to make the experience of building production-ready collaborative applications as close as possible to the ease and speed of writing a local prototype. This is why the Automerge API focuses on giving you something that feels like just modifying a local Javascript object. Automerge provides a consistent abstraction for your data so that you can focus on your users’ needs and not on the finer points of storage and synchronization.</p>
<p>In this context, rich text poses a problem. As we discuss at length in our past paper, <a href="https://inkandswitch.com/peritext">Peritext</a>, rich text doesn’t map easily on to plain-text or tree structures. Attempting to do so can lead to incorrect behaviour during a merge.</p>
<p>For a real-world example of the kind of data-loss that is difficult to avoid with traditional approaches, here’s an example using the yjs prosemirror bindings:</p>
<video controls playsinline autoplay muted loop>
  <source src="yjs-structure-change.webm" type="video/webm" />
  Conflicting structure changes in yjs can cause loss of text
</video>
<p>When the edits from the two sides come together, the representation of the data requires the editor to choose between either adding a list item, or converting the list into a paragraph. In this case, the extra list item is lost (though it could have been the opposite.)</p>
<p>This kind of conflict is very rare in online editing scenarios. It only occurs when two users manage to submit conflicting structural edits concurrently. This becomes much more likely during longer sessions of offline collaboration Automerge is designed to support. Our goal is to ensure consistent and correct behaviour under all network and collaboration conditions, so for us this was an important problem.</p>
<p>Our goal has been to provide an implementation of rich-text support which allows both edits to be kept.</p>
<h2 id="how-it-works"><a class="plain" href="#how-it-works">How it works</a></h2>
<p>Rather than representing rich text as a tree structure like HTML, we represent it as plain text annotatedwith spans and blocks:</p>
<table>
<thead>
<tr>
<th></th>
<th>examples</th>
<th>behaviour</th>
</tr>
</thead>
<tbody>
<tr>
<td>spans</td>
<td>&lt;a&gt; &lt;em&gt;</td>
<td>overlapping</td>
</tr>
<tr>
<td>blocks</td>
<td>&lt;p&gt; &lt;li&gt;</td>
<td>independent</td>
</tr>
</tbody>
</table>
<p>The difference between the two is that text may appear in many spans, but should only ever be in a single block. A sentence may be bold <em>and</em> italic, but it cannot be simultaneously part of two paragraphs.</p>
<p>Formatting spans, originally described in <a href="https://inkandswitch.com/peritext">Peritext</a> are conceptually stored outside the text. A formatting span has a beginning and an end within the text sequence and a flag detailing whether the span should expand when characters are inserted at the boundaries of the span.</p>
<p>Block markers have a type - such as “ordered list item” - and parents - such as “blockquote”. The parents represent the hierarchical structure of the document. Block markers are inserted into the sequence of text characters.</p>
<p>These elements map quite closely to user actions whilst editing. Typically a text editor allows you to highlight a sequence of characters and format them - regardless of whether they are in different regions of the document (try highlighting and bolding half of a list item and preceding paragraph in Google Docs for example). On the other hand, inserting a new list item is usually achieved by pressing Enter at the end of the current list item - inserting a block marker; and indenting a list item is done by pressing a button in the toolbar - inserting a new parent into the block parents.</p>
<p>Choosing operations on the underlying data structure which map well to typical actions performed while editing text means we can provide accurate representations of the difference between two versions of the text. Here’s the same structure change example in Automerge</p>
<video controls playsinline autoplay muted loop>
  <source src="automerge-structure-change.webm" type="video/webm" />
  Structure change in Automerge preserves edits
</video>
<p>We plan to write a more detailed description of these algorithms (which were developed in concert with Martin Kleppmann) in a future paper.</p>
<h2 id="how-can-i-try-it"><a class="plain" href="#how-can-i-try-it">How can I try it?</a></h2>
<p>Support for rich text landed in Automerge 2.2 and you can find a writeup of the API <a href="/docs/reference/documents/rich-text">here</a>. You can find several examples of how to use the Prosemirror bindings in the <a href="https://github.com/automerge/automerge-prosemirror">Automerge-ProseMirror</a>  repository. We’ve also made a <a href="https://github.com/automerge/prosemirror-quickstart">simple starter project</a> to a starter project you can fork. Please feel free to experiment with the playground above. If you find any behaviours that seem surprising, we’d love to hear about it. Whatever you’re doing, we hope you’ll join us in the <a href="https://discord.gg/TrgN9FkYSa">Automerge Discord</a> and let us know how you’re getting on.</p>
<h2 id="commercial-support-for-automerge"><a class="plain" href="#commercial-support-for-automerge">Commercial Support for Automerge</a></h2>
<p>If you’re a business building a commercial product on top of Automerge, we recommend becoming a commercial sponsor. Automerge is only available for production use thanks to our supporters and we are highly motivated to ensure their success.</p>
<p>Sponsors of the project receive ongoing support from our team, including architecture review early in a project, advice around scaling or launch issues, and extra visibility and influence into our roadmap. Sponsors also get a private Discord channel for asking questions specific to their project.</p>
<p>Email <a href="mailto:alex@inkandswitch.com">alex@inkandswitch.com</a> or message us in the <a href="https://discord.gg/TrgN9FkYSa">Automerge Discord</a> if you’d like to learn more about sponsorship and support options.</p>]]></content:encoded>
    </item>
    <item>
      <title><![CDATA[Merry Commitmas]]></title>
      <link>https://automerge.org/blog/merry-commitmas/</link>
      <guid isPermaLink="true">https://automerge.org/blog/merry-commitmas/</guid>
      <pubDate>Mon, 25 Dec 2023 00:00:00 GMT</pubDate>
      <description><![CDATA[A year-end recap of what’s new in Automerge.]]></description>
      <content:encoded><![CDATA[<p>Since <a href="/blog/automerge-repo">releasing</a> automerge-repo last month, we’ve been working closely with our users to improve the library based on real-world usage. One in-house project, the <a href="https://github.com/inkandswitch/tiny-essay-editor">Tiny Essay Editor</a>, is a Markdown editor with comment support which was used to write the <a href="https://www.inkandswitch.com/embark/">latest Ink &amp; Switch essay, Embark</a>.</p>
<p>Like many Ink &amp; Switch essays, Embark is a large piece: the final version is over 11,000 words and 60,000 characters. The full edit history is just shy of 200,000 edits. That means the team produced roughly 3x as much text as made it into the final version. The final version of the document with the full history and all the comments included is only 376kb and takes a little under 4s to load from disk, but from then on edits are reasonably snappy: most edits take 25ms (equivalent to 30fps) from keypress to paint on my desktop.</p>
<p>There’s still plenty of room to improve here. Ultimately our goal is to reliably achieve single-frame updates even on very large documents and we still have a long way to go on memory usage. Still, we thought folks might enjoy hearing a little behind-the-scenes description of what we’ve been up to.</p>
<p>But first, a few feature updates:</p>
<h2 id="codemirror-integration"><a class="plain" href="#codemirror-integration">CodeMirror Integration</a></h2>
<p>Tiny Essay Editor is built around the <a href="https://github.com/automerge/automerge-codemirror">automerge-codemirror</a> integration and uses incremental updates to make sure it stays fast even on extremely large documents. We’ve managed to maintain next-frame performance for most edits and document sizes, but on very large documents we still have a few stalls caused by calculating network synchronization messages to work through.</p>
<p>That said, the CodeMirror integration is stable, efficient, and works well with both the marks and cursors APIs. If you need a well-supported plaintext editor (or want a reference to write your own integration for your favorite editor) start here. ProseMirror integration is coming too, more about that after Christmas.</p>
<h2 id="updatetext-for-easy-integration"><a class="plain" href="#updatetext-for-easy-integration">updateText for easy integration</a></h2>
<p>By default, Automerge’s text fields update by replacement, much like they would with any web form. If your application submits the full value for a field, Automerge will replace the whole value. Under the hood, Automerge’s strings default to being editable, but integrating a full text editor component in your application is a lot of complication for making a simple text field editable.</p>
<p>The reason is that the interface Automerge exposes for modifying text is <code>Automerge.splice</code>, which lets you insert or delete characters at a particular index in the string. Unfortunately, browsers (and most other platforms) don’t give you this information very easily; instead they just give you the whole content of the text field and you have to figure out yourself what changed.</p>
<p>Figuring out what changed between two strings is actually quite fiddly. There are algorithms you can study, such as the <a href="https://www.nathaniel.ai/myers-diff/">Myers diff</a>, and libraries <a href="https://www.npmjs.com/package/myers-diff">that implement them</a>… but we decided that it would be worthwhile to just build one into Automerge and spare you the hassle. We’ve therefore introduced a function <code>Automerge.updateText</code>, which looks like this:</p>
<pre><code class="language-javascript"><div class="code-line"><span class="token keyword">let</span> doc1 <span class="token operator">=</span> Automerge<span class="token punctuation">.</span><span class="token function">from</span><span class="token punctuation">(</span><span class="token punctuation">{</span> <span class="token literal-property property">text</span><span class="token operator">:</span> <span class="token string">"Hello world!"</span> <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span></div><div class="code-line"> </div><div class="code-line"><span class="token keyword">let</span> doc2 <span class="token operator">=</span> Automerge<span class="token punctuation">.</span><span class="token function">clone</span><span class="token punctuation">(</span>doc1<span class="token punctuation">)</span><span class="token punctuation">;</span></div><div class="code-line">doc2 <span class="token operator">=</span> Automerge<span class="token punctuation">.</span><span class="token function">change</span><span class="token punctuation">(</span>doc2<span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token parameter">d</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">{</span></div><div class="code-line">  <span class="token comment">/// Note we just pass the new value we want the whole field to have</span></div><div class="code-line">  Automerge<span class="token punctuation">.</span><span class="token function">updateText</span><span class="token punctuation">(</span>d<span class="token punctuation">,</span> <span class="token punctuation">[</span><span class="token string">"text"</span><span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token string">"Goodbye world!"</span><span class="token punctuation">)</span><span class="token punctuation">;</span></div><div class="code-line"><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span></div><div class="code-line"> </div><div class="code-line">doc1 <span class="token operator">=</span> Automerge<span class="token punctuation">.</span><span class="token function">change</span><span class="token punctuation">(</span>doc1<span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token parameter">d</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">{</span></div><div class="code-line">  Automerge<span class="token punctuation">.</span><span class="token function">updateText</span><span class="token punctuation">(</span>d<span class="token punctuation">,</span> <span class="token punctuation">[</span><span class="token string">"text"</span><span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token string">"Hello friends!"</span><span class="token punctuation">)</span><span class="token punctuation">;</span></div><div class="code-line"><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span></div><div class="code-line"> </div><div class="code-line"><span class="token comment">/// text is now "Goodbye friends!"</span></div><div class="code-line"><span class="token keyword">const</span> merged <span class="token operator">=</span> Automerge<span class="token punctuation">.</span><span class="token function">merge</span><span class="token punctuation">(</span>doc1<span class="token punctuation">,</span> doc2<span class="token punctuation">)</span><span class="token punctuation">;</span></div></code></pre><p>This approach is really handy for places like form fields where a full rich-text editor would be overkill, but isn’t as efficient at capturing inputs, particularly for larger documents. Let us know how it works for you!</p>
<h2 id="surfacing-sync-state"><a class="plain" href="#surfacing-sync-state">Surfacing Sync State</a></h2>
<p>As the Embark essay grew ever-larger, the team began to wonder whether they were up-to-date with each other, our storage server, and so on. We worked with them (thanks to Paul Sonnentag) to allow sync state to be forwarded among peers so that you could subscribe to the sync state of other systems. Right now TEE is just using this to confirm when changes are sent to (or received from) our storage server, particularly after editing offline, but the same infrastructure could be used to keep track of which of your devices were up-to-date, whether a collaborator had received your changes, or even to annotate a chat history. We’re eager to see how you might use this. (And don’t forget you can always send arbitrary messages to other peers with the ephemeral messaging API!)</p>
<h2 id="loading-faster"><a class="plain" href="#loading-faster">Loading faster</a></h2>
<p>Finally, let’s wrap up with some performance work. As we described above, the Embark essay’s Automerge document history got pretty large – roughly 200,000 operations, with around 1000 edit sessions (one per editor tab). This uncovered some performance problems in Automerge: when we started, loading the editor took around 40 seconds!</p>
<p>If you’ve ever encountered the <a href="https://github.com/automerge/automerge-perf">“edit trace” benchmark</a>, which is widely used to benchmark CRDT performance, this might be confusing. That benchmark is even larger. It contains around 270,000 operations and Automerge can load it in ~200ms. Why were we taking two orders of magnitude longer to load a similar-sized document?</p>
<p>Well, notice that I said loading the <em>editor</em> took 40s. In profiling this problem, we saw that the Tiny Essay Editor (TEE) created an empty Automerge document, and ran the sync protocol with our sync server to fetch the document. The sync protocol didn’t send the whole document down the wire in one go – instead it would send the list of changes that the client doesn’t have. In the case of the initial load, the client doesn’t have <em>any</em> of the changes, and so each change was sent down the wire individually. TEE would then apply each change one after another. Applying invididual changes in this way is much slower than loading the compressed document format (which is produced by <code>Automerge.save</code>).</p>
<p>We solved this in a straightforward way: when a peer requests a document it doesn’t have at all, we skip the elaborate sync protocol and simply send the whole compressed document. Future synchronizations are very fast: the peers remember their last sync state and can quickly calculate the comparison</p>
<p>Unfortunately, even loading the compressed version of this document was much slower than we expected: it was taking somewhere around 5s. That’s about 5s too long.</p>
<p>Investigating where the time was being spent we spotted a few performance problems, including:</p>
<ul>
<li>Automerge stores operations internally in a B-tree, which has a vector of operations on each node. We were losing some time allocating these little vectors every time we received a new change.</li>
<li>Each node in the B-tree has an index on it, where we store things like the number of ops and the number of characters in its subtree. When loading a document we were updating these indexes for every edit in the document’s history.</li>
</ul>
<p>We solved these problems by making several changes:</p>
<ol>
<li>Rather than storing the operations directly in the B-tree, we now store them in a separate table and just store indexes into this table in the B-tree. This consolidates allocations so we don’t spend so much time making tiny allocations.</li>
<li>When loading a document, we wait until we’ve inserted every op into the B-tree before generating indexes.</li>
</ol>
<p>Putting this all together, the load time for the Embark essay is reduced to around ~4 seconds on my machine. This is still about 4s too slow but we’ve managed to shave the first 90% off of the loading time in this application.</p>
<h1>That’s it!</h1>
<p>You can get all this good stuff by updating to Automerge 2.1.10 or later, as well as plenty of smaller improvements (like import/export) and bug fixes (like getting rid of a React hook race condition).</p>]]></content:encoded>
    </item>
    <item>
      <title><![CDATA[Automerge Repo: A "batteries-included" toolkit for building local-first applications]]></title>
      <link>https://automerge.org/blog/automerge-repo/</link>
      <guid isPermaLink="true">https://automerge.org/blog/automerge-repo/</guid>
      <pubDate>Mon, 06 Nov 2023 00:00:00 GMT</pubDate>
      <description><![CDATA[Now you can simply create a repo, point it to a sync server, and get to work on your app.]]></description>
      <content:encoded><![CDATA[<p>Today we are announcing our new library, <a href="https://github.com/automerge/automerge-repo"><code>automerge-repo</code></a>, which makes it vastly easier to build local-first applications with Automerge. Take a look at our <a href="/docs/tutorial">quickstart guide</a> or read on for some background and examples.</p>
<p>For those new to this idea: local-first applications are a way of building software that allows both real-time collaboration (think Google Docs) and offline working (think Git). They work by storing the user’s data locally, on their own device, and syncing it with collaborators in the background. You can read more about the motivation for local-first software <a href="https://inkandswitch.com/local-first/">in our essay</a>, or watch a <a href="https://www.youtube.com/watch?v=PHz17gwiOc8">talk introducing the idea</a>.</p>
<p>A challenge in local-first software is how to merge edits that were made independently on different devices, and <a href="https://crdt.tech/">CRDTs</a> were developed to solve this problem. Automerge is a fairly mature CRDT implementation. In fact, we wrote this blog post using it! The API is quite low-level though, and Automerge-Core has no opinion about how networking or storage should be done. Often, the first thing developers ask after discovering Automerge was how to connect it into an actual application.</p>
<p>Our new library, <code>automerge-repo</code>, extends the collaboration engine of Automerge-Core with networking and storage adapters, and provides integrations with React and other UI frameworks. You can get to building your app straight away by taking advantage of default implementations that solve common problems such as how to send binary data over a WebSocket, how often to send synchronization messages, what network format to use, or how to store data in places like the browser’s IndexedDB or on the filesystem.</p>
<p>If you’ve been intimidated by the effort of integrating Automerge into your application because of these choices, this library is for you. Now you can simply create a repo, point it to a sync server, and get to work on your app.</p>
<h2 id="automerge-repo-a-simple-example"><a class="plain" href="#automerge-repo-a-simple-example"><code>automerge-repo</code>: a simple example</a></h2>
<p>Let’s start by taking a look at a simple example of how <code>automerge-repo</code> works. To begin, create and configure a repository for Automerge documents.</p>
<pre><code class="language-typescript"><div class="code-line"><span class="token keyword">const</span> repo <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">Repo</span><span class="token punctuation">(</span><span class="token punctuation">{</span></div><div class="code-line">  storage<span class="token operator">:</span> <span class="token keyword">new</span> <span class="token class-name">IndexedDBStorageAdapter</span><span class="token punctuation">(</span><span class="token string">"automerge-demo"</span><span class="token punctuation">)</span><span class="token punctuation">,</span></div><div class="code-line">  network<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token keyword">new</span> <span class="token class-name">WebsocketClientNetworkAdapter</span><span class="token punctuation">(</span><span class="token string">"wss://sync.automerge.org"</span><span class="token punctuation">)</span><span class="token punctuation">]</span></div><div class="code-line"><span class="token punctuation">}</span><span class="token punctuation">)</span></div></code></pre><p>The code in the example above creates a repository and adds a storage and network adapter to it. It tells <code>automerge-repo</code> to store all changes in an IndexedDB table called <code>automerge-demo</code> and to synchronize documents with the WebSocket server at <code>sync.automerge.org</code>. The library is designed to support a wide variety of network transports, and we include a simple client/server WebSocket adapter out of the box. Members of the community are already adding support for other transports, such as WebRTC.</p>
<p>In this example we’re connecting to the public test server hosted by the Automerge team, but you can also run your own sync server. In fact, our <a href="https://github.com/automerge/automerge-repo-sync-server">sync server</a> runs almost the same code as above, but with a different network and storage adapter.</p>
<div class="note">
<h4 id="worth-noting"><a class="plain" href="#worth-noting">Worth Noting</a></h4>
<p>The Automerge project provides a public sync server for you to experiment with <code>sync.automerge.org</code>. This is not a private instance, and as an experimental service has no reliability or data safety guarantees. Basically, it’s good for demos and prototyping, but run your own sync server for production uses.</p>
</div>
<p>Next, create a document and make some changes to it:</p>
<pre><code class="language-typescript"><div class="code-line"><span class="token operator">></span> <span class="token keyword">const</span> handle <span class="token operator">=</span> repo<span class="token punctuation">.</span><span class="token function">create</span><span class="token punctuation">(</span><span class="token punctuation">)</span></div><div class="code-line">   <span class="token operator">></span> handle<span class="token punctuation">.</span><span class="token function">change</span><span class="token punctuation">(</span>doc <span class="token operator">=></span> <span class="token punctuation">{</span> doc<span class="token punctuation">.</span>hello <span class="token operator">=</span> <span class="token string">"World."</span> <span class="token punctuation">}</span><span class="token punctuation">)</span></div><div class="code-line">   <span class="token operator">></span> <span class="token builtin">console</span><span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span>handle<span class="token punctuation">.</span>url<span class="token punctuation">)</span></div><div class="code-line">   automerge<span class="token operator">:</span>2j9knpCseyhnK8izDmLpGP5WMdZQ</div></code></pre><p>The code logs a URL to the document you created. On another computer, or in another browser, you could load this document using the same URL, as shown below:</p>
<pre><code class="language-typescript"><div class="code-line"><span class="token operator">></span> <span class="token keyword">const</span> handle <span class="token operator">=</span> repo<span class="token punctuation">.</span><span class="token function">find</span><span class="token punctuation">(</span><span class="token string">"automerge:2j9knpCseyhnK8izDmLpGP5WMdZQ"</span><span class="token punctuation">)</span></div><div class="code-line">   <span class="token operator">></span> <span class="token builtin">console</span><span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span><span class="token keyword">await</span> handle<span class="token punctuation">.</span><span class="token function">doc</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span></div><div class="code-line">   <span class="token comment">// why don't you try it and find out?</span></div></code></pre><p>What’s happening here to make all this work? <code>automerge-repo</code> wraps the core Automerge library and handles all the work of moving the bytes around to make your application function.</p>
<h2 id="key-concepts-and-basic-usage"><a class="plain" href="#key-concepts-and-basic-usage">Key Concepts &amp; Basic Usage</a></h2>
<p>Let’s go into a bit more detail. For full documentation please see <a href="/docs/reference/repositories/">the docs</a>.</p>
<h3 id="repo"><a class="plain" href="#repo">Repo</a></h3>
<p>Create a repo by initializing it with an optional storage plugin and any number of network adapters. These are the options for initializing a repo:</p>
<pre><code class="language-typescript"><div class="code-line"><span class="token keyword">export</span> <span class="token keyword">interface</span> <span class="token class-name">RepoConfig</span> <span class="token punctuation">{</span></div><div class="code-line">  <span class="token comment">// A unique identifier for this peer, the default is a random id</span></div><div class="code-line">  peerId<span class="token operator">?</span><span class="token operator">:</span> PeerId</div><div class="code-line">  <span class="token comment">// Something which knows how to store and retrieve binary blobs</span></div><div class="code-line">  storage<span class="token operator">?</span><span class="token operator">:</span> StorageAdapter</div><div class="code-line">  <span class="token comment">// Something which knows how to send and receive sync messages</span></div><div class="code-line">  network<span class="token operator">:</span> NetworkAdapter<span class="token punctuation">[</span><span class="token punctuation">]</span></div><div class="code-line">  <span class="token comment">// A function which determines whether to share a document with a peer</span></div><div class="code-line">  sharePolicy<span class="token operator">?</span><span class="token operator">:</span> SharePolicy</div><div class="code-line"><span class="token punctuation">}</span></div></code></pre><p>Don’t let the usage of “peer” confuse you into thinking this is limited to peer to peer connectivity, <code>automerge-repo</code> works with both client-server and peer-to-peer network transports.</p>
<p>The main methods on Repo are <code>find(url)</code> and <code>create()</code>, both of which return a <code>DocHandle</code> you can work with.</p>
<h3 id="handle-and-automerge-urls"><a class="plain" href="#handle-and-automerge-urls">Handle &amp; Automerge URLs</a></h3>
<p>A <code>DocHandle</code> is a reference to an Automerge document that a <code>Repo</code> syncs and stores . The <code>Repo</code> instance saves any changes you make to the document and syncs with connected peers. Likewise, you can listen over the network to a <code>Repo</code> for any changes it received.</p>
<p>Each <code>DocHandle</code> has a <code>.url</code> property. This is a string which uniquely identifies a document in the form <code>automerge:&lt;base58 encoded bytes&gt;</code>. Once you have a URL you can use it to request the document from other peers.</p>
<h3 id="dochandle-doc-and-dochandle-docsync"><a class="plain" href="#dochandle-doc-and-dochandle-docsync"><code>DocHandle.doc()</code> and <code>DocHandle.docSync()</code></a></h3>
<p>These two methods return the current state of the document. <code>doc()</code> is an asynchronous method that resolves when a repository loads the document from storage or retrieves it from a peer (whichever happens first), and <code>docSync()</code> is a synchronous method that assumes the document is already available.
The examples below illustrate asynchronously loading a document or synchronously loading a document and then interacting with it:</p>
<pre><code class="language-typescript"><div class="code-line"><span class="token operator">></span> <span class="token keyword">const</span> handle <span class="token operator">=</span> repo<span class="token punctuation">.</span><span class="token function">find</span><span class="token punctuation">(</span><span class="token string">"automerge:2j9knpCseyhnK8izDmLpGP5WMdZQ"</span><span class="token punctuation">)</span></div><div class="code-line"><span class="token operator">></span> <span class="token keyword">const</span> doc <span class="token operator">=</span> <span class="token keyword">await</span> handle<span class="token punctuation">.</span><span class="token function">doc</span><span class="token punctuation">(</span><span class="token punctuation">)</span></div><div class="code-line"><span class="token operator">></span> <span class="token builtin">console</span><span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span>doc<span class="token punctuation">)</span></div></code></pre><p>Or</p>
<pre><code class="language-typescript"><div class="code-line"><span class="token operator">></span> <span class="token keyword">const</span> handle <span class="token operator">=</span> repo<span class="token punctuation">.</span><span class="token function">find</span><span class="token punctuation">(</span><span class="token string">"automerge:2j9knpCseyhnK8izDmLpGP5WMdZQ"</span><span class="token punctuation">)</span></div><div class="code-line"><span class="token operator">></span> handle<span class="token punctuation">.</span><span class="token function">whenReady</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">then</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">{</span></div><div class="code-line">  <span class="token builtin">console</span><span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span>handle<span class="token punctuation">.</span><span class="token function">docSync</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span></div><div class="code-line"><span class="token punctuation">}</span><span class="token punctuation">)</span></div></code></pre><p>In this latter example we use <code>DocHandle.whenReady</code>, which returns a promise that the repository resolves when it loads a document from storage or fetches it from another peer in the network.</p>
<h3 id="change-and-on-quot-change-quot"><a class="plain" href="#change-and-on-quot-change-quot"><code>change()</code> and <code>on(&quot;change&quot;)</code></a></h3>
<p>Use <code>DocHandle.change</code> when you modify a document.</p>
<pre><code class="language-typescript"><div class="code-line"><span class="token operator">></span> <span class="token keyword">const</span> handle <span class="token operator">=</span> repo<span class="token punctuation">.</span><span class="token function">find</span><span class="token punctuation">(</span><span class="token string">"automerge:2j9knpCseyhnK8izDmLpGP5WMdZQ"</span><span class="token punctuation">)</span></div><div class="code-line"><span class="token operator">></span> <span class="token keyword">await</span> handle<span class="token punctuation">.</span><span class="token function">doc</span><span class="token punctuation">(</span><span class="token punctuation">)</span></div><div class="code-line"><span class="token operator">></span> handle<span class="token punctuation">.</span><span class="token function">change</span><span class="token punctuation">(</span>d <span class="token operator">=></span> d<span class="token punctuation">.</span>foo <span class="token operator">=</span> <span class="token string">"bar"</span><span class="token punctuation">)</span></div></code></pre><p>The <code>Repo</code> calls <code>DocHandle.on(&quot;change&quot;)</code> whenever the document is modified – either due to a local change or a sync message being received from another peer.</p>
<pre><code class="language-typescript"><div class="code-line"><span class="token operator">></span> <span class="token keyword">const</span> handle <span class="token operator">=</span> repo<span class="token punctuation">.</span><span class="token function">find</span><span class="token punctuation">(</span><span class="token string">"automerge:4CkUej7mAYnaFMfVnffDipc4Mtvn"</span><span class="token punctuation">)</span></div><div class="code-line"><span class="token operator">></span> <span class="token keyword">await</span> handle<span class="token punctuation">.</span><span class="token function">doc</span><span class="token punctuation">(</span><span class="token punctuation">)</span></div><div class="code-line"><span class="token operator">></span> handle<span class="token punctuation">.</span><span class="token function">on</span><span class="token punctuation">(</span><span class="token string">"change"</span><span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token punctuation">{</span>doc<span class="token punctuation">}</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">{</span></div><div class="code-line">  <span class="token builtin">console</span><span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span><span class="token string">"document changed"</span><span class="token punctuation">)</span></div><div class="code-line">  <span class="token builtin">console</span><span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span><span class="token string">"New content: "</span><span class="token punctuation">,</span> doc<span class="token punctuation">)</span></div><div class="code-line"><span class="token punctuation">}</span><span class="token punctuation">)</span></div></code></pre><h2 id="integrations"><a class="plain" href="#integrations">Integrations</a></h2>
<p><code>automerge-repo</code> provides a set of primitives that you can use to build a wide range of applications. To make this easier, we have built integrations with a few common UI frameworks. You can easily add further integrations and we welcome contributions which integrate with popular frameworks!</p>
<h3 id="react-integration"><a class="plain" href="#react-integration">React Integration</a></h3>
<p><a href="https://www.npmjs.com/package/@automerge/automerge-repo-react-hooks"><code>@automerge/automerge-repo-react-hooks</code></a> makes it easy to use <code>automerge-repo</code> in a React application. Once you’ve constructed a <code>Repo</code> you can make it available to your React application using <a href="https://automerge.org/automerge-repo/variables/_automerge_react..RepoContext.html"><code>RepoContext</code></a>. Once available, call <code>useHandle</code> to obtain a <code>DocHandle</code>:</p>
<pre><code class="language-typescript"><div class="code-line"><span class="token keyword">function</span> <span class="token function">TodoList</span><span class="token punctuation">(</span>listUrl<span class="token operator">:</span> AutomergeUrl<span class="token punctuation">)</span> <span class="token punctuation">{</span></div><div class="code-line">    <span class="token keyword">const</span> handle <span class="token operator">=</span> <span class="token function">useHandle</span><span class="token punctuation">(</span>listUrl<span class="token punctuation">)</span></div><div class="code-line">    <span class="token comment">// render the todolist</span></div><div class="code-line"><span class="token punctuation">}</span></div></code></pre><p>Note that when <code>Repo</code> receives changes over the network or registers local changes, the original Automerge document remains immutable, and any modified parts of the document get new objects. This means that you can continue to use reference equality checks you’re used to for in-memory data, in places like <code>React.memo</code> or <code>useMemo</code>.</p>
<h3 id="svelte-integration"><a class="plain" href="#svelte-integration">Svelte Integration</a></h3>
<p><a href="https://www.npmjs.com/package/@automerge/automerge-repo-svelte-store"><code>@automerge/automerge-repo-svelte-store</code></a> provides <code>setContextRepo</code> to set the <code>Repo</code> which is used by the <code>document</code> store:</p>
<pre><code class="language-html"><div class="code-line"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>script</span> <span class="token attr-name">lang</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>ts<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token script"><span class="token language-javascript"></div><div class="code-line">  <span class="token keyword">import</span> <span class="token punctuation">{</span> document <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">"@automerge/automerge-repo-svelte-store"</span></div><div class="code-line">  <span class="token keyword">import</span> <span class="token punctuation">{</span> type AutomergeUrl <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">"@automerge/automerge-repo"</span></div><div class="code-line"> </div><div class="code-line">  <span class="token keyword">export</span> <span class="token keyword">let</span> <span class="token literal-property property">documentUrl</span><span class="token operator">:</span> AutomergeUrl</div><div class="code-line"> </div><div class="code-line">  <span class="token comment">// Doc is an Automerge store with a `change` method which accepts</span></div><div class="code-line">  <span class="token comment">// a standard Automerge change function</span></div><div class="code-line">  <span class="token keyword">const</span> doc <span class="token operator">=</span> document<span class="token operator">&lt;</span>HasCount<span class="token operator">></span><span class="token punctuation">(</span>documentUrl<span class="token punctuation">)</span></div><div class="code-line">  <span class="token keyword">const</span> <span class="token function-variable function">increment</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">{</span></div><div class="code-line">    doc<span class="token punctuation">.</span><span class="token function">change</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token parameter"><span class="token literal-property property">d</span><span class="token operator">:</span> HasCount</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">(</span>d<span class="token punctuation">.</span>count <span class="token operator">=</span> <span class="token punctuation">(</span>d<span class="token punctuation">.</span>count <span class="token operator">||</span> <span class="token number">0</span><span class="token punctuation">)</span> <span class="token operator">+</span> <span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">)</span></div><div class="code-line">  <span class="token punctuation">}</span></div><div class="code-line"></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>script</span><span class="token punctuation">></span></span></div><div class="code-line"> </div><div class="code-line"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>button</span> <span class="token attr-name"><span class="token namespace">on:</span>click</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span>{increment}</span><span class="token punctuation">></span></span></div><div class="code-line">  count is {$doc?.count || 0}</div><div class="code-line"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>button</span><span class="token punctuation">></span></span></div></code></pre><h2 id="what-about-lt-x-gt"><a class="plain" href="#what-about-lt-x-gt">What about &lt;X&gt;?</a></h2>
<p>We’d love to help you make Automerge work in your favorite development environment! Please reach out to us on GitHub or via <a href="https://join.slack.com/t/automerge/shared_invite/zt-e4p3760n-kKh7r3KRH1YwwNfiZM8ktw">our Slack</a>.</p>
<h2 id="extending-automerge-repo"><a class="plain" href="#extending-automerge-repo">Extending <code>automerge-repo</code></a></h2>
<p>You can extend <code>automerge-repo</code> by writing new storage or network adapters.</p>
<h3 id="storage-adapters"><a class="plain" href="#storage-adapters">Storage Adapters</a></h3>
<p>A storage adapter represents some kind of backend that stores the data in a repo. Storage adapters can be implemented for any key/value store that allows you to query a range of keys with a given prefix. There is no concurrency control required (that’s implemented in <code>automerge-repo</code>) so you can safely have multiple repos pointing at the same storage. For example, you could implement an adapter on top of Redis.</p>
<p>The <code>automerge-repo</code> library provides storage adapters for IndexedDB and the file system (on Node).</p>
<h3 id="network-adapters"><a class="plain" href="#network-adapters">Network Adapters</a></h3>
<p>A network adapter represents a way of connecting to other peers. Network adapters raise events when a new peer is discovered or when a message is recieved, and implement a <code>send</code> method for transmitting messages to another peer. <code>automerge-repo</code> assumes a reliable, in-order transport for each peer; as long as you can provide this (e.g. using a TCP connection), you can implement an adapter. You could implement an adapter for <a href="https://en.wikipedia.org/wiki/Bluetooth_Low_Energy">BLE</a>, for example.</p>
<p>The <code>automerge-repo</code> library provides network adapters for WebSocket, MessageChannel, and BroadcastChannel.</p>
<h3 id="other-languages-platforms"><a class="plain" href="#other-languages-platforms">Other languages/platforms</a></h3>
<p>This release of <code>automerge-repo</code> is just for JavaScript. Automerge is a multi-language library though and there are efforts under way to implement <code>automerge-repo</code> on other platforms. The most mature of these is <a href="https://github.com/automerge/automerge-repo-rs"><code>automerge-repo-rs</code></a>. We welcome contributions and please reach out if you’re starting to develop <code>automerge-repo</code> for a new platform.</p>
<h2 id="beta-quality"><a class="plain" href="#beta-quality">Beta Quality</a></h2>
<p><code>automerge-repo</code> works pretty well – we’re using it at <a href="https://www.inkandswitch.com/">Ink &amp; Switch</a> for a bunch of internal projects. The basic shape of the API is simple and useful, and not having to think about the plumbing makes it much, much faster to get a useful application off the ground. However, there are some performance problems we’re working on:</p>
<ol>
<li>Documents with large histories (e.g. a collaboratively edited document with &gt;60,000 edits) can be slow to sync.</li>
<li>The sync protocol currently requires that a document it is syncing be loaded into memory. This means that a sync server can struggle to handle a lot of traffic on large documents.</li>
</ol>
<p>These two points mean that we’re not ready to say this project is ready for production.</p>
<p>We’re working hard on fixing the performance so that we <em>can</em> say this is ready for production. But if you are interested in experimenting with the library now, or if you are only going to be working with relatively small documents or low traffic sync servers then you are good to go!</p>
<p>(If you want us to get to production faster, or you have some specific requirements, please consider <a href="https://github.com/sponsors/automerge">sponsoring</a> Automerge development 🙂)</p>
<p>Finally, we don’t want to give the impression that everything is smooth sailing. <code>automerge-repo</code> solves a bunch of the hard problems people were encountering around networking and storage. There are still plenty of other difficult problems in local first software where we don’t have turnkey solutions: authentication and authorization, end-to-end encryption, schema changes, version control workflows etc. <code>automerge-repo</code> makes many things much easier, but it’s a frontier out here.</p>]]></content:encoded>
    </item>
    <item>
      <title><![CDATA[Introducing Automerge 2.0]]></title>
      <link>https://automerge.org/blog/automerge-2/</link>
      <guid isPermaLink="true">https://automerge.org/blog/automerge-2/</guid>
      <pubDate>Tue, 17 Jan 2023 00:00:00 GMT</pubDate>
      <description><![CDATA[Automerge 2.0 is here and ready for production.]]></description>
      <content:encoded><![CDATA[<p>Automerge 2.0 is here and ready for production. It’s our first supported release resulting from a ground-up rewrite. The result is a production-ready CRDT with huge improvements in performance and reliability. It’s available in both JavaScript and Rust, and includes TypeScript types and C bindings for use in other ecosystems. Even better, Automerge 2.0 comes with improved documentation and, for the first time, support options for production users.</p>
<h2 id="automerge-crdts-and-local-first-software"><a class="plain" href="#automerge-crdts-and-local-first-software">Automerge, CRDTs, and Local-first Software</a></h2>
<p>Before getting into the details of why we’re excited about Automerge 2.0, let’s take a bit of time to explain what Automerge is for anyone unfamiliar with the project.</p>
<p>Automerge is a <a href="https://crdt.tech/">CRDT</a>, or “conflict-free replicated data type”, but if you’re allergic to buzzwords you can just think of it as a version controlled data structure. Automerge lets you record changes made to data and then replay them in other places, reliably producing the same result in each. It supports JSON-like data, including arbitrarily nested maps and arrays, as well as some more advanced data types such as text and numeric counters.</p>
<p>This is useful for quite a few reasons: you can use it to implement real-time collaboration for an application without having to figure out tricky application-specific algorithms on the server. You can also use it to better support offline work. We think it has even more potential than just that.</p>
<p>Since the rise of the cloud, developers have largely had to choose between building cloud software or traditional installed software. Although installed software has some reliability and performance benefits, cloud software has dominated the market. Cloud software makes sharing data between users easy and includes ubiquitous access from any computing device. Unfortunately, the advantages of cloud software come at a high price. Cloud software is fragile and prone to outages, rarely supports offline use, and is expensive to scale to large audiences.</p>
<p>At Ink &amp; Switch, we’ve been researching a model for developing software which we call <a href="https://www.inkandswitch.com/local-first/">local-first software</a>, with the goal of combining the best of both worlds: reliable, locally-executed software paired with scalable offline-friendly collaboration infrastructure. We believe that a strong data model based on recording change over time for every application should be a cornerstone of that effort.</p>
<h2 id="automerge-rs-rebuilt-for-performance-and-portability"><a class="plain" href="#automerge-rs-rebuilt-for-performance-and-portability">Automerge-RS: Rebuilt for Performance &amp; Portability</a></h2>
<p>Earlier versions of Automerge were implemented in pure JavaScript. Our initial implementations were theoretically sound but much too slow and used too much memory for most production use cases.</p>
<p>Furthermore, JavaScript support on mobile devices and embedded systems is limited. We wanted a fast and efficient version of Automerge that was available everywhere: in the browser, on any mobile device, and even microcontrollers like the <a href="https://en.wikipedia.org/wiki/ESP32">ESP32</a>.</p>
<p>Instead of trying to coordinate multiple distinct versions of Automerge, we decided to rewrite Automerge in Rust and use platform-specific wrappers to make it available in each language ecosystem. This way we can be confident that the core CRDT logic is identical across all platforms and that everyone benefits from new features and optimizations together.</p>
<p>For JavaScript applications, this means compiling the Rust to WebAssembly and providing a JavaScript wrapper that maintains the existing Automerge API. Rust applications can obviously use the library directly, and we’re making sure that it’s as easy as possible to implement support in other languages with well-designed traits and a comprehensive set of C bindings.</p>
<p>To deliver this new version, lab members Alex Good and Orion Henry teamed up with open source collaborators including Andrew Jeffery and Jason Kankiewicz to polish and optimize the Rust implementation and JavaScript wrapper. The result is a codebase that is hundreds of times faster than past releases, radically more memory efficient, better tested, and more reliable.</p>
<h2 id="documenting-automerge"><a class="plain" href="#documenting-automerge">Documenting Automerge</a></h2>
<p>With Automerge 2.0 we’ve made a big investment in improving documentation. In addition to <a href="https://github.com/automerge/automerge-rs/tree/main/javascript/examples">sample code</a>, we now have a <a href="/docs/tutorial/">quick-start guide</a> that supports both Vite and create-react-app, as well as <a href="/docs/how-it-works/backend/">internals</a> documentation, <a href="https://automerge.org/automerge-binary-format-spec/">file format</a> and <a href="/docs/how-it-works/sync/">sync protocol</a> documentation. This work was led by lab alumnus Rae McKelvey and we hope it helps make getting started with Automerge much easier. Please let us know if there are other topics or areas you’d like to see covered!</p>
<h2 id="supporting-automerge"><a class="plain" href="#supporting-automerge">Supporting Automerge</a></h2>
<p>Those who have been following Automerge for a while may have noticed that we describe Automerge 2.0 as our first <em>supported</em> release. That’s because as part of the Automerge 2.0 release we’ve brought Alex Good onto the team full-time to provide support to external users, handle documentation, release management, and—of course—to continue implementing new Automerge features for the community.</p>
<p>This is a big moment for Ink &amp; Switch and the Automerge project: we’re now able to provide support to our users thanks to sponsorship from enterprises like <a href="https://fly.io/">Fly.io</a>, <a href="https://www.prisma.io/">Prisma</a>, and <a href="https://bowtie.works/">Bowtie</a> as well as so many others who have contributed either directly to Automerge or through supporting Martin Kleppmann on Patreon.</p>
<p>If your business is interested in sponsoring Automerge, you can <a href="https://github.com/sponsors/automerge">sponsor us directly</a>, or <a href="mailto:hello@inkandswitch.com">get in touch with us for more information or other sponsorship methods</a>. Every little bit helps, and the more sponsors we have, the more work we can do while still remaining an independent open source project.</p>
<blockquote>
<p>At Bowtie we support Automerge because it’s the best way to achieve the resilliency properties that we’re delivering to globally distributed private networks. It’s clear to me that our sponsorship has furthered our software, and that this crew are among the best distributed-systems thinkers in the business.
– Issac Kelly, CTO, Bowtie.</p>
</blockquote>
<h2 id="performance-speed-memory-and-disk"><a class="plain" href="#performance-speed-memory-and-disk">Performance: Speed, Memory and Disk</a></h2>
<p>Using a CRDT inherently comes with overhead: we have to track additional information in order to be able to correctly merge work from different sources. The goal of all CRDT authors is to find the right trade-offs between preserving useful history, reducing CPU overhead, and efficiently storing data in memory and on disk.</p>
<p>With the Automerge project, our goal is to retain the full history of any document and allow an author to reconstruct any point in time on demand. As software developers we’re accustomed to having this power: it’s hard to imagine version control without history.</p>
<p>With Automerge 2.0, we’ve brought together an efficient binary data format with fast updates, save, and load performance. Without getting too into the details, we accomplish this by packing data efficiently in memory, ensuring that related data is stored close together for quick retrieval.</p>
<p>Let’s take a look at some numbers. One of the most challenging benchmarks for CRDTs is realtime text collaboration. That’s because a long editing session can result in hundreds of thousands of individual keystrokes to record and synchronize. Martin Kleppmann recorded the keystrokes that went into writing an academic paper and replaying that data has become a <a href="https://github.com/automerge/automerge-perf">popular benchmark</a> for CRDTs.</p>
<table>
<thead>
<tr>
<th>Insert ~260k operations</th>
<th>Timing (ms)</th>
<th>Memory (bytes)</th>
</tr>
</thead>
<tbody>
<tr>
<td>Automerge 0.14</td>
<td>~500,000</td>
<td>~1,100,000,000</td>
</tr>
<tr>
<td>Automerge 1.0.1</td>
<td>13,052</td>
<td>184,721,408</td>
</tr>
<tr>
<td>Automerge 2.0.1</td>
<td>1,816</td>
<td>44,523,520</td>
</tr>
<tr>
<td>Yjs</td>
<td>1,074</td>
<td>10,141,696</td>
</tr>
<tr>
<td>Automerge 2.0.2-unstable</td>
<td>661</td>
<td>22,953,984</td>
</tr>
</tbody>
</table>
<p>Of course, even the most productive authors struggle to type an entire paper quite so quickly. Indeed, writing a paper can occur over months or even years, making both storage size on disk and load performance important as well.</p>
<table>
<thead>
<tr>
<th>Size on Disk</th>
<th>bytes</th>
</tr>
</thead>
<tbody>
<tr>
<td>plain text</td>
<td>107,121</td>
</tr>
<tr>
<td>automerge 2.0</td>
<td>129,062</td>
</tr>
<tr>
<td>automerge 0.14</td>
<td>146,406,415</td>
</tr>
</tbody>
</table>
<p>The binary format works wonders in this example, encoding a full history for the document with only 30% overhead. That’s less than one additional byte per character! The naive JSON encoding often used circa Automerge 0.14 could exceed 1,300 bytes <em>per character</em>. If you’d like to learn more about the file format, we have a <a href="https://automerge.org/automerge-binary-format-spec/">specification</a> document.</p>
<table>
<thead>
<tr>
<th>Load ~260k operations</th>
<th>Timing (ms)</th>
</tr>
</thead>
<tbody>
<tr>
<td>Automerge 1.0.1</td>
<td>590</td>
</tr>
<tr>
<td>Automerge 2.0.1</td>
<td>593</td>
</tr>
<tr>
<td>Automerge 2.0.2-unstable</td>
<td>438</td>
</tr>
</tbody>
</table>
<p>Loading the compressed document is fast as well, ensuring the best possible start-up time.</p>
<p>While we are proud of these results, we will continue to invest in improved performance with each release as you can see with the preliminary numbers for the upcoming Automerge 2.0.2 release.</p>
<p>A few notes about methodology before we move on. The particular implementation we used to run the benchmarks can be found <a href="https://github.com/alexjg/automerge-perf-comparisons">here</a>. These numbers were produced on Ryzen 9 7900X. The “timing” column is how long it takes to apply every single edit in the trace, whilst the “memory” common is the peak memory usage during this process.</p>
<p>The improvements found in “2.0.2-unstable” mostly result from an upcoming improved API for text. Also note that the “Automerge 1.0.1” here is actually the <code>automerge@1.0.1-preview-7</code> release. Automerge 1.0.1 was a significant rewrite from 0.14 and has a similar architecture to the Rust implementation. Improvements between 1.0.1 and 2.0.1 are a result of both optimization and adopting WebAssembly rather than an architectural change.</p>
<h2 id="portability-and-mobile-devices"><a class="plain" href="#portability-and-mobile-devices">Portability &amp; Mobile Devices</a></h2>
<p>Because the core logic of Automerge is now built in Rust, we’re able to port it more easily to a wide variety of environments and bind it to almost any language. We have users today who directly build on Automerge using the Rust APIs (and the helpful <a href="https://github.com/automerge/autosurgeon">autosurgeon</a> library). We also have a <a href="https://github.com/automerge/automerge-rs/tree/main/rust/automerge-c">C-bindings API</a> designed and contributed by Jason Kankiewicz, and are excited to see the <a href="https://github.com/automerge/automerge-go"><code>automerge-go</code></a> implementation underway by Conrad Irwin.</p>
<p>In the future, we hope to provide bindings for other languages including Swift, Kotlin, and Python. If you’re interested in getting involved in those projects please let us know!</p>
<p>One important note is that React-Native does not support WASM today. Developers building mobile applications will need to bind directly via C. If you’re interested in either working on or sponsoring work on this problem, feel free to get in touch.</p>
<h1>What’s Next</h1>
<p>With the release of Automerge 2.0 out the door, we will of course be listening closely to the community about their experience with the release, but in the months ahead, we expect to work on at least some of the following features:</p>
<h2 id="native-rich-text-support"><a class="plain" href="#native-rich-text-support">Native Rich Text Support</a></h2>
<p>As with most CRDTs, Automerge originally focused on optimizing editing of plaintext. In the <a href="https://www.inkandswitch.com/peritext/">Peritext paper</a> by Ink &amp; Switch we discuss an algorithm for supporting rich text with good merging accuracy, and we are planning to integrate this algorithm into Automerge. Support for rich text will also make it easier to implement features like comments or cursor and selection sharing.</p>
<h2 id="automerge-repo"><a class="plain" href="#automerge-repo">Automerge-Repo</a></h2>
<p>We’ve worked hard to keep Automerge platform-agnostic and support a wide variety of deployment environments. We don’t require a particular network stack or storage system, and Automerge has been used successfully in, client-server web applications, peer-to-peer desktop software, and as a data synchronization engine for cloud services. Unfortunately, excluding network and storage from the library has left a lot of the busy-work up to application developers, and asked them to learn a lot about distributed systems just to get started.</p>
<p>Our new library, <a href="https://github.com/automerge/automerge-repo">Automerge-Repo</a>, is a modular batteries-included approach to building web applications with Automerge. It works both in the browser (desktop and mobile) and in Node, and supports a variety of networking and storage adapters. There are even text editor bindings for Quill and Prosemirror as well as React Hooks to make it easy to get started quickly.</p>
<p>It’s under active development, and available in beta right now. We’ll talk more about it when we announce GA, but if you’re starting a browser-based application now, it’s probably the right place to start.</p>
<h2 id="rust-developer-experience-improvements"><a class="plain" href="#rust-developer-experience-improvements">Rust Developer Experience Improvements</a></h2>
<p>We’ve seen tremendous enthusiasm for the native Rust experience of Automerge, and the current Rust API is powerful and fast. Unfortunately, it’s also low-level and can be difficult to work with directly. To make building Rust applications against Automerge easier, Alex built <a href="https://github.com/automerge/autosurgeon">Autosurgeon</a>, a library that helps bind Rust data structures to Automerge documents, and we’ll continue to listen to our Rust users and improve on that experience.</p>
<h2 id="improved-synchronization"><a class="plain" href="#improved-synchronization">Improved Synchronization</a></h2>
<p>Automerge’s current synchronization system has some great properties. In many cases it can bring two clients up to date with only a single round-trip each direction. That said, we see big potential to improve the CPU performance of this process, and also lots of opportunity to improve sync performance of many documents at once. We also expect to provide other optimizations our users and sponsors have requested, such as more efficient first-document loading, network compaction of related changes, and enabling something akin to a Git “shallow clone” for clients which don’t need historical data.</p>
<h2 id="built-in-branches"><a class="plain" href="#built-in-branches">Built-in Branches</a></h2>
<p>While we retain the full history of Automerge documents and provide APIs to access it, we don’t currently provide an efficient way to reconcile many closely related versions of a given document. This feature is particularly valuable for supporting offline collaboration in professional environments and (combined with Rich Text Support) should make it much easier for our friends in journalism organizations to build powerful and accurate editing tools.</p>
<h2 id="history-management"><a class="plain" href="#history-management">History Management</a></h2>
<p>Today the best way to remove something from an Automerge document’s history is to recreate the document from scratch or to reset to a time before that change went in. In the future, we plan to provide additional tools to give developers more control over document history. We expect this to include the ability to share just the latest version of a document (similar to a shallow clone in <code>git</code>), and to share updates that bypass changes you don’t want to share (as when a developer squashes commits before publishing).</p>
<h1>Conclusion</h1>
<p>Automerge 2.0 is here, it’s ready for you, and we’re tremendously excited to share it with you. We’ve made Automerge faster, more memory efficient, and we’re bringing it to more platforms than ever. We’re adding features, making it easier to adopt, and have begun growing a team to support it. There has never been a better moment to start building local-first software: why not <a href="/docs/hello/">give it a try</a>, and please feel welcome to <a href="https://join.slack.com/t/automerge/shared_invite/zt-e4p3760n-kKh7r3KRH1YwwNfiZM8ktw">join us in the Automerge Slack</a>, too.</p>]]></content:encoded>
    </item>
  </channel>
</rss>