tinybase 8.0.0 → 8.1.0-beta.1
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.
- package/@types/ui-svelte/index.d.ts +2248 -0
- package/@types/ui-svelte/with-schemas/index.d.ts +1552 -0
- package/min/ui-svelte/index.js +1 -0
- package/min/ui-svelte/index.js.gz +0 -0
- package/min/ui-svelte/with-schemas/index.js +1 -0
- package/min/ui-svelte/with-schemas/index.js.gz +0 -0
- package/package.json +42 -2
- package/readme.md +3 -3
- package/releases.md +27 -1
- package/ui-svelte/index.js +2015 -0
- package/ui-svelte/with-schemas/index.js +2015 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"svelte/internal/disclose-version";import*as e from"svelte/internal/client";import{getContext as t,setContext as r}from"svelte";const n=e=>typeof e,s=n(""),d="Listener",u="Result",o="Ids",g="Table",i=g+"s",c=g+o,p="Row",a=p+"Count",l=p+o,I="Sorted"+p+o,f="Cell",h=f+o,b="Value",v=b+"s",m=b+o,x="Status",_="Metric",y="Slice",w="Checkpoint",k=e=>void 0===e,q=(C=k,(e,t,r)=>C(e)?r?.():t(e));var C;const R=e=>n(e)==s,L=Object.keys,$=(e,t)=>q(e,e=>e[t]),B="tinybase_uisc",V=[],S={},T=[V,void 0,V],z=e=>"function"==typeof e?e():e,j=()=>t(B)??[],A=(e,t,r)=>k(t)||R(t)?k(t)?e[2*r]:$(e[2*r+1],t):t,F=(e,t)=>A(j(),e,t),H=(e,t)=>{const r=j();return()=>A(r,"function"==typeof t?t():t,e)},M=(e,t)=>L(e[2*t+1]??S),O=e=>H(0,e),Q=e=>H(1,e),D=e=>H(2,e),E=e=>H(3,e),G=e=>H(4,e),J=e=>H(5,e),K=(t,r,n,s,d)=>{let u=e.state(e.proxy(t()?.[r]?.(...d())??s));return e.user_effect(()=>{const o=t(),g=d();e.set(u,o?.[r]?.(...g)??s,!0);const i=o?.[n]?.(...g,()=>{e.set(u,o[r](...d())??s,!0)});return()=>o?.delListener?.(i)}),{get current(){return e.get(u)}}},N=(e,t,r,n=()=>V)=>K(e,"get"+t,"add"+t+d,r,n),P=(e,t,r=()=>V)=>K(e,"has"+t,"addHas"+t+d,!1,r),U=e=>P(O(e),i),W=e=>N(O(e),i,S),X=e=>N(O(e),c,V),Y=(e,t)=>P(O(t),g,()=>[z(e)]),Z=(e,t)=>N(O(t),g,S,()=>[z(e)]),ee=(e,t)=>N(O(t),g+h,V,()=>[z(e)]),te=(e,t,r)=>P(O(r),g+f,()=>[z(e),z(t)]),re=(e,t)=>N(O(t),a,0,()=>[z(e)]),ne=(e,t)=>N(O(t),l,V,()=>[z(e)]),se=(e,t,r=!1,n=0,s,d)=>N(O(d),I,V,()=>[z(e),z(t),z(r),z(n),z(s)]),de=(e,t,r)=>P(O(r),p,()=>[z(e),z(t)]),ue=(e,t,r)=>N(O(r),p,S,()=>[z(e),z(t)]),oe=(e,t,r)=>N(O(r),h,V,()=>[z(e),z(t)]),ge=(e,t,r,n)=>P(O(n),f,()=>[z(e),z(t),z(r)]),ie=(e,t,r,n)=>N(O(n),f,void 0,()=>[z(e),z(t),z(r)]),ce=(t,r,n,s)=>{const d=O(s);let u=e.state(e.proxy(d()?.getCell(z(t),z(r),z(n))));return e.user_effect(()=>{const s=d(),o=z(t),g=z(r),i=z(n);e.set(u,s?.getCell(o,g,i),!0);const c=s?.addCellListener(o,g,i,s=>{e.set(u,s.getCell(z(t),z(r),z(n)),!0)});return()=>s?.delListener?.(c)}),{get current(){return e.get(u)},set current(e){d()?.setCell(z(t),z(r),z(n),e)}}},pe=e=>P(O(e),v),ae=e=>N(O(e),v,S),le=e=>N(O(e),m,V),Ie=(e,t)=>P(O(t),b,()=>[z(e)]),fe=(e,t)=>N(O(t),b,void 0,()=>[z(e)]),he=(t,r)=>{const n=O(r);let s=e.state(e.proxy(n()?.getValue(z(t))));return e.user_effect(()=>{const r=n(),d=z(t);e.set(s,r?.getValue(d),!0);const u=r?.addValueListener(d,r=>{e.set(s,r.getValue(z(t)),!0)});return()=>r?.delListener?.(u)}),{get current(){return e.get(s)},set current(e){n()?.setValue(z(t),e)}}},be=e=>F(e,0),ve=()=>{const t=j();let r=e.state(e.proxy(M(t,0)));return e.user_effect(()=>{e.set(r,M(t,0),!0)}),{get current(){return e.get(r)}}},me=e=>F(e,1),xe=()=>{const t=j();let r=e.state(e.proxy(M(t,1)));return e.user_effect(()=>{e.set(r,M(t,1),!0)}),{get current(){return e.get(r)}}},_e=e=>N(Q(e),_+o,V),ye=(e,t)=>N(Q(t),_,void 0,()=>[z(e)]),we=e=>F(e,2),ke=()=>{const t=j();let r=e.state(e.proxy(M(t,2)));return e.user_effect(()=>{e.set(r,M(t,2),!0)}),{get current(){return e.get(r)}}},qe=e=>N(D(e),"Index"+o,V),Ce=(e,t)=>N(D(t),y+o,V,()=>[z(e)]),Re=(e,t,r)=>N(D(r),y+l,V,()=>[z(e),z(t)]),Le=e=>F(e,4),$e=()=>{const t=j();let r=e.state(e.proxy(M(t,4)));return e.user_effect(()=>{e.set(r,M(t,4),!0)}),{get current(){return e.get(r)}}},Be=e=>N(G(e),"Query"+o,V),Ve=(e,t)=>N(G(t),u+g,S,()=>[z(e)]),Se=(e,t)=>N(G(t),u+g+h,V,()=>[z(e)]),Te=(e,t)=>N(G(t),u+a,0,()=>[z(e)]),ze=(e,t)=>N(G(t),u+l,V,()=>[z(e)]),je=(e,t,r=!1,n=0,s,d)=>N(G(d),u+I,V,()=>[z(e),z(t),z(r),z(n),z(s)]),Ae=(e,t,r)=>N(G(r),u+p,S,()=>[z(e),z(t)]),Fe=(e,t,r)=>N(G(r),u+h,V,()=>[z(e),z(t)]),He=(e,t,r,n)=>N(G(n),u+f,void 0,()=>[z(e),z(t),z(r)]),Me=e=>F(e,3),Oe=()=>{const t=j();let r=e.state(e.proxy(M(t,3)));return e.user_effect(()=>{e.set(r,M(t,3),!0)}),{get current(){return e.get(r)}}},Qe=e=>N(E(e),"Relationship"+o,V),De=(e,t,r)=>N(E(r),"RemoteRowId",void 0,()=>[z(e),z(t)]),Ee=(e,t,r)=>N(E(r),"Local"+l,V,()=>[z(e),z(t)]),Ge=(e,t,r)=>N(E(r),"Linked"+l,V,()=>[z(e),z(t)]),Je=e=>F(e,5),Ke=()=>{const t=j();let r=e.state(e.proxy(M(t,5)));return e.user_effect(()=>{e.set(r,M(t,5),!0)}),{get current(){return e.get(r)}}},Ne=e=>N(J(e),w+o,T),Pe=(e,t)=>N(J(t),w,void 0,()=>[z(e)]),Ue=e=>{const t=J(e);return()=>t()?.goBackward()},We=e=>{const t=J(e);return()=>t()?.goForward()},Xe=e=>F(e,6),Ye=()=>{const t=j();let r=e.state(e.proxy(M(t,6)));return e.user_effect(()=>{e.set(r,M(t,6),!0)}),{get current(){return e.get(r)}}},Ze=e=>N(H(6,e),x,0),et=e=>F(e,7),tt=()=>{const t=j();let r=e.state(e.proxy(M(t,7)));return e.user_effect(()=>{e.set(r,M(t,7),!0)}),{get current(){return e.get(r)}}},rt=e=>N(H(7,e),x,0),nt=(t,r,n)=>{const s=j();e.user_effect(()=>(s[16]?.(t,r,n),()=>s[17]?.(t,r)))},st=(e,t)=>nt(0,e,t),dt=(e,t)=>nt(1,e,t),ut=(e,t)=>nt(2,e,t),ot=(e,t)=>nt(3,e,t),gt=(e,t)=>nt(4,e,t),it=(e,t)=>nt(5,e,t),ct=(e,t)=>nt(6,e,t),pt=(e,t)=>nt(7,e,t);function at(t,r){e.push(r,!0);const n=Pe(()=>r.checkpointId,()=>r.checkpoints),s=e.derived(()=>""+(n.current??"")),d=e.derived(()=>r.debugIds?`${r.checkpointId}:{${e.get(s)}}`:e.get(s));e.next();var u=e.text();e.template_effect(()=>e.set_text(u,e.get(d))),e.append(t,u),e.pop()}var lt=e.from_html("<!><!>",1),It=e.from_html("<!><!><!>",1);function ft(t,r){var n=It(),s=e.first_child(n),d=t=>{var n=e.text();e.template_effect(()=>e.set_text(n,(r.id??"")+":{")),e.append(t,n)};e.if(s,e=>{r.debugIds&&void 0!==r.id&&e(d)});var u=e.sibling(s);e.each(u,17,()=>r.ids,e.index,(t,n,s)=>{var d=lt(),u=e.first_child(d),o=t=>{var n=e.comment(),s=e.first_child(n);e.snippet(s,()=>r.separator),e.append(t,n)};e.if(u,e=>{s>0&&r.separator&&e(o)});var g=e.sibling(u),i=t=>{var s=e.comment(),d=e.first_child(s);e.snippet(d,()=>r.custom,()=>e.get(n)),e.append(t,s)},c=t=>{var s=e.comment(),d=e.first_child(s);e.snippet(d,()=>r.children,()=>e.get(n)),e.append(t,s)};e.if(g,e=>{r.custom?e(i):e(c,-1)}),e.append(t,d)});var o=e.sibling(u),g=t=>{var r=e.text();r.nodeValue="}",e.append(t,r)};e.if(o,e=>{r.debugIds&&void 0!==r.id&&e(g)}),e.append(t,n)}function ht(t,r){e.push(r,!0);const n=Ne(()=>r.checkpoints),s=e.derived(()=>n.current[0]);{const n=(t,n=e.noop)=>{at(t,{get checkpointId(){return n()},get checkpoints(){return r.checkpoints},get debugIds(){return r.debugIds}})};ft(t,{get ids(){return e.get(s)},get separator(){return r.separator},get debugIds(){return r.debugIds},get custom(){return r.checkpoint},children:n})}e.pop()}function bt(t,r){e.push(r,!0);const n=ie(()=>r.tableId,()=>r.rowId,()=>r.cellId,()=>r.store),s=e.derived(()=>""+(n.current??"")),d=e.derived(()=>r.debugIds?`${r.cellId}:{${e.get(s)}}`:e.get(s));e.next();var u=e.text();e.template_effect(()=>e.set_text(u,e.get(d))),e.append(t,u),e.pop()}function vt(t,r){e.push(r,!0);const n=Ne(()=>r.checkpoints),s=e.derived(()=>n.current[1]);var d=e.comment(),u=e.first_child(d),o=t=>{var n=e.comment(),d=e.first_child(n),u=t=>{var n=e.comment(),d=e.first_child(n);e.snippet(d,()=>r.checkpoint,()=>e.get(s)),e.append(t,n)},o=t=>{at(t,{get checkpointId(){return e.get(s)},get checkpoints(){return r.checkpoints},get debugIds(){return r.debugIds}})};e.if(d,e=>{r.checkpoint?e(u):e(o,-1)}),e.append(t,n)};e.if(u,t=>{void 0!==e.get(s)&&t(o)}),e.append(t,d),e.pop()}function mt(t,r){e.push(r,!0);const n=Ne(()=>r.checkpoints),s=e.derived(()=>n.current[2]);{const n=(t,n=e.noop)=>{at(t,{get checkpointId(){return n()},get checkpoints(){return r.checkpoints},get debugIds(){return r.debugIds}})};ft(t,{get ids(){return e.get(s)},get separator(){return r.separator},get debugIds(){return r.debugIds},get custom(){return r.checkpoint},children:n})}e.pop()}function xt(t,r){e.push(r,!0);const n=oe(()=>r.tableId,()=>r.rowId,()=>r.store),s=e.derived(()=>r.customCellIds??n.current);{const n=(t,n=e.noop)=>{bt(t,{get tableId(){return r.tableId},get rowId(){return r.rowId},get cellId(){return n()},get store(){return r.store},get debugIds(){return r.debugIds}})};ft(t,{get ids(){return e.get(s)},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.rowId},get custom(){return r.cell},children:n})}e.pop()}function _t(r,n){e.push(n,!0);const s=t(B)??[],d=e.derived(()=>R(n.indexes)?$(s[5],n.indexes):n.indexes??s[4]),u=e.derived(()=>e.get(d)?.getStore()),o=e.derived(()=>e.get(d)?.getTableId(n.indexId)),g=Re(()=>n.indexId,()=>n.sliceId,()=>n.indexes);{const t=(t,r=e.noop)=>{var s=e.comment(),d=e.first_child(s),g=t=>{xt(t,{get tableId(){return e.get(o)},get rowId(){return r()},get store(){return e.get(u)},get debugIds(){return n.debugIds}})};e.if(d,t=>{e.get(o)&&t(g)}),e.append(t,s)};ft(r,{get ids(){return g.current},get separator(){return n.separator},get debugIds(){return n.debugIds},get id(){return n.sliceId},get custom(){return n.row},children:t})}e.pop()}function yt(t,r){e.push(r,!0);const n=Ce(()=>r.indexId,()=>r.indexes);{const s=(t,n=e.noop)=>{_t(t,{get indexId(){return r.indexId},get sliceId(){return n()},get indexes(){return r.indexes},get debugIds(){return r.debugIds}})};ft(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.indexId},get custom(){return r.slice},children:s})}e.pop()}function wt(r,n){e.push(n,!0);const s=t(B)??[],d=e.derived(()=>R(n.relationships)?$(s[7],n.relationships):n.relationships??s[6]),u=e.derived(()=>e.get(d)?.getStore()),o=e.derived(()=>e.get(d)?.getLocalTableId(n.relationshipId)),g=Ge(()=>n.relationshipId,()=>n.firstRowId,()=>n.relationships);{const t=(t,r=e.noop)=>{var s=e.comment(),d=e.first_child(s),g=t=>{xt(t,{get tableId(){return e.get(o)},get rowId(){return r()},get store(){return e.get(u)},get debugIds(){return n.debugIds}})};e.if(d,t=>{e.get(o)&&t(g)}),e.append(t,s)};ft(r,{get ids(){return g.current},get separator(){return n.separator},get debugIds(){return n.debugIds},get id(){return n.firstRowId},get custom(){return n.row},children:t})}e.pop()}function kt(r,n){e.push(n,!0);const s=t(B)??[],d=e.derived(()=>R(n.relationships)?$(s[7],n.relationships):n.relationships??s[6]),u=e.derived(()=>e.get(d)?.getStore()),o=e.derived(()=>e.get(d)?.getLocalTableId(n.relationshipId)),g=Ee(()=>n.relationshipId,()=>n.remoteRowId,()=>n.relationships);{const t=(t,r=e.noop)=>{var s=e.comment(),d=e.first_child(s),g=t=>{xt(t,{get tableId(){return e.get(o)},get rowId(){return r()},get store(){return e.get(u)},get debugIds(){return n.debugIds}})};e.if(d,t=>{e.get(o)&&t(g)}),e.append(t,s)};ft(r,{get ids(){return g.current},get separator(){return n.separator},get debugIds(){return n.debugIds},get id(){return n.remoteRowId},get custom(){return n.row},children:t})}e.pop()}function qt(t,r){e.push(r,!0);const n=ye(()=>r.metricId,()=>r.metrics),s=e.derived(()=>""+(n.current??"")),d=e.derived(()=>r.debugIds?`${r.metricId}:{${e.get(s)}}`:e.get(s));e.next();var u=e.text();e.template_effect(()=>e.set_text(u,e.get(d))),e.append(t,u),e.pop()}function Ct(n,s){e.push(s,!0);const d=t(B)??[];let u=e.proxy(Array.from({length:8},()=>({})));const o=(e,t,r)=>{u[e]={...u[e],[t]:r}},g=(e,t)=>{const{[t]:r,...n}=u[e];u[e]=n};r(B,{get 0(){return s.store??d[0]},get 1(){return{...d[1]??{},...s.storesById,...u[0]}},get 2(){return s.metrics??d[2]},get 3(){return{...d[3]??{},...s.metricsById,...u[1]}},get 4(){return s.indexes??d[4]},get 5(){return{...d[5]??{},...s.indexesById,...u[2]}},get 6(){return s.relationships??d[6]},get 7(){return{...d[7]??{},...s.relationshipsById,...u[3]}},get 8(){return s.queries??d[8]},get 9(){return{...d[9]??{},...s.queriesById,...u[4]}},get 10(){return s.checkpoints??d[10]},get 11(){return{...d[11]??{},...s.checkpointsById,...u[5]}},get 12(){return s.persister??d[12]},get 13(){return{...d[13]??{},...s.persistersById,...u[6]}},get 14(){return s.synchronizer??d[14]},get 15(){return{...d[15]??{},...s.synchronizersById,...u[7]}},get 16(){return o},get 17(){return g}});var i=e.comment(),c=e.first_child(i);e.snippet(c,()=>s.children),e.append(n,i),e.pop()}var Rt=e.from_html("<!><!><!>",1);function Lt(r,n){e.push(n,!0);const s=t(B)??[],d=e.derived(()=>R(n.relationships)?$(s[7],n.relationships):n.relationships??s[6]),u=e.derived(()=>e.get(d)?.getStore()),o=e.derived(()=>e.get(d)?.getRemoteTableId(n.relationshipId)),g=De(()=>n.relationshipId,()=>n.localRowId,()=>n.relationships);var i=Rt(),c=e.first_child(i),p=t=>{var r=e.text();e.template_effect(()=>e.set_text(r,(n.localRowId??"")+":{")),e.append(t,r)};e.if(c,e=>{n.debugIds&&e(p)});var a=e.sibling(c),l=t=>{var r=e.comment(),s=e.first_child(r),d=t=>{var r=e.comment(),s=e.first_child(r);e.snippet(s,()=>n.row,()=>g.current),e.append(t,r)},i=t=>{xt(t,{get tableId(){return e.get(o)},get rowId(){return g.current},get store(){return e.get(u)},get debugIds(){return n.debugIds}})};e.if(s,t=>{n.row?t(d):e.get(o)&&t(i,1)}),e.append(t,r)};e.if(a,e=>{void 0!==g.current&&e(l)});var I=e.sibling(a),f=t=>{var r=e.text();r.nodeValue="}",e.append(t,r)};e.if(I,e=>{n.debugIds&&e(f)}),e.append(r,i),e.pop()}function $t(t,r){e.push(r,!0);const n=He(()=>r.queryId,()=>r.rowId,()=>r.cellId,()=>r.queries),s=e.derived(()=>""+(n.current??"")),d=e.derived(()=>r.debugIds?`${r.cellId}:{${e.get(s)}}`:e.get(s));e.next();var u=e.text();e.template_effect(()=>e.set_text(u,e.get(d))),e.append(t,u),e.pop()}function Bt(t,r){e.push(r,!0);const n=Fe(()=>r.queryId,()=>r.rowId,()=>r.queries);{const s=(t,n=e.noop)=>{$t(t,{get queryId(){return r.queryId},get rowId(){return r.rowId},get cellId(){return n()},get queries(){return r.queries},get debugIds(){return r.debugIds}})};ft(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.rowId},get custom(){return r.cell},children:s})}e.pop()}function Vt(t,r){e.push(r,!0);const n=je(()=>r.queryId,()=>r.cellId,()=>r.descending??!1,()=>r.offset??0,()=>r.limit,()=>r.queries);{const s=(t,n=e.noop)=>{Bt(t,{get queryId(){return r.queryId},get rowId(){return n()},get queries(){return r.queries},get debugIds(){return r.debugIds}})};ft(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.queryId},get custom(){return r.row},children:s})}e.pop()}function St(t,r){e.push(r,!0);const n=ze(()=>r.queryId,()=>r.queries);{const s=(t,n=e.noop)=>{Bt(t,{get queryId(){return r.queryId},get rowId(){return n()},get queries(){return r.queries},get debugIds(){return r.debugIds}})};ft(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.queryId},get custom(){return r.row},children:s})}e.pop()}function Tt(t,r){e.push(r,!0);const n=se(()=>r.tableId,()=>r.cellId,()=>r.descending??!1,()=>r.offset??0,()=>r.limit,()=>r.store);{const s=(t,n=e.noop)=>{xt(t,{get tableId(){return r.tableId},get rowId(){return n()},get store(){return r.store},get customCellIds(){return r.customCellIds},get debugIds(){return r.debugIds}})};ft(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.tableId},get custom(){return r.row},children:s})}e.pop()}function zt(t,r){e.push(r,!0);const n=ne(()=>r.tableId,()=>r.store);{const s=(t,n=e.noop)=>{xt(t,{get tableId(){return r.tableId},get rowId(){return n()},get store(){return r.store},get customCellIds(){return r.customCellIds},get debugIds(){return r.debugIds}})};ft(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.tableId},get custom(){return r.row},children:s})}e.pop()}function jt(t,r){e.push(r,!0);const n=X(()=>r.store);{const s=(t,n=e.noop)=>{zt(t,{get tableId(){return n()},get store(){return r.store},get debugIds(){return r.debugIds}})};ft(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get custom(){return r.table},children:s})}e.pop()}function At(t,r){e.push(r,!0);const n=fe(()=>r.valueId,()=>r.store),s=e.derived(()=>""+(n.current??"")),d=e.derived(()=>r.debugIds?`${r.valueId}:{${e.get(s)}}`:e.get(s));e.next();var u=e.text();e.template_effect(()=>e.set_text(u,e.get(d))),e.append(t,u),e.pop()}function Ft(t,r){e.push(r,!0);const n=le(()=>r.store);{const s=(t,n=e.noop)=>{At(t,{get valueId(){return n()},get store(){return r.store},get debugIds(){return r.debugIds}})};ft(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get custom(){return r.value},children:s})}e.pop()}export{ht as BackwardCheckpointsView,bt as CellView,at as CheckpointView,vt as CurrentCheckpointView,mt as ForwardCheckpointsView,yt as IndexView,wt as LinkedRowsView,kt as LocalRowsView,qt as MetricView,Ct as Provider,Lt as RemoteRowView,$t as ResultCellView,Bt as ResultRowView,Vt as ResultSortedTableView,St as ResultTableView,xt as RowView,_t as SliceView,Tt as SortedTableView,zt as TableView,jt as TablesView,At as ValueView,Ft as ValuesView,it as provideCheckpoints,ut as provideIndexes,dt as provideMetrics,ct as providePersister,gt as provideQueries,ot as provideRelationships,st as provideStore,pt as provideSynchronizer,ie as useCell,oe as useCellIds,ce as useCellState,Pe as useCheckpoint,Ne as useCheckpointIds,Je as useCheckpoints,Ke as useCheckpointsIds,Ue as useGoBackwardCallback,We as useGoForwardCallback,ge as useHasCell,de as useHasRow,Y as useHasTable,te as useHasTableCell,U as useHasTables,Ie as useHasValue,pe as useHasValues,qe as useIndexIds,we as useIndexes,ke as useIndexesIds,Ge as useLinkedRowIds,Ee as useLocalRowIds,ye as useMetric,_e as useMetricIds,me as useMetrics,xe as useMetricsIds,Xe as usePersister,Ye as usePersisterIds,Ze as usePersisterStatus,Le as useQueries,$e as useQueriesIds,Be as useQueryIds,Qe as useRelationshipIds,Me as useRelationships,Oe as useRelationshipsIds,De as useRemoteRowId,He as useResultCell,Fe as useResultCellIds,Ae as useResultRow,Te as useResultRowCount,ze as useResultRowIds,je as useResultSortedRowIds,Ve as useResultTable,Se as useResultTableCellIds,ue as useRow,re as useRowCount,ne as useRowIds,Ce as useSliceIds,Re as useSliceRowIds,se as useSortedRowIds,be as useStore,ve as useStoreIds,et as useSynchronizer,tt as useSynchronizerIds,rt as useSynchronizerStatus,Z as useTable,ee as useTableCellIds,X as useTableIds,W as useTables,fe as useValue,le as useValueIds,he as useValueState,ae as useValues};
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"svelte/internal/disclose-version";import*as e from"svelte/internal/client";import{getContext as t,setContext as r}from"svelte";const n=e=>typeof e,s=n(""),d="Listener",u="Result",o="Ids",g="Table",i=g+"s",c=g+o,p="Row",a=p+"Count",l=p+o,I="Sorted"+p+o,f="Cell",h=f+o,b="Value",v=b+"s",m=b+o,x="Status",_="Metric",y="Slice",w="Checkpoint",k=e=>void 0===e,q=(C=k,(e,t,r)=>C(e)?r?.():t(e));var C;const R=e=>n(e)==s,L=Object.keys,$=(e,t)=>q(e,e=>e[t]),B="tinybase_uisc",V=[],S={},T=[V,void 0,V],z=e=>"function"==typeof e?e():e,j=()=>t(B)??[],A=(e,t,r)=>k(t)||R(t)?k(t)?e[2*r]:$(e[2*r+1],t):t,F=(e,t)=>A(j(),e,t),H=(e,t)=>{const r=j();return()=>A(r,"function"==typeof t?t():t,e)},M=(e,t)=>L(e[2*t+1]??S),O=e=>H(0,e),Q=e=>H(1,e),D=e=>H(2,e),E=e=>H(3,e),G=e=>H(4,e),J=e=>H(5,e),K=(t,r,n,s,d)=>{let u=e.state(e.proxy(t()?.[r]?.(...d())??s));return e.user_effect(()=>{const o=t(),g=d();e.set(u,o?.[r]?.(...g)??s,!0);const i=o?.[n]?.(...g,()=>{e.set(u,o[r](...d())??s,!0)});return()=>o?.delListener?.(i)}),{get current(){return e.get(u)}}},N=(e,t,r,n=()=>V)=>K(e,"get"+t,"add"+t+d,r,n),P=(e,t,r=()=>V)=>K(e,"has"+t,"addHas"+t+d,!1,r),U=e=>P(O(e),i),W=e=>N(O(e),i,S),X=e=>N(O(e),c,V),Y=(e,t)=>P(O(t),g,()=>[z(e)]),Z=(e,t)=>N(O(t),g,S,()=>[z(e)]),ee=(e,t)=>N(O(t),g+h,V,()=>[z(e)]),te=(e,t,r)=>P(O(r),g+f,()=>[z(e),z(t)]),re=(e,t)=>N(O(t),a,0,()=>[z(e)]),ne=(e,t)=>N(O(t),l,V,()=>[z(e)]),se=(e,t,r=!1,n=0,s,d)=>N(O(d),I,V,()=>[z(e),z(t),z(r),z(n),z(s)]),de=(e,t,r)=>P(O(r),p,()=>[z(e),z(t)]),ue=(e,t,r)=>N(O(r),p,S,()=>[z(e),z(t)]),oe=(e,t,r)=>N(O(r),h,V,()=>[z(e),z(t)]),ge=(e,t,r,n)=>P(O(n),f,()=>[z(e),z(t),z(r)]),ie=(e,t,r,n)=>N(O(n),f,void 0,()=>[z(e),z(t),z(r)]),ce=(t,r,n,s)=>{const d=O(s);let u=e.state(e.proxy(d()?.getCell(z(t),z(r),z(n))));return e.user_effect(()=>{const s=d(),o=z(t),g=z(r),i=z(n);e.set(u,s?.getCell(o,g,i),!0);const c=s?.addCellListener(o,g,i,s=>{e.set(u,s.getCell(z(t),z(r),z(n)),!0)});return()=>s?.delListener?.(c)}),{get current(){return e.get(u)},set current(e){d()?.setCell(z(t),z(r),z(n),e)}}},pe=e=>P(O(e),v),ae=e=>N(O(e),v,S),le=e=>N(O(e),m,V),Ie=(e,t)=>P(O(t),b,()=>[z(e)]),fe=(e,t)=>N(O(t),b,void 0,()=>[z(e)]),he=(t,r)=>{const n=O(r);let s=e.state(e.proxy(n()?.getValue(z(t))));return e.user_effect(()=>{const r=n(),d=z(t);e.set(s,r?.getValue(d),!0);const u=r?.addValueListener(d,r=>{e.set(s,r.getValue(z(t)),!0)});return()=>r?.delListener?.(u)}),{get current(){return e.get(s)},set current(e){n()?.setValue(z(t),e)}}},be=e=>F(e,0),ve=()=>{const t=j();let r=e.state(e.proxy(M(t,0)));return e.user_effect(()=>{e.set(r,M(t,0),!0)}),{get current(){return e.get(r)}}},me=e=>F(e,1),xe=()=>{const t=j();let r=e.state(e.proxy(M(t,1)));return e.user_effect(()=>{e.set(r,M(t,1),!0)}),{get current(){return e.get(r)}}},_e=e=>N(Q(e),_+o,V),ye=(e,t)=>N(Q(t),_,void 0,()=>[z(e)]),we=e=>F(e,2),ke=()=>{const t=j();let r=e.state(e.proxy(M(t,2)));return e.user_effect(()=>{e.set(r,M(t,2),!0)}),{get current(){return e.get(r)}}},qe=e=>N(D(e),"Index"+o,V),Ce=(e,t)=>N(D(t),y+o,V,()=>[z(e)]),Re=(e,t,r)=>N(D(r),y+l,V,()=>[z(e),z(t)]),Le=e=>F(e,4),$e=()=>{const t=j();let r=e.state(e.proxy(M(t,4)));return e.user_effect(()=>{e.set(r,M(t,4),!0)}),{get current(){return e.get(r)}}},Be=e=>N(G(e),"Query"+o,V),Ve=(e,t)=>N(G(t),u+g,S,()=>[z(e)]),Se=(e,t)=>N(G(t),u+g+h,V,()=>[z(e)]),Te=(e,t)=>N(G(t),u+a,0,()=>[z(e)]),ze=(e,t)=>N(G(t),u+l,V,()=>[z(e)]),je=(e,t,r=!1,n=0,s,d)=>N(G(d),u+I,V,()=>[z(e),z(t),z(r),z(n),z(s)]),Ae=(e,t,r)=>N(G(r),u+p,S,()=>[z(e),z(t)]),Fe=(e,t,r)=>N(G(r),u+h,V,()=>[z(e),z(t)]),He=(e,t,r,n)=>N(G(n),u+f,void 0,()=>[z(e),z(t),z(r)]),Me=e=>F(e,3),Oe=()=>{const t=j();let r=e.state(e.proxy(M(t,3)));return e.user_effect(()=>{e.set(r,M(t,3),!0)}),{get current(){return e.get(r)}}},Qe=e=>N(E(e),"Relationship"+o,V),De=(e,t,r)=>N(E(r),"RemoteRowId",void 0,()=>[z(e),z(t)]),Ee=(e,t,r)=>N(E(r),"Local"+l,V,()=>[z(e),z(t)]),Ge=(e,t,r)=>N(E(r),"Linked"+l,V,()=>[z(e),z(t)]),Je=e=>F(e,5),Ke=()=>{const t=j();let r=e.state(e.proxy(M(t,5)));return e.user_effect(()=>{e.set(r,M(t,5),!0)}),{get current(){return e.get(r)}}},Ne=e=>N(J(e),w+o,T),Pe=(e,t)=>N(J(t),w,void 0,()=>[z(e)]),Ue=e=>{const t=J(e);return()=>t()?.goBackward()},We=e=>{const t=J(e);return()=>t()?.goForward()},Xe=e=>F(e,6),Ye=()=>{const t=j();let r=e.state(e.proxy(M(t,6)));return e.user_effect(()=>{e.set(r,M(t,6),!0)}),{get current(){return e.get(r)}}},Ze=e=>N(H(6,e),x,0),et=e=>F(e,7),tt=()=>{const t=j();let r=e.state(e.proxy(M(t,7)));return e.user_effect(()=>{e.set(r,M(t,7),!0)}),{get current(){return e.get(r)}}},rt=e=>N(H(7,e),x,0),nt=(t,r,n)=>{const s=j();e.user_effect(()=>(s[16]?.(t,r,n),()=>s[17]?.(t,r)))},st=(e,t)=>nt(0,e,t),dt=(e,t)=>nt(1,e,t),ut=(e,t)=>nt(2,e,t),ot=(e,t)=>nt(3,e,t),gt=(e,t)=>nt(4,e,t),it=(e,t)=>nt(5,e,t),ct=(e,t)=>nt(6,e,t),pt=(e,t)=>nt(7,e,t);function at(t,r){e.push(r,!0);const n=Pe(()=>r.checkpointId,()=>r.checkpoints),s=e.derived(()=>""+(n.current??"")),d=e.derived(()=>r.debugIds?`${r.checkpointId}:{${e.get(s)}}`:e.get(s));e.next();var u=e.text();e.template_effect(()=>e.set_text(u,e.get(d))),e.append(t,u),e.pop()}var lt=e.from_html("<!><!>",1),It=e.from_html("<!><!><!>",1);function ft(t,r){var n=It(),s=e.first_child(n),d=t=>{var n=e.text();e.template_effect(()=>e.set_text(n,(r.id??"")+":{")),e.append(t,n)};e.if(s,e=>{r.debugIds&&void 0!==r.id&&e(d)});var u=e.sibling(s);e.each(u,17,()=>r.ids,e.index,(t,n,s)=>{var d=lt(),u=e.first_child(d),o=t=>{var n=e.comment(),s=e.first_child(n);e.snippet(s,()=>r.separator),e.append(t,n)};e.if(u,e=>{s>0&&r.separator&&e(o)});var g=e.sibling(u),i=t=>{var s=e.comment(),d=e.first_child(s);e.snippet(d,()=>r.custom,()=>e.get(n)),e.append(t,s)},c=t=>{var s=e.comment(),d=e.first_child(s);e.snippet(d,()=>r.children,()=>e.get(n)),e.append(t,s)};e.if(g,e=>{r.custom?e(i):e(c,-1)}),e.append(t,d)});var o=e.sibling(u),g=t=>{var r=e.text();r.nodeValue="}",e.append(t,r)};e.if(o,e=>{r.debugIds&&void 0!==r.id&&e(g)}),e.append(t,n)}function ht(t,r){e.push(r,!0);const n=Ne(()=>r.checkpoints),s=e.derived(()=>n.current[0]);{const n=(t,n=e.noop)=>{at(t,{get checkpointId(){return n()},get checkpoints(){return r.checkpoints},get debugIds(){return r.debugIds}})};ft(t,{get ids(){return e.get(s)},get separator(){return r.separator},get debugIds(){return r.debugIds},get custom(){return r.checkpoint},children:n})}e.pop()}function bt(t,r){e.push(r,!0);const n=ie(()=>r.tableId,()=>r.rowId,()=>r.cellId,()=>r.store),s=e.derived(()=>""+(n.current??"")),d=e.derived(()=>r.debugIds?`${r.cellId}:{${e.get(s)}}`:e.get(s));e.next();var u=e.text();e.template_effect(()=>e.set_text(u,e.get(d))),e.append(t,u),e.pop()}function vt(t,r){e.push(r,!0);const n=Ne(()=>r.checkpoints),s=e.derived(()=>n.current[1]);var d=e.comment(),u=e.first_child(d),o=t=>{var n=e.comment(),d=e.first_child(n),u=t=>{var n=e.comment(),d=e.first_child(n);e.snippet(d,()=>r.checkpoint,()=>e.get(s)),e.append(t,n)},o=t=>{at(t,{get checkpointId(){return e.get(s)},get checkpoints(){return r.checkpoints},get debugIds(){return r.debugIds}})};e.if(d,e=>{r.checkpoint?e(u):e(o,-1)}),e.append(t,n)};e.if(u,t=>{void 0!==e.get(s)&&t(o)}),e.append(t,d),e.pop()}function mt(t,r){e.push(r,!0);const n=Ne(()=>r.checkpoints),s=e.derived(()=>n.current[2]);{const n=(t,n=e.noop)=>{at(t,{get checkpointId(){return n()},get checkpoints(){return r.checkpoints},get debugIds(){return r.debugIds}})};ft(t,{get ids(){return e.get(s)},get separator(){return r.separator},get debugIds(){return r.debugIds},get custom(){return r.checkpoint},children:n})}e.pop()}function xt(t,r){e.push(r,!0);const n=oe(()=>r.tableId,()=>r.rowId,()=>r.store),s=e.derived(()=>r.customCellIds??n.current);{const n=(t,n=e.noop)=>{bt(t,{get tableId(){return r.tableId},get rowId(){return r.rowId},get cellId(){return n()},get store(){return r.store},get debugIds(){return r.debugIds}})};ft(t,{get ids(){return e.get(s)},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.rowId},get custom(){return r.cell},children:n})}e.pop()}function _t(r,n){e.push(n,!0);const s=t(B)??[],d=e.derived(()=>R(n.indexes)?$(s[5],n.indexes):n.indexes??s[4]),u=e.derived(()=>e.get(d)?.getStore()),o=e.derived(()=>e.get(d)?.getTableId(n.indexId)),g=Re(()=>n.indexId,()=>n.sliceId,()=>n.indexes);{const t=(t,r=e.noop)=>{var s=e.comment(),d=e.first_child(s),g=t=>{xt(t,{get tableId(){return e.get(o)},get rowId(){return r()},get store(){return e.get(u)},get debugIds(){return n.debugIds}})};e.if(d,t=>{e.get(o)&&t(g)}),e.append(t,s)};ft(r,{get ids(){return g.current},get separator(){return n.separator},get debugIds(){return n.debugIds},get id(){return n.sliceId},get custom(){return n.row},children:t})}e.pop()}function yt(t,r){e.push(r,!0);const n=Ce(()=>r.indexId,()=>r.indexes);{const s=(t,n=e.noop)=>{_t(t,{get indexId(){return r.indexId},get sliceId(){return n()},get indexes(){return r.indexes},get debugIds(){return r.debugIds}})};ft(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.indexId},get custom(){return r.slice},children:s})}e.pop()}function wt(r,n){e.push(n,!0);const s=t(B)??[],d=e.derived(()=>R(n.relationships)?$(s[7],n.relationships):n.relationships??s[6]),u=e.derived(()=>e.get(d)?.getStore()),o=e.derived(()=>e.get(d)?.getLocalTableId(n.relationshipId)),g=Ge(()=>n.relationshipId,()=>n.firstRowId,()=>n.relationships);{const t=(t,r=e.noop)=>{var s=e.comment(),d=e.first_child(s),g=t=>{xt(t,{get tableId(){return e.get(o)},get rowId(){return r()},get store(){return e.get(u)},get debugIds(){return n.debugIds}})};e.if(d,t=>{e.get(o)&&t(g)}),e.append(t,s)};ft(r,{get ids(){return g.current},get separator(){return n.separator},get debugIds(){return n.debugIds},get id(){return n.firstRowId},get custom(){return n.row},children:t})}e.pop()}function kt(r,n){e.push(n,!0);const s=t(B)??[],d=e.derived(()=>R(n.relationships)?$(s[7],n.relationships):n.relationships??s[6]),u=e.derived(()=>e.get(d)?.getStore()),o=e.derived(()=>e.get(d)?.getLocalTableId(n.relationshipId)),g=Ee(()=>n.relationshipId,()=>n.remoteRowId,()=>n.relationships);{const t=(t,r=e.noop)=>{var s=e.comment(),d=e.first_child(s),g=t=>{xt(t,{get tableId(){return e.get(o)},get rowId(){return r()},get store(){return e.get(u)},get debugIds(){return n.debugIds}})};e.if(d,t=>{e.get(o)&&t(g)}),e.append(t,s)};ft(r,{get ids(){return g.current},get separator(){return n.separator},get debugIds(){return n.debugIds},get id(){return n.remoteRowId},get custom(){return n.row},children:t})}e.pop()}function qt(t,r){e.push(r,!0);const n=ye(()=>r.metricId,()=>r.metrics),s=e.derived(()=>""+(n.current??"")),d=e.derived(()=>r.debugIds?`${r.metricId}:{${e.get(s)}}`:e.get(s));e.next();var u=e.text();e.template_effect(()=>e.set_text(u,e.get(d))),e.append(t,u),e.pop()}function Ct(n,s){e.push(s,!0);const d=t(B)??[];let u=e.proxy(Array.from({length:8},()=>({})));const o=(e,t,r)=>{u[e]={...u[e],[t]:r}},g=(e,t)=>{const{[t]:r,...n}=u[e];u[e]=n};r(B,{get 0(){return s.store??d[0]},get 1(){return{...d[1]??{},...s.storesById,...u[0]}},get 2(){return s.metrics??d[2]},get 3(){return{...d[3]??{},...s.metricsById,...u[1]}},get 4(){return s.indexes??d[4]},get 5(){return{...d[5]??{},...s.indexesById,...u[2]}},get 6(){return s.relationships??d[6]},get 7(){return{...d[7]??{},...s.relationshipsById,...u[3]}},get 8(){return s.queries??d[8]},get 9(){return{...d[9]??{},...s.queriesById,...u[4]}},get 10(){return s.checkpoints??d[10]},get 11(){return{...d[11]??{},...s.checkpointsById,...u[5]}},get 12(){return s.persister??d[12]},get 13(){return{...d[13]??{},...s.persistersById,...u[6]}},get 14(){return s.synchronizer??d[14]},get 15(){return{...d[15]??{},...s.synchronizersById,...u[7]}},get 16(){return o},get 17(){return g}});var i=e.comment(),c=e.first_child(i);e.snippet(c,()=>s.children),e.append(n,i),e.pop()}var Rt=e.from_html("<!><!><!>",1);function Lt(r,n){e.push(n,!0);const s=t(B)??[],d=e.derived(()=>R(n.relationships)?$(s[7],n.relationships):n.relationships??s[6]),u=e.derived(()=>e.get(d)?.getStore()),o=e.derived(()=>e.get(d)?.getRemoteTableId(n.relationshipId)),g=De(()=>n.relationshipId,()=>n.localRowId,()=>n.relationships);var i=Rt(),c=e.first_child(i),p=t=>{var r=e.text();e.template_effect(()=>e.set_text(r,(n.localRowId??"")+":{")),e.append(t,r)};e.if(c,e=>{n.debugIds&&e(p)});var a=e.sibling(c),l=t=>{var r=e.comment(),s=e.first_child(r),d=t=>{var r=e.comment(),s=e.first_child(r);e.snippet(s,()=>n.row,()=>g.current),e.append(t,r)},i=t=>{xt(t,{get tableId(){return e.get(o)},get rowId(){return g.current},get store(){return e.get(u)},get debugIds(){return n.debugIds}})};e.if(s,t=>{n.row?t(d):e.get(o)&&t(i,1)}),e.append(t,r)};e.if(a,e=>{void 0!==g.current&&e(l)});var I=e.sibling(a),f=t=>{var r=e.text();r.nodeValue="}",e.append(t,r)};e.if(I,e=>{n.debugIds&&e(f)}),e.append(r,i),e.pop()}function $t(t,r){e.push(r,!0);const n=He(()=>r.queryId,()=>r.rowId,()=>r.cellId,()=>r.queries),s=e.derived(()=>""+(n.current??"")),d=e.derived(()=>r.debugIds?`${r.cellId}:{${e.get(s)}}`:e.get(s));e.next();var u=e.text();e.template_effect(()=>e.set_text(u,e.get(d))),e.append(t,u),e.pop()}function Bt(t,r){e.push(r,!0);const n=Fe(()=>r.queryId,()=>r.rowId,()=>r.queries);{const s=(t,n=e.noop)=>{$t(t,{get queryId(){return r.queryId},get rowId(){return r.rowId},get cellId(){return n()},get queries(){return r.queries},get debugIds(){return r.debugIds}})};ft(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.rowId},get custom(){return r.cell},children:s})}e.pop()}function Vt(t,r){e.push(r,!0);const n=je(()=>r.queryId,()=>r.cellId,()=>r.descending??!1,()=>r.offset??0,()=>r.limit,()=>r.queries);{const s=(t,n=e.noop)=>{Bt(t,{get queryId(){return r.queryId},get rowId(){return n()},get queries(){return r.queries},get debugIds(){return r.debugIds}})};ft(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.queryId},get custom(){return r.row},children:s})}e.pop()}function St(t,r){e.push(r,!0);const n=ze(()=>r.queryId,()=>r.queries);{const s=(t,n=e.noop)=>{Bt(t,{get queryId(){return r.queryId},get rowId(){return n()},get queries(){return r.queries},get debugIds(){return r.debugIds}})};ft(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.queryId},get custom(){return r.row},children:s})}e.pop()}function Tt(t,r){e.push(r,!0);const n=se(()=>r.tableId,()=>r.cellId,()=>r.descending??!1,()=>r.offset??0,()=>r.limit,()=>r.store);{const s=(t,n=e.noop)=>{xt(t,{get tableId(){return r.tableId},get rowId(){return n()},get store(){return r.store},get customCellIds(){return r.customCellIds},get debugIds(){return r.debugIds}})};ft(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.tableId},get custom(){return r.row},children:s})}e.pop()}function zt(t,r){e.push(r,!0);const n=ne(()=>r.tableId,()=>r.store);{const s=(t,n=e.noop)=>{xt(t,{get tableId(){return r.tableId},get rowId(){return n()},get store(){return r.store},get customCellIds(){return r.customCellIds},get debugIds(){return r.debugIds}})};ft(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.tableId},get custom(){return r.row},children:s})}e.pop()}function jt(t,r){e.push(r,!0);const n=X(()=>r.store);{const s=(t,n=e.noop)=>{zt(t,{get tableId(){return n()},get store(){return r.store},get debugIds(){return r.debugIds}})};ft(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get custom(){return r.table},children:s})}e.pop()}function At(t,r){e.push(r,!0);const n=fe(()=>r.valueId,()=>r.store),s=e.derived(()=>""+(n.current??"")),d=e.derived(()=>r.debugIds?`${r.valueId}:{${e.get(s)}}`:e.get(s));e.next();var u=e.text();e.template_effect(()=>e.set_text(u,e.get(d))),e.append(t,u),e.pop()}function Ft(t,r){e.push(r,!0);const n=le(()=>r.store);{const s=(t,n=e.noop)=>{At(t,{get valueId(){return n()},get store(){return r.store},get debugIds(){return r.debugIds}})};ft(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get custom(){return r.value},children:s})}e.pop()}export{ht as BackwardCheckpointsView,bt as CellView,at as CheckpointView,vt as CurrentCheckpointView,mt as ForwardCheckpointsView,yt as IndexView,wt as LinkedRowsView,kt as LocalRowsView,qt as MetricView,Ct as Provider,Lt as RemoteRowView,$t as ResultCellView,Bt as ResultRowView,Vt as ResultSortedTableView,St as ResultTableView,xt as RowView,_t as SliceView,Tt as SortedTableView,zt as TableView,jt as TablesView,At as ValueView,Ft as ValuesView,it as provideCheckpoints,ut as provideIndexes,dt as provideMetrics,ct as providePersister,gt as provideQueries,ot as provideRelationships,st as provideStore,pt as provideSynchronizer,ie as useCell,oe as useCellIds,ce as useCellState,Pe as useCheckpoint,Ne as useCheckpointIds,Je as useCheckpoints,Ke as useCheckpointsIds,Ue as useGoBackwardCallback,We as useGoForwardCallback,ge as useHasCell,de as useHasRow,Y as useHasTable,te as useHasTableCell,U as useHasTables,Ie as useHasValue,pe as useHasValues,qe as useIndexIds,we as useIndexes,ke as useIndexesIds,Ge as useLinkedRowIds,Ee as useLocalRowIds,ye as useMetric,_e as useMetricIds,me as useMetrics,xe as useMetricsIds,Xe as usePersister,Ye as usePersisterIds,Ze as usePersisterStatus,Le as useQueries,$e as useQueriesIds,Be as useQueryIds,Qe as useRelationshipIds,Me as useRelationships,Oe as useRelationshipsIds,De as useRemoteRowId,He as useResultCell,Fe as useResultCellIds,Ae as useResultRow,Te as useResultRowCount,ze as useResultRowIds,je as useResultSortedRowIds,Ve as useResultTable,Se as useResultTableCellIds,ue as useRow,re as useRowCount,ne as useRowIds,Ce as useSliceIds,Re as useSliceRowIds,se as useSortedRowIds,be as useStore,ve as useStoreIds,et as useSynchronizer,tt as useSynchronizerIds,rt as useSynchronizerStatus,Z as useTable,ee as useTableCellIds,X as useTableIds,W as useTables,fe as useValue,le as useValueIds,he as useValueState,ae as useValues};
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tinybase",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.1.0-beta.1",
|
|
4
4
|
"author": "jamesgpearce",
|
|
5
5
|
"repository": "github:tinyplex/tinybase",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"sideEffects": false,
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"@automerge/automerge-repo": "^2.5.3",
|
|
25
|
-
"@cloudflare/workers-types": "^4.
|
|
25
|
+
"@cloudflare/workers-types": "^4.20260307.1",
|
|
26
26
|
"@electric-sql/pglite": "^0.3.15",
|
|
27
27
|
"@libsql/client": "^0.17.0",
|
|
28
28
|
"@powersync/common": "^1.48.0",
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"react-native-mmkv": "4.2.0",
|
|
44
44
|
"react-native-sqlite-storage": "^6.0.1",
|
|
45
45
|
"sqlite3": "^5.1.7",
|
|
46
|
+
"svelte": "^5.53.8",
|
|
46
47
|
"valibot": "^1.2.0",
|
|
47
48
|
"ws": "^8.19.0",
|
|
48
49
|
"yjs": "^13.6.29",
|
|
@@ -115,6 +116,9 @@
|
|
|
115
116
|
"sqlite3": {
|
|
116
117
|
"optional": true
|
|
117
118
|
},
|
|
119
|
+
"svelte": {
|
|
120
|
+
"optional": true
|
|
121
|
+
},
|
|
118
122
|
"valibot": {
|
|
119
123
|
"optional": true
|
|
120
124
|
},
|
|
@@ -438,6 +442,12 @@
|
|
|
438
442
|
"ui-react/with-schemas": [
|
|
439
443
|
"./@types/ui-react/with-schemas/index.d.ts"
|
|
440
444
|
],
|
|
445
|
+
"ui-svelte": [
|
|
446
|
+
"./@types/ui-svelte/index.d.ts"
|
|
447
|
+
],
|
|
448
|
+
"ui-svelte/with-schemas": [
|
|
449
|
+
"./@types/ui-svelte/with-schemas/index.d.ts"
|
|
450
|
+
],
|
|
441
451
|
"min": [
|
|
442
452
|
"./@types/index.d.ts"
|
|
443
453
|
],
|
|
@@ -743,6 +753,12 @@
|
|
|
743
753
|
],
|
|
744
754
|
"min/ui-react/with-schemas": [
|
|
745
755
|
"./@types/ui-react/with-schemas/index.d.ts"
|
|
756
|
+
],
|
|
757
|
+
"min/ui-svelte": [
|
|
758
|
+
"./@types/ui-svelte/index.d.ts"
|
|
759
|
+
],
|
|
760
|
+
"min/ui-svelte/with-schemas": [
|
|
761
|
+
"./@types/ui-svelte/with-schemas/index.d.ts"
|
|
746
762
|
]
|
|
747
763
|
}
|
|
748
764
|
},
|
|
@@ -1359,6 +1375,18 @@
|
|
|
1359
1375
|
"default": "./ui-react/index.js"
|
|
1360
1376
|
}
|
|
1361
1377
|
},
|
|
1378
|
+
"./ui-svelte": {
|
|
1379
|
+
"default": {
|
|
1380
|
+
"types": "./@types/ui-svelte/index.d.ts",
|
|
1381
|
+
"default": "./ui-svelte/index.js"
|
|
1382
|
+
}
|
|
1383
|
+
},
|
|
1384
|
+
"./ui-svelte/with-schemas": {
|
|
1385
|
+
"default": {
|
|
1386
|
+
"types": "./@types/ui-svelte/with-schemas/index.d.ts",
|
|
1387
|
+
"default": "./ui-svelte/index.js"
|
|
1388
|
+
}
|
|
1389
|
+
},
|
|
1362
1390
|
"./min": {
|
|
1363
1391
|
"default": {
|
|
1364
1392
|
"types": "./@types/index.d.ts",
|
|
@@ -1970,6 +1998,18 @@
|
|
|
1970
1998
|
"types": "./@types/ui-react/with-schemas/index.d.ts",
|
|
1971
1999
|
"default": "./min/ui-react/index.js"
|
|
1972
2000
|
}
|
|
2001
|
+
},
|
|
2002
|
+
"./min/ui-svelte": {
|
|
2003
|
+
"default": {
|
|
2004
|
+
"types": "./@types/ui-svelte/index.d.ts",
|
|
2005
|
+
"default": "./min/ui-svelte/index.js"
|
|
2006
|
+
}
|
|
2007
|
+
},
|
|
2008
|
+
"./min/ui-svelte/with-schemas": {
|
|
2009
|
+
"default": {
|
|
2010
|
+
"types": "./@types/ui-svelte/with-schemas/index.d.ts",
|
|
2011
|
+
"default": "./min/ui-svelte/index.js"
|
|
2012
|
+
}
|
|
1973
2013
|
}
|
|
1974
2014
|
}
|
|
1975
2015
|
}
|
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/browser.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://beta.tinybase.org/zod.svg?asImg"><link rel="preload" as="image" href="https://beta.tinybase.org/typebox.svg?asImg"><link rel="preload" as="image" href="https://beta.tinybase.org/valibot.svg?asImg"><link rel="preload" as="image" href="https://beta.tinybase.org/arktype.svg?asImg"><link rel="preload" as="image" href="https://beta.tinybase.org/yup.svg?asImg"><link rel="preload" as="image" href="https://beta.tinybase.org/effect.svg?asImg"><link rel="preload" as="image" href="https://img.shields.io/github/stars/tinyplex/tinybase?style=for-the-badge&logo=GitHub&logoColor=%23fff&label=GitHub&labelColor=%23d81b60&color=%23333"><link rel="preload" as="image" href="https://img.shields.io/badge/Bluesky-Follow-blue?style=for-the-badge&logo=bluesky&logoColor=%23fff&color=%23333&labelColor=%230285FF"><link rel="preload" as="image" href="https://img.shields.io/badge/%2F%20Twitter-Follow-blue?style=for-the-badge&logo=x&logoColor=%23fff&color=%23333&labelColor=%23000"><link rel="preload" as="image" href="https://img.shields.io/discord/1027918215323590676?style=for-the-badge&logo=discord&logoColor=%23fff&label=Discord&labelColor=%233131e8&color=%23333"><link rel="preload" as="image" href="https://img.shields.io/github/discussions/tinyplex/tinybase?style=for-the-badge&logo=GitHub&logoColor=%23fff&label=Ideas&labelColor=%23d81b60&color=%23333"><link rel="preload" as="image" href="https://img.shields.io/github/issues/tinyplex/tinybase?style=for-the-badge&logo=GitHub&logoColor=%23fff&label=Issues&labelColor=%23d81b60&color=%23333"><link rel="preload" as="image" href="https://img.shields.io/badge/Tests-100%25-green?style=for-the-badge&logo=Vitest&logoColor=%23fff&color=%23333&labelColor=%2387c305"><link rel="preload" as="image" href="https://img.shields.io/npm/v/tinybase?style=for-the-badge&logo=npm&logoColor=%23fff&labelColor=%23bd0005&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/inspector.webp"><link rel="preload" as="image" href="https://github.com/fastrepl.png?size=48"><link rel="preload" as="image" href="https://github.com/ComputelessComputer.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/expo.png?size=48"><link rel="preload" as="image" href="https://github.com/braden-w.png?size=48"><link rel="preload" as="image" href="https://github.com/dylmye.png?size=48"><link rel="preload" as="image" href="https://github.com/gonza224.png?size=48"><link rel="preload" as="image" href="https://github.com/cpojer.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/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://synclets.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><em>sync</em> engine</span></h2></section><p><a href="https://beta.tinybase.org/guides/releases/#v8-
|
|
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/browser.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://beta.tinybase.org/zod.svg?asImg"><link rel="preload" as="image" href="https://beta.tinybase.org/typebox.svg?asImg"><link rel="preload" as="image" href="https://beta.tinybase.org/valibot.svg?asImg"><link rel="preload" as="image" href="https://beta.tinybase.org/arktype.svg?asImg"><link rel="preload" as="image" href="https://beta.tinybase.org/yup.svg?asImg"><link rel="preload" as="image" href="https://beta.tinybase.org/effect.svg?asImg"><link rel="preload" as="image" href="https://img.shields.io/github/stars/tinyplex/tinybase?style=for-the-badge&logo=GitHub&logoColor=%23fff&label=GitHub&labelColor=%23d81b60&color=%23333"><link rel="preload" as="image" href="https://img.shields.io/badge/Bluesky-Follow-blue?style=for-the-badge&logo=bluesky&logoColor=%23fff&color=%23333&labelColor=%230285FF"><link rel="preload" as="image" href="https://img.shields.io/badge/%2F%20Twitter-Follow-blue?style=for-the-badge&logo=x&logoColor=%23fff&color=%23333&labelColor=%23000"><link rel="preload" as="image" href="https://img.shields.io/discord/1027918215323590676?style=for-the-badge&logo=discord&logoColor=%23fff&label=Discord&labelColor=%233131e8&color=%23333"><link rel="preload" as="image" href="https://img.shields.io/github/discussions/tinyplex/tinybase?style=for-the-badge&logo=GitHub&logoColor=%23fff&label=Ideas&labelColor=%23d81b60&color=%23333"><link rel="preload" as="image" href="https://img.shields.io/github/issues/tinyplex/tinybase?style=for-the-badge&logo=GitHub&logoColor=%23fff&label=Issues&labelColor=%23d81b60&color=%23333"><link rel="preload" as="image" href="https://img.shields.io/badge/Tests-100%25-green?style=for-the-badge&logo=Vitest&logoColor=%23fff&color=%23333&labelColor=%2387c305"><link rel="preload" as="image" href="https://img.shields.io/npm/v/tinybase?style=for-the-badge&logo=npm&logoColor=%23fff&labelColor=%23bd0005&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/inspector.webp"><link rel="preload" as="image" href="https://github.com/fastrepl.png?size=48"><link rel="preload" as="image" href="https://github.com/ComputelessComputer.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/expo.png?size=48"><link rel="preload" as="image" href="https://github.com/braden-w.png?size=48"><link rel="preload" as="image" href="https://github.com/dylmye.png?size=48"><link rel="preload" as="image" href="https://github.com/gonza224.png?size=48"><link rel="preload" as="image" href="https://github.com/cpojer.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/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://synclets.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><em>sync</em> engine</span></h2></section><p><a href="https://beta.tinybase.org/guides/releases/#v8-1"><em>NEW!</em> v8.1 release</a></p><p><span id="one-with">"The one with Svelte 5 support!"</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/the-essentials/creating-stores/store/">Read the docs</a></p><hr><section><h2 id="let-s-build-local-first-apps">Let's build <em>local-first</em> apps</h2><p>Create a todo list, a chat app, a drawing tool, or a tic-tac-toe game - with sync & persistence! - in less than 60 seconds.</p></section>
|
|
2
2
|
|
|
3
3
|
```bash
|
|
4
4
|
> npm create tinybase@latest
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
📦 Creating your project...
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
<hr><section><h2 id="it-s-reactive">It'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'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's Built For A <em>Local-First</em> World</h2><p>TinyBase works anywhere that JavaScript does, but it's especially great for local-first apps: where data is stored locally on the user's device and that can be run offline. It's tiny by name, tiny by nature: just <a href="#did-we-say-tiny">6.2kB - 13.2kB</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/api/persister-browser"><img src="https://beta.tinybase.org/browser.svg?asImg" width="48"> OPFS</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><div><a href="https://beta.tinybase.org/api/schematizer-zod/functions/creation/createzodschematizer"><img src="https://beta.tinybase.org/zod.svg?asImg" width="48"> Zod</a></div><div><a href="https://beta.tinybase.org/api/schematizer-typebox/functions/creation/createtypeboxschematizer"><img src="https://beta.tinybase.org/typebox.svg?asImg" width="48"> TypeBox</a></div><div><a href="https://beta.tinybase.org/api/schematizer-valibot/functions/creation/createvalibotschematizer"><img src="https://beta.tinybase.org/valibot.svg?asImg" width="48"> Valibot</a></div><div><a href="https://beta.tinybase.org/api/schematizer-arktype/functions/creation/createarktypeschematizer"><img src="https://beta.tinybase.org/arktype.svg?asImg" width="48"> ArkType</a></div><div><a href="https://beta.tinybase.org/api/schematizer-yup/functions/creation/createyupschematizer"><img src="https://beta.tinybase.org/yup.svg?asImg" width="48"> Yup</a></div><div><a href="https://beta.tinybase.org/api/schematizer-effect/functions/creation/createeffectschematizer"><img src="https://beta.tinybase.org/effect.svg?asImg" width="48"> Effect</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&logo=GitHub&logoColor=%23fff&label=GitHub&labelColor=%23d81b60&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&logo=bluesky&logoColor=%23fff&color=%23333&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&logo=x&logoColor=%23fff&color=%23333&labelColor=%23000"> </a><a href="https://discord.com/invite/mGz3mevwP8" target="_blank"><img src="https://img.shields.io/discord/1027918215323590676?style=for-the-badge&logo=discord&logoColor=%23fff&label=Discord&labelColor=%233131e8&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&logo=GitHub&logoColor=%23fff&label=Ideas&labelColor=%23d81b60&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&logo=GitHub&logoColor=%23fff&label=Issues&labelColor=%23d81b60&color=%23333"> </a><a href="#well-tested-and-documented"><img src="https://img.shields.io/badge/Tests-100%25-green?style=for-the-badge&logo=Vitest&logoColor=%23fff&color=%23333&labelColor=%2387c305"> </a><a href="https://www.npmjs.com/package/tinybase/v/8.
|
|
9
|
+
<hr><section><h2 id="it-s-reactive">It'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'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's Built For A <em>Local-First</em> World</h2><p>TinyBase works anywhere that JavaScript does, but it's especially great for local-first apps: where data is stored locally on the user's device and that can be run offline. It's tiny by name, tiny by nature: just <a href="#did-we-say-tiny">6.2kB - 13.2kB</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/api/persister-browser"><img src="https://beta.tinybase.org/browser.svg?asImg" width="48"> OPFS</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><div><a href="https://beta.tinybase.org/api/schematizer-zod/functions/creation/createzodschematizer"><img src="https://beta.tinybase.org/zod.svg?asImg" width="48"> Zod</a></div><div><a href="https://beta.tinybase.org/api/schematizer-typebox/functions/creation/createtypeboxschematizer"><img src="https://beta.tinybase.org/typebox.svg?asImg" width="48"> TypeBox</a></div><div><a href="https://beta.tinybase.org/api/schematizer-valibot/functions/creation/createvalibotschematizer"><img src="https://beta.tinybase.org/valibot.svg?asImg" width="48"> Valibot</a></div><div><a href="https://beta.tinybase.org/api/schematizer-arktype/functions/creation/createarktypeschematizer"><img src="https://beta.tinybase.org/arktype.svg?asImg" width="48"> ArkType</a></div><div><a href="https://beta.tinybase.org/api/schematizer-yup/functions/creation/createyupschematizer"><img src="https://beta.tinybase.org/yup.svg?asImg" width="48"> Yup</a></div><div><a href="https://beta.tinybase.org/api/schematizer-effect/functions/creation/createeffectschematizer"><img src="https://beta.tinybase.org/effect.svg?asImg" width="48"> Effect</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&logo=GitHub&logoColor=%23fff&label=GitHub&labelColor=%23d81b60&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&logo=bluesky&logoColor=%23fff&color=%23333&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&logo=x&logoColor=%23fff&color=%23333&labelColor=%23000"> </a><a href="https://discord.com/invite/mGz3mevwP8" target="_blank"><img src="https://img.shields.io/discord/1027918215323590676?style=for-the-badge&logo=discord&logoColor=%23fff&label=Discord&labelColor=%233131e8&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&logo=GitHub&logoColor=%23fff&label=Ideas&labelColor=%23d81b60&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&logo=GitHub&logoColor=%23fff&label=Issues&labelColor=%23d81b60&color=%23333"> </a><a href="#well-tested-and-documented"><img src="https://img.shields.io/badge/Tests-100%25-green?style=for-the-badge&logo=Vitest&logoColor=%23fff&color=%23333&labelColor=%2387c305"> </a><a href="https://www.npmjs.com/package/tinybase/v/8.1.0-beta.1" target="_blank"><img src="https://img.shields.io/npm/v/tinybase?style=for-the-badge&logo=npm&logoColor=%23fff&labelColor=%23bd0005&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/the-essentials/creating-stores/store/"><code>Store</code></a> requires just a simple call to the <a href="https://beta.tinybase.org/api/the-essentials/creating-stores/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>
|
|
10
10
|
|
|
11
11
|
```js
|
|
12
12
|
import {createStore} from 'tinybase';
|
|
@@ -283,4 +283,4 @@ console.log(store.getCell('pets', 'felix', 'sold'));
|
|
|
283
283
|
// -> false
|
|
284
284
|
```
|
|
285
285
|
|
|
286
|
-
<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'll only add a gzipped <em>6.2kB</em> to your app. Incrementally add the other modules as you need more functionality, or get it all for <em>13.2kB</em>.</p><p>The optional <a href="https://beta.tinybase.org/api/ui-react/"><code>ui-react</code></a> module is just <em>5.5kB</em>, the ui-react-dom components are another <em>4.0kB</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>6.2kB</td><td>65.4kB</td></tr><tr><th class="right">tinybase (complete)</th><td>13.2kB</td><td>142.7kB</td></tr><tr><th class="right"><a href="https://beta.tinybase.org/api/ui-react/">ui-react</a></th><td>5.5kB</td><td>60.0kB</td></tr><tr><th class="right"><a href="https://beta.tinybase.org/api/ui-react-dom/">ui-react-dom</a></th><td>4.0kB</td><td>36.5kB</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,614</td><td>2,613</td><td>100.0%</td></tr><tr><th class="right">Statements</th><td>2,840</td><td>2,839</td><td>100.0%</td></tr><tr><th class="right">Functions</th><td>1,157</td><td>1,156</td><td>99.9%</td></tr><tr><th class="right">Branches</th><td>1,008</td><td>1,008</td><td>100.0%</td></tr><tr><th class="right">Tests</th><td colspan="3">7,607</td></tr><tr><th class="right">Assertions</th><td colspan="3">32,746</td></tr></tbody></table></div><hr><section id="sponsors"><h2 id="proud-to-be-supported-by">Proud to be supported by:</h2><a href="https://github.com/fastrepl" target="_blank"><img src="https://github.com/fastrepl.png?size=48" title="fastrepl" width="48" height="48"></a><a href="https://github.com/ComputelessComputer" target="_blank"><img src="https://github.com/ComputelessComputer.png?size=48" title="ComputelessComputer" 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/expo" target="_blank"><img src="https://github.com/expo.png?size=48" title="expo" width="48" height="48"></a><a href="https://github.com/braden-w" target="_blank"><img src="https://github.com/braden-w.png?size=48" title="braden-w" width="48" height="48"></a><a href="https://github.com/dylmye" target="_blank"><img src="https://github.com/dylmye.png?size=48" title="dylmye" width="48" height="48"></a><a href="https://github.com/gonza224" target="_blank"><img src="https://github.com/gonza224.png?size=48" title="gonza224" 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/beekeeb" target="_blank"><img src="https://github.com/beekeeb.png?size=48" title="beekeeb" 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/the-essentials/creating-stores/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><a href="https://synclets.org" target="_blank"><img src="https://synclets.org/favicon.svg?asImg" width="48"><br><b>Synclets</b></a><br>An open, storage-agnostic, sync engine development kit.</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>
|
|
286
|
+
<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'll only add a gzipped <em>6.2kB</em> to your app. Incrementally add the other modules as you need more functionality, or get it all for <em>13.2kB</em>.</p><p>The optional <a href="https://beta.tinybase.org/api/ui-react/"><code>ui-react</code></a> module is just <em>5.5kB</em>, the ui-react-dom components are another <em>4.0kB</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>6.2kB</td><td>65.4kB</td></tr><tr><th class="right">tinybase (complete)</th><td>13.2kB</td><td>142.7kB</td></tr><tr><th class="right"><a href="https://beta.tinybase.org/api/ui-react/">ui-react</a></th><td>5.5kB</td><td>60.0kB</td></tr><tr><th class="right"><a href="https://beta.tinybase.org/api/ui-react-dom/">ui-react-dom</a></th><td>4.0kB</td><td>36.5kB</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,614</td><td>2,613</td><td>100.0%</td></tr><tr><th class="right">Statements</th><td>2,840</td><td>2,839</td><td>100.0%</td></tr><tr><th class="right">Functions</th><td>1,157</td><td>1,156</td><td>99.9%</td></tr><tr><th class="right">Branches</th><td>1,008</td><td>1,008</td><td>100.0%</td></tr><tr><th class="right">Tests</th><td colspan="3">7,741</td></tr><tr><th class="right">Assertions</th><td colspan="3">33,099</td></tr></tbody></table></div><hr><section id="sponsors"><h2 id="proud-to-be-supported-by">Proud to be supported by:</h2><a href="https://github.com/fastrepl" target="_blank"><img src="https://github.com/fastrepl.png?size=48" title="fastrepl" width="48" height="48"></a><a href="https://github.com/ComputelessComputer" target="_blank"><img src="https://github.com/ComputelessComputer.png?size=48" title="ComputelessComputer" 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/expo" target="_blank"><img src="https://github.com/expo.png?size=48" title="expo" width="48" height="48"></a><a href="https://github.com/braden-w" target="_blank"><img src="https://github.com/braden-w.png?size=48" title="braden-w" width="48" height="48"></a><a href="https://github.com/dylmye" target="_blank"><img src="https://github.com/dylmye.png?size=48" title="dylmye" width="48" height="48"></a><a href="https://github.com/gonza224" target="_blank"><img src="https://github.com/gonza224.png?size=48" title="gonza224" 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/beekeeb" target="_blank"><img src="https://github.com/beekeeb.png?size=48" title="beekeeb" 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/the-essentials/creating-stores/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><a href="https://synclets.org" target="_blank"><img src="https://synclets.org/favicon.svg?asImg" width="48"><br><b>Synclets</b></a><br>An open, storage-agnostic, sync engine development kit.</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,30 @@
|
|
|
1
|
-
<link rel="preload" as="image" href="https://beta.tinybase.org/inspector.webp"><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="v8-
|
|
1
|
+
<link rel="preload" as="image" href="https://beta.tinybase.org/inspector.webp"><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="v8-1">v8.1</h1><h2 id="svelte-5-support">Svelte 5 Support</h2><p>This release introduces the new <code>tinybase/ui-svelte</code> module, bringing native Svelte 5 runes-based reactive bindings to TinyBase. The module provides hooks and view components for building reactive UIs without any additional state management.</p><p>Hooks return a reactive <code>{ current }</code> object backed by Svelte's <code>$state</code> rune. Any component that reads <code>hook.current</code> will automatically re-render when the underlying TinyBase data changes:</p>
|
|
2
|
+
|
|
3
|
+
```svelte
|
|
4
|
+
<script>
|
|
5
|
+
import {createStore} from 'tinybase';
|
|
6
|
+
import {useCell} from 'tinybase/ui-svelte';
|
|
7
|
+
|
|
8
|
+
const store = createStore().setCell('pets', 'fido', 'color', 'brown');
|
|
9
|
+
const color = useCell('pets', 'fido', 'color', store);
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<p>Color: {color.current}</p>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
<p>The <code>useCellState</code> and <code>useValueState</code> hooks go further, providing a writable <code>current</code> property that pairs naturally with Svelte's <code>bind:</code> directive for two-way data binding:</p>
|
|
16
|
+
|
|
17
|
+
```svelte
|
|
18
|
+
<script>
|
|
19
|
+
import {useCellState} from 'tinybase/ui-svelte';
|
|
20
|
+
|
|
21
|
+
const color = useCellState('pets', 'fido', 'color', store);
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<input bind:value={color.current} />
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
<p>All hooks accept reactive getter functions as parameters — the <code>R<T></code> type (<code>T | (() => T)</code>) — so passing <code>() => rowId</code> from a <code>$state</code> variable causes the hook to reactively track which row it reads, without unmounting and remounting.</p><p>The module further includes a <code>Provider</code> component and context helpers (<code>useStore</code>, <code>useMetrics</code>, etc.) for sharing TinyBase objects across a component tree, and ~23 built-in view components (<code>CellView</code>, <code>RowView</code>, <code>TablesView</code>, and more) for assembling UIs directly from <a href="https://beta.tinybase.org/api/the-essentials/creating-stores/store/"><code>Store</code></a> data.</p><p>Read more in the new <a href="https://beta.tinybase.org/guides/building-uis/building-uis-with-svelte/">Building UIs With Svelte</a> guide.</p><hr><h1 id="v8-0">v8.0</h1><h2 id="object-and-array-types">Object And Array Types</h2><p>This release extends the range of types that a <a href="https://beta.tinybase.org/api/store/type-aliases/store/cell/"><code>Cell</code></a> or <a href="https://beta.tinybase.org/api/store/type-aliases/store/value/"><code>Value</code></a> can hold. Previously, TinyBase supported <code>string</code>, <code>number</code>, <code>boolean</code>, and (since v7.0) <code>null</code>. Now you can also store plain JavaScript <strong>objects</strong> and <strong>arrays</strong> directly in a <a href="https://beta.tinybase.org/api/the-essentials/creating-stores/store/"><code>Store</code></a>.</p>
|
|
2
28
|
|
|
3
29
|
```js
|
|
4
30
|
import {createStore} from 'tinybase';
|