@fireproof/core 0.20.0-dev-preview-06 → 0.20.0-dev-preview-11
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +9 -9
- package/index.cjs +3221 -3166
- package/index.cjs.map +1 -1
- package/index.d.cts +241 -189
- package/index.d.ts +241 -189
- package/index.js +3211 -3156
- package/index.js.map +1 -1
- package/metafile-cjs.json +1 -1
- package/metafile-esm.json +1 -1
- package/package.json +3 -3
- package/react/index.cjs.map +1 -1
- package/react/index.js.map +1 -1
- package/tests/blockstore/loader.test.ts +6 -6
- package/tests/blockstore/transaction.test.ts +8 -8
- package/tests/fireproof/all-gateway.test.ts +7 -7
- package/tests/fireproof/crdt.test.ts +35 -45
- package/tests/fireproof/database.test.ts +34 -33
- package/tests/fireproof/fireproof.test.ts +58 -60
- package/tests/fireproof/hello.test.ts +3 -3
- package/tests/fireproof/indexer.test.ts +37 -36
- package/tests/gateway/file/loader-config.test.ts +17 -17
- package/tests/gateway/indexdb/loader-config.test.ts +5 -5
- package/tests/www/gallery.html +2 -2
- package/tests/www/todo-aws.html +1 -1
- package/tests/www/todo-ipfs.html +1 -1
- package/tests/www/todo-local.html +1 -1
- package/tests/www/todo.html +1 -1
- /package/tests/fireproof/{multiple-database.test.ts → multiple-ledger.test.ts} +0 -0
package/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# <img src="https://fireproof.storage/static/img/flame.svg" alt="Fireproof logo" width="25"> [Fireproof](https://fireproof.storage) realtime
|
1
|
+
# <img src="https://fireproof.storage/static/img/flame.svg" alt="Fireproof logo" width="25"> [Fireproof](https://fireproof.storage) realtime ledger
|
2
2
|
|
3
3
|
<p align="right">
|
4
4
|
<img src="https://img.shields.io/bundlephobia/minzip/%40fireproof%2Fcore" alt="Package size">
|
@@ -9,11 +9,11 @@
|
|
9
9
|
|
10
10
|
### No setup: write features first, access your data anywhere
|
11
11
|
|
12
|
-
Add collaboration to any app with Fireproof. Access data from JavaScript servers and edge functions. Use live queries to update your UI automatically when the
|
12
|
+
Add collaboration to any app with Fireproof. Access data from JavaScript servers and edge functions. Use live queries to update your UI automatically when the ledger changes. [Connect realtime sync](https://www.npmjs.com/package/@fireproof/connect) and those changes will sync between browsers and backend functions. Apps built this way are multi-player by default.
|
13
13
|
|
14
14
|
### JavaScript quick start
|
15
15
|
|
16
|
-
The document
|
16
|
+
The document ledger API will feel familiar. Queries use dynamic indexes, and the ledger can refresh your UI, as seen in the `db.subscribe` call below, as well as the React liveQuery hook.
|
17
17
|
|
18
18
|
```js
|
19
19
|
import { fireproof } from "@fireproof/core";
|
@@ -32,7 +32,7 @@ beyonceDoc.hitSingles += 1;
|
|
32
32
|
await db.put(beyonceDoc);
|
33
33
|
```
|
34
34
|
|
35
|
-
Jump to the docs site [for JavaScript API basics.](https://use-fireproof.com/docs/
|
35
|
+
Jump to the docs site [for JavaScript API basics.](https://use-fireproof.com/docs/ledger-api/basics)
|
36
36
|
|
37
37
|
### Live data hooks for React
|
38
38
|
|
@@ -51,7 +51,7 @@ Read the [step-by-step React tutorial](https://use-fireproof.com/docs/react-tuto
|
|
51
51
|
|
52
52
|
## Why choose Fireproof
|
53
53
|
|
54
|
-
Compared to other embedded
|
54
|
+
Compared to other embedded ledgers, Fireproof:
|
55
55
|
|
56
56
|
- is network aware, encrypted, and multi-writer safe
|
57
57
|
- is designed for real-time collaboration with CRDTs
|
@@ -60,7 +60,7 @@ Compared to other embedded databases, Fireproof:
|
|
60
60
|
|
61
61
|
Deliver interactive experiences without waiting on the backend. Fireproof runs in any cloud, browser, or edge environment, so your application can access data anywhere.
|
62
62
|
|
63
|
-
[Get the latest roadmap updates on our blog](https://fireproof.storage/blog/) or join our [Discord](https://discord.gg/cCryrNHePH) to collaborate. Read the docs to learn more about the
|
63
|
+
[Get the latest roadmap updates on our blog](https://fireproof.storage/blog/) or join our [Discord](https://discord.gg/cCryrNHePH) to collaborate. Read the docs to learn more about the ledger [architecture](https://use-fireproof.com/docs/architecture).
|
64
64
|
|
65
65
|
### Use cases
|
66
66
|
|
@@ -84,7 +84,7 @@ Get started with the React hooks:
|
|
84
84
|
npm install use-fireproof
|
85
85
|
```
|
86
86
|
|
87
|
-
or install the
|
87
|
+
or install the ledger in any JavaScript environment:
|
88
88
|
|
89
89
|
```sh
|
90
90
|
npm install @fireproof/core
|
@@ -96,7 +96,7 @@ The default build is optimized for browsers, to load the node build add `/node`:
|
|
96
96
|
import { fireproof } from "@fireproof/core/node";
|
97
97
|
```
|
98
98
|
|
99
|
-
Add the
|
99
|
+
Add the ledger to any web page via HTML script tag (global is `Fireproof`):
|
100
100
|
|
101
101
|
```html
|
102
102
|
<script src="https://cdn.jsdelivr.net/npm/@fireproof/core/dist/browser/fireproof.global.js"></script>
|
@@ -166,7 +166,7 @@ pnpm run build:doc
|
|
166
166
|
|
167
167
|
## Thanks 🙏
|
168
168
|
|
169
|
-
Fireproof is a synthesis of work done by people in the web community over the years. I couldn't even begin to name all the folks who made pivotal contributions. Without npm, React, and VS Code all this would have taken so much longer. Thanks to everyone who supported me getting into
|
169
|
+
Fireproof is a synthesis of work done by people in the web community over the years. I couldn't even begin to name all the folks who made pivotal contributions. Without npm, React, and VS Code all this would have taken so much longer. Thanks to everyone who supported me getting into ledger development via Apache CouchDB, one of the original document ledgers. The distinguishing work on immutable data-structures comes from the years of consideration [IPFS](https://ipfs.tech), [IPLD](https://ipld.io), and the [Filecoin APIs](https://docs.filecoin.io) have enjoyed.
|
170
170
|
|
171
171
|
Thanks to Alan Shaw and Mikeal Rogers without whom this project would have never got started. The core Merkle hash-tree clock is based on [Alan's Pail](https://github.com/alanshaw/pail), and you can see the repository history goes all the way back to work begun as a branch of that repo. Mikeal wrote [the prolly trees implementation](https://github.com/mikeal/prolly-trees).
|
172
172
|
|