tinybase 8.1.0-beta.4 → 8.1.0
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/indexes/index.d.ts +0 -1
- package/@types/indexes/with-schemas/index.d.ts +0 -1
- package/@types/metrics/index.d.ts +0 -1
- package/@types/metrics/with-schemas/index.d.ts +0 -1
- package/@types/ui-react/index.d.ts +2 -1
- package/@types/ui-react/with-schemas/index.d.ts +2 -1
- package/@types/ui-svelte/index.d.ts +462 -361
- package/@types/ui-svelte/with-schemas/index.d.ts +451 -359
- package/min/omni/index.js +1 -1
- package/min/omni/index.js.gz +0 -0
- package/min/omni/with-schemas/index.js +1 -1
- package/min/omni/with-schemas/index.js.gz +0 -0
- package/min/persisters/persister-partykit-server/index.js +1 -1
- package/min/persisters/persister-partykit-server/index.js.gz +0 -0
- package/min/persisters/persister-partykit-server/with-schemas/index.js +1 -1
- package/min/persisters/persister-partykit-server/with-schemas/index.js.gz +0 -0
- package/min/persisters/persister-remote/index.js +1 -1
- package/min/persisters/persister-remote/index.js.gz +0 -0
- package/min/persisters/persister-remote/with-schemas/index.js +1 -1
- package/min/persisters/persister-remote/with-schemas/index.js.gz +0 -0
- package/min/ui-svelte/index.js +1 -1
- package/min/ui-svelte/index.js.gz +0 -0
- package/min/ui-svelte/with-schemas/index.js +1 -1
- package/min/ui-svelte/with-schemas/index.js.gz +0 -0
- package/omni/index.js +5 -2
- package/omni/with-schemas/index.js +5 -2
- package/package.json +5 -5
- package/persisters/persister-partykit-server/index.js +1 -0
- package/persisters/persister-partykit-server/with-schemas/index.js +1 -0
- package/persisters/persister-remote/index.js +4 -2
- package/persisters/persister-remote/with-schemas/index.js +4 -2
- package/readme.md +5 -5
- package/releases.md +15 -7
- package/ui-svelte/index.js +121 -121
- package/ui-svelte/with-schemas/index.js +121 -121
|
@@ -1 +1 @@
|
|
|
1
|
-
import"svelte/internal/disclose-version";import*as e from"svelte/internal/client";import{getContext as t,setContext as r,untrack as n}from"svelte";import{createSubscriber as s}from"svelte/reactivity";const d=e=>typeof e,u=d(""),o=d(d),c="Listener",g="Result",i="Has",a="Ids",p="Table",l=p+"s",I=p+a,f="Row",b=f+"Count",h=f+a,m="Sorted"+f+a,v="Cell",x=v+a,_="Value",w=_+"s",y=_+a,$="Transaction",k="Finish",q="Status",R="Metric",C="Slice",T="RemoteRowId",L="Local",B="Linked",V="Checkpoint",S=globalThis,z=e=>void 0===e,F=()=>!z(S.window),P=(j=z,(e,t,r)=>j(e)?r?.():t(e));var j;const A=()=>{},D=Object.keys,H="tinybase_uisc";class M{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get current(){return this.#t(),this.#e()}}class O extends M{#r;constructor(e,t,r){super(e,r),this.#r=t}get current(){return super.current}set current(e){this.#r(e)}}const Q=[],W={},E=[Q,void 0,Q],G=e=>(e=>d(e)==o)(e)?e():e,J=()=>t(H)??[],K=(e,t,r)=>{return z(t)?e[2*r]:d(t)==u?(n=e[2*r+1],s=t,P(n,e=>e[s])):t;var n,s},N=(e,t)=>K(J(),e,t),U=(e,t)=>{const r=J();return()=>K(r,G(e),t)},X=(e,t)=>D(e[2*t+1]??W),Y=e=>U(e,0),Z=e=>U(e,1),ee=e=>U(e,2),te=e=>U(e,3),re=e=>U(e,4),ne=e=>U(e,5),se=e=>U(e,6),de=e=>U(e,7),ue=(t,r,n,d=()=>Q,u)=>{const o=(u?"has":"get")+r,g="add"+(u?i:"")+r+c;let a=e.state(e.proxy(A));return F()&&e.user_effect(()=>{const r=t(),n=d();e.set(a,s(e=>{const t=r?.[g]?.(...n,e);return()=>r?.delListener?.(t)}),!0)}),new M(()=>t()?.[o]?.(...d())??n,()=>e.get(a)())},oe=(t,r,n,s=()=>Q,d)=>{F()&&e.user_effect(()=>{const e=t(),u=s(),o=e?.["add"+r+c]?.(...u,n,...void 0!==d?[d]:Q);return()=>e?.delListener?.(o)})},ce=e=>ue(Y(e),l,!1,()=>Q,1),ge=e=>ue(Y(e),l,W),ie=e=>ue(Y(e),I,Q),ae=(e,t)=>ue(Y(t),p,!1,()=>[G(e)],1),pe=(e,t)=>ue(Y(t),p,W,()=>[G(e)]),le=(e,t)=>ue(Y(t),p+x,Q,()=>[G(e)]),Ie=(e,t,r)=>ue(Y(r),p+v,!1,()=>[G(e),G(t)],1),fe=(e,t)=>ue(Y(t),b,0,()=>[G(e)]),be=(e,t)=>ue(Y(t),h,Q,()=>[G(e)]),he=(e,t,r=!1,n=0,s,d)=>ue(Y(d),m,Q,()=>[G(e),G(t),G(r),G(n),G(s)]),me=(e,t,r)=>ue(Y(r),f,!1,()=>[G(e),G(t)],1),ve=(e,t,r)=>ue(Y(r),f,W,()=>[G(e),G(t)]),xe=(e,t,r)=>ue(Y(r),x,Q,()=>[G(e),G(t)]),_e=(e,t,r,n)=>ue(Y(n),v,!1,()=>[G(e),G(t),G(r)],1),we=(t,r,n,d)=>{const u=Y(d);let o=e.state(e.proxy(A));return F()&&e.user_effect(()=>{const d=u(),c=G(t),g=G(r),i=G(n);e.set(o,s(e=>{const t=d?.addCellListener(c,g,i,e);return()=>d?.delListener?.(t)}),!0)}),new O(()=>u()?.getCell(G(t),G(r),G(n)),e=>u()?.setCell(G(t),G(r),G(n),e),()=>e.get(o)())},ye=e=>ue(Y(e),w,!1,()=>Q,1),$e=e=>ue(Y(e),w,W),ke=e=>ue(Y(e),y,Q),qe=(e,t)=>ue(Y(t),_,!1,()=>[G(e)],1),Re=(t,r)=>{const n=Y(r);let d=e.state(e.proxy(A));return F()&&e.user_effect(()=>{const r=n(),u=G(t);e.set(d,s(e=>{const t=r?.addValueListener(u,e);return()=>r?.delListener?.(t)}),!0)}),new O(()=>n()?.getValue(G(t)),e=>n()?.setValue(G(t),e),()=>e.get(d)())},Ce=e=>N(e,0),Te=()=>{const t=J();let r=e.state(e.proxy(X(t,0)));return F()&&e.user_effect(()=>{e.set(r,X(t,0),!0)}),{get current(){return e.get(r)}}},Le=e=>N(e,1),Be=()=>{const t=J();let r=e.state(e.proxy(X(t,1)));return F()&&e.user_effect(()=>{e.set(r,X(t,1),!0)}),{get current(){return e.get(r)}}},Ve=e=>ue(Z(e),R+a,Q),Se=(e,t)=>ue(Z(t),R,void 0,()=>[G(e)]),ze=e=>N(e,2),Fe=()=>{const t=J();let r=e.state(e.proxy(X(t,2)));return F()&&e.user_effect(()=>{e.set(r,X(t,2),!0)}),{get current(){return e.get(r)}}},Pe=e=>ue(ee(e),"Index"+a,Q),je=(e,t)=>ue(ee(t),C+a,Q,()=>[G(e)]),Ae=(e,t,r)=>ue(ee(r),C+h,Q,()=>[G(e),G(t)]),De=(e,t)=>{const r=ee(e);return{get store(){return r()?.getStore()},get tableId(){return r()?.getTableId(G(t))}}},He=e=>N(e,4),Me=()=>{const t=J();let r=e.state(e.proxy(X(t,4)));return F()&&e.user_effect(()=>{e.set(r,X(t,4),!0)}),{get current(){return e.get(r)}}},Oe=e=>ue(re(e),"Query"+a,Q),Qe=(e,t)=>ue(re(t),g+p,W,()=>[G(e)]),We=(e,t)=>ue(re(t),g+p+x,Q,()=>[G(e)]),Ee=(e,t)=>ue(re(t),g+b,0,()=>[G(e)]),Ge=(e,t)=>ue(re(t),g+h,Q,()=>[G(e)]),Je=(e,t,r=!1,n=0,s,d)=>ue(re(d),g+m,Q,()=>[G(e),G(t),G(r),G(n),G(s)]),Ke=(e,t,r)=>ue(re(r),g+f,W,()=>[G(e),G(t)]),Ne=(e,t,r)=>ue(re(r),g+x,Q,()=>[G(e),G(t)]),Ue=(e,t,r,n)=>ue(re(n),g+v,void 0,()=>[G(e),G(t),G(r)]),Xe=e=>N(e,3),Ye=()=>{const t=J();let r=e.state(e.proxy(X(t,3)));return F()&&e.user_effect(()=>{e.set(r,X(t,3),!0)}),{get current(){return e.get(r)}}},Ze=e=>ue(te(e),"Relationship"+a,Q),et=(e,t,r)=>ue(te(r),T,void 0,()=>[G(e),G(t)]),tt=(e,t,r)=>ue(te(r),L+h,Q,()=>[G(e),G(t)]),rt=(e,t,r)=>ue(te(r),B+h,Q,()=>[G(e),G(t)]),nt=(e,t)=>{const r=te(e);return{get store(){return r()?.getStore()},get localTableId(){return r()?.getLocalTableId(G(t))},get remoteTableId(){return r()?.getRemoteTableId(G(t))}}},st=e=>N(e,5),dt=()=>{const t=J();let r=e.state(e.proxy(X(t,5)));return F()&&e.user_effect(()=>{e.set(r,X(t,5),!0)}),{get current(){return e.get(r)}}},ut=e=>ue(ne(e),V+a,E),ot=(e,t)=>ue(ne(t),V,void 0,()=>[G(e)]),ct=e=>{const t=ne(e);return()=>t()?.goBackward()},gt=e=>{const t=ne(e);return()=>t()?.goForward()},it=e=>N(e,6),at=()=>{const t=J();let r=e.state(e.proxy(X(t,6)));return F()&&e.user_effect(()=>{e.set(r,X(t,6),!0)}),{get current(){return e.get(r)}}},pt=e=>ue(se(e),q,0),lt=e=>N(e,7),It=()=>{const t=J();let r=e.state(e.proxy(X(t,7)));return F()&&e.user_effect(()=>{e.set(r,X(t,7),!0)}),{get current(){return e.get(r)}}},ft=e=>ue(de(e),q,0),bt=(e,t,r)=>oe(Y(r),i+l,e,()=>Q,t),ht=(e,t,r)=>oe(Y(r),l,e,()=>Q,t),mt=(e,t,r)=>oe(Y(r),I,e,()=>Q,t),vt=(e,t,r,n)=>oe(Y(n),i+p,t,()=>[G(e)],r),xt=(e,t,r,n)=>oe(Y(n),p,t,()=>[G(e)],r),_t=(e,t,r,n)=>oe(Y(n),p+x,t,()=>[G(e)],r),wt=(e,t,r,n,s)=>oe(Y(s),i+p+v,r,()=>[G(e),G(t)],n),yt=(e,t,r,n)=>oe(Y(n),b,t,()=>[G(e)],r),$t=(e,t,r,n)=>oe(Y(n),h,t,()=>[G(e)],r),kt=(e,t,r,n,s,d,u,o)=>oe(Y(o),m,d,()=>[G(e),G(t),G(r),G(n),G(s)],u),qt=(e,t,r,n,s)=>oe(Y(s),i+f,r,()=>[G(e),G(t)],n),Rt=(e,t,r,n,s)=>oe(Y(s),f,r,()=>[G(e),G(t)],n),Ct=(e,t,r,n,s)=>oe(Y(s),x,r,()=>[G(e),G(t)],n),Tt=(e,t,r,n,s,d)=>oe(Y(d),i+v,n,()=>[G(e),G(t),G(r)],s),Lt=(e,t,r,n,s,d)=>oe(Y(d),v,n,()=>[G(e),G(t),G(r)],s),Bt=(e,t,r)=>oe(Y(r),i+w,e,()=>Q,t),Vt=(e,t,r)=>oe(Y(r),w,e,()=>Q,t),St=(e,t,r)=>oe(Y(r),y,e,()=>Q,t),zt=(e,t,r,n)=>oe(Y(n),i+_,t,()=>[G(e)],r),Ft=(e,t,r,n)=>oe(Y(n),_,t,()=>[G(e)],r),Pt=(e,t)=>oe(Y(t),"Start"+$,e),jt=(e,t)=>oe(Y(t),"Will"+k+$,e),At=(e,t)=>oe(Y(t),"Did"+k+$,e),Dt=(e,t,r)=>oe(Z(r),R,t,()=>[G(e)]),Ht=(e,t,r)=>oe(ee(r),C+a,t,()=>[G(e)]),Mt=(e,t,r,n)=>oe(ee(n),C+h,r,()=>[G(e),G(t)]),Ot=(e,t,r,n)=>oe(te(n),T,r,()=>[G(e),G(t)]),Qt=(e,t,r,n)=>oe(te(n),L+h,r,()=>[G(e),G(t)]),Wt=(e,t,r,n)=>oe(te(n),B+h,r,()=>[G(e),G(t)]),Et=(e,t,r)=>oe(re(r),g+p,t,()=>[G(e)]),Gt=(e,t,r)=>oe(re(r),g+p+x,t,()=>[G(e)]),Jt=(e,t,r)=>oe(re(r),g+b,t,()=>[G(e)]),Kt=(e,t,r)=>oe(re(r),g+h,t,()=>[G(e)]),Nt=(e,t,r,n,s,d,u)=>oe(re(u),g+m,d,()=>[G(e),G(t),G(r),G(n),G(s)]),Ut=(e,t,r,n)=>oe(re(n),g+f,r,()=>[G(e),G(t)]),Xt=(e,t,r,n)=>oe(re(n),g+x,r,()=>[G(e),G(t)]),Yt=(e,t,r,n,s)=>oe(re(s),g+v,n,()=>[G(e),G(t),G(r)]),Zt=(e,t,r)=>oe(re(r),"ParamValues",t,()=>[G(e)]),er=(e,t,r,n)=>oe(re(n),"ParamValue",r,()=>[G(e),G(t)]),tr=(e,t)=>oe(ne(t),V+a,e),rr=(e,t,r)=>oe(ne(r),V,t,()=>[G(e)]),nr=(e,t)=>oe(se(t),q,e),sr=(e,t)=>oe(de(t),q,e),dr=(t,r,n)=>{const s=J();F()&&e.user_effect(()=>(s[16]?.(n,t,r),()=>s[17]?.(n,t)))},ur=(e,t)=>dr(e,t,0),or=(e,t)=>dr(e,t,1),cr=(e,t)=>dr(e,t,2),gr=(e,t)=>dr(e,t,3),ir=(e,t)=>dr(e,t,4),ar=(e,t)=>dr(e,t,5),pr=(e,t)=>dr(e,t,6),lr=(e,t)=>dr(e,t,7);function Ir(t,r){e.push(r,!0);const n=ot(()=>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 fr=e.from_html("<!><!>",1),br=e.from_html("<!><!><!>",1);function hr(t,r){e.push(r,!0);var n=br(),s=e.first_child(n),d=t=>{var n=e.text();e.template_effect(()=>e.set_text(n,(r.id??"")+":{")),e.append(t,n)},u=e.derived(()=>r.debugIds&&!z(r.id));e.if(s,t=>{e.get(u)&&t(d)});var o=e.sibling(s);e.each(o,18,()=>r.ids,e=>e,(t,n,s)=>{var d=fr(),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,t=>{e.get(s)>0&&r.separator&&t(o)});var c=e.sibling(u),g=t=>{var s=e.comment(),d=e.first_child(s);e.snippet(d,()=>r.custom,()=>n),e.append(t,s)},i=t=>{var s=e.comment(),d=e.first_child(s);e.snippet(d,()=>r.children,()=>n),e.append(t,s)};e.if(c,e=>{r.custom?e(g):e(i,-1)}),e.append(t,d)});var c=e.sibling(o),g=t=>{var r=e.text();r.nodeValue="}",e.append(t,r)},i=e.derived(()=>r.debugIds&&!z(r.id));e.if(c,t=>{e.get(i)&&t(g)}),e.append(t,n),e.pop()}function mr(t,r){e.push(r,!0);const n=ut(()=>r.checkpoints),s=e.derived(()=>n.current[0]);{const n=(t,n=e.noop)=>{Ir(t,{get checkpointId(){return n()},get checkpoints(){return r.checkpoints},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return e.get(s)},get separator(){return r.separator},get debugIds(){return r.debugIds},get custom(){return r.checkpoint},children:n,$$slots:{default:!0}})}e.pop()}function vr(t,r){e.push(r,!0);const n=we(()=>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 xr(t,r){e.push(r,!0);const n=ut(()=>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=>{Ir(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)},c=e.derived(()=>!z(e.get(s)));e.if(u,t=>{e.get(c)&&t(o)}),e.append(t,d),e.pop()}function _r(t,r){e.push(r,!0);const n=ut(()=>r.checkpoints),s=e.derived(()=>n.current[2]);{const n=(t,n=e.noop)=>{Ir(t,{get checkpointId(){return n()},get checkpoints(){return r.checkpoints},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return e.get(s)},get separator(){return r.separator},get debugIds(){return r.debugIds},get custom(){return r.checkpoint},children:n,$$slots:{default:!0}})}e.pop()}function wr(t,r){e.push(r,!0);const n=xe(()=>r.tableId,()=>r.rowId,()=>r.store),s=e.derived(()=>r.customCellIds??n.current);{const n=(t,n=e.noop)=>{vr(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}})};hr(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,$$slots:{default:!0}})}e.pop()}function yr(t,r){e.push(r,!0);const{store:n,tableId:s}=De(()=>r.indexes,()=>r.indexId),d=Ae(()=>r.indexId,()=>r.sliceId,()=>r.indexes);{const u=(t,d=e.noop)=>{var u=e.comment(),o=e.first_child(u),c=e=>{wr(e,{get tableId(){return s},get rowId(){return d()},get store(){return n},get debugIds(){return r.debugIds}})};e.if(o,e=>{s&&e(c)}),e.append(t,u)};hr(t,{get ids(){return d.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.sliceId},get custom(){return r.row},children:u,$$slots:{default:!0}})}e.pop()}function $r(t,r){e.push(r,!0);const n=je(()=>r.indexId,()=>r.indexes);{const s=(t,n=e.noop)=>{yr(t,{get indexId(){return r.indexId},get sliceId(){return n()},get indexes(){return r.indexes},get debugIds(){return r.debugIds}})};hr(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,$$slots:{default:!0}})}e.pop()}function kr(t,r){e.push(r,!0);const{store:n,localTableId:s}=nt(()=>r.relationships,()=>r.relationshipId),d=rt(()=>r.relationshipId,()=>r.firstRowId,()=>r.relationships);{const u=(t,d=e.noop)=>{var u=e.comment(),o=e.first_child(u),c=e=>{wr(e,{get tableId(){return s},get rowId(){return d()},get store(){return n},get debugIds(){return r.debugIds}})};e.if(o,e=>{s&&e(c)}),e.append(t,u)};hr(t,{get ids(){return d.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.firstRowId},get custom(){return r.row},children:u,$$slots:{default:!0}})}e.pop()}function qr(t,r){e.push(r,!0);const{store:n,localTableId:s}=nt(()=>r.relationships,()=>r.relationshipId),d=tt(()=>r.relationshipId,()=>r.remoteRowId,()=>r.relationships);{const u=(t,d=e.noop)=>{var u=e.comment(),o=e.first_child(u),c=e=>{wr(e,{get tableId(){return s},get rowId(){return d()},get store(){return n},get debugIds(){return r.debugIds}})};e.if(o,e=>{s&&e(c)}),e.append(t,u)};hr(t,{get ids(){return d.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.remoteRowId},get custom(){return r.row},children:u,$$slots:{default:!0}})}e.pop()}function Rr(t,r){e.push(r,!0);const n=Se(()=>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 Cr(s,d){e.push(d,!0);const u=t(H)??[];let o=e.proxy(Array.from({length:8},()=>({})));const c=(e,t,r)=>{o[e]={...n(()=>o[e]),[t]:r}},g=(e,t)=>{const{[t]:r,...s}=n(()=>o[e]);o[e]=s};r(H,{get 0(){return d.store??u[0]},get 1(){return{...u[1]??{},...d.storesById,...o[0]}},get 2(){return d.metrics??u[2]},get 3(){return{...u[3]??{},...d.metricsById,...o[1]}},get 4(){return d.indexes??u[4]},get 5(){return{...u[5]??{},...d.indexesById,...o[2]}},get 6(){return d.relationships??u[6]},get 7(){return{...u[7]??{},...d.relationshipsById,...o[3]}},get 8(){return d.queries??u[8]},get 9(){return{...u[9]??{},...d.queriesById,...o[4]}},get 10(){return d.checkpoints??u[10]},get 11(){return{...u[11]??{},...d.checkpointsById,...o[5]}},get 12(){return d.persister??u[12]},get 13(){return{...u[13]??{},...d.persistersById,...o[6]}},get 14(){return d.synchronizer??u[14]},get 15(){return{...u[15]??{},...d.synchronizersById,...o[7]}},get 16(){return c},get 17(){return g}});var i=e.comment(),a=e.first_child(i);e.snippet(a,()=>d.children),e.append(s,i),e.pop()}var Tr=e.from_html("<!><!><!>",1);function Lr(t,r){e.push(r,!0);const{store:n,remoteTableId:s}=nt(()=>r.relationships,()=>r.relationshipId),d=et(()=>r.relationshipId,()=>r.localRowId,()=>r.relationships);var u=Tr(),o=e.first_child(u),c=t=>{var n=e.text();e.template_effect(()=>e.set_text(n,(r.localRowId??"")+":{")),e.append(t,n)};e.if(o,e=>{r.debugIds&&e(c)});var g=e.sibling(o),i=t=>{var u=e.comment(),o=e.first_child(u),c=t=>{var n=e.comment(),s=e.first_child(n);e.snippet(s,()=>r.row,()=>d.current),e.append(t,n)},g=e=>{wr(e,{get tableId(){return s},get rowId(){return d.current},get store(){return n},get debugIds(){return r.debugIds}})};e.if(o,e=>{r.row?e(c):s&&e(g,1)}),e.append(t,u)},a=e.derived(()=>!z(d.current));e.if(g,t=>{e.get(a)&&t(i)});var p=e.sibling(g),l=t=>{var r=e.text();r.nodeValue="}",e.append(t,r)};e.if(p,e=>{r.debugIds&&e(l)}),e.append(t,u),e.pop()}function Br(t,r){e.push(r,!0);const n=Ue(()=>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 Vr(t,r){e.push(r,!0);const n=Ne(()=>r.queryId,()=>r.rowId,()=>r.queries);{const s=(t,n=e.noop)=>{Br(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}})};hr(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,$$slots:{default:!0}})}e.pop()}function Sr(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)=>{Vr(t,{get queryId(){return r.queryId},get rowId(){return n()},get queries(){return r.queries},get debugIds(){return r.debugIds}})};hr(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,$$slots:{default:!0}})}e.pop()}function zr(t,r){e.push(r,!0);const n=Ge(()=>r.queryId,()=>r.queries);{const s=(t,n=e.noop)=>{Vr(t,{get queryId(){return r.queryId},get rowId(){return n()},get queries(){return r.queries},get debugIds(){return r.debugIds}})};hr(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,$$slots:{default:!0}})}e.pop()}function Fr(t,r){e.push(r,!0);const n=he(()=>r.tableId,()=>r.cellId,()=>r.descending??!1,()=>r.offset??0,()=>r.limit,()=>r.store);{const s=(t,n=e.noop)=>{wr(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}})};hr(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,$$slots:{default:!0}})}e.pop()}function Pr(t,r){e.push(r,!0);const n=be(()=>r.tableId,()=>r.store);{const s=(t,n=e.noop)=>{wr(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}})};hr(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,$$slots:{default:!0}})}e.pop()}function jr(t,r){e.push(r,!0);const n=ie(()=>r.store);{const s=(t,n=e.noop)=>{Pr(t,{get tableId(){return n()},get store(){return r.store},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get custom(){return r.table},children:s,$$slots:{default:!0}})}e.pop()}function Ar(t,r){e.push(r,!0);const n=Re(()=>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 Dr(t,r){e.push(r,!0);const n=ke(()=>r.store);{const s=(t,n=e.noop)=>{Ar(t,{get valueId(){return n()},get store(){return r.store},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get custom(){return r.value},children:s,$$slots:{default:!0}})}e.pop()}export{mr as BackwardCheckpointsView,vr as CellView,Ir as CheckpointView,xr as CurrentCheckpointView,_r as ForwardCheckpointsView,$r as IndexView,kr as LinkedRowsView,qr as LocalRowsView,Rr as MetricView,Cr as Provider,Lr as RemoteRowView,Br as ResultCellView,Vr as ResultRowView,Sr as ResultSortedTableView,zr as ResultTableView,wr as RowView,yr as SliceView,Fr as SortedTableView,Pr as TableView,jr as TablesView,Ar as ValueView,Dr as ValuesView,we as createCell,xe as createCellIds,ot as createCheckpoint,ut as createCheckpointIds,dt as createCheckpointsIds,ct as createGoBackwardCallback,gt as createGoForwardCallback,_e as createHasCell,me as createHasRow,ae as createHasTable,Ie as createHasTableCell,ce as createHasTables,qe as createHasValue,ye as createHasValues,Pe as createIndexIds,Fe as createIndexesIds,rt as createLinkedRowIds,tt as createLocalRowIds,Se as createMetric,Ve as createMetricIds,Be as createMetricsIds,at as createPersisterIds,pt as createPersisterStatus,Me as createQueriesIds,Oe as createQueryIds,Ze as createRelationshipIds,Ye as createRelationshipsIds,et as createRemoteRowId,Ue as createResultCell,Ne as createResultCellIds,Ke as createResultRow,Ee as createResultRowCount,Ge as createResultRowIds,Je as createResultSortedRowIds,Qe as createResultTable,We as createResultTableCellIds,ve as createRow,fe as createRowCount,be as createRowIds,je as createSliceIds,Ae as createSliceRowIds,he as createSortedRowIds,Te as createStoreIds,It as createSynchronizerIds,ft as createSynchronizerStatus,pe as createTable,le as createTableCellIds,ie as createTableIds,ge as createTables,Re as createValue,ke as createValueIds,$e as createValues,st as getCheckpoints,De as getIndexStoreTableId,ze as getIndexes,Le as getMetrics,it as getPersister,He as getQueries,Xe as getRelationships,nt as getRelationshipsStoreTableIds,Ce as getStore,lt as getSynchronizer,Lt as onCell,Ct as onCellIds,rr as onCheckpoint,tr as onCheckpointIds,At as onDidFinishTransaction,Tt as onHasCell,qt as onHasRow,vt as onHasTable,wt as onHasTableCell,bt as onHasTables,zt as onHasValue,Bt as onHasValues,Wt as onLinkedRowIds,Qt as onLocalRowIds,Dt as onMetric,er as onParamValue,Zt as onParamValues,nr as onPersisterStatus,Ot as onRemoteRowId,Yt as onResultCell,Xt as onResultCellIds,Ut as onResultRow,Jt as onResultRowCount,Kt as onResultRowIds,Nt as onResultSortedRowIds,Et as onResultTable,Gt as onResultTableCellIds,Rt as onRow,yt as onRowCount,$t as onRowIds,Ht as onSliceIds,Mt as onSliceRowIds,kt as onSortedRowIds,Pt as onStartTransaction,sr as onSynchronizerStatus,xt as onTable,_t as onTableCellIds,mt as onTableIds,ht as onTables,Ft as onValue,St as onValueIds,Vt as onValues,jt as onWillFinishTransaction,ar as provideCheckpoints,cr as provideIndexes,or as provideMetrics,pr as providePersister,ir as provideQueries,gr as provideRelationships,ur as provideStore,lr as provideSynchronizer,ne as resolveCheckpoints,ee as resolveIndexes,Z as resolveMetrics,se as resolvePersister,re as resolveQueries,te as resolveRelationships,Y as resolveStore,de as resolveSynchronizer};
|
|
1
|
+
import"svelte/internal/disclose-version";import*as e from"svelte/internal/client";import{getContext as t,setContext as r,untrack as n}from"svelte";import{createSubscriber as s}from"svelte/reactivity";const d=e=>typeof e,u=d(""),o=d(d),c="Listener",g="Result",i="Has",a="Ids",p="Table",l=p+"s",I=p+a,f="Row",b=f+"Count",h=f+a,m="Sorted"+f+a,v="Cell",x=v+a,_="Value",w=_+"s",y=_+a,$="Transaction",k="Finish",q="Status",R="Metric",C="Slice",T="RemoteRowId",L="Local",B="Linked",V="Checkpoint",S=globalThis,z=e=>void 0===e,F=()=>!z(S.window),P=(j=z,(e,t,r)=>j(e)?r?.():t(e));var j;const A=()=>{},D=Object.keys,H="tinybase_uisc";class M{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get current(){return this.#t(),this.#e()}}class O extends M{#r;constructor(e,t,r){super(e,r),this.#r=t}get current(){return super.current}set current(e){this.#r(e)}}const Q=[],W={},E=[Q,void 0,Q],G=e=>(e=>d(e)==o)(e)?e():e,J=()=>t(H)??[],K=(e,t,r)=>{return z(t)?e[2*r]:d(t)==u?(n=e[2*r+1],s=t,P(n,e=>e[s])):t;var n,s},N=(e,t)=>K(J(),e,t),U=(e,t)=>{const r=J();return()=>K(r,G(e),t)},X=(e,t)=>D(e[2*t+1]??W),Y=e=>U(e,0),Z=e=>U(e,1),ee=e=>U(e,2),te=e=>U(e,3),re=e=>U(e,4),ne=e=>U(e,5),se=e=>U(e,6),de=e=>U(e,7),ue=(t,r,n,d=()=>Q,u)=>{const o=(u?"has":"get")+r,g="add"+(u?i:"")+r+c;let a=e.state(e.proxy(A));return F()&&e.user_effect(()=>{const r=t(),n=d();e.set(a,s(e=>{const t=r?.[g]?.(...n,e);return()=>r?.delListener?.(t)}),!0)}),new M(()=>t()?.[o]?.(...d())??n,()=>e.get(a)())},oe=(t,r,n,s=()=>Q,d)=>{F()&&e.user_effect(()=>{const e=t(),u=s(),o=e?.["add"+r+c]?.(...u,n,...void 0!==d?[d]:Q);return()=>e?.delListener?.(o)})},ce=e=>ue(Y(e),l,!1,()=>Q,1),ge=e=>ue(Y(e),l,W),ie=e=>ue(Y(e),I,Q),ae=(e,t)=>ue(Y(t),p,!1,()=>[G(e)],1),pe=(e,t)=>ue(Y(t),p,W,()=>[G(e)]),le=(e,t)=>ue(Y(t),p+x,Q,()=>[G(e)]),Ie=(e,t,r)=>ue(Y(r),p+v,!1,()=>[G(e),G(t)],1),fe=(e,t)=>ue(Y(t),b,0,()=>[G(e)]),be=(e,t)=>ue(Y(t),h,Q,()=>[G(e)]),he=(e,t,r=!1,n=0,s,d)=>ue(Y(d),m,Q,()=>[G(e),G(t),G(r),G(n),G(s)]),me=(e,t,r)=>ue(Y(r),f,!1,()=>[G(e),G(t)],1),ve=(e,t,r)=>ue(Y(r),f,W,()=>[G(e),G(t)]),xe=(e,t,r)=>ue(Y(r),x,Q,()=>[G(e),G(t)]),_e=(e,t,r,n)=>ue(Y(n),v,!1,()=>[G(e),G(t),G(r)],1),we=(t,r,n,d)=>{const u=Y(d);let o=e.state(e.proxy(A));return F()&&e.user_effect(()=>{const d=u(),c=G(t),g=G(r),i=G(n);e.set(o,s(e=>{const t=d?.addCellListener(c,g,i,e);return()=>d?.delListener?.(t)}),!0)}),new O(()=>u()?.getCell(G(t),G(r),G(n)),e=>u()?.setCell(G(t),G(r),G(n),e),()=>e.get(o)())},ye=e=>ue(Y(e),w,!1,()=>Q,1),$e=e=>ue(Y(e),w,W),ke=e=>ue(Y(e),y,Q),qe=(e,t)=>ue(Y(t),_,!1,()=>[G(e)],1),Re=(t,r)=>{const n=Y(r);let d=e.state(e.proxy(A));return F()&&e.user_effect(()=>{const r=n(),u=G(t);e.set(d,s(e=>{const t=r?.addValueListener(u,e);return()=>r?.delListener?.(t)}),!0)}),new O(()=>n()?.getValue(G(t)),e=>n()?.setValue(G(t),e),()=>e.get(d)())},Ce=e=>N(e,0),Te=()=>{const t=J();let r=e.state(e.proxy(X(t,0)));return F()&&e.user_effect(()=>{e.set(r,X(t,0),!0)}),{get current(){return e.get(r)}}},Le=e=>N(e,1),Be=()=>{const t=J();let r=e.state(e.proxy(X(t,1)));return F()&&e.user_effect(()=>{e.set(r,X(t,1),!0)}),{get current(){return e.get(r)}}},Ve=e=>ue(Z(e),R+a,Q),Se=(e,t)=>ue(Z(t),R,void 0,()=>[G(e)]),ze=e=>N(e,2),Fe=()=>{const t=J();let r=e.state(e.proxy(X(t,2)));return F()&&e.user_effect(()=>{e.set(r,X(t,2),!0)}),{get current(){return e.get(r)}}},Pe=e=>ue(ee(e),"Index"+a,Q),je=(e,t)=>ue(ee(t),C+a,Q,()=>[G(e)]),Ae=(e,t,r)=>ue(ee(r),C+h,Q,()=>[G(e),G(t)]),De=(e,t)=>{const r=ee(e);return{get store(){return r()?.getStore()},get tableId(){return r()?.getTableId(G(t))}}},He=e=>N(e,4),Me=()=>{const t=J();let r=e.state(e.proxy(X(t,4)));return F()&&e.user_effect(()=>{e.set(r,X(t,4),!0)}),{get current(){return e.get(r)}}},Oe=e=>ue(re(e),"Query"+a,Q),Qe=(e,t)=>ue(re(t),g+p,W,()=>[G(e)]),We=(e,t)=>ue(re(t),g+p+x,Q,()=>[G(e)]),Ee=(e,t)=>ue(re(t),g+b,0,()=>[G(e)]),Ge=(e,t)=>ue(re(t),g+h,Q,()=>[G(e)]),Je=(e,t,r=!1,n=0,s,d)=>ue(re(d),g+m,Q,()=>[G(e),G(t),G(r),G(n),G(s)]),Ke=(e,t,r)=>ue(re(r),g+f,W,()=>[G(e),G(t)]),Ne=(e,t,r)=>ue(re(r),g+x,Q,()=>[G(e),G(t)]),Ue=(e,t,r,n)=>ue(re(n),g+v,void 0,()=>[G(e),G(t),G(r)]),Xe=e=>N(e,3),Ye=()=>{const t=J();let r=e.state(e.proxy(X(t,3)));return F()&&e.user_effect(()=>{e.set(r,X(t,3),!0)}),{get current(){return e.get(r)}}},Ze=e=>ue(te(e),"Relationship"+a,Q),et=(e,t,r)=>ue(te(r),T,void 0,()=>[G(e),G(t)]),tt=(e,t,r)=>ue(te(r),L+h,Q,()=>[G(e),G(t)]),rt=(e,t,r)=>ue(te(r),B+h,Q,()=>[G(e),G(t)]),nt=(e,t)=>{const r=te(e);return{get store(){return r()?.getStore()},get localTableId(){return r()?.getLocalTableId(G(t))},get remoteTableId(){return r()?.getRemoteTableId(G(t))}}},st=e=>N(e,5),dt=()=>{const t=J();let r=e.state(e.proxy(X(t,5)));return F()&&e.user_effect(()=>{e.set(r,X(t,5),!0)}),{get current(){return e.get(r)}}},ut=e=>ue(ne(e),V+a,E),ot=(e,t)=>ue(ne(t),V,void 0,()=>[G(e)]),ct=e=>{const t=ne(e);return()=>t()?.goBackward()},gt=e=>{const t=ne(e);return()=>t()?.goForward()},it=e=>N(e,6),at=()=>{const t=J();let r=e.state(e.proxy(X(t,6)));return F()&&e.user_effect(()=>{e.set(r,X(t,6),!0)}),{get current(){return e.get(r)}}},pt=e=>ue(se(e),q,0),lt=e=>N(e,7),It=()=>{const t=J();let r=e.state(e.proxy(X(t,7)));return F()&&e.user_effect(()=>{e.set(r,X(t,7),!0)}),{get current(){return e.get(r)}}},ft=e=>ue(de(e),q,0),bt=(e,t,r)=>oe(Y(r),i+l,e,()=>Q,t),ht=(e,t,r)=>oe(Y(r),l,e,()=>Q,t),mt=(e,t,r)=>oe(Y(r),I,e,()=>Q,t),vt=(e,t,r,n)=>oe(Y(n),i+p,t,()=>[G(e)],r),xt=(e,t,r,n)=>oe(Y(n),p,t,()=>[G(e)],r),_t=(e,t,r,n)=>oe(Y(n),p+x,t,()=>[G(e)],r),wt=(e,t,r,n,s)=>oe(Y(s),i+p+v,r,()=>[G(e),G(t)],n),yt=(e,t,r,n)=>oe(Y(n),b,t,()=>[G(e)],r),$t=(e,t,r,n)=>oe(Y(n),h,t,()=>[G(e)],r),kt=(e,t,r,n,s,d,u,o)=>oe(Y(o),m,d,()=>[G(e),G(t),G(r),G(n),G(s)],u),qt=(e,t,r,n,s)=>oe(Y(s),i+f,r,()=>[G(e),G(t)],n),Rt=(e,t,r,n,s)=>oe(Y(s),f,r,()=>[G(e),G(t)],n),Ct=(e,t,r,n,s)=>oe(Y(s),x,r,()=>[G(e),G(t)],n),Tt=(e,t,r,n,s,d)=>oe(Y(d),i+v,n,()=>[G(e),G(t),G(r)],s),Lt=(e,t,r,n,s,d)=>oe(Y(d),v,n,()=>[G(e),G(t),G(r)],s),Bt=(e,t,r)=>oe(Y(r),i+w,e,()=>Q,t),Vt=(e,t,r)=>oe(Y(r),w,e,()=>Q,t),St=(e,t,r)=>oe(Y(r),y,e,()=>Q,t),zt=(e,t,r,n)=>oe(Y(n),i+_,t,()=>[G(e)],r),Ft=(e,t,r,n)=>oe(Y(n),_,t,()=>[G(e)],r),Pt=(e,t)=>oe(Y(t),"Start"+$,e),jt=(e,t)=>oe(Y(t),"Will"+k+$,e),At=(e,t)=>oe(Y(t),"Did"+k+$,e),Dt=(e,t,r)=>oe(Z(r),R,t,()=>[G(e)]),Ht=(e,t,r)=>oe(ee(r),C+a,t,()=>[G(e)]),Mt=(e,t,r,n)=>oe(ee(n),C+h,r,()=>[G(e),G(t)]),Ot=(e,t,r,n)=>oe(te(n),T,r,()=>[G(e),G(t)]),Qt=(e,t,r,n)=>oe(te(n),L+h,r,()=>[G(e),G(t)]),Wt=(e,t,r,n)=>oe(te(n),B+h,r,()=>[G(e),G(t)]),Et=(e,t,r)=>oe(re(r),g+p,t,()=>[G(e)]),Gt=(e,t,r)=>oe(re(r),g+p+x,t,()=>[G(e)]),Jt=(e,t,r)=>oe(re(r),g+b,t,()=>[G(e)]),Kt=(e,t,r)=>oe(re(r),g+h,t,()=>[G(e)]),Nt=(e,t,r,n,s,d,u)=>oe(re(u),g+m,d,()=>[G(e),G(t),G(r),G(n),G(s)]),Ut=(e,t,r,n)=>oe(re(n),g+f,r,()=>[G(e),G(t)]),Xt=(e,t,r,n)=>oe(re(n),g+x,r,()=>[G(e),G(t)]),Yt=(e,t,r,n,s)=>oe(re(s),g+v,n,()=>[G(e),G(t),G(r)]),Zt=(e,t,r)=>oe(re(r),"ParamValues",t,()=>[G(e)]),er=(e,t,r,n)=>oe(re(n),"ParamValue",r,()=>[G(e),G(t)]),tr=(e,t)=>oe(ne(t),V+a,e),rr=(e,t,r)=>oe(ne(r),V,t,()=>[G(e)]),nr=(e,t)=>oe(se(t),q,e),sr=(e,t)=>oe(de(t),q,e),dr=(t,r,n)=>{const s=J();F()&&e.user_effect(()=>(s[16]?.(n,t,r),()=>s[17]?.(n,t)))},ur=(e,t)=>dr(e,t,0),or=(e,t)=>dr(e,t,1),cr=(e,t)=>dr(e,t,2),gr=(e,t)=>dr(e,t,3),ir=(e,t)=>dr(e,t,4),ar=(e,t)=>dr(e,t,5),pr=(e,t)=>dr(e,t,6),lr=(e,t)=>dr(e,t,7);function Ir(t,r){e.push(r,!0);const n=ot(()=>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 fr=e.from_html("<!><!>",1),br=e.from_html("<!><!><!>",1);function hr(t,r){e.push(r,!0);var n=br(),s=e.first_child(n),d=t=>{var n=e.text();e.template_effect(()=>e.set_text(n,(r.id??"")+":{")),e.append(t,n)},u=e.derived(()=>r.debugIds&&!z(r.id));e.if(s,t=>{e.get(u)&&t(d)});var o=e.sibling(s);e.each(o,18,()=>r.ids,e=>e,(t,n,s)=>{var d=fr(),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,t=>{e.get(s)>0&&r.separator&&t(o)});var c=e.sibling(u),g=t=>{var s=e.comment(),d=e.first_child(s);e.snippet(d,()=>r.custom,()=>n),e.append(t,s)},i=t=>{var s=e.comment(),d=e.first_child(s);e.snippet(d,()=>r.children,()=>n),e.append(t,s)};e.if(c,e=>{r.custom?e(g):e(i,-1)}),e.append(t,d)});var c=e.sibling(o),g=t=>{var r=e.text();r.nodeValue="}",e.append(t,r)},i=e.derived(()=>r.debugIds&&!z(r.id));e.if(c,t=>{e.get(i)&&t(g)}),e.append(t,n),e.pop()}function mr(t,r){e.push(r,!0);const n=ut(()=>r.checkpoints),s=e.derived(()=>n.current[0]);{const n=(t,n=e.noop)=>{Ir(t,{get checkpointId(){return n()},get checkpoints(){return r.checkpoints},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return e.get(s)},get separator(){return r.separator},get debugIds(){return r.debugIds},get custom(){return r.checkpoint},children:n,$$slots:{default:!0}})}e.pop()}function vr(t,r){e.push(r,!0);const n=we(()=>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 xr(t,r){e.push(r,!0);const n=ut(()=>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=>{Ir(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)},c=e.derived(()=>!z(e.get(s)));e.if(u,t=>{e.get(c)&&t(o)}),e.append(t,d),e.pop()}function _r(t,r){e.push(r,!0);const n=ut(()=>r.checkpoints),s=e.derived(()=>n.current[2]);{const n=(t,n=e.noop)=>{Ir(t,{get checkpointId(){return n()},get checkpoints(){return r.checkpoints},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return e.get(s)},get separator(){return r.separator},get debugIds(){return r.debugIds},get custom(){return r.checkpoint},children:n,$$slots:{default:!0}})}e.pop()}function wr(t,r){e.push(r,!0);const n=xe(()=>r.tableId,()=>r.rowId,()=>r.store),s=e.derived(()=>r.customCellIds??n.current);{const n=(t,n=e.noop)=>{vr(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}})};hr(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,$$slots:{default:!0}})}e.pop()}function yr(t,r){e.push(r,!0);const{store:n,tableId:s}=De(()=>r.indexes,()=>r.indexId),d=Ae(()=>r.indexId,()=>r.sliceId,()=>r.indexes);{const u=(t,d=e.noop)=>{var u=e.comment(),o=e.first_child(u),c=e=>{wr(e,{get tableId(){return s},get rowId(){return d()},get store(){return n},get debugIds(){return r.debugIds}})};e.if(o,e=>{s&&e(c)}),e.append(t,u)};hr(t,{get ids(){return d.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.sliceId},get custom(){return r.row},children:u,$$slots:{default:!0}})}e.pop()}function $r(t,r){e.push(r,!0);const n=je(()=>r.indexId,()=>r.indexes);{const s=(t,n=e.noop)=>{yr(t,{get indexId(){return r.indexId},get sliceId(){return n()},get indexes(){return r.indexes},get debugIds(){return r.debugIds}})};hr(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,$$slots:{default:!0}})}e.pop()}function kr(t,r){e.push(r,!0);const{store:n,localTableId:s}=nt(()=>r.relationships,()=>r.relationshipId),d=rt(()=>r.relationshipId,()=>r.firstRowId,()=>r.relationships);{const u=(t,d=e.noop)=>{var u=e.comment(),o=e.first_child(u),c=e=>{wr(e,{get tableId(){return s},get rowId(){return d()},get store(){return n},get debugIds(){return r.debugIds}})};e.if(o,e=>{s&&e(c)}),e.append(t,u)};hr(t,{get ids(){return d.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.firstRowId},get custom(){return r.row},children:u,$$slots:{default:!0}})}e.pop()}function qr(t,r){e.push(r,!0);const{store:n,localTableId:s}=nt(()=>r.relationships,()=>r.relationshipId),d=tt(()=>r.relationshipId,()=>r.remoteRowId,()=>r.relationships);{const u=(t,d=e.noop)=>{var u=e.comment(),o=e.first_child(u),c=e=>{wr(e,{get tableId(){return s},get rowId(){return d()},get store(){return n},get debugIds(){return r.debugIds}})};e.if(o,e=>{s&&e(c)}),e.append(t,u)};hr(t,{get ids(){return d.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.remoteRowId},get custom(){return r.row},children:u,$$slots:{default:!0}})}e.pop()}function Rr(t,r){e.push(r,!0);const n=Se(()=>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 Cr(s,d){e.push(d,!0);const u=t(H)??[];let o=e.proxy(Array.from({length:8},()=>({})));const c=(e,t,r)=>{o[e]={...n(()=>o[e]),[t]:r}},g=(e,t)=>{const{[t]:r,...s}=n(()=>o[e]);o[e]=s};r(H,{get 0(){return d.store??u[0]},get 1(){return{...u[1]??{},...d.storesById,...o[0]}},get 2(){return d.metrics??u[2]},get 3(){return{...u[3]??{},...d.metricsById,...o[1]}},get 4(){return d.indexes??u[4]},get 5(){return{...u[5]??{},...d.indexesById,...o[2]}},get 6(){return d.relationships??u[6]},get 7(){return{...u[7]??{},...d.relationshipsById,...o[3]}},get 8(){return d.queries??u[8]},get 9(){return{...u[9]??{},...d.queriesById,...o[4]}},get 10(){return d.checkpoints??u[10]},get 11(){return{...u[11]??{},...d.checkpointsById,...o[5]}},get 12(){return d.persister??u[12]},get 13(){return{...u[13]??{},...d.persistersById,...o[6]}},get 14(){return d.synchronizer??u[14]},get 15(){return{...u[15]??{},...d.synchronizersById,...o[7]}},get 16(){return c},get 17(){return g}});var i=e.comment(),a=e.first_child(i);e.snippet(a,()=>d.children),e.append(s,i),e.pop()}var Tr=e.from_html("<!><!><!>",1);function Lr(t,r){e.push(r,!0);const{store:n,remoteTableId:s}=nt(()=>r.relationships,()=>r.relationshipId),d=et(()=>r.relationshipId,()=>r.localRowId,()=>r.relationships);var u=Tr(),o=e.first_child(u),c=t=>{var n=e.text();e.template_effect(()=>e.set_text(n,(r.localRowId??"")+":{")),e.append(t,n)};e.if(o,e=>{r.debugIds&&e(c)});var g=e.sibling(o),i=t=>{var u=e.comment(),o=e.first_child(u),c=t=>{var n=e.comment(),s=e.first_child(n);e.snippet(s,()=>r.row,()=>d.current),e.append(t,n)},g=e=>{wr(e,{get tableId(){return s},get rowId(){return d.current},get store(){return n},get debugIds(){return r.debugIds}})};e.if(o,e=>{r.row?e(c):s&&e(g,1)}),e.append(t,u)},a=e.derived(()=>!z(d.current));e.if(g,t=>{e.get(a)&&t(i)});var p=e.sibling(g),l=t=>{var r=e.text();r.nodeValue="}",e.append(t,r)};e.if(p,e=>{r.debugIds&&e(l)}),e.append(t,u),e.pop()}function Br(t,r){e.push(r,!0);const n=Ue(()=>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 Vr(t,r){e.push(r,!0);const n=Ne(()=>r.queryId,()=>r.rowId,()=>r.queries);{const s=(t,n=e.noop)=>{Br(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}})};hr(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,$$slots:{default:!0}})}e.pop()}function Sr(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)=>{Vr(t,{get queryId(){return r.queryId},get rowId(){return n()},get queries(){return r.queries},get debugIds(){return r.debugIds}})};hr(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,$$slots:{default:!0}})}e.pop()}function zr(t,r){e.push(r,!0);const n=Ge(()=>r.queryId,()=>r.queries);{const s=(t,n=e.noop)=>{Vr(t,{get queryId(){return r.queryId},get rowId(){return n()},get queries(){return r.queries},get debugIds(){return r.debugIds}})};hr(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,$$slots:{default:!0}})}e.pop()}function Fr(t,r){e.push(r,!0);const n=he(()=>r.tableId,()=>r.cellId,()=>r.descending??!1,()=>r.offset??0,()=>r.limit,()=>r.store);{const s=(t,n=e.noop)=>{wr(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}})};hr(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,$$slots:{default:!0}})}e.pop()}function Pr(t,r){e.push(r,!0);const n=be(()=>r.tableId,()=>r.store);{const s=(t,n=e.noop)=>{wr(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}})};hr(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,$$slots:{default:!0}})}e.pop()}function jr(t,r){e.push(r,!0);const n=ie(()=>r.store);{const s=(t,n=e.noop)=>{Pr(t,{get tableId(){return n()},get store(){return r.store},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get custom(){return r.table},children:s,$$slots:{default:!0}})}e.pop()}function Ar(t,r){e.push(r,!0);const n=Re(()=>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 Dr(t,r){e.push(r,!0);const n=ke(()=>r.store);{const s=(t,n=e.noop)=>{Ar(t,{get valueId(){return n()},get store(){return r.store},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get custom(){return r.value},children:s,$$slots:{default:!0}})}e.pop()}export{mr as BackwardCheckpointsView,vr as CellView,Ir as CheckpointView,xr as CurrentCheckpointView,_r as ForwardCheckpointsView,$r as IndexView,kr as LinkedRowsView,qr as LocalRowsView,Rr as MetricView,Cr as Provider,Lr as RemoteRowView,Br as ResultCellView,Vr as ResultRowView,Sr as ResultSortedTableView,zr as ResultTableView,wr as RowView,yr as SliceView,Fr as SortedTableView,Pr as TableView,jr as TablesView,Ar as ValueView,Dr as ValuesView,ct as createGoBackwardCallback,gt as createGoForwardCallback,we as getCell,xe as getCellIds,ot as getCheckpoint,ut as getCheckpointIds,st as getCheckpoints,dt as getCheckpointsIds,Pe as getIndexIds,De as getIndexStoreTableId,ze as getIndexes,Fe as getIndexesIds,rt as getLinkedRowIds,tt as getLocalRowIds,Se as getMetric,Ve as getMetricIds,Le as getMetrics,Be as getMetricsIds,it as getPersister,at as getPersisterIds,pt as getPersisterStatus,He as getQueries,Me as getQueriesIds,Oe as getQueryIds,Ze as getRelationshipIds,Xe as getRelationships,Ye as getRelationshipsIds,nt as getRelationshipsStoreTableIds,et as getRemoteRowId,Ue as getResultCell,Ne as getResultCellIds,Ke as getResultRow,Ee as getResultRowCount,Ge as getResultRowIds,Je as getResultSortedRowIds,Qe as getResultTable,We as getResultTableCellIds,ve as getRow,fe as getRowCount,be as getRowIds,je as getSliceIds,Ae as getSliceRowIds,he as getSortedRowIds,Ce as getStore,Te as getStoreIds,lt as getSynchronizer,It as getSynchronizerIds,ft as getSynchronizerStatus,pe as getTable,le as getTableCellIds,ie as getTableIds,ge as getTables,Re as getValue,ke as getValueIds,$e as getValues,_e as hasCell,me as hasRow,ae as hasTable,Ie as hasTableCell,ce as hasTables,qe as hasValue,ye as hasValues,Lt as onCell,Ct as onCellIds,rr as onCheckpoint,tr as onCheckpointIds,At as onDidFinishTransaction,Tt as onHasCell,qt as onHasRow,vt as onHasTable,wt as onHasTableCell,bt as onHasTables,zt as onHasValue,Bt as onHasValues,Wt as onLinkedRowIds,Qt as onLocalRowIds,Dt as onMetric,er as onParamValue,Zt as onParamValues,nr as onPersisterStatus,Ot as onRemoteRowId,Yt as onResultCell,Xt as onResultCellIds,Ut as onResultRow,Jt as onResultRowCount,Kt as onResultRowIds,Nt as onResultSortedRowIds,Et as onResultTable,Gt as onResultTableCellIds,Rt as onRow,yt as onRowCount,$t as onRowIds,Ht as onSliceIds,Mt as onSliceRowIds,kt as onSortedRowIds,Pt as onStartTransaction,sr as onSynchronizerStatus,xt as onTable,_t as onTableCellIds,mt as onTableIds,ht as onTables,Ft as onValue,St as onValueIds,Vt as onValues,jt as onWillFinishTransaction,ar as provideCheckpoints,cr as provideIndexes,or as provideMetrics,pr as providePersister,ir as provideQueries,gr as provideRelationships,ur as provideStore,lr as provideSynchronizer,ne as resolveCheckpoints,ee as resolveIndexes,Z as resolveMetrics,se as resolvePersister,re as resolveQueries,te as resolveRelationships,Y as resolveStore,de as resolveSynchronizer};
|
|
Binary file
|
package/omni/index.js
CHANGED
|
@@ -5698,6 +5698,7 @@ class TinyBasePartyKitServer {
|
|
|
5698
5698
|
this.config.storagePrefix ??= EMPTY_STRING;
|
|
5699
5699
|
this.config.responseHeaders ??= RESPONSE_HEADERS;
|
|
5700
5700
|
}
|
|
5701
|
+
party;
|
|
5701
5702
|
config = {};
|
|
5702
5703
|
async onRequest(request) {
|
|
5703
5704
|
const {
|
|
@@ -6017,6 +6018,8 @@ const createReactNativeSqlitePersister = (
|
|
|
6017
6018
|
);
|
|
6018
6019
|
|
|
6019
6020
|
const getETag = (response) => response.headers.get('ETag') ?? '';
|
|
6021
|
+
const getIfNoneMatchHeaders = (lastEtag) =>
|
|
6022
|
+
lastEtag == '' ? void 0 : {'If-None-Match': lastEtag};
|
|
6020
6023
|
const createRemotePersister = (
|
|
6021
6024
|
store,
|
|
6022
6025
|
loadUrl,
|
|
@@ -6027,7 +6030,7 @@ const createRemotePersister = (
|
|
|
6027
6030
|
let lastEtag = '';
|
|
6028
6031
|
const getPersisted = async () => {
|
|
6029
6032
|
const response = await fetch(loadUrl, {
|
|
6030
|
-
headers:
|
|
6033
|
+
headers: getIfNoneMatchHeaders(lastEtag),
|
|
6031
6034
|
});
|
|
6032
6035
|
lastEtag = getETag(response);
|
|
6033
6036
|
return jsonParse(await response.text());
|
|
@@ -6042,7 +6045,7 @@ const createRemotePersister = (
|
|
|
6042
6045
|
startInterval(async () => {
|
|
6043
6046
|
const response = await fetch(loadUrl, {
|
|
6044
6047
|
method: 'HEAD',
|
|
6045
|
-
headers:
|
|
6048
|
+
headers: getIfNoneMatchHeaders(lastEtag),
|
|
6046
6049
|
});
|
|
6047
6050
|
const currentEtag = getETag(response);
|
|
6048
6051
|
if (currentEtag != lastEtag) {
|
|
@@ -5698,6 +5698,7 @@ class TinyBasePartyKitServer {
|
|
|
5698
5698
|
this.config.storagePrefix ??= EMPTY_STRING;
|
|
5699
5699
|
this.config.responseHeaders ??= RESPONSE_HEADERS;
|
|
5700
5700
|
}
|
|
5701
|
+
party;
|
|
5701
5702
|
config = {};
|
|
5702
5703
|
async onRequest(request) {
|
|
5703
5704
|
const {
|
|
@@ -6017,6 +6018,8 @@ const createReactNativeSqlitePersister = (
|
|
|
6017
6018
|
);
|
|
6018
6019
|
|
|
6019
6020
|
const getETag = (response) => response.headers.get('ETag') ?? '';
|
|
6021
|
+
const getIfNoneMatchHeaders = (lastEtag) =>
|
|
6022
|
+
lastEtag == '' ? void 0 : {'If-None-Match': lastEtag};
|
|
6020
6023
|
const createRemotePersister = (
|
|
6021
6024
|
store,
|
|
6022
6025
|
loadUrl,
|
|
@@ -6027,7 +6030,7 @@ const createRemotePersister = (
|
|
|
6027
6030
|
let lastEtag = '';
|
|
6028
6031
|
const getPersisted = async () => {
|
|
6029
6032
|
const response = await fetch(loadUrl, {
|
|
6030
|
-
headers:
|
|
6033
|
+
headers: getIfNoneMatchHeaders(lastEtag),
|
|
6031
6034
|
});
|
|
6032
6035
|
lastEtag = getETag(response);
|
|
6033
6036
|
return jsonParse(await response.text());
|
|
@@ -6042,7 +6045,7 @@ const createRemotePersister = (
|
|
|
6042
6045
|
startInterval(async () => {
|
|
6043
6046
|
const response = await fetch(loadUrl, {
|
|
6044
6047
|
method: 'HEAD',
|
|
6045
|
-
headers:
|
|
6048
|
+
headers: getIfNoneMatchHeaders(lastEtag),
|
|
6046
6049
|
});
|
|
6047
6050
|
const currentEtag = getETag(response);
|
|
6048
6051
|
if (currentEtag != lastEtag) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tinybase",
|
|
3
|
-
"version": "8.1.0
|
|
3
|
+
"version": "8.1.0",
|
|
4
4
|
"author": "jamesgpearce",
|
|
5
5
|
"repository": "github:tinyplex/tinybase",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
},
|
|
22
22
|
"sideEffects": false,
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@automerge/automerge-repo": "^2.5.
|
|
25
|
-
"@cloudflare/workers-types": "^4.
|
|
26
|
-
"@electric-sql/pglite": "^0.4.
|
|
24
|
+
"@automerge/automerge-repo": "^2.5.5",
|
|
25
|
+
"@cloudflare/workers-types": "^4.20260405.1",
|
|
26
|
+
"@electric-sql/pglite": "^0.4.3",
|
|
27
27
|
"@libsql/client": "^0.17.2",
|
|
28
28
|
"@powersync/common": "^1.51.0",
|
|
29
29
|
"@sinclair/typebox": "^0.34.49",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"effect": "^3.21.0",
|
|
35
35
|
"electric-sql": "^0.12.1",
|
|
36
36
|
"expo": "^55.0.9",
|
|
37
|
-
"expo-sqlite": "^55.0.
|
|
37
|
+
"expo-sqlite": "^55.0.13",
|
|
38
38
|
"partykit": "^0.0.115",
|
|
39
39
|
"partysocket": "^1.1.16",
|
|
40
40
|
"postgres": "^3.4.8",
|
|
@@ -442,6 +442,8 @@ const createCustomPersister = (
|
|
|
442
442
|
};
|
|
443
443
|
|
|
444
444
|
const getETag = (response) => response.headers.get('ETag') ?? '';
|
|
445
|
+
const getIfNoneMatchHeaders = (lastEtag) =>
|
|
446
|
+
lastEtag == '' ? void 0 : {'If-None-Match': lastEtag};
|
|
445
447
|
const createRemotePersister = (
|
|
446
448
|
store,
|
|
447
449
|
loadUrl,
|
|
@@ -452,7 +454,7 @@ const createRemotePersister = (
|
|
|
452
454
|
let lastEtag = '';
|
|
453
455
|
const getPersisted = async () => {
|
|
454
456
|
const response = await fetch(loadUrl, {
|
|
455
|
-
headers:
|
|
457
|
+
headers: getIfNoneMatchHeaders(lastEtag),
|
|
456
458
|
});
|
|
457
459
|
lastEtag = getETag(response);
|
|
458
460
|
return jsonParse(await response.text());
|
|
@@ -467,7 +469,7 @@ const createRemotePersister = (
|
|
|
467
469
|
startInterval(async () => {
|
|
468
470
|
const response = await fetch(loadUrl, {
|
|
469
471
|
method: 'HEAD',
|
|
470
|
-
headers:
|
|
472
|
+
headers: getIfNoneMatchHeaders(lastEtag),
|
|
471
473
|
});
|
|
472
474
|
const currentEtag = getETag(response);
|
|
473
475
|
if (currentEtag != lastEtag) {
|
|
@@ -442,6 +442,8 @@ const createCustomPersister = (
|
|
|
442
442
|
};
|
|
443
443
|
|
|
444
444
|
const getETag = (response) => response.headers.get('ETag') ?? '';
|
|
445
|
+
const getIfNoneMatchHeaders = (lastEtag) =>
|
|
446
|
+
lastEtag == '' ? void 0 : {'If-None-Match': lastEtag};
|
|
445
447
|
const createRemotePersister = (
|
|
446
448
|
store,
|
|
447
449
|
loadUrl,
|
|
@@ -452,7 +454,7 @@ const createRemotePersister = (
|
|
|
452
454
|
let lastEtag = '';
|
|
453
455
|
const getPersisted = async () => {
|
|
454
456
|
const response = await fetch(loadUrl, {
|
|
455
|
-
headers:
|
|
457
|
+
headers: getIfNoneMatchHeaders(lastEtag),
|
|
456
458
|
});
|
|
457
459
|
lastEtag = getETag(response);
|
|
458
460
|
return jsonParse(await response.text());
|
|
@@ -467,7 +469,7 @@ const createRemotePersister = (
|
|
|
467
469
|
startInterval(async () => {
|
|
468
470
|
const response = await fetch(loadUrl, {
|
|
469
471
|
method: 'HEAD',
|
|
470
|
-
headers:
|
|
472
|
+
headers: getIfNoneMatchHeaders(lastEtag),
|
|
471
473
|
});
|
|
472
474
|
const currentEtag = getETag(response);
|
|
473
475
|
if (currentEtag != lastEtag) {
|
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"><em>NEW!</em> v8.1 release</a></p><p><span id="one-with">"The one with Svelte!"</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>
|
|
1
|
+
<link rel="preload" as="image" href="https://beta.tinybase.org/react.svg?asImg"><link rel="preload" as="image" href="https://beta.tinybase.org/svelte.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!"</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.1.0-beta.3" 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>
|
|
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/guides/building-uis/building-uis-with-svelte"><img src="https://beta.tinybase.org/svelte.svg?asImg" width="48"> Svelte</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.5" 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';
|
|
@@ -43,7 +43,7 @@ store.setCell('pets', 'fido', 'sold', false);
|
|
|
43
43
|
store.delListener(listenerId);
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
<section><h2 id="
|
|
46
|
+
<section><h2 id="bind-to-data-in-ui-libraries">Bind to data in UI libraries.</h2><p>If you're using React or Svelte in your application, the optional ui-react module and <a href="https://beta.tinybase.org/api/ui-svelte/"><code>ui-svelte</code></a> module provides hooks and functions to bind to the data in a <a href="https://beta.tinybase.org/api/the-essentials/creating-stores/store/"><code>Store</code></a>.</p><p>For example, the <a href="https://beta.tinybase.org/api/the-essentials/using-react/usecell/"><code>useCell</code></a> hook in this example fetches the dog's color. But it also registers a listener on that cell that will fire and re-render the component whenever the value changes!</p><p>Basically you simply describe what data you want in your user interface and TinyBase will take care of the whole lifecycle of updating it for you.</p><p>Read more about the using hooks in the <a href="https://beta.tinybase.org/guides/building-uis/using-react-hooks/">Using React Hooks</a> guide and the <a href="https://beta.tinybase.org/guides/building-uis/building-uis-with-svelte/">Building UIs With Svelte</a> guide.</p></section>
|
|
47
47
|
|
|
48
48
|
```jsx
|
|
49
49
|
import React from 'react';
|
|
@@ -68,7 +68,7 @@ console.log(app.innerHTML);
|
|
|
68
68
|
root.unmount();
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
-
<section><h2 id="pre-built-reactive-components">Pre-built reactive components.</h2><p>The
|
|
71
|
+
<section><h2 id="pre-built-reactive-components">Pre-built reactive components.</h2><p>The UI modules also provides bare React and Svelte components that let you build up a fully reactive user interface based on a <a href="https://beta.tinybase.org/api/the-essentials/creating-stores/store/"><code>Store</code></a>.</p><p>For React web applications in particular, the new <a href="https://beta.tinybase.org/api/ui-react-dom/"><code>ui-react-dom</code></a> module provides pre-built components for tabular display of your data, with lots of customization and interactivity options.</p><p>Try them out in the <a href="https://beta.tinybase.org/demos/ui-components/">UI Components</a> demos, and read more about the underlying <a href="https://beta.tinybase.org/api/ui-react/"><code>ui-react</code></a> module in the <a href="https://beta.tinybase.org/guides/building-uis/">Building UIs</a> guides.</p></section><img src="https://beta.tinybase.org/ui-react-dom.webp"><section><h2 id="an-inspector-for-your-data">An inspector for your data.</h2><p>If you are building a web application with React, the new <a href="https://beta.tinybase.org/api/the-essentials/using-react/inspector/"><code>Inspector</code></a> component lets you overlay a view of the data in your <a href="https://beta.tinybase.org/api/the-essentials/creating-stores/store/"><code>Store</code></a>, <a href="https://beta.tinybase.org/api/indexes/interfaces/indexes/indexes/"><code>Indexes</code></a>, <a href="https://beta.tinybase.org/api/relationships/interfaces/relationships/relationships/"><code>Relationships</code></a>, and so on. You can even edit the data in place and see it update in your app immediately.</p><p>Read more about this powerful new tool in the <a href="https://beta.tinybase.org/guides/inspecting-data/">Inspecting Data</a> guide.</p></section><img src="https://beta.tinybase.org/inspector.webp"><section><h2 id="apply-schemas-to-tables-values">Apply schemas to tables & values.</h2><p>Want clean data? You can add a <a href="https://beta.tinybase.org/api/store/type-aliases/schema/valuesschema/"><code>ValuesSchema</code></a> or a <a href="https://beta.tinybase.org/api/store/type-aliases/schema/tablesschema/"><code>TablesSchema</code></a> to a <a href="https://beta.tinybase.org/api/the-essentials/creating-stores/store/"><code>Store</code></a> to ensure that they are always what you expect by constraining types, and providing defaults. There are even TypeScript definitions that infer API types from the data schemas you apply.</p><p>And our 'schematizer' modules let you convert schemas from libraries like Zod, TypeBox, Valibot, ArkType, Yup, and Effect Schema into TinyBase at runtime.</p><p>Read more about schemas in the <a href="https://beta.tinybase.org/guides/schemas/">Schemas</a> guide.</p></section>
|
|
72
72
|
|
|
73
73
|
```js
|
|
74
74
|
store.setTablesSchema({
|
|
@@ -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.6kB</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.5kB</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.6kB</td><td>60.7kB</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.7kB</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>3,597</td><td>3,597</td><td>100.0%</td></tr><tr><th class="right">Statements</th><td>3,896</td><td>3,896</td><td>100.0%</td></tr><tr><th class="right">Functions</th><td>1,729</td><td>1,729</td><td>100.0%</td></tr><tr><th class="right">Branches</th><td>1,165</td><td>1,165</td><td>100.0%</td></tr><tr><th class="right">Tests</th><td colspan="3">7,834</td></tr><tr><th class="right">Assertions</th><td colspan="3">33,593</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.6kB</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.5kB</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.6kB</td><td>60.7kB</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.7kB</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>3,602</td><td>3,602</td><td>100.0%</td></tr><tr><th class="right">Statements</th><td>3,902</td><td>3,902</td><td>100.0%</td></tr><tr><th class="right">Functions</th><td>1,735</td><td>1,735</td><td>100.0%</td></tr><tr><th class="right">Branches</th><td>1,161</td><td>1,161</td><td>100.0%</td></tr><tr><th class="right">Tests</th><td colspan="3">7,834</td></tr><tr><th class="right">Assertions</th><td colspan="3">33,588</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>
|