Skip to content

Commit 31e5e0e

Browse files
committed
[action] Mirrored from tinybase beta branch.
1 parent 0174efb commit 31e5e0e

File tree

5 files changed

+14
-6
lines changed

5 files changed

+14
-6
lines changed

docs/guides/releases/article.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
<link rel="preload" as="image" href="/partykit.gif"><link rel="preload" as="image" href="/ui-react-dom.webp"><link rel="preload" as="image" href="/store-inspector.webp"><link rel="preload" as="image" href="/car-analysis.webp"><link rel="preload" as="image" href="/movie-database.webp"><nav><ul><li><a href="/">TinyBase</a></li><li><a href="/guides/">Guides</a></li><li><a href="/guides/releases/">Releases</a></li></ul></nav><section class="s1" id="/guides/releases/" data-id="R"><h1>Releases</h1><p>This is a reverse chronological list of the major TinyBase releases, with highlighted features.</p><hr><h2 id="v6-2">v6.2</h2><h3 id="with-schema-exports">with-schema exports</h3><p>This release changes the <code>package.json</code> exports slightly so that imports of both <code>/with-schema</code> and non-schema&#x27;d versions of the modules resolve to the same JavaScript file. This reduces bundle size for apps that use both schema and non-schema imports.</p><h3 id="new-omni-module">New <code>omni</code> module</h3><p>The new <code>omni</code> module is an explicit superset of everything in the TinyBase ecosystem. It includes all the features and functionality of the existing modules, including every persister, every UI component, and every synchronizer. This is useful for applications that want to use multiple facets of the overall TinyBase ecosystem and also benefit from the shared code they use internally.</p><p>However, it should go without saying that you should only use the <code>omni</code> module if you have a good tree-shaking bundler that can remove all the persisters, synchronizers, and so on, that you do NOT use.</p><h3 id="hlc-functions">HLC functions</h3><p>The <a href="/api/common/"><code>common</code></a> module (and hence tinybase module) now export the getHlcFunction function. This returns set of seven functions that can be used to create and manipulate HLC (Hybrid Logical Clock) timestamps. If needed, you can use these in your own systems to ensure the timestamps are compatible with the ones generated in TinyBase <a href="/api/mergeable-store/interfaces/mergeable/mergeablestore/"><code>MergeableStore</code></a> objects.</p><h3 id="move-of-the-getnow-type">Move of the <a href="/api/common/type-aliases/stamps/getnow/"><code>GetNow</code></a> type</h3><p>The rarely-used <a href="/api/common/type-aliases/stamps/getnow/"><code>GetNow</code></a> type has been moved from the <a href="/api/mergeable-store/"><code>mergeable-store</code></a> module into the <a href="/api/common/"><code>common</code></a> module.</p><h2 id="v6-1">v6.1</h2><h3 id="in-summary">In Summary</h3><ul><li><a href="#bun-sqlite">A new Persister for Bun</a>&#x27;s embedded SQLite database.</li><li><a href="#subset-persistence">Subset persistence</a> to load subsets of tables into a <a href="/api/store/interfaces/store/store/"><code>Store</code></a>.</li><li><a href="#destructured-object-arguments-for-sorted-row-ids">Destructured object arguments</a> for sorted <a href="/api/store/type-aliases/store/row/"><code>Row</code></a> <a href="/api/common/type-aliases/identity/id/"><code>Id</code></a> methods and hooks.</li><li><a href="#new-startautopersisting-method">A new startAutoPersisting method</a>.</li></ul><p>And more!</p><h3 id="bun-sqlite">Bun SQLite</h3><p>This release includes a new <a href="/api/persisters/interfaces/persister/persister/"><code>Persister</code></a> for the <a href="https://bun.sh/docs/api/sqlite">embedded SQLite database</a> available in the Bun runtime.</p><p>You use it by passing a reference to a Bun Database object into the <a href="/api/persister-sqlite-bun/functions/creation/createsqlitebunpersister/"><code>createSqliteBunPersister</code></a> function:</p><pre><code><span class="keyword">import</span> <span class="punctuation">{</span>Database<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'bun:sqlite'</span><span class="punctuation">;</span>
1+
<link rel="preload" as="image" href="/partykit.gif"><link rel="preload" as="image" href="/ui-react-dom.webp"><link rel="preload" as="image" href="/store-inspector.webp"><link rel="preload" as="image" href="/car-analysis.webp"><link rel="preload" as="image" href="/movie-database.webp"><nav><ul><li><a href="/">TinyBase</a></li><li><a href="/guides/">Guides</a></li><li><a href="/guides/releases/">Releases</a></li></ul></nav><section class="s1" id="/guides/releases/" data-id="R"><h1>Releases</h1><p>This is a reverse chronological list of the major TinyBase releases, with highlighted features.</p><hr><h2 id="v6-2">v6.2</h2><p>This release contains various packaging improvements and exposes some internal HLC functions that are useful for people building their own persisters or synchronizers.</p><h3 id="hlc-functions">HLC functions</h3><p>The <a href="/api/common/"><code>common</code></a> module (and hence tinybase module) now export the getHlcFunction function. This returns set of seven functions that can be used to create and manipulate HLC (Hybrid Logical Clock) timestamps.</p><pre><code><span class="keyword">import</span> <span class="punctuation">{</span>getHlcFunctions<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'tinybase'</span><span class="punctuation">;</span>
2+
<span class="keyword">const</span> <span class="punctuation">[</span>getNextHlc<span class="punctuation">,</span> seenHlc<span class="punctuation">,</span> encodeHlc<span class="punctuation">]</span> <span class="operator">=</span> <span class="function"><a href="/api/common/functions/stamps/gethlcfunctions/">getHlcFunctions</a></span><span class="punctuation">(</span><span class="punctuation">)</span><span class="punctuation">;</span>
3+
</code></pre><p>If needed, you can use these in your own systems to ensure the timestamps are compatible with the ones generated in TinyBase <a href="/api/mergeable-store/interfaces/mergeable/mergeablestore/"><code>MergeableStore</code></a> objects.</p><h3 id="new-omni-module">New <code>omni</code> module</h3><p>There is a new <code>omni</code> module that is an explicit superset of everything in the TinyBase ecosystem. It exports the features and functionality of every <code>tinybase/*</code> module, including every persister, every synchronizer, and every UI component. This is useful for applications that want to use multiple facets of the overall TinyBase ecosystem and also benefit from the fact they share a lot of code internally.</p><pre><code><span class="keyword">import</span> <span class="punctuation">{</span>createStore<span class="punctuation">,</span> createSqliteBunPersister<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'tinybase/omni'</span><span class="punctuation">;</span>
4+
</code></pre><p>However, it should go without saying that you should only use the <code>omni</code> module if you have a good tree-shaking bundler that can remove all the persisters, synchronizers, and so on, that you do <em>not</em> use.</p><h3 id="with-schema-exports">with-schema exports</h3><p>This release changes the <code>package.json</code> exports slightly so that imports of both <code>/with-schema</code> and non-schema&#x27;d versions of the modules resolve to the same JavaScript file. This reduces bundle size for apps that use both schema and non-schema imports.</p><h3 id="moving-the-getnow-type">Moving the <a href="/api/common/type-aliases/stamps/getnow/"><code>GetNow</code></a> type</h3><p>The rarely-used <a href="/api/common/type-aliases/stamps/getnow/"><code>GetNow</code></a> type has been moved from the <a href="/api/mergeable-store/"><code>mergeable-store</code></a> module into the <a href="/api/common/"><code>common</code></a> module.</p><h2 id="v6-1">v6.1</h2><h3 id="in-summary">In Summary</h3><ul><li><a href="#bun-sqlite">A new Persister for Bun</a>&#x27;s embedded SQLite database.</li><li><a href="#subset-persistence">Subset persistence</a> to load subsets of tables into a <a href="/api/store/interfaces/store/store/"><code>Store</code></a>.</li><li><a href="#destructured-object-arguments-for-sorted-row-ids">Destructured object arguments</a> for sorted <a href="/api/store/type-aliases/store/row/"><code>Row</code></a> <a href="/api/common/type-aliases/identity/id/"><code>Id</code></a> methods and hooks.</li><li><a href="#new-startautopersisting-method">A new startAutoPersisting method</a>.</li></ul><p>And more!</p><h3 id="bun-sqlite">Bun SQLite</h3><p>This release includes a new <a href="/api/persisters/interfaces/persister/persister/"><code>Persister</code></a> for the <a href="https://bun.sh/docs/api/sqlite">embedded SQLite database</a> available in the Bun runtime.</p><p>You use it by passing a reference to a Bun Database object into the <a href="/api/persister-sqlite-bun/functions/creation/createsqlitebunpersister/"><code>createSqliteBunPersister</code></a> function:</p><pre><code><span class="keyword">import</span> <span class="punctuation">{</span>Database<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'bun:sqlite'</span><span class="punctuation">;</span>
25
<span class="keyword">import</span> <span class="punctuation">{</span>createStore<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'tinybase'</span><span class="punctuation">;</span>
36
<span class="keyword">import</span> <span class="punctuation">{</span>createSqliteBunPersister<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'tinybase/persisters/persister-sqlite-bun'</span><span class="punctuation">;</span>
47

0 commit comments

Comments
 (0)