tinybase 6.1.0-beta.3 → 6.1.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (233) hide show
  1. package/@types/persisters/index.d.ts +83 -40
  2. package/@types/persisters/persister-automerge/index.d.ts +4 -4
  3. package/@types/persisters/persister-automerge/with-schemas/index.d.ts +4 -4
  4. package/@types/persisters/persister-browser/index.d.ts +4 -4
  5. package/@types/persisters/persister-browser/with-schemas/index.d.ts +4 -4
  6. package/@types/persisters/persister-cr-sqlite-wasm/index.d.ts +3 -3
  7. package/@types/persisters/persister-cr-sqlite-wasm/with-schemas/index.d.ts +3 -3
  8. package/@types/persisters/persister-electric-sql/index.d.ts +3 -3
  9. package/@types/persisters/persister-electric-sql/with-schemas/index.d.ts +3 -3
  10. package/@types/persisters/persister-expo-sqlite/index.d.ts +3 -3
  11. package/@types/persisters/persister-expo-sqlite/with-schemas/index.d.ts +3 -3
  12. package/@types/persisters/persister-file/index.d.ts +2 -2
  13. package/@types/persisters/persister-file/with-schemas/index.d.ts +2 -2
  14. package/@types/persisters/persister-indexed-db/index.d.ts +2 -2
  15. package/@types/persisters/persister-indexed-db/with-schemas/index.d.ts +2 -2
  16. package/@types/persisters/persister-libsql/index.d.ts +3 -3
  17. package/@types/persisters/persister-libsql/with-schemas/index.d.ts +3 -3
  18. package/@types/persisters/persister-partykit-client/index.d.ts +2 -2
  19. package/@types/persisters/persister-partykit-client/with-schemas/index.d.ts +2 -2
  20. package/@types/persisters/persister-pglite/index.d.ts +3 -3
  21. package/@types/persisters/persister-pglite/with-schemas/index.d.ts +3 -3
  22. package/@types/persisters/persister-postgres/index.d.ts +3 -3
  23. package/@types/persisters/persister-postgres/with-schemas/index.d.ts +3 -3
  24. package/@types/persisters/persister-powersync/index.d.ts +3 -3
  25. package/@types/persisters/persister-powersync/with-schemas/index.d.ts +3 -3
  26. package/@types/persisters/persister-remote/index.d.ts +2 -2
  27. package/@types/persisters/persister-remote/with-schemas/index.d.ts +2 -2
  28. package/@types/persisters/persister-sqlite-bun/index.d.ts +159 -0
  29. package/@types/persisters/persister-sqlite-bun/with-schemas/index.d.ts +178 -0
  30. package/@types/persisters/persister-sqlite-wasm/index.d.ts +3 -3
  31. package/@types/persisters/persister-sqlite-wasm/with-schemas/index.d.ts +3 -3
  32. package/@types/persisters/persister-sqlite3/index.d.ts +3 -3
  33. package/@types/persisters/persister-sqlite3/with-schemas/index.d.ts +3 -3
  34. package/@types/persisters/persister-yjs/index.d.ts +4 -4
  35. package/@types/persisters/persister-yjs/with-schemas/index.d.ts +4 -4
  36. package/@types/persisters/with-schemas/index.d.ts +87 -42
  37. package/@types/synchronizers/index.d.ts +18 -16
  38. package/@types/synchronizers/synchronizer-broadcast-channel/index.d.ts +3 -3
  39. package/@types/synchronizers/synchronizer-broadcast-channel/with-schemas/index.d.ts +3 -3
  40. package/@types/synchronizers/synchronizer-local/index.d.ts +2 -2
  41. package/@types/synchronizers/synchronizer-local/with-schemas/index.d.ts +2 -2
  42. package/@types/synchronizers/synchronizer-ws-client/index.d.ts +5 -5
  43. package/@types/synchronizers/synchronizer-ws-client/with-schemas/index.d.ts +5 -5
  44. package/@types/synchronizers/synchronizer-ws-server/index.d.ts +37 -37
  45. package/@types/synchronizers/synchronizer-ws-server/with-schemas/index.d.ts +37 -37
  46. package/@types/synchronizers/synchronizer-ws-server-simple/index.d.ts +7 -7
  47. package/@types/synchronizers/synchronizer-ws-server-simple/with-schemas/index.d.ts +7 -7
  48. package/@types/synchronizers/with-schemas/index.d.ts +18 -16
  49. package/@types/ui-react/index.d.ts +2 -2
  50. package/@types/ui-react/with-schemas/index.d.ts +2 -2
  51. package/index.js +23 -17
  52. package/mergeable-store/index.js +23 -17
  53. package/mergeable-store/with-schemas/index.js +23 -17
  54. package/min/index.js +1 -1
  55. package/min/index.js.gz +0 -0
  56. package/min/mergeable-store/index.js +1 -1
  57. package/min/mergeable-store/index.js.gz +0 -0
  58. package/min/mergeable-store/with-schemas/index.js +1 -1
  59. package/min/mergeable-store/with-schemas/index.js.gz +0 -0
  60. package/min/persisters/index.js +1 -1
  61. package/min/persisters/index.js.gz +0 -0
  62. package/min/persisters/persister-automerge/index.js +1 -1
  63. package/min/persisters/persister-automerge/index.js.gz +0 -0
  64. package/min/persisters/persister-automerge/with-schemas/index.js +1 -1
  65. package/min/persisters/persister-automerge/with-schemas/index.js.gz +0 -0
  66. package/min/persisters/persister-browser/index.js +1 -1
  67. package/min/persisters/persister-browser/index.js.gz +0 -0
  68. package/min/persisters/persister-browser/with-schemas/index.js +1 -1
  69. package/min/persisters/persister-browser/with-schemas/index.js.gz +0 -0
  70. package/min/persisters/persister-cr-sqlite-wasm/index.js +1 -1
  71. package/min/persisters/persister-cr-sqlite-wasm/index.js.gz +0 -0
  72. package/min/persisters/persister-cr-sqlite-wasm/with-schemas/index.js +1 -1
  73. package/min/persisters/persister-cr-sqlite-wasm/with-schemas/index.js.gz +0 -0
  74. package/min/persisters/persister-durable-object-storage/index.js +1 -1
  75. package/min/persisters/persister-durable-object-storage/index.js.gz +0 -0
  76. package/min/persisters/persister-durable-object-storage/with-schemas/index.js +1 -1
  77. package/min/persisters/persister-durable-object-storage/with-schemas/index.js.gz +0 -0
  78. package/min/persisters/persister-electric-sql/index.js +1 -1
  79. package/min/persisters/persister-electric-sql/index.js.gz +0 -0
  80. package/min/persisters/persister-electric-sql/with-schemas/index.js +1 -1
  81. package/min/persisters/persister-electric-sql/with-schemas/index.js.gz +0 -0
  82. package/min/persisters/persister-expo-sqlite/index.js +1 -1
  83. package/min/persisters/persister-expo-sqlite/index.js.gz +0 -0
  84. package/min/persisters/persister-expo-sqlite/with-schemas/index.js +1 -1
  85. package/min/persisters/persister-expo-sqlite/with-schemas/index.js.gz +0 -0
  86. package/min/persisters/persister-file/index.js +1 -1
  87. package/min/persisters/persister-file/index.js.gz +0 -0
  88. package/min/persisters/persister-file/with-schemas/index.js +1 -1
  89. package/min/persisters/persister-file/with-schemas/index.js.gz +0 -0
  90. package/min/persisters/persister-indexed-db/index.js +1 -1
  91. package/min/persisters/persister-indexed-db/index.js.gz +0 -0
  92. package/min/persisters/persister-indexed-db/with-schemas/index.js +1 -1
  93. package/min/persisters/persister-indexed-db/with-schemas/index.js.gz +0 -0
  94. package/min/persisters/persister-libsql/index.js +1 -1
  95. package/min/persisters/persister-libsql/index.js.gz +0 -0
  96. package/min/persisters/persister-libsql/with-schemas/index.js +1 -1
  97. package/min/persisters/persister-libsql/with-schemas/index.js.gz +0 -0
  98. package/min/persisters/persister-partykit-client/index.js +1 -1
  99. package/min/persisters/persister-partykit-client/index.js.gz +0 -0
  100. package/min/persisters/persister-partykit-client/with-schemas/index.js +1 -1
  101. package/min/persisters/persister-partykit-client/with-schemas/index.js.gz +0 -0
  102. package/min/persisters/persister-pglite/index.js +1 -1
  103. package/min/persisters/persister-pglite/index.js.gz +0 -0
  104. package/min/persisters/persister-pglite/with-schemas/index.js +1 -1
  105. package/min/persisters/persister-pglite/with-schemas/index.js.gz +0 -0
  106. package/min/persisters/persister-postgres/index.js +1 -1
  107. package/min/persisters/persister-postgres/index.js.gz +0 -0
  108. package/min/persisters/persister-postgres/with-schemas/index.js +1 -1
  109. package/min/persisters/persister-postgres/with-schemas/index.js.gz +0 -0
  110. package/min/persisters/persister-powersync/index.js +1 -1
  111. package/min/persisters/persister-powersync/index.js.gz +0 -0
  112. package/min/persisters/persister-powersync/with-schemas/index.js +1 -1
  113. package/min/persisters/persister-powersync/with-schemas/index.js.gz +0 -0
  114. package/min/persisters/persister-remote/index.js +1 -1
  115. package/min/persisters/persister-remote/index.js.gz +0 -0
  116. package/min/persisters/persister-remote/with-schemas/index.js +1 -1
  117. package/min/persisters/persister-remote/with-schemas/index.js.gz +0 -0
  118. package/min/persisters/persister-sqlite-bun/index.js +1 -0
  119. package/min/persisters/persister-sqlite-bun/index.js.gz +0 -0
  120. package/min/persisters/persister-sqlite-bun/with-schemas/index.js +1 -0
  121. package/min/persisters/persister-sqlite-bun/with-schemas/index.js.gz +0 -0
  122. package/min/persisters/persister-sqlite-wasm/index.js +1 -1
  123. package/min/persisters/persister-sqlite-wasm/index.js.gz +0 -0
  124. package/min/persisters/persister-sqlite-wasm/with-schemas/index.js +1 -1
  125. package/min/persisters/persister-sqlite-wasm/with-schemas/index.js.gz +0 -0
  126. package/min/persisters/persister-sqlite3/index.js +1 -1
  127. package/min/persisters/persister-sqlite3/index.js.gz +0 -0
  128. package/min/persisters/persister-sqlite3/with-schemas/index.js +1 -1
  129. package/min/persisters/persister-sqlite3/with-schemas/index.js.gz +0 -0
  130. package/min/persisters/persister-yjs/index.js +1 -1
  131. package/min/persisters/persister-yjs/index.js.gz +0 -0
  132. package/min/persisters/persister-yjs/with-schemas/index.js +1 -1
  133. package/min/persisters/persister-yjs/with-schemas/index.js.gz +0 -0
  134. package/min/persisters/with-schemas/index.js +1 -1
  135. package/min/persisters/with-schemas/index.js.gz +0 -0
  136. package/min/store/index.js +1 -1
  137. package/min/store/index.js.gz +0 -0
  138. package/min/store/with-schemas/index.js +1 -1
  139. package/min/store/with-schemas/index.js.gz +0 -0
  140. package/min/synchronizers/index.js +1 -1
  141. package/min/synchronizers/index.js.gz +0 -0
  142. package/min/synchronizers/synchronizer-broadcast-channel/index.js +1 -1
  143. package/min/synchronizers/synchronizer-broadcast-channel/index.js.gz +0 -0
  144. package/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +1 -1
  145. package/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js.gz +0 -0
  146. package/min/synchronizers/synchronizer-local/index.js +1 -1
  147. package/min/synchronizers/synchronizer-local/index.js.gz +0 -0
  148. package/min/synchronizers/synchronizer-local/with-schemas/index.js +1 -1
  149. package/min/synchronizers/synchronizer-local/with-schemas/index.js.gz +0 -0
  150. package/min/synchronizers/synchronizer-ws-client/index.js +1 -1
  151. package/min/synchronizers/synchronizer-ws-client/index.js.gz +0 -0
  152. package/min/synchronizers/synchronizer-ws-client/with-schemas/index.js +1 -1
  153. package/min/synchronizers/synchronizer-ws-client/with-schemas/index.js.gz +0 -0
  154. package/min/synchronizers/synchronizer-ws-server/index.js +1 -1
  155. package/min/synchronizers/synchronizer-ws-server/index.js.gz +0 -0
  156. package/min/synchronizers/synchronizer-ws-server/with-schemas/index.js +1 -1
  157. package/min/synchronizers/synchronizer-ws-server/with-schemas/index.js.gz +0 -0
  158. package/min/synchronizers/synchronizer-ws-server-durable-object/index.js +1 -1
  159. package/min/synchronizers/synchronizer-ws-server-durable-object/index.js.gz +0 -0
  160. package/min/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js +1 -1
  161. package/min/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js.gz +0 -0
  162. package/min/synchronizers/synchronizer-ws-server-simple/index.js +1 -1
  163. package/min/synchronizers/synchronizer-ws-server-simple/index.js.gz +0 -0
  164. package/min/synchronizers/synchronizer-ws-server-simple/with-schemas/index.js +1 -1
  165. package/min/synchronizers/synchronizer-ws-server-simple/with-schemas/index.js.gz +0 -0
  166. package/min/synchronizers/with-schemas/index.js +1 -1
  167. package/min/synchronizers/with-schemas/index.js.gz +0 -0
  168. package/min/ui-react-inspector/index.js +1 -1
  169. package/min/ui-react-inspector/index.js.gz +0 -0
  170. package/min/ui-react-inspector/with-schemas/index.js +1 -1
  171. package/min/ui-react-inspector/with-schemas/index.js.gz +0 -0
  172. package/min/with-schemas/index.js +1 -1
  173. package/min/with-schemas/index.js.gz +0 -0
  174. package/package.json +46 -6
  175. package/persisters/index.js +293 -161
  176. package/persisters/persister-automerge/index.js +55 -50
  177. package/persisters/persister-automerge/with-schemas/index.js +55 -50
  178. package/persisters/persister-browser/index.js +56 -55
  179. package/persisters/persister-browser/with-schemas/index.js +56 -55
  180. package/persisters/persister-cr-sqlite-wasm/index.js +181 -134
  181. package/persisters/persister-cr-sqlite-wasm/with-schemas/index.js +181 -134
  182. package/persisters/persister-durable-object-storage/index.js +58 -53
  183. package/persisters/persister-durable-object-storage/with-schemas/index.js +58 -53
  184. package/persisters/persister-electric-sql/index.js +181 -134
  185. package/persisters/persister-electric-sql/with-schemas/index.js +181 -134
  186. package/persisters/persister-expo-sqlite/index.js +181 -134
  187. package/persisters/persister-expo-sqlite/with-schemas/index.js +181 -134
  188. package/persisters/persister-file/index.js +55 -50
  189. package/persisters/persister-file/with-schemas/index.js +55 -50
  190. package/persisters/persister-indexed-db/index.js +82 -78
  191. package/persisters/persister-indexed-db/with-schemas/index.js +82 -78
  192. package/persisters/persister-libsql/index.js +182 -135
  193. package/persisters/persister-libsql/with-schemas/index.js +182 -135
  194. package/persisters/persister-partykit-client/index.js +56 -51
  195. package/persisters/persister-partykit-client/with-schemas/index.js +56 -51
  196. package/persisters/persister-pglite/index.js +299 -173
  197. package/persisters/persister-pglite/with-schemas/index.js +299 -173
  198. package/persisters/persister-postgres/index.js +296 -171
  199. package/persisters/persister-postgres/with-schemas/index.js +296 -171
  200. package/persisters/persister-powersync/index.js +189 -138
  201. package/persisters/persister-powersync/with-schemas/index.js +189 -138
  202. package/persisters/persister-remote/index.js +55 -50
  203. package/persisters/persister-remote/with-schemas/index.js +55 -50
  204. package/persisters/persister-sqlite-bun/index.js +1171 -0
  205. package/persisters/persister-sqlite-bun/with-schemas/index.js +1171 -0
  206. package/persisters/persister-sqlite-wasm/index.js +182 -135
  207. package/persisters/persister-sqlite-wasm/with-schemas/index.js +182 -135
  208. package/persisters/persister-sqlite3/index.js +181 -134
  209. package/persisters/persister-sqlite3/with-schemas/index.js +181 -134
  210. package/persisters/persister-yjs/index.js +55 -50
  211. package/persisters/persister-yjs/with-schemas/index.js +55 -50
  212. package/persisters/with-schemas/index.js +293 -161
  213. package/readme.md +2 -2
  214. package/releases.md +29 -1
  215. package/store/index.js +20 -15
  216. package/store/with-schemas/index.js +20 -15
  217. package/synchronizers/index.js +68 -63
  218. package/synchronizers/synchronizer-broadcast-channel/index.js +68 -63
  219. package/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +68 -63
  220. package/synchronizers/synchronizer-local/index.js +68 -63
  221. package/synchronizers/synchronizer-local/with-schemas/index.js +68 -63
  222. package/synchronizers/synchronizer-ws-client/index.js +68 -63
  223. package/synchronizers/synchronizer-ws-client/with-schemas/index.js +68 -63
  224. package/synchronizers/synchronizer-ws-server/index.js +79 -70
  225. package/synchronizers/synchronizer-ws-server/with-schemas/index.js +79 -70
  226. package/synchronizers/synchronizer-ws-server-durable-object/index.js +69 -51
  227. package/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js +69 -51
  228. package/synchronizers/synchronizer-ws-server-simple/index.js +1 -1
  229. package/synchronizers/synchronizer-ws-server-simple/with-schemas/index.js +1 -1
  230. package/synchronizers/with-schemas/index.js +68 -63
  231. package/ui-react-inspector/index.js +68 -60
  232. package/ui-react-inspector/with-schemas/index.js +68 -60
  233. package/with-schemas/index.js +23 -17
package/readme.md CHANGED
@@ -1,4 +1,4 @@
1
- <link rel="preload" as="image" href="https://beta.tinybase.org/react.svg?asImg"><link rel="preload" as="image" href="https://beta.tinybase.org/indexeddb.svg?asImg"><link rel="preload" as="image" href="https://beta.tinybase.org/postgresql.svg?asImg"><link rel="preload" as="image" href="https://beta.tinybase.org/pglite.svg?asImg"><link rel="preload" as="image" href="https://beta.tinybase.org/sqlite.svg?asImg"><link rel="preload" as="image" href="https://beta.tinybase.org/expo.svg?asImg"><link rel="preload" as="image" href="https://beta.tinybase.org/cloudflare.svg?asImg"><link rel="preload" as="image" href="https://beta.tinybase.org/electric.svg?asImg"><link rel="preload" as="image" href="https://beta.tinybase.org/turso.svg?asImg"><link rel="preload" as="image" href="https://beta.tinybase.org/powersync.svg?asImg"><link rel="preload" as="image" href="https://beta.tinybase.org/partykit.svg?asImg"><link rel="preload" as="image" href="https://beta.tinybase.org/yjs.svg?asImg"><link rel="preload" as="image" href="https://beta.tinybase.org/crsqlite.png"><link rel="preload" as="image" href="https://beta.tinybase.org/automerge.svg?asImg"><link rel="preload" as="image" href="https://img.shields.io/github/stars/tinyplex/tinybase?style=for-the-badge&amp;logo=GitHub&amp;logoColor=%23fff&amp;label=GitHub&amp;labelColor=%23d81b60&amp;color=%23333"><link rel="preload" as="image" href="https://img.shields.io/badge/Bluesky-Follow-blue?style=for-the-badge&amp;logo=bluesky&amp;logoColor=%23fff&amp;color=%23333&amp;labelColor=%230285FF"><link rel="preload" as="image" href="https://img.shields.io/badge/%2F%20Twitter-Follow-blue?style=for-the-badge&amp;logo=x&amp;logoColor=%23fff&amp;color=%23333&amp;labelColor=%23000"><link rel="preload" as="image" href="https://img.shields.io/discord/1027918215323590676?style=for-the-badge&amp;logo=discord&amp;logoColor=%23fff&amp;label=Discord&amp;labelColor=%233131e8&amp;color=%23333"><link rel="preload" as="image" href="https://img.shields.io/github/discussions/tinyplex/tinybase?style=for-the-badge&amp;logo=GitHub&amp;logoColor=%23fff&amp;label=Ideas&amp;labelColor=%23d81b60&amp;color=%23333"><link rel="preload" as="image" href="https://img.shields.io/github/issues/tinyplex/tinybase?style=for-the-badge&amp;logo=GitHub&amp;logoColor=%23fff&amp;label=Issues&amp;labelColor=%23d81b60&amp;color=%23333"><link rel="preload" as="image" href="https://img.shields.io/badge/Tests-100%25-green?style=for-the-badge&amp;logo=jest&amp;logoColor=%23fff&amp;color=%23333&amp;labelColor=%2387c305"><link rel="preload" as="image" href="https://img.shields.io/npm/v/tinybase?style=for-the-badge&amp;logo=npm&amp;logoColor=%23fff&amp;labelColor=%23bd0005&amp;color=%23333"><link rel="preload" as="image" href="https://beta.tinybase.org/ui-react-dom.webp"><link rel="preload" as="image" href="https://beta.tinybase.org/store-inspector.webp"><link rel="preload" as="image" href="https://github.com/cpojer.png?size=48"><link rel="preload" as="image" href="https://github.com/expo.png?size=48"><link rel="preload" as="image" href="https://github.com/beekeeb.png?size=48"><link rel="preload" as="image" href="https://github.com/cancelself.png?size=48"><link rel="preload" as="image" href="https://github.com/WonderPanda.png?size=48"><link rel="preload" as="image" href="https://github.com/arpitBhalla.png?size=48"><link rel="preload" as="image" href="https://github.com/behrends.png?size=48"><link rel="preload" as="image" href="https://github.com/betomoedano.png?size=48"><link rel="preload" as="image" href="https://github.com/brentvatne.png?size=48"><link rel="preload" as="image" href="https://github.com/byCedric.png?size=48"><link rel="preload" as="image" href="https://github.com/circadian-risk.png?size=48"><link rel="preload" as="image" href="https://github.com/cubecull.png?size=48"><link rel="preload" as="image" href="https://github.com/erwinkn.png?size=48"><link rel="preload" as="image" href="https://github.com/ezra-en.png?size=48"><link rel="preload" as="image" href="https://github.com/feychenie.png?size=48"><link rel="preload" as="image" href="https://github.com/flaming-codes.png?size=48"><link rel="preload" as="image" href="https://github.com/fostertheweb.png?size=48"><link rel="preload" as="image" href="https://github.com/Giulio987.png?size=48"><link rel="preload" as="image" href="https://github.com/hi-ogawa.png?size=48"><link rel="preload" as="image" href="https://github.com/itsdevcoffee.png?size=48"><link rel="preload" as="image" href="https://github.com/jbolda.png?size=48"><link rel="preload" as="image" href="https://github.com/Kayoo-asso.png?size=48"><link rel="preload" as="image" href="https://github.com/kotofurumiya.png?size=48"><link rel="preload" as="image" href="https://github.com/Kudo.png?size=48"><link rel="preload" as="image" href="https://github.com/learn-anything.png?size=48"><link rel="preload" as="image" href="https://github.com/lluc.png?size=48"><link rel="preload" as="image" href="https://github.com/marksteve.png?size=48"><link rel="preload" as="image" href="https://github.com/miking-the-viking.png?size=48"><link rel="preload" as="image" href="https://github.com/mjamesderocher.png?size=48"><link rel="preload" as="image" href="https://github.com/mouktardev.png?size=48"><link rel="preload" as="image" href="https://github.com/nickmessing.png?size=48"><link rel="preload" as="image" href="https://github.com/nikitavoloboev.png?size=48"><link rel="preload" as="image" href="https://github.com/nkzw-tech.png?size=48"><link rel="preload" as="image" href="https://github.com/palerdot.png?size=48"><link rel="preload" as="image" href="https://github.com/PorcoRosso85.png?size=48"><link rel="preload" as="image" href="https://github.com/primodiumxyz.png?size=48"><link rel="preload" as="image" href="https://github.com/shaneosullivan.png?size=48"><link rel="preload" as="image" href="https://github.com/sudo-self.png?size=48"><link rel="preload" as="image" href="https://github.com/SuperSonicHub1.png?size=48"><link rel="preload" as="image" href="https://github.com/threepointone.png?size=48"><link rel="preload" as="image" href="https://github.com/uptonking.png?size=48"><link rel="preload" as="image" href="https://github.com/ViktorZhurbin.png?size=48"><link rel="preload" as="image" href="https://github.com/wilkerlucio.png?size=48"><link rel="preload" as="image" href="https://tinybase.org/favicon.svg?asImg"><link rel="preload" as="image" href="https://tinywidgets.org/favicon.svg?asImg"><link rel="preload" as="image" href="https://tinytick.org/favicon.svg?asImg"><link rel="preload" as="image" href="https://beta.tinybase.org/youtube.webp"><section id="hero"><h2 id="a-reactive-data-store-sync-engine">A <em>reactive</em> data store <span>&amp; <em>sync</em> engine</span>.</h2></section><p><a href="https://beta.tinybase.org/guides/releases/#v6-0"><em>NEW!</em> v6.0 release</a></p><p><span id="one-with">&quot;The One With React 19!&quot;</span></p><p><a class="start" href="https://beta.tinybase.org/guides/the-basics/getting-started/">Get started</a></p><p><a href="https://beta.tinybase.org/demos/">Try the demos</a></p><p><a href="https://beta.tinybase.org/api/store/interfaces/store/store/">Read the docs</a></p><hr><section><h2 id="it-s-reactive">It&#x27;s <em>Reactive</em></h2><p>TinyBase lets you <a href="#register-granular-listeners">listen to changes</a> made to any part of your data. This means your app will be fast, since you only spend rendering cycles on things that change. The optional <a href="#call-hooks-to-bind-to-data">bindings to React</a> and <a href="#pre-built-reactive-components">pre-built components</a> let you easily build fully reactive UIs on top of TinyBase. You even get a built-in <a href="#set-checkpoints-for-an-undo-stack">undo stack</a>, and <a href="#an-inspector-for-your-data">developer tools</a>!</p></section><section><h2 id="it-s-database-like">It&#x27;s <em>Database-Like</em></h2><p>Consumer app? Enterprise app? Or even a game? Model <a href="#start-with-a-simple-key-value-store">key-value data</a> and <a href="#level-up-to-use-tabular-data">tabular data</a> with optional typed <a href="#apply-schemas-to-tables-values">schematization</a>, whatever its data structures. There are built-in <a href="#create-indexes-for-fast-lookups">indexing</a>, <a href="#define-metrics-and-aggregations">metric aggregation</a>, and tabular <a href="#model-table-relationships">relationships</a> APIs - and a powerful <a href="#build-complex-queries-with-tinyql">query engine</a> to select, join, filter, and group data (reactively!) without SQL.</p></section><section><h2 id="it-synchronizes">It <em>Synchronizes</em></h2><p>TinyBase has <a href="#synchronize-between-devices">native CRDT</a> support, meaning that you can deterministically <a href="https://beta.tinybase.org/guides/synchronization/">synchronize</a> and merge data across multiple sources, clients, and servers. And although TinyBase is an in-memory data store, you can easily <a href="#persist-to-storage-databases-more">persist</a> your data to file, <a href="https://beta.tinybase.org/api/persister-browser">browser storage</a>, <a href="https://beta.tinybase.org/api/persister-indexed-db">IndexedDB</a>, <a href="https://beta.tinybase.org/guides/persistence/database-persistence/">SQLite or PostgreSQL databases</a>, and <a href="https://beta.tinybase.org/guides/persistence/third-party-crdt-persistence/">more</a>.</p></section><section><h2 id="it-s-built-for-a-local-first-world">It&#x27;s Built For A <em>Local-First</em> World</h2><p>TinyBase works anywhere that JavaScript does, but it&#x27;s especially great for local-first apps: where data is stored locally on the user&#x27;s device and that can be run offline. It&#x27;s tiny by name, tiny by nature: just <a href="#did-we-say-tiny">5.3kB - 11.5kB</a> and with no dependencies - yet <a href="#well-tested-and-documented">100% tested</a>, <a href="https://beta.tinybase.org/guides/the-basics/getting-started/">fully documented</a>, and of course, <a href="https://github.com/tinyplex/tinybase">open source</a>!</p></section><hr><section id="friends"><h2 id="tinybase-works-great-on-its-own-but-also-plays-well-with-friends">TinyBase works great on its own, but also plays well with friends.</h2><div><a href="https://beta.tinybase.org/guides/building-uis/getting-started-with-ui-react"><img src="https://beta.tinybase.org/react.svg?asImg" width="48"> React</a></div><div><a href="https://beta.tinybase.org/api/persister-indexed-db/functions/creation/createindexeddbpersister"><img src="https://beta.tinybase.org/indexeddb.svg?asImg" width="48"> IndexedDB</a></div><div><a href="https://beta.tinybase.org/guides/schemas-and-persistence/database-persistence"><img src="https://beta.tinybase.org/postgresql.svg?asImg" width="48"> PostgreSQL</a></div><div><a href="https://beta.tinybase.org/guides/schemas-and-persistence/database-persistence"><img src="https://beta.tinybase.org/pglite.svg?asImg" width="48"> PGlite</a></div><div><a href="https://beta.tinybase.org/guides/schemas-and-persistence/database-persistence"><img src="https://beta.tinybase.org/sqlite.svg?asImg" width="48"> SQLite</a></div><div><a href="https://beta.tinybase.org/guides/schemas-and-persistence/database-persistence"><img src="https://beta.tinybase.org/expo.svg?asImg" width="48"> Expo SQLite</a></div><div><a href="https://beta.tinybase.org/guides/integrations/cloudflare-durable-objects"><img src="https://beta.tinybase.org/cloudflare.svg?asImg" width="48"> Cloudflare</a></div><div><a href="https://beta.tinybase.org/guides/schemas-and-persistence/database-persistence"><img src="https://beta.tinybase.org/electric.svg?asImg" width="48"> ElectricSQL</a></div><div><a href="https://beta.tinybase.org/guides/schemas-and-persistence/database-persistence"><img src="https://beta.tinybase.org/turso.svg?asImg" width="48"> Turso</a></div><div><a href="https://beta.tinybase.org/guides/schemas-and-persistence/database-persistence"><img src="https://beta.tinybase.org/powersync.svg?asImg" width="48"> PowerSync</a></div><div><a href="https://beta.tinybase.org/api/persister-partykit-client"><img src="https://beta.tinybase.org/partykit.svg?asImg" width="48"> PartyKit</a></div><div><a href="https://beta.tinybase.org/api/persister-yjs/functions/creation/createyjspersister"><img src="https://beta.tinybase.org/yjs.svg?asImg" width="48"> YJS</a></div><div><a href="https://beta.tinybase.org/api/persister-cr-sqlite-wasm"><img src="https://beta.tinybase.org/crsqlite.png" width="48"> CR-SQLite</a></div><div><a href="https://beta.tinybase.org/api/persister-automerge"><img src="https://beta.tinybase.org/automerge.svg?asImg" width="48"> Automerge</a></div><p>(Baffled by all these logos? Check out our <a href="https://beta.tinybase.org/guides/the-basics/architectural-options">architectural options</a> guide to make sense of it all!)</p></section><hr><section id="follow"><a href="https://github.com/tinyplex/tinybase" target="_blank"><img src="https://img.shields.io/github/stars/tinyplex/tinybase?style=for-the-badge&amp;logo=GitHub&amp;logoColor=%23fff&amp;label=GitHub&amp;labelColor=%23d81b60&amp;color=%23333"> </a><a href="https://bsky.app/profile/tinybase.bsky.social"><img src="https://img.shields.io/badge/Bluesky-Follow-blue?style=for-the-badge&amp;logo=bluesky&amp;logoColor=%23fff&amp;color=%23333&amp;labelColor=%230285FF"> </a><a href="https://x.com/tinybasejs" target="_blank"><img src="https://img.shields.io/badge/%2F%20Twitter-Follow-blue?style=for-the-badge&amp;logo=x&amp;logoColor=%23fff&amp;color=%23333&amp;labelColor=%23000"> </a><a href="https://discord.com/invite/mGz3mevwP8" target="_blank"><img src="https://img.shields.io/discord/1027918215323590676?style=for-the-badge&amp;logo=discord&amp;logoColor=%23fff&amp;label=Discord&amp;labelColor=%233131e8&amp;color=%23333"></a><br><a href="https://github.com/tinyplex/tinybase/discussions" target="_blank"><img src="https://img.shields.io/github/discussions/tinyplex/tinybase?style=for-the-badge&amp;logo=GitHub&amp;logoColor=%23fff&amp;label=Ideas&amp;labelColor=%23d81b60&amp;color=%23333"> </a><a href="https://github.com/tinyplex/tinybase/issues" target="_blank"><img src="https://img.shields.io/github/issues/tinyplex/tinybase?style=for-the-badge&amp;logo=GitHub&amp;logoColor=%23fff&amp;label=Issues&amp;labelColor=%23d81b60&amp;color=%23333"> </a><a href="#well-tested-and-documented"><img src="https://img.shields.io/badge/Tests-100%25-green?style=for-the-badge&amp;logo=jest&amp;logoColor=%23fff&amp;color=%23333&amp;labelColor=%2387c305"> </a><a href="https://www.npmjs.com/package/tinybase/v/6.1.0-beta.2" target="_blank"><img src="https://img.shields.io/npm/v/tinybase?style=for-the-badge&amp;logo=npm&amp;logoColor=%23fff&amp;labelColor=%23bd0005&amp;color=%23333"></a></section><hr><section><h2 id="start-with-a-simple-key-value-store">Start with a simple key-value store.</h2><p>Creating a <a href="https://beta.tinybase.org/api/store/interfaces/store/store/"><code>Store</code></a> requires just a simple call to the <a href="https://beta.tinybase.org/api/store/functions/creation/createstore/"><code>createStore</code></a> function. Once you have one, you can easily set <a href="https://beta.tinybase.org/api/store/type-aliases/store/values/"><code>Values</code></a> in it by unique <a href="https://beta.tinybase.org/api/common/type-aliases/identity/id/"><code>Id</code></a>. And of course you can easily get them back out again.</p><p>Read more about using keyed value data in <a href="https://beta.tinybase.org/guides/the-basics/">The Basics</a> guide.</p></section>
1
+ <link rel="preload" as="image" href="https://beta.tinybase.org/react.svg?asImg"><link rel="preload" as="image" href="https://beta.tinybase.org/indexeddb.svg?asImg"><link rel="preload" as="image" href="https://beta.tinybase.org/cloudflare.svg?asImg"><link rel="preload" as="image" href="https://beta.tinybase.org/postgresql.svg?asImg"><link rel="preload" as="image" href="https://beta.tinybase.org/pglite.svg?asImg"><link rel="preload" as="image" href="https://beta.tinybase.org/sqlite.svg?asImg"><link rel="preload" as="image" href="https://beta.tinybase.org/bun.svg?asImg"><link rel="preload" as="image" href="https://beta.tinybase.org/expo.svg?asImg"><link rel="preload" as="image" href="https://beta.tinybase.org/electric.svg?asImg"><link rel="preload" as="image" href="https://beta.tinybase.org/turso.svg?asImg"><link rel="preload" as="image" href="https://beta.tinybase.org/powersync.svg?asImg"><link rel="preload" as="image" href="https://beta.tinybase.org/partykit.svg?asImg"><link rel="preload" as="image" href="https://beta.tinybase.org/yjs.svg?asImg"><link rel="preload" as="image" href="https://beta.tinybase.org/crsqlite.png"><link rel="preload" as="image" href="https://beta.tinybase.org/automerge.svg?asImg"><link rel="preload" as="image" href="https://img.shields.io/github/stars/tinyplex/tinybase?style=for-the-badge&amp;logo=GitHub&amp;logoColor=%23fff&amp;label=GitHub&amp;labelColor=%23d81b60&amp;color=%23333"><link rel="preload" as="image" href="https://img.shields.io/badge/Bluesky-Follow-blue?style=for-the-badge&amp;logo=bluesky&amp;logoColor=%23fff&amp;color=%23333&amp;labelColor=%230285FF"><link rel="preload" as="image" href="https://img.shields.io/badge/%2F%20Twitter-Follow-blue?style=for-the-badge&amp;logo=x&amp;logoColor=%23fff&amp;color=%23333&amp;labelColor=%23000"><link rel="preload" as="image" href="https://img.shields.io/discord/1027918215323590676?style=for-the-badge&amp;logo=discord&amp;logoColor=%23fff&amp;label=Discord&amp;labelColor=%233131e8&amp;color=%23333"><link rel="preload" as="image" href="https://img.shields.io/github/discussions/tinyplex/tinybase?style=for-the-badge&amp;logo=GitHub&amp;logoColor=%23fff&amp;label=Ideas&amp;labelColor=%23d81b60&amp;color=%23333"><link rel="preload" as="image" href="https://img.shields.io/github/issues/tinyplex/tinybase?style=for-the-badge&amp;logo=GitHub&amp;logoColor=%23fff&amp;label=Issues&amp;labelColor=%23d81b60&amp;color=%23333"><link rel="preload" as="image" href="https://img.shields.io/badge/Tests-100%25-green?style=for-the-badge&amp;logo=jest&amp;logoColor=%23fff&amp;color=%23333&amp;labelColor=%2387c305"><link rel="preload" as="image" href="https://img.shields.io/npm/v/tinybase?style=for-the-badge&amp;logo=npm&amp;logoColor=%23fff&amp;labelColor=%23bd0005&amp;color=%23333"><link rel="preload" as="image" href="https://beta.tinybase.org/ui-react-dom.webp"><link rel="preload" as="image" href="https://beta.tinybase.org/store-inspector.webp"><link rel="preload" as="image" href="https://github.com/cpojer.png?size=48"><link rel="preload" as="image" href="https://github.com/expo.png?size=48"><link rel="preload" as="image" href="https://github.com/beekeeb.png?size=48"><link rel="preload" as="image" href="https://github.com/cancelself.png?size=48"><link rel="preload" as="image" href="https://github.com/WonderPanda.png?size=48"><link rel="preload" as="image" href="https://github.com/arpitBhalla.png?size=48"><link rel="preload" as="image" href="https://github.com/behrends.png?size=48"><link rel="preload" as="image" href="https://github.com/betomoedano.png?size=48"><link rel="preload" as="image" href="https://github.com/brentvatne.png?size=48"><link rel="preload" as="image" href="https://github.com/byCedric.png?size=48"><link rel="preload" as="image" href="https://github.com/circadian-risk.png?size=48"><link rel="preload" as="image" href="https://github.com/cubecull.png?size=48"><link rel="preload" as="image" href="https://github.com/erwinkn.png?size=48"><link rel="preload" as="image" href="https://github.com/ezra-en.png?size=48"><link rel="preload" as="image" href="https://github.com/feychenie.png?size=48"><link rel="preload" as="image" href="https://github.com/flaming-codes.png?size=48"><link rel="preload" as="image" href="https://github.com/fostertheweb.png?size=48"><link rel="preload" as="image" href="https://github.com/Giulio987.png?size=48"><link rel="preload" as="image" href="https://github.com/hi-ogawa.png?size=48"><link rel="preload" as="image" href="https://github.com/itsdevcoffee.png?size=48"><link rel="preload" as="image" href="https://github.com/jbolda.png?size=48"><link rel="preload" as="image" href="https://github.com/Kayoo-asso.png?size=48"><link rel="preload" as="image" href="https://github.com/kotofurumiya.png?size=48"><link rel="preload" as="image" href="https://github.com/Kudo.png?size=48"><link rel="preload" as="image" href="https://github.com/learn-anything.png?size=48"><link rel="preload" as="image" href="https://github.com/lluc.png?size=48"><link rel="preload" as="image" href="https://github.com/marksteve.png?size=48"><link rel="preload" as="image" href="https://github.com/miking-the-viking.png?size=48"><link rel="preload" as="image" href="https://github.com/mjamesderocher.png?size=48"><link rel="preload" as="image" href="https://github.com/mouktardev.png?size=48"><link rel="preload" as="image" href="https://github.com/nickmessing.png?size=48"><link rel="preload" as="image" href="https://github.com/nikitavoloboev.png?size=48"><link rel="preload" as="image" href="https://github.com/nkzw-tech.png?size=48"><link rel="preload" as="image" href="https://github.com/palerdot.png?size=48"><link rel="preload" as="image" href="https://github.com/PorcoRosso85.png?size=48"><link rel="preload" as="image" href="https://github.com/primodiumxyz.png?size=48"><link rel="preload" as="image" href="https://github.com/shaneosullivan.png?size=48"><link rel="preload" as="image" href="https://github.com/sudo-self.png?size=48"><link rel="preload" as="image" href="https://github.com/SuperSonicHub1.png?size=48"><link rel="preload" as="image" href="https://github.com/threepointone.png?size=48"><link rel="preload" as="image" href="https://github.com/uptonking.png?size=48"><link rel="preload" as="image" href="https://github.com/ViktorZhurbin.png?size=48"><link rel="preload" as="image" href="https://github.com/wilkerlucio.png?size=48"><link rel="preload" as="image" href="https://tinybase.org/favicon.svg?asImg"><link rel="preload" as="image" href="https://tinywidgets.org/favicon.svg?asImg"><link rel="preload" as="image" href="https://tinytick.org/favicon.svg?asImg"><link rel="preload" as="image" href="https://beta.tinybase.org/youtube.webp"><section id="hero"><h2 id="a-reactive-data-store-sync-engine">A <em>reactive</em> data store <span>&amp; <em>sync</em> engine</span>.</h2></section><p><a href="https://beta.tinybase.org/guides/releases/#v6-1"><em>NEW!</em> v6.1 release</a></p><p><span id="one-with">&quot;The One With Bun SQLite!&quot;</span></p><p><a class="start" href="https://beta.tinybase.org/guides/the-basics/getting-started/">Get started</a></p><p><a href="https://beta.tinybase.org/demos/">Try the demos</a></p><p><a href="https://beta.tinybase.org/api/store/interfaces/store/store/">Read the docs</a></p><hr><section><h2 id="it-s-reactive">It&#x27;s <em>Reactive</em></h2><p>TinyBase lets you <a href="#register-granular-listeners">listen to changes</a> made to any part of your data. This means your app will be fast, since you only spend rendering cycles on things that change. The optional <a href="#call-hooks-to-bind-to-data">bindings to React</a> and <a href="#pre-built-reactive-components">pre-built components</a> let you easily build fully reactive UIs on top of TinyBase. You even get a built-in <a href="#set-checkpoints-for-an-undo-stack">undo stack</a>, and <a href="#an-inspector-for-your-data">developer tools</a>!</p></section><section><h2 id="it-s-database-like">It&#x27;s <em>Database-Like</em></h2><p>Consumer app? Enterprise app? Or even a game? Model <a href="#start-with-a-simple-key-value-store">key-value data</a> and <a href="#level-up-to-use-tabular-data">tabular data</a> with optional typed <a href="#apply-schemas-to-tables-values">schematization</a>, whatever its data structures. There are built-in <a href="#create-indexes-for-fast-lookups">indexing</a>, <a href="#define-metrics-and-aggregations">metric aggregation</a>, and tabular <a href="#model-table-relationships">relationships</a> APIs - and a powerful <a href="#build-complex-queries-with-tinyql">query engine</a> to select, join, filter, and group data (reactively!) without SQL.</p></section><section><h2 id="it-synchronizes">It <em>Synchronizes</em></h2><p>TinyBase has <a href="#synchronize-between-devices">native CRDT</a> support, meaning that you can deterministically <a href="https://beta.tinybase.org/guides/synchronization/">synchronize</a> and merge data across multiple sources, clients, and servers. And although TinyBase is an in-memory data store, you can easily <a href="#persist-to-storage-databases-more">persist</a> your data to file, <a href="https://beta.tinybase.org/api/persister-browser">browser storage</a>, <a href="https://beta.tinybase.org/api/persister-indexed-db">IndexedDB</a>, <a href="https://beta.tinybase.org/guides/persistence/database-persistence/">SQLite or PostgreSQL databases</a>, and <a href="https://beta.tinybase.org/guides/persistence/third-party-crdt-persistence/">more</a>.</p></section><section><h2 id="it-s-built-for-a-local-first-world">It&#x27;s Built For A <em>Local-First</em> World</h2><p>TinyBase works anywhere that JavaScript does, but it&#x27;s especially great for local-first apps: where data is stored locally on the user&#x27;s device and that can be run offline. It&#x27;s tiny by name, tiny by nature: just <a href="#did-we-say-tiny">5.3kB - 11.5kB</a> and with no dependencies - yet <a href="#well-tested-and-documented">100% tested</a>, <a href="https://beta.tinybase.org/guides/the-basics/getting-started/">fully documented</a>, and of course, <a href="https://github.com/tinyplex/tinybase">open source</a>!</p></section><hr><section id="friends"><h2 id="tinybase-works-great-on-its-own-but-also-plays-well-with-friends">TinyBase works great on its own, but also plays well with friends.</h2><div><a href="https://beta.tinybase.org/guides/building-uis/getting-started-with-ui-react"><img src="https://beta.tinybase.org/react.svg?asImg" width="48"> React</a></div><div><a href="https://beta.tinybase.org/api/persister-indexed-db/functions/creation/createindexeddbpersister"><img src="https://beta.tinybase.org/indexeddb.svg?asImg" width="48"> IndexedDB</a></div><div><a href="https://beta.tinybase.org/guides/integrations/cloudflare-durable-objects"><img src="https://beta.tinybase.org/cloudflare.svg?asImg" width="48"> Cloudflare</a></div><div><a href="https://beta.tinybase.org/guides/schemas-and-persistence/database-persistence"><img src="https://beta.tinybase.org/postgresql.svg?asImg" width="48"> PostgreSQL</a></div><div><a href="https://beta.tinybase.org/guides/schemas-and-persistence/database-persistence"><img src="https://beta.tinybase.org/pglite.svg?asImg" width="48"> PGlite</a></div><div><a href="https://beta.tinybase.org/guides/schemas-and-persistence/database-persistence"><img src="https://beta.tinybase.org/sqlite.svg?asImg" width="48"> SQLite</a></div><div><a href="https://beta.tinybase.org/guides/schemas-and-persistence/database-persistence"><img src="https://beta.tinybase.org/bun.svg?asImg" width="48"> Bun SQLite</a></div><div><a href="https://beta.tinybase.org/guides/schemas-and-persistence/database-persistence"><img src="https://beta.tinybase.org/expo.svg?asImg" width="48"> Expo SQLite</a></div><div><a href="https://beta.tinybase.org/guides/schemas-and-persistence/database-persistence"><img src="https://beta.tinybase.org/electric.svg?asImg" width="48"> ElectricSQL</a></div><div><a href="https://beta.tinybase.org/guides/schemas-and-persistence/database-persistence"><img src="https://beta.tinybase.org/turso.svg?asImg" width="48"> Turso</a></div><div><a href="https://beta.tinybase.org/guides/schemas-and-persistence/database-persistence"><img src="https://beta.tinybase.org/powersync.svg?asImg" width="48"> PowerSync</a></div><div><a href="https://beta.tinybase.org/api/persister-partykit-client"><img src="https://beta.tinybase.org/partykit.svg?asImg" width="48"> PartyKit</a></div><div><a href="https://beta.tinybase.org/api/persister-yjs/functions/creation/createyjspersister"><img src="https://beta.tinybase.org/yjs.svg?asImg" width="48"> YJS</a></div><div><a href="https://beta.tinybase.org/api/persister-cr-sqlite-wasm"><img src="https://beta.tinybase.org/crsqlite.png" width="48"> CR-SQLite</a></div><div><a href="https://beta.tinybase.org/api/persister-automerge"><img src="https://beta.tinybase.org/automerge.svg?asImg" width="48"> Automerge</a></div><p>(Baffled by all these logos? Check out our <a href="https://beta.tinybase.org/guides/the-basics/architectural-options">architectural options</a> guide to make sense of it all!)</p></section><hr><section id="follow"><a href="https://github.com/tinyplex/tinybase" target="_blank"><img src="https://img.shields.io/github/stars/tinyplex/tinybase?style=for-the-badge&amp;logo=GitHub&amp;logoColor=%23fff&amp;label=GitHub&amp;labelColor=%23d81b60&amp;color=%23333"> </a><a href="https://bsky.app/profile/tinybase.bsky.social"><img src="https://img.shields.io/badge/Bluesky-Follow-blue?style=for-the-badge&amp;logo=bluesky&amp;logoColor=%23fff&amp;color=%23333&amp;labelColor=%230285FF"> </a><a href="https://x.com/tinybasejs" target="_blank"><img src="https://img.shields.io/badge/%2F%20Twitter-Follow-blue?style=for-the-badge&amp;logo=x&amp;logoColor=%23fff&amp;color=%23333&amp;labelColor=%23000"> </a><a href="https://discord.com/invite/mGz3mevwP8" target="_blank"><img src="https://img.shields.io/discord/1027918215323590676?style=for-the-badge&amp;logo=discord&amp;logoColor=%23fff&amp;label=Discord&amp;labelColor=%233131e8&amp;color=%23333"></a><br><a href="https://github.com/tinyplex/tinybase/discussions" target="_blank"><img src="https://img.shields.io/github/discussions/tinyplex/tinybase?style=for-the-badge&amp;logo=GitHub&amp;logoColor=%23fff&amp;label=Ideas&amp;labelColor=%23d81b60&amp;color=%23333"> </a><a href="https://github.com/tinyplex/tinybase/issues" target="_blank"><img src="https://img.shields.io/github/issues/tinyplex/tinybase?style=for-the-badge&amp;logo=GitHub&amp;logoColor=%23fff&amp;label=Issues&amp;labelColor=%23d81b60&amp;color=%23333"> </a><a href="#well-tested-and-documented"><img src="https://img.shields.io/badge/Tests-100%25-green?style=for-the-badge&amp;logo=jest&amp;logoColor=%23fff&amp;color=%23333&amp;labelColor=%2387c305"> </a><a href="https://www.npmjs.com/package/tinybase/v/6.1.0-beta.4" target="_blank"><img src="https://img.shields.io/npm/v/tinybase?style=for-the-badge&amp;logo=npm&amp;logoColor=%23fff&amp;labelColor=%23bd0005&amp;color=%23333"></a></section><hr><section><h2 id="start-with-a-simple-key-value-store">Start with a simple key-value store.</h2><p>Creating a <a href="https://beta.tinybase.org/api/store/interfaces/store/store/"><code>Store</code></a> requires just a simple call to the <a href="https://beta.tinybase.org/api/store/functions/creation/createstore/"><code>createStore</code></a> function. Once you have one, you can easily set <a href="https://beta.tinybase.org/api/store/type-aliases/store/values/"><code>Values</code></a> in it by unique <a href="https://beta.tinybase.org/api/common/type-aliases/identity/id/"><code>Id</code></a>. And of course you can easily get them back out again.</p><p>Read more about using keyed value data in <a href="https://beta.tinybase.org/guides/the-basics/">The Basics</a> guide.</p></section>
2
2
 
3
3
  ```js
4
4
  import {createStore} from 'tinybase';
@@ -275,4 +275,4 @@ console.log(store.getCell('pets', 'felix', 'sold'));
275
275
  // -> false
276
276
  ```
277
277
 
278
- <section><h2 id="did-we-say-tiny">Did we say tiny?</h2><p>If you use the basic <a href="https://beta.tinybase.org/api/store/"><code>store</code></a> module alone, you&#x27;ll only add a gzipped <em>5.3kB</em> to your app. Incrementally add the other modules as you need more functionality, or get it all for <em>11.5kB</em>.</p><p>The optional <a href="https://beta.tinybase.org/api/ui-react/"><code>ui-react</code></a> module is just <em>5.1kB</em>, the ui-react-dom components are another <em>2.6kB</em>, and everything is super fast. Life is easy when you have zero dependencies!</p><p>Read more about how TinyBase is structured and packaged in the <a href="https://beta.tinybase.org/guides/how-tinybase-is-built/architecture/">Architecture</a> guide.</p></section><div class="table"><table class="fixed"><tbody><tr><th> </th><th>Minified .js.gz</th><th>Source .js</th></tr><tr><th class="right"><a href="https://beta.tinybase.org/api/store/">tinybase/store</a> (minimal)</th><td>5.3kB</td><td>52.7kB</td></tr><tr><th class="right">tinybase (complete)</th><td>11.5kB</td><td>119.7kB</td></tr><tr><th class="right"><a href="https://beta.tinybase.org/api/ui-react/">ui-react</a></th><td>5.1kB</td><td>54.1kB</td></tr><tr><th class="right"><a href="https://beta.tinybase.org/api/ui-react-dom/">ui-react-dom</a></th><td>2.6kB</td><td>21.1kB</td></tr></tbody></table></div><section><h2 id="well-tested-and-documented">Well tested and documented.</h2><p>TinyBase has <em>100.0%</em> test coverage, including the code throughout the documentation - even on this page! The guides, demos, and API examples are designed to make it as easy as possible for you to get your TinyBase-powered app up and running.</p><p>Read more about how TinyBase is tested in the Unit <a href="https://beta.tinybase.org/guides/how-tinybase-is-built/testing/">Testing</a> guide.</p></section><div class="table"><table class="fixed"><tbody><tr><th width="30%"> </th><th>Total</th><th>Tested</th><th>Coverage</th></tr><tr><th class="right">Lines</th><td>2,300</td><td>2,300</td><td>100.0%</td></tr><tr><th class="right">Statements</th><td>2,484</td><td>2,484</td><td>100.0%</td></tr><tr><th class="right">Functions</th><td>990</td><td>990</td><td>100.0%</td></tr><tr><th class="right">Branches</th><td>858</td><td>858</td><td>100.0%</td></tr><tr><th class="right">Tests</th><td colspan="3">7,066</td></tr><tr><th class="right">Assertions</th><td colspan="3">32,747</td></tr></tbody></table></div><hr><section id="sponsors"><h2 id="proud-to-be-sponsored-by">Proud to be sponsored by:</h2><a href="https://github.com/cpojer" target="_blank"><img src="https://github.com/cpojer.png?size=48" title="cpojer" width="48" height="48"></a><a href="https://github.com/expo" target="_blank"><img src="https://github.com/expo.png?size=48" title="expo" width="48" height="48"></a><a href="https://github.com/beekeeb" target="_blank"><img src="https://github.com/beekeeb.png?size=48" title="beekeeb" width="48" height="48"></a><a href="https://github.com/cancelself" target="_blank"><img src="https://github.com/cancelself.png?size=48" title="cancelself" width="48" height="48"></a><a href="https://github.com/WonderPanda" target="_blank"><img src="https://github.com/WonderPanda.png?size=48" title="WonderPanda" width="48" height="48"></a><a href="https://github.com/arpitBhalla" target="_blank"><img src="https://github.com/arpitBhalla.png?size=48" title="arpitBhalla" width="48" height="48"></a></section><section id="users"><h2 id="excited-to-be-used-by">Excited to be used by:</h2><a href="https://github.com/behrends" target="_blank"><img src="https://github.com/behrends.png?size=48" title="behrends" width="48" height="48"></a><a href="https://github.com/betomoedano" target="_blank"><img src="https://github.com/betomoedano.png?size=48" title="betomoedano" width="48" height="48"></a><a href="https://github.com/brentvatne" target="_blank"><img src="https://github.com/brentvatne.png?size=48" title="brentvatne" width="48" height="48"></a><a href="https://github.com/byCedric" target="_blank"><img src="https://github.com/byCedric.png?size=48" title="byCedric" width="48" height="48"></a><a href="https://github.com/circadian-risk" target="_blank"><img src="https://github.com/circadian-risk.png?size=48" title="circadian-risk" width="48" height="48"></a><a href="https://github.com/cpojer" target="_blank"><img src="https://github.com/cpojer.png?size=48" title="cpojer" width="48" height="48"></a><a href="https://github.com/cubecull" target="_blank"><img src="https://github.com/cubecull.png?size=48" title="cubecull" width="48" height="48"></a><a href="https://github.com/erwinkn" target="_blank"><img src="https://github.com/erwinkn.png?size=48" title="erwinkn" width="48" height="48"></a><a href="https://github.com/expo" target="_blank"><img src="https://github.com/expo.png?size=48" title="expo" width="48" height="48"></a><a href="https://github.com/ezra-en" target="_blank"><img src="https://github.com/ezra-en.png?size=48" title="ezra-en" width="48" height="48"></a><a href="https://github.com/feychenie" target="_blank"><img src="https://github.com/feychenie.png?size=48" title="feychenie" width="48" height="48"></a><a href="https://github.com/flaming-codes" target="_blank"><img src="https://github.com/flaming-codes.png?size=48" title="flaming-codes" width="48" height="48"></a><a href="https://github.com/fostertheweb" target="_blank"><img src="https://github.com/fostertheweb.png?size=48" title="fostertheweb" width="48" height="48"></a><a href="https://github.com/Giulio987" target="_blank"><img src="https://github.com/Giulio987.png?size=48" title="Giulio987" width="48" height="48"></a><a href="https://github.com/hi-ogawa" target="_blank"><img src="https://github.com/hi-ogawa.png?size=48" title="hi-ogawa" width="48" height="48"></a><a href="https://github.com/itsdevcoffee" target="_blank"><img src="https://github.com/itsdevcoffee.png?size=48" title="itsdevcoffee" width="48" height="48"></a><a href="https://github.com/jbolda" target="_blank"><img src="https://github.com/jbolda.png?size=48" title="jbolda" width="48" height="48"></a><a href="https://github.com/Kayoo-asso" target="_blank"><img src="https://github.com/Kayoo-asso.png?size=48" title="Kayoo-asso" width="48" height="48"></a><a href="https://github.com/kotofurumiya" target="_blank"><img src="https://github.com/kotofurumiya.png?size=48" title="kotofurumiya" width="48" height="48"></a><a href="https://github.com/Kudo" target="_blank"><img src="https://github.com/Kudo.png?size=48" title="Kudo" width="48" height="48"></a><a href="https://github.com/learn-anything" target="_blank"><img src="https://github.com/learn-anything.png?size=48" title="learn-anything" width="48" height="48"></a><a href="https://github.com/lluc" target="_blank"><img src="https://github.com/lluc.png?size=48" title="lluc" width="48" height="48"></a><a href="https://github.com/marksteve" target="_blank"><img src="https://github.com/marksteve.png?size=48" title="marksteve" width="48" height="48"></a><a href="https://github.com/miking-the-viking" target="_blank"><img src="https://github.com/miking-the-viking.png?size=48" title="miking-the-viking" width="48" height="48"></a><a href="https://github.com/mjamesderocher" target="_blank"><img src="https://github.com/mjamesderocher.png?size=48" title="mjamesderocher" width="48" height="48"></a><a href="https://github.com/mouktardev" target="_blank"><img src="https://github.com/mouktardev.png?size=48" title="mouktardev" width="48" height="48"></a><a href="https://github.com/nickmessing" target="_blank"><img src="https://github.com/nickmessing.png?size=48" title="nickmessing" width="48" height="48"></a><a href="https://github.com/nikitavoloboev" target="_blank"><img src="https://github.com/nikitavoloboev.png?size=48" title="nikitavoloboev" width="48" height="48"></a><a href="https://github.com/nkzw-tech" target="_blank"><img src="https://github.com/nkzw-tech.png?size=48" title="nkzw-tech" width="48" height="48"></a><a href="https://github.com/palerdot" target="_blank"><img src="https://github.com/palerdot.png?size=48" title="palerdot" width="48" height="48"></a><a href="https://github.com/PorcoRosso85" target="_blank"><img src="https://github.com/PorcoRosso85.png?size=48" title="PorcoRosso85" width="48" height="48"></a><a href="https://github.com/primodiumxyz" target="_blank"><img src="https://github.com/primodiumxyz.png?size=48" title="primodiumxyz" width="48" height="48"></a><a href="https://github.com/shaneosullivan" target="_blank"><img src="https://github.com/shaneosullivan.png?size=48" title="shaneosullivan" width="48" height="48"></a><a href="https://github.com/sudo-self" target="_blank"><img src="https://github.com/sudo-self.png?size=48" title="sudo-self" width="48" height="48"></a><a href="https://github.com/SuperSonicHub1" target="_blank"><img src="https://github.com/SuperSonicHub1.png?size=48" title="SuperSonicHub1" width="48" height="48"></a><a href="https://github.com/threepointone" target="_blank"><img src="https://github.com/threepointone.png?size=48" title="threepointone" width="48" height="48"></a><a href="https://github.com/uptonking" target="_blank"><img src="https://github.com/uptonking.png?size=48" title="uptonking" width="48" height="48"></a><a href="https://github.com/ViktorZhurbin" target="_blank"><img src="https://github.com/ViktorZhurbin.png?size=48" title="ViktorZhurbin" width="48" height="48"></a><a href="https://github.com/wilkerlucio" target="_blank"><img src="https://github.com/wilkerlucio.png?size=48" title="wilkerlucio" width="48" height="48"></a><a href="https://github.com/WonderPanda" target="_blank"><img src="https://github.com/WonderPanda.png?size=48" title="WonderPanda" width="48" height="48"></a></section><hr><p><a class="start" href="https://beta.tinybase.org/guides/the-basics/getting-started/">Get started</a></p><p><a href="https://beta.tinybase.org/demos/">Try the demos</a></p><p><a href="https://beta.tinybase.org/api/store/interfaces/store/store/">Read the docs</a></p><hr><section id="family"><h2 id="meet-the-family">Meet the family</h2><p>TinyBase is part of a group of small libraries designed to help make rich client and local-first apps easier to build. Check out the others!</p><p><img src="https://tinybase.org/favicon.svg?asImg" width="48"><br><b>TinyBase</b><br>A reactive data store and sync engine.</p><p><a href="https://tinywidgets.org" target="_blank"><img src="https://tinywidgets.org/favicon.svg?asImg" width="48"><br><b>TinyWidgets</b></a><br>A collection of tiny, reusable, UI components.</p><p><a href="https://tinytick.org" target="_blank"><img src="https://tinytick.org/favicon.svg?asImg" width="48"><br><b>TinyTick</b></a><br>A tiny but very useful task orchestrator.</p></section><hr><section id="about"><h2 id="about">About</h2><p>Modern apps deserve better. Why trade reactive user experiences to be able to use relational data? Or sacrifice features for bundle size? And why does the cloud do all the work <a href="https://localfirstweb.dev/" target="_blank">anyway</a>?</p><p>Building TinyBase was originally an interesting exercise for <a rel="me" href="https://tripleodeon.com">me</a> in API design, minification, and documentation. But now it has taken on a life of its own, and has grown beyond my wildest expectations.</p><p>It could not have been built without these great <a href="https://beta.tinybase.org/guides/how-tinybase-is-built/credits/#giants">projects</a> and <a href="https://beta.tinybase.org/guides/how-tinybase-is-built/credits/#and-friends">friends</a>, and I hope you enjoy using it as much as I do building it!</p></section><section id="story"><h2 id="the-story">The story</h2><a href="https://youtu.be/hXL7OkW-Prk?t=1232" target="_blank"><img src="https://beta.tinybase.org/youtube.webp"></a></section>
278
+ <section><h2 id="did-we-say-tiny">Did we say tiny?</h2><p>If you use the basic <a href="https://beta.tinybase.org/api/store/"><code>store</code></a> module alone, you&#x27;ll only add a gzipped <em>5.3kB</em> to your app. Incrementally add the other modules as you need more functionality, or get it all for <em>11.5kB</em>.</p><p>The optional <a href="https://beta.tinybase.org/api/ui-react/"><code>ui-react</code></a> module is just <em>5.1kB</em>, the ui-react-dom components are another <em>2.6kB</em>, and everything is super fast. Life is easy when you have zero dependencies!</p><p>Read more about how TinyBase is structured and packaged in the <a href="https://beta.tinybase.org/guides/how-tinybase-is-built/architecture/">Architecture</a> guide.</p></section><div class="table"><table class="fixed"><tbody><tr><th> </th><th>Minified .js.gz</th><th>Source .js</th></tr><tr><th class="right"><a href="https://beta.tinybase.org/api/store/">tinybase/store</a> (minimal)</th><td>5.3kB</td><td>52.7kB</td></tr><tr><th class="right">tinybase (complete)</th><td>11.5kB</td><td>119.7kB</td></tr><tr><th class="right"><a href="https://beta.tinybase.org/api/ui-react/">ui-react</a></th><td>5.1kB</td><td>54.1kB</td></tr><tr><th class="right"><a href="https://beta.tinybase.org/api/ui-react-dom/">ui-react-dom</a></th><td>2.6kB</td><td>21.1kB</td></tr></tbody></table></div><section><h2 id="well-tested-and-documented">Well tested and documented.</h2><p>TinyBase has <em>100.0%</em> test coverage, including the code throughout the documentation - even on this page! The guides, demos, and API examples are designed to make it as easy as possible for you to get your TinyBase-powered app up and running.</p><p>Read more about how TinyBase is tested in the Unit <a href="https://beta.tinybase.org/guides/how-tinybase-is-built/testing/">Testing</a> guide.</p></section><div class="table"><table class="fixed"><tbody><tr><th width="30%"> </th><th>Total</th><th>Tested</th><th>Coverage</th></tr><tr><th class="right">Lines</th><td>2,300</td><td>2,300</td><td>100.0%</td></tr><tr><th class="right">Statements</th><td>2,484</td><td>2,484</td><td>100.0%</td></tr><tr><th class="right">Functions</th><td>990</td><td>990</td><td>100.0%</td></tr><tr><th class="right">Branches</th><td>857</td><td>857</td><td>100.0%</td></tr><tr><th class="right">Tests</th><td colspan="3">7,067</td></tr><tr><th class="right">Assertions</th><td colspan="3">32,754</td></tr></tbody></table></div><hr><section id="sponsors"><h2 id="proud-to-be-sponsored-by">Proud to be sponsored by:</h2><a href="https://github.com/cpojer" target="_blank"><img src="https://github.com/cpojer.png?size=48" title="cpojer" width="48" height="48"></a><a href="https://github.com/expo" target="_blank"><img src="https://github.com/expo.png?size=48" title="expo" width="48" height="48"></a><a href="https://github.com/beekeeb" target="_blank"><img src="https://github.com/beekeeb.png?size=48" title="beekeeb" width="48" height="48"></a><a href="https://github.com/cancelself" target="_blank"><img src="https://github.com/cancelself.png?size=48" title="cancelself" width="48" height="48"></a><a href="https://github.com/WonderPanda" target="_blank"><img src="https://github.com/WonderPanda.png?size=48" title="WonderPanda" width="48" height="48"></a><a href="https://github.com/arpitBhalla" target="_blank"><img src="https://github.com/arpitBhalla.png?size=48" title="arpitBhalla" width="48" height="48"></a></section><section id="users"><h2 id="excited-to-be-used-by">Excited to be used by:</h2><a href="https://github.com/behrends" target="_blank"><img src="https://github.com/behrends.png?size=48" title="behrends" width="48" height="48"></a><a href="https://github.com/betomoedano" target="_blank"><img src="https://github.com/betomoedano.png?size=48" title="betomoedano" width="48" height="48"></a><a href="https://github.com/brentvatne" target="_blank"><img src="https://github.com/brentvatne.png?size=48" title="brentvatne" width="48" height="48"></a><a href="https://github.com/byCedric" target="_blank"><img src="https://github.com/byCedric.png?size=48" title="byCedric" width="48" height="48"></a><a href="https://github.com/circadian-risk" target="_blank"><img src="https://github.com/circadian-risk.png?size=48" title="circadian-risk" width="48" height="48"></a><a href="https://github.com/cpojer" target="_blank"><img src="https://github.com/cpojer.png?size=48" title="cpojer" width="48" height="48"></a><a href="https://github.com/cubecull" target="_blank"><img src="https://github.com/cubecull.png?size=48" title="cubecull" width="48" height="48"></a><a href="https://github.com/erwinkn" target="_blank"><img src="https://github.com/erwinkn.png?size=48" title="erwinkn" width="48" height="48"></a><a href="https://github.com/expo" target="_blank"><img src="https://github.com/expo.png?size=48" title="expo" width="48" height="48"></a><a href="https://github.com/ezra-en" target="_blank"><img src="https://github.com/ezra-en.png?size=48" title="ezra-en" width="48" height="48"></a><a href="https://github.com/feychenie" target="_blank"><img src="https://github.com/feychenie.png?size=48" title="feychenie" width="48" height="48"></a><a href="https://github.com/flaming-codes" target="_blank"><img src="https://github.com/flaming-codes.png?size=48" title="flaming-codes" width="48" height="48"></a><a href="https://github.com/fostertheweb" target="_blank"><img src="https://github.com/fostertheweb.png?size=48" title="fostertheweb" width="48" height="48"></a><a href="https://github.com/Giulio987" target="_blank"><img src="https://github.com/Giulio987.png?size=48" title="Giulio987" width="48" height="48"></a><a href="https://github.com/hi-ogawa" target="_blank"><img src="https://github.com/hi-ogawa.png?size=48" title="hi-ogawa" width="48" height="48"></a><a href="https://github.com/itsdevcoffee" target="_blank"><img src="https://github.com/itsdevcoffee.png?size=48" title="itsdevcoffee" width="48" height="48"></a><a href="https://github.com/jbolda" target="_blank"><img src="https://github.com/jbolda.png?size=48" title="jbolda" width="48" height="48"></a><a href="https://github.com/Kayoo-asso" target="_blank"><img src="https://github.com/Kayoo-asso.png?size=48" title="Kayoo-asso" width="48" height="48"></a><a href="https://github.com/kotofurumiya" target="_blank"><img src="https://github.com/kotofurumiya.png?size=48" title="kotofurumiya" width="48" height="48"></a><a href="https://github.com/Kudo" target="_blank"><img src="https://github.com/Kudo.png?size=48" title="Kudo" width="48" height="48"></a><a href="https://github.com/learn-anything" target="_blank"><img src="https://github.com/learn-anything.png?size=48" title="learn-anything" width="48" height="48"></a><a href="https://github.com/lluc" target="_blank"><img src="https://github.com/lluc.png?size=48" title="lluc" width="48" height="48"></a><a href="https://github.com/marksteve" target="_blank"><img src="https://github.com/marksteve.png?size=48" title="marksteve" width="48" height="48"></a><a href="https://github.com/miking-the-viking" target="_blank"><img src="https://github.com/miking-the-viking.png?size=48" title="miking-the-viking" width="48" height="48"></a><a href="https://github.com/mjamesderocher" target="_blank"><img src="https://github.com/mjamesderocher.png?size=48" title="mjamesderocher" width="48" height="48"></a><a href="https://github.com/mouktardev" target="_blank"><img src="https://github.com/mouktardev.png?size=48" title="mouktardev" width="48" height="48"></a><a href="https://github.com/nickmessing" target="_blank"><img src="https://github.com/nickmessing.png?size=48" title="nickmessing" width="48" height="48"></a><a href="https://github.com/nikitavoloboev" target="_blank"><img src="https://github.com/nikitavoloboev.png?size=48" title="nikitavoloboev" width="48" height="48"></a><a href="https://github.com/nkzw-tech" target="_blank"><img src="https://github.com/nkzw-tech.png?size=48" title="nkzw-tech" width="48" height="48"></a><a href="https://github.com/palerdot" target="_blank"><img src="https://github.com/palerdot.png?size=48" title="palerdot" width="48" height="48"></a><a href="https://github.com/PorcoRosso85" target="_blank"><img src="https://github.com/PorcoRosso85.png?size=48" title="PorcoRosso85" width="48" height="48"></a><a href="https://github.com/primodiumxyz" target="_blank"><img src="https://github.com/primodiumxyz.png?size=48" title="primodiumxyz" width="48" height="48"></a><a href="https://github.com/shaneosullivan" target="_blank"><img src="https://github.com/shaneosullivan.png?size=48" title="shaneosullivan" width="48" height="48"></a><a href="https://github.com/sudo-self" target="_blank"><img src="https://github.com/sudo-self.png?size=48" title="sudo-self" width="48" height="48"></a><a href="https://github.com/SuperSonicHub1" target="_blank"><img src="https://github.com/SuperSonicHub1.png?size=48" title="SuperSonicHub1" width="48" height="48"></a><a href="https://github.com/threepointone" target="_blank"><img src="https://github.com/threepointone.png?size=48" title="threepointone" width="48" height="48"></a><a href="https://github.com/uptonking" target="_blank"><img src="https://github.com/uptonking.png?size=48" title="uptonking" width="48" height="48"></a><a href="https://github.com/ViktorZhurbin" target="_blank"><img src="https://github.com/ViktorZhurbin.png?size=48" title="ViktorZhurbin" width="48" height="48"></a><a href="https://github.com/wilkerlucio" target="_blank"><img src="https://github.com/wilkerlucio.png?size=48" title="wilkerlucio" width="48" height="48"></a><a href="https://github.com/WonderPanda" target="_blank"><img src="https://github.com/WonderPanda.png?size=48" title="WonderPanda" width="48" height="48"></a></section><hr><p><a class="start" href="https://beta.tinybase.org/guides/the-basics/getting-started/">Get started</a></p><p><a href="https://beta.tinybase.org/demos/">Try the demos</a></p><p><a href="https://beta.tinybase.org/api/store/interfaces/store/store/">Read the docs</a></p><hr><section id="family"><h2 id="meet-the-family">Meet the family</h2><p>TinyBase is part of a group of small libraries designed to help make rich client and local-first apps easier to build. Check out the others!</p><p><img src="https://tinybase.org/favicon.svg?asImg" width="48"><br><b>TinyBase</b><br>A reactive data store and sync engine.</p><p><a href="https://tinywidgets.org" target="_blank"><img src="https://tinywidgets.org/favicon.svg?asImg" width="48"><br><b>TinyWidgets</b></a><br>A collection of tiny, reusable, UI components.</p><p><a href="https://tinytick.org" target="_blank"><img src="https://tinytick.org/favicon.svg?asImg" width="48"><br><b>TinyTick</b></a><br>A tiny but very useful task orchestrator.</p></section><hr><section id="about"><h2 id="about">About</h2><p>Modern apps deserve better. Why trade reactive user experiences to be able to use relational data? Or sacrifice features for bundle size? And why does the cloud do all the work <a href="https://localfirstweb.dev/" target="_blank">anyway</a>?</p><p>Building TinyBase was originally an interesting exercise for <a rel="me" href="https://tripleodeon.com">me</a> in API design, minification, and documentation. But now it has taken on a life of its own, and has grown beyond my wildest expectations.</p><p>It could not have been built without these great <a href="https://beta.tinybase.org/guides/how-tinybase-is-built/credits/#giants">projects</a> and <a href="https://beta.tinybase.org/guides/how-tinybase-is-built/credits/#and-friends">friends</a>, and I hope you enjoy using it as much as I do building it!</p></section><section id="story"><h2 id="the-story">The story</h2><a href="https://youtu.be/hXL7OkW-Prk?t=1232" target="_blank"><img src="https://beta.tinybase.org/youtube.webp"></a></section>
package/releases.md CHANGED
@@ -1,4 +1,32 @@
1
- <link rel="preload" as="image" href="https://beta.tinybase.org/partykit.gif"><link rel="preload" as="image" href="https://beta.tinybase.org/ui-react-dom.webp"><link rel="preload" as="image" href="https://beta.tinybase.org/store-inspector.webp"><link rel="preload" as="image" href="https://beta.tinybase.org/car-analysis.webp"><link rel="preload" as="image" href="https://beta.tinybase.org/movie-database.webp"><p>This is a reverse chronological list of the major TinyBase releases, with highlighted features.</p><hr><h1 id="v6-0">v6.0</h1><p>This major release is about updating dependencies and infrastructure rather than adding new features.</p><p>The most notable changes for users are:</p><ul><li>The package distribution only includes modern ESM packages (both minified and non-minified).</li><li>React 19 is now compatible as an optional peer dependency.</li><li>The tools module and TinyBase CLI have been removed.</li></ul><p>If you have been using CJS or UMD packages, you will need to update your bundling strategy for TinyBase (in the same way that you will have had to have done for React 19, for example) but this change should be compatible with most packaging tools. If you had been using the library directly a browser, you should consider the <a href="https://esm.sh/">esm.sh</a> CDN, as we have for our demos.</p><p>As a result of these changes, there have been some additional knock-on effects to the project and developer infrastructure as a whole. For example:</p><ul><li>The test suite has been updated to use <code>react-testing-library</code> instead of <code>react-test-renderer</code>.</li><li>The React <code>jsx-runtime</code> is used for JSX transformations.</li><li><a href="https://beta.tinybase.org/demos/">Demos</a> (and CodePen examples) have been updated to use an <code>importmap</code> mapping the modules to the <a href="https://esm.sh/">esm.sh</a> CDN.</li><li>ESLint has finally been upgraded to v9.</li></ul><p>Note that TinyBase v6.0 adds no new functionality, so you can afford to stay on v5.4.x for a while if these changes are somehow incompatible for you. However, all future functionality changes and bug fixes <em>will</em> take effect as v6.x releases (and probably won&#x27;t be back-ported to v5.4.x), so you should endeavor to upgrade as soon as you can.</p><p>Please let us know how these changes find you, and please file an issue on GitHub if you need help adapting to any of them.</p><h1 id="v5-4">v5.4</h1><h2 id="durable-objects-synchronization">Durable Objects synchronization</h2><p>This release contains a new WebSocket synchronization server that runs on Cloudflare as a Durable Object.</p><p><embed src="https://beta.tinybase.org/durable.svg" title="Durable Objects"></p><p>It&#x27;s in the new <a href="https://beta.tinybase.org/api/synchronizer-ws-server-durable-object/"><code>synchronizer-ws-server-durable-object</code></a> module, and you use it by extending the <a href="https://beta.tinybase.org/api/synchronizer-ws-server-durable-object/classes/creation/wsserverdurableobject/"><code>WsServerDurableObject</code></a> class. Use the <a href="https://beta.tinybase.org/api/synchronizer-ws-server-durable-object/functions/creation/getwsserverdurableobjectfetch/"><code>getWsServerDurableObjectFetch</code></a> function for conveniently binding your Cloudflare Worker to your Durable Object:</p>
1
+ <link rel="preload" as="image" href="https://beta.tinybase.org/partykit.gif"><link rel="preload" as="image" href="https://beta.tinybase.org/ui-react-dom.webp"><link rel="preload" as="image" href="https://beta.tinybase.org/store-inspector.webp"><link rel="preload" as="image" href="https://beta.tinybase.org/car-analysis.webp"><link rel="preload" as="image" href="https://beta.tinybase.org/movie-database.webp"><p>This is a reverse chronological list of the major TinyBase releases, with highlighted features.</p><hr><h1 id="v6-1">v6.1</h1><h2 id="bun-sqlite">Bun SQLite</h2><p>This release includes a new <a href="https://beta.tinybase.org/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="https://beta.tinybase.org/api/persister-sqlite-bun/functions/creation/createsqlitebunpersister/"><code>createSqliteBunPersister</code></a> function:</p>
2
+
3
+ ```js bun
4
+ import {Database} from 'bun:sqlite';
5
+ import {createStore} from 'tinybase';
6
+ import {createSqliteBunPersister} from 'tinybase/persisters/persister-sqlite-bun';
7
+
8
+ const db = new Database(':memory:');
9
+ const store = createStore().setTables({pets: {fido: {species: 'dog'}}});
10
+ const persister = createSqliteBunPersister(store, db, 'my_tinybase');
11
+
12
+ await persister.save();
13
+ // Store will be saved to the database.
14
+
15
+ console.log(db.query('SELECT * FROM my_tinybase;').all());
16
+ // -> [{_id: '_', store: '[{"pets":{"fido":{"species":"dog"}}},{}]'}]
17
+
18
+ db.query(
19
+ 'UPDATE my_tinybase SET store = ' +
20
+ `'[{"pets":{"felix":{"species":"cat"}}},{}]' WHERE _id = '_';`,
21
+ ).run();
22
+ await persister.load();
23
+ console.log(store.getTables());
24
+ // -> {pets: {felix: {species: 'cat'}}}
25
+
26
+ persister.destroy();
27
+ ```
28
+
29
+ <p>There&#x27;s more information the documentation for the new <a href="https://beta.tinybase.org/api/persister-sqlite-bun/"><code>persister-sqlite-bun</code></a> module.</p><h2 id="createmergeablestore-getnow">createMergeableStore getNow</h2><p>The <a href="https://beta.tinybase.org/api/mergeable-store/functions/creation/createmergeablestore/"><code>createMergeableStore</code></a> function now takes an optional <code>getNow</code> argument that lets you override the clock used to generate HLC timestamps.</p><h1 id="v6-0">v6.0</h1><p>This major release is about updating dependencies and infrastructure rather than adding new features.</p><p>The most notable changes for users are:</p><ul><li>The package distribution only includes modern ESM packages (both minified and non-minified).</li><li>React 19 is now compatible as an optional peer dependency.</li><li>The tools module and TinyBase CLI have been removed.</li></ul><p>If you have been using CJS or UMD packages, you will need to update your bundling strategy for TinyBase (in the same way that you will have had to have done for React 19, for example) but this change should be compatible with most packaging tools. If you had been using the library directly a browser, you should consider the <a href="https://esm.sh/">esm.sh</a> CDN, as we have for our demos.</p><p>As a result of these changes, there have been some additional knock-on effects to the project and developer infrastructure as a whole. For example:</p><ul><li>The test suite has been updated to use <code>react-testing-library</code> instead of <code>react-test-renderer</code>.</li><li>The React <code>jsx-runtime</code> is used for JSX transformations.</li><li><a href="https://beta.tinybase.org/demos/">Demos</a> (and CodePen examples) have been updated to use an <code>importmap</code> mapping the modules to the <a href="https://esm.sh/">esm.sh</a> CDN.</li><li>ESLint has finally been upgraded to v9.</li></ul><p>Note that TinyBase v6.0 adds no new functionality, so you can afford to stay on v5.4.x for a while if these changes are somehow incompatible for you. However, all future functionality changes and bug fixes <em>will</em> take effect as v6.x releases (and probably won&#x27;t be back-ported to v5.4.x), so you should endeavor to upgrade as soon as you can.</p><p>Please let us know how these changes find you, and please file an issue on GitHub if you need help adapting to any of them.</p><h1 id="v5-4">v5.4</h1><h2 id="durable-objects-synchronization">Durable Objects synchronization</h2><p>This release contains a new WebSocket synchronization server that runs on Cloudflare as a Durable Object.</p><p><embed src="https://beta.tinybase.org/durable.svg" title="Durable Objects"></p><p>It&#x27;s in the new <a href="https://beta.tinybase.org/api/synchronizer-ws-server-durable-object/"><code>synchronizer-ws-server-durable-object</code></a> module, and you use it by extending the <a href="https://beta.tinybase.org/api/synchronizer-ws-server-durable-object/classes/creation/wsserverdurableobject/"><code>WsServerDurableObject</code></a> class. Use the <a href="https://beta.tinybase.org/api/synchronizer-ws-server-durable-object/functions/creation/getwsserverdurableobjectfetch/"><code>getWsServerDurableObjectFetch</code></a> function for conveniently binding your Cloudflare Worker to your Durable Object:</p>
2
30
 
3
31
  ```js yolo
4
32
  import {
package/store/index.js CHANGED
@@ -34,6 +34,14 @@ const isArray = (thing) => Array.isArray(thing);
34
34
  const slice = (arrayOrString, start, end) => arrayOrString.slice(start, end);
35
35
  const size = (arrayOrString) => arrayOrString.length;
36
36
  const test = (regex, subject) => regex.test(subject);
37
+ const tryCatch = async (action, then1, then2) => {
38
+ try {
39
+ return await action();
40
+ } catch (error) {
41
+ /* istanbul ignore next */
42
+ then1?.(error);
43
+ }
44
+ };
37
45
 
38
46
  const arrayHas = (array, value) => array.includes(value);
39
47
  const arrayEvery = (array, cb) => array.every(cb);
@@ -1146,27 +1154,24 @@ const createStore = () => {
1146
1154
  );
1147
1155
  });
1148
1156
  const setTablesJson = (tablesJson) => {
1149
- try {
1150
- setOrDelTables(jsonParse(tablesJson));
1151
- } catch {}
1157
+ tryCatch(() => setOrDelTables(jsonParse(tablesJson)));
1152
1158
  return store;
1153
1159
  };
1154
1160
  const setValuesJson = (valuesJson) => {
1155
- try {
1156
- setOrDelValues(jsonParse(valuesJson));
1157
- } catch {}
1161
+ tryCatch(() => setOrDelValues(jsonParse(valuesJson)));
1158
1162
  return store;
1159
1163
  };
1160
1164
  const setJson = (tablesAndValuesJson) =>
1161
- fluentTransaction(() => {
1162
- try {
1163
- const [tables, values] = jsonParse(tablesAndValuesJson);
1164
- setOrDelTables(tables);
1165
- setOrDelValues(values);
1166
- } catch {
1167
- setTablesJson(tablesAndValuesJson);
1168
- }
1169
- });
1165
+ fluentTransaction(() =>
1166
+ tryCatch(
1167
+ () => {
1168
+ const [tables, values] = jsonParse(tablesAndValuesJson);
1169
+ setOrDelTables(tables);
1170
+ setOrDelValues(values);
1171
+ },
1172
+ () => setTablesJson(tablesAndValuesJson),
1173
+ ),
1174
+ );
1170
1175
  const setTablesSchema = (tablesSchema) =>
1171
1176
  fluentTransaction(() => {
1172
1177
  if ((hasTablesSchema = validateTablesSchema(tablesSchema))) {
@@ -34,6 +34,14 @@ const isArray = (thing) => Array.isArray(thing);
34
34
  const slice = (arrayOrString, start, end) => arrayOrString.slice(start, end);
35
35
  const size = (arrayOrString) => arrayOrString.length;
36
36
  const test = (regex, subject) => regex.test(subject);
37
+ const tryCatch = async (action, then1, then2) => {
38
+ try {
39
+ return await action();
40
+ } catch (error) {
41
+ /* istanbul ignore next */
42
+ then1?.(error);
43
+ }
44
+ };
37
45
 
38
46
  const arrayHas = (array, value) => array.includes(value);
39
47
  const arrayEvery = (array, cb) => array.every(cb);
@@ -1146,27 +1154,24 @@ const createStore = () => {
1146
1154
  );
1147
1155
  });
1148
1156
  const setTablesJson = (tablesJson) => {
1149
- try {
1150
- setOrDelTables(jsonParse(tablesJson));
1151
- } catch {}
1157
+ tryCatch(() => setOrDelTables(jsonParse(tablesJson)));
1152
1158
  return store;
1153
1159
  };
1154
1160
  const setValuesJson = (valuesJson) => {
1155
- try {
1156
- setOrDelValues(jsonParse(valuesJson));
1157
- } catch {}
1161
+ tryCatch(() => setOrDelValues(jsonParse(valuesJson)));
1158
1162
  return store;
1159
1163
  };
1160
1164
  const setJson = (tablesAndValuesJson) =>
1161
- fluentTransaction(() => {
1162
- try {
1163
- const [tables, values] = jsonParse(tablesAndValuesJson);
1164
- setOrDelTables(tables);
1165
- setOrDelValues(values);
1166
- } catch {
1167
- setTablesJson(tablesAndValuesJson);
1168
- }
1169
- });
1165
+ fluentTransaction(() =>
1166
+ tryCatch(
1167
+ () => {
1168
+ const [tables, values] = jsonParse(tablesAndValuesJson);
1169
+ setOrDelTables(tables);
1170
+ setOrDelValues(values);
1171
+ },
1172
+ () => setTablesJson(tablesAndValuesJson),
1173
+ ),
1174
+ );
1170
1175
  const setTablesSchema = (tablesSchema) =>
1171
1176
  fluentTransaction(() => {
1172
1177
  if ((hasTablesSchema = validateTablesSchema(tablesSchema))) {
@@ -19,6 +19,14 @@ const promiseNew = (resolver) => new promise(resolver);
19
19
  const errorNew = (message) => {
20
20
  throw new Error(message);
21
21
  };
22
+ const tryCatch = async (action, then1, then2) => {
23
+ try {
24
+ return await action();
25
+ } catch (error) {
26
+ /* istanbul ignore next */
27
+ then1?.(error);
28
+ }
29
+ };
22
30
 
23
31
  const arrayForEach = (array, cb) => array.forEach(cb);
24
32
  const arrayMap = (array, cb) => array.map(cb);
@@ -283,12 +291,7 @@ const createCustomPersister = (
283
291
  while (
284
292
  !isUndefined((action = arrayShift(mapGet(scheduleActions, scheduleId))))
285
293
  ) {
286
- try {
287
- await action();
288
- } catch (error) {
289
- /* istanbul ignore next */
290
- onIgnoredError?.(error);
291
- }
294
+ await tryCatch(action, onIgnoredError);
292
295
  }
293
296
  mapSet(scheduleRunning, scheduleId, 0);
294
297
  }
@@ -308,21 +311,23 @@ const createCustomPersister = (
308
311
  setStatus(1 /* Loading */);
309
312
  loads++;
310
313
  await schedule(async () => {
311
- try {
312
- const content = await getPersisted();
313
- if (isArray(content)) {
314
- setContentOrChanges(content);
315
- } else if (initialContent) {
316
- setDefaultContent(initialContent);
317
- } else {
318
- errorNew(`Content is not an array: ${content}`);
319
- }
320
- } catch (error) {
321
- onIgnoredError?.(error);
322
- if (initialContent) {
323
- setDefaultContent(initialContent);
324
- }
325
- }
314
+ await tryCatch(
315
+ async () => {
316
+ const content = await getPersisted();
317
+ if (isArray(content)) {
318
+ setContentOrChanges(content);
319
+ } else if (initialContent) {
320
+ setDefaultContent(initialContent);
321
+ } else {
322
+ errorNew(`Content is not an array: ${content}`);
323
+ }
324
+ },
325
+ () => {
326
+ if (initialContent) {
327
+ setDefaultContent(initialContent);
328
+ }
329
+ },
330
+ );
326
331
  setStatus(0 /* Idle */);
327
332
  });
328
333
  }
@@ -331,29 +336,33 @@ const createCustomPersister = (
331
336
  const startAutoLoad = async (initialContent) => {
332
337
  stopAutoLoad();
333
338
  await load(initialContent);
334
- try {
335
- autoLoadHandle = await addPersisterListener(async (content, changes) => {
336
- if (changes || content) {
337
- /* istanbul ignore else */
338
- if (status != 2 /* Saving */) {
339
- setStatus(1 /* Loading */);
340
- loads++;
341
- setContentOrChanges(changes ?? content);
342
- setStatus(0 /* Idle */);
343
- }
344
- } else {
345
- await load();
346
- }
347
- });
348
- } catch (error) {
349
- /* istanbul ignore next */
350
- onIgnoredError?.(error);
351
- }
339
+ await tryCatch(
340
+ async () =>
341
+ (autoLoadHandle = await addPersisterListener(
342
+ async (content, changes) => {
343
+ if (changes || content) {
344
+ /* istanbul ignore else */
345
+ if (status != 2 /* Saving */) {
346
+ setStatus(1 /* Loading */);
347
+ loads++;
348
+ setContentOrChanges(changes ?? content);
349
+ setStatus(0 /* Idle */);
350
+ }
351
+ } else {
352
+ await load();
353
+ }
354
+ },
355
+ )),
356
+ onIgnoredError,
357
+ );
352
358
  return persister;
353
359
  };
354
- const stopAutoLoad = () => {
360
+ const stopAutoLoad = async () => {
355
361
  if (autoLoadHandle) {
356
- delPersisterListener(autoLoadHandle);
362
+ await tryCatch(
363
+ () => delPersisterListener(autoLoadHandle),
364
+ onIgnoredError,
365
+ );
357
366
  autoLoadHandle = void 0;
358
367
  }
359
368
  return persister;
@@ -365,12 +374,7 @@ const createCustomPersister = (
365
374
  setStatus(2 /* Saving */);
366
375
  saves++;
367
376
  await schedule(async () => {
368
- try {
369
- await setPersisted(getContent, changes);
370
- } catch (error) {
371
- /* istanbul ignore next */
372
- onIgnoredError?.(error);
373
- }
377
+ await tryCatch(() => setPersisted(getContent, changes), onIgnoredError);
374
378
  setStatus(0 /* Idle */);
375
379
  });
376
380
  }
@@ -387,7 +391,7 @@ const createCustomPersister = (
387
391
  });
388
392
  return persister;
389
393
  };
390
- const stopAutoSave = () => {
394
+ const stopAutoSave = async () => {
391
395
  if (autoSaveListenerId) {
392
396
  store.delListener(autoSaveListenerId);
393
397
  autoSaveListenerId = void 0;
@@ -408,9 +412,10 @@ const createCustomPersister = (
408
412
  return persister;
409
413
  };
410
414
  const getStore = () => store;
411
- const destroy = () => {
415
+ const destroy = async () => {
412
416
  arrayClear(mapGet(scheduleActions, scheduleId));
413
- return stopAutoLoad().stopAutoSave();
417
+ await persister.stopAutoLoad();
418
+ return await persister.stopAutoSave();
414
419
  };
415
420
  const getStats = () => ({loads, saves});
416
421
  const persister = {
@@ -448,7 +453,7 @@ const createCustomSynchronizer = (
448
453
  store,
449
454
  send,
450
455
  registerReceive,
451
- destroyImpl,
456
+ extraDestroy,
452
457
  requestTimeoutSeconds,
453
458
  onSend,
454
459
  onReceive,
@@ -502,12 +507,12 @@ const createCustomSynchronizer = (
502
507
  });
503
508
  tablesStamp[1] = getLatestTime(tablesStamp[1], tablesTime2);
504
509
  };
505
- const getChangesFromOtherStore = async (
510
+ const getChangesFromOtherStore = (
506
511
  otherClientId = null,
507
512
  otherContentHashes,
508
513
  transactionId = getTransactionId(),
509
- ) => {
510
- try {
514
+ ) =>
515
+ tryCatch(async () => {
511
516
  if (isUndefined(otherContentHashes)) {
512
517
  [otherContentHashes, otherClientId, transactionId] = await request(
513
518
  null,
@@ -566,10 +571,7 @@ const createCustomSynchronizer = (
566
571
  )[0],
567
572
  1,
568
573
  ];
569
- } catch (error) {
570
- onIgnoredError?.(error);
571
- }
572
- };
574
+ }, onIgnoredError);
573
575
  const getPersisted = async () => {
574
576
  const changes = await getChangesFromOtherStore();
575
577
  return changes && (!objIsEmpty(changes[0][0]) || !objIsEmpty(changes[1][0]))
@@ -593,13 +595,16 @@ const createCustomSynchronizer = (
593
595
  await persister.startAutoLoad(initialContent)
594
596
  ).startAutoSave();
595
597
  };
596
- const stopSync = () => {
598
+ const stopSync = async () => {
597
599
  syncing = 0;
598
- return persister.stopAutoLoad().stopAutoSave();
600
+ await persister.stopAutoLoad();
601
+ await persister.stopAutoSave();
602
+ return persister;
599
603
  };
600
- const destroy = () => {
601
- destroyImpl();
602
- return persister.stopSync();
604
+ const destroy = async () => {
605
+ await persister.stopSync();
606
+ extraDestroy();
607
+ return persister;
603
608
  };
604
609
  const getSynchronizerStats = () => ({sends, receives});
605
610
  const persister = createCustomPersister(