Skip to content

Commit 131ca1c

Browse files
committed
[opfs] Release notes
1 parent c8663a3 commit 131ca1c

File tree

2 files changed

+37
-2
lines changed

2 files changed

+37
-2
lines changed

site/guides/15_releases.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,41 @@ highlighted features.
55

66
---
77

8+
# v6.7
9+
10+
This release includes support for the Origin Private File System (OPFS) in a
11+
browser. The createOpfsPersister entry point is available in the existing
12+
persister-browser module:
13+
14+
```js
15+
import {createStore} from 'tinybase';
16+
import {createOpfsPersister} from 'tinybase/persisters/persister-browser';
17+
18+
const opfs = await navigator.storage.getDirectory();
19+
const handle = await opfs.getFileHandle('tinybase.json', {create: true});
20+
21+
const store = createStore().setTables({pets: {fido: {species: 'dog'}}});
22+
const persister = createOpfsPersister(store, handle);
23+
24+
await persister.save();
25+
// Store JSON will be saved to the OPFS file.
26+
27+
await persister.load();
28+
// Store JSON will be loaded from the OPFS file.
29+
30+
await persister.destroy();
31+
```
32+
33+
That's it! If you've used other TinyBase persisters, this API should be easy and
34+
familiar to use.
35+
36+
One caveat: observability in OPFS is not yet standardized in browsers. This
37+
means that the auto-load functionality of the persister may not work as
38+
expected, although a best effort is made using the experimental
39+
FileSystemObserverAPI, so please let us know how that works!
40+
41+
---
42+
843
# v6.6
944

1045
This release improves the Inspector tool, making it easier to debug, inspect,

site/home/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
</h2>
77
</section>
88

9-
<a href='/guides/releases/#v6-6'><em>NEW!</em> v6.6 release</a>
9+
<a href='/guides/releases/#v6-7'><em>NEW!</em> v6.7 release</a>
1010

11-
<span id="one-with">"Shiny New Inspector Tools!"</span>
11+
<span id="one-with">"The one with OPFS!"</span>
1212

1313
<a class='start' href='/guides/the-basics/getting-started/'>Get started</a>
1414

0 commit comments

Comments
 (0)