Skip to content

Comments

feat(zero): added initZero to client/react/solidjs#5404

Draft
0xcadams wants to merge 8 commits intomainfrom
0xcadams/init-zero
Draft

feat(zero): added initZero to client/react/solidjs#5404
0xcadams wants to merge 8 commits intomainfrom
0xcadams/init-zero

Conversation

@0xcadams
Copy link
Member

@0xcadams 0xcadams commented Jan 9, 2026

No description provided.

@vercel
Copy link

vercel bot commented Jan 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
replicache-docs Ready Ready Preview, Comment Jan 9, 2026 11:59pm
zbugs Ready Ready Preview, Comment Jan 9, 2026 11:59pm

@github-actions
Copy link

github-actions bot commented Jan 9, 2026

🐰 Bencher Report

Branch0xcadams/init-zero
TestbedLinux
Click to view all benchmark results
BenchmarkFile SizeBenchmark Result
kilobytes (KB)
(Result Δ%)
Upper Boundary
kilobytes (KB)
(Limit %)
zero-package.tgz📈 view plot
🚷 view threshold
1,783.08 KB
(+0.14%)Baseline: 1,780.59 KB
1,816.21 KB
(98.18%)
zero.js📈 view plot
🚷 view threshold
241.04 KB
(+0.02%)Baseline: 240.99 KB
245.81 KB
(98.06%)
zero.js.br📈 view plot
🚷 view threshold
66.24 KB
(+0.09%)Baseline: 66.19 KB
67.51 KB
(98.12%)
🐰 View full continuous benchmarking report in Bencher

@github-actions
Copy link

github-actions bot commented Jan 9, 2026

🐰 Bencher Report

Branch0xcadams/init-zero
Testbedself-hosted
Click to view all benchmark results
BenchmarkThroughputBenchmark Result
operations / second (ops/s)
(Result Δ%)
Lower Boundary
operations / second (ops/s)
(Limit %)
1 exists: track.exists(album)📈 view plot
🚷 view threshold
14,274.39 ops/s
(-1.84%)Baseline: 14,542.15 ops/s
12,966.95 ops/s
(90.84%)
10 exists (AND)📈 view plot
🚷 view threshold
212,267.21 ops/s
(-0.88%)Baseline: 214,147.95 ops/s
191,831.09 ops/s
(90.37%)
10 exists (OR)📈 view plot
🚷 view threshold
4,171.67 ops/s
(+0.21%)Baseline: 4,162.74 ops/s
3,753.48 ops/s
(89.98%)
12 exists (AND)📈 view plot
🚷 view threshold
181,220.21 ops/s
(-4.20%)Baseline: 189,170.82 ops/s
170,158.34 ops/s
(93.90%)
12 exists (OR)📈 view plot
🚷 view threshold
3,398.94 ops/s
(-4.00%)Baseline: 3,540.44 ops/s
3,171.16 ops/s
(93.30%)
12 level nesting📈 view plot
🚷 view threshold
3,090.82 ops/s
(+0.02%)Baseline: 3,090.17 ops/s
2,783.30 ops/s
(90.05%)
2 exists (AND): track.exists(album).exists(genre)📈 view plot
🚷 view threshold
5,483.43 ops/s
(+0.18%)Baseline: 5,473.57 ops/s
4,881.47 ops/s
(89.02%)
3 exists (AND)📈 view plot
🚷 view threshold
2,136.58 ops/s
(+0.77%)Baseline: 2,120.35 ops/s
1,888.89 ops/s
(88.41%)
3 exists (OR)📈 view plot
🚷 view threshold
995.40 ops/s
(-6.30%)Baseline: 1,062.30 ops/s
940.66 ops/s
(94.50%)
5 exists (AND)📈 view plot
🚷 view threshold
332.07 ops/s
(-0.77%)Baseline: 334.66 ops/s
300.36 ops/s
(90.45%)
5 exists (OR)📈 view plot
🚷 view threshold
175.72 ops/s
(-0.45%)Baseline: 176.51 ops/s
157.68 ops/s
(89.73%)
Nested 2 levels: track > album > artist📈 view plot
🚷 view threshold
4,774.68 ops/s
(+0.48%)Baseline: 4,751.79 ops/s
4,290.36 ops/s
(89.86%)
Nested 4 levels: playlist > tracks > album > artist📈 view plot
🚷 view threshold
772.30 ops/s
(-1.04%)Baseline: 780.41 ops/s
701.30 ops/s
(90.81%)
Nested with filters: track > album > artist (filtered)📈 view plot
🚷 view threshold
3,923.70 ops/s
(-0.75%)Baseline: 3,953.39 ops/s
3,543.27 ops/s
(90.30%)
planned: playlist.exists(tracks)📈 view plot
🚷 view threshold
632.68 ops/s
(-2.26%)Baseline: 647.31 ops/s
598.66 ops/s
(94.62%)
planned: track.exists(album) OR exists(genre)📈 view plot
🚷 view threshold
162.37 ops/s
(-5.00%)Baseline: 170.92 ops/s
160.54 ops/s
(98.87%)
planned: track.exists(album) where title="Big Ones"📈 view plot
🚷 view threshold
7,539.98 ops/s
(-4.54%)Baseline: 7,898.21 ops/s
7,282.40 ops/s
(96.58%)
planned: track.exists(album).exists(genre)📈 view plot
🚷 view threshold
38.78 ops/s
(-5.79%)Baseline: 41.16 ops/s
37.96 ops/s
(97.90%)
planned: track.exists(album).exists(genre) with filters📈 view plot
🚷 view threshold
5,336.24 ops/s
(-4.33%)Baseline: 5,577.63 ops/s
5,170.63 ops/s
(96.90%)
planned: track.exists(playlists)📈 view plot
🚷 view threshold
4.00 ops/s
(-4.31%)Baseline: 4.18 ops/s
3.89 ops/s
(97.14%)
unplanned: playlist.exists(tracks)📈 view plot
🚷 view threshold
620.39 ops/s
(-1.49%)Baseline: 629.77 ops/s
586.46 ops/s
(94.53%)
unplanned: track.exists(album) OR exists(genre)📈 view plot
🚷 view threshold
44.67 ops/s
(-4.86%)Baseline: 46.95 ops/s
42.95 ops/s
(96.15%)
unplanned: track.exists(album) where title="Big Ones"📈 view plot
🚷 view threshold
56.78 ops/s
(-3.30%)Baseline: 58.71 ops/s
54.30 ops/s
(95.64%)
unplanned: track.exists(album).exists(genre)📈 view plot
🚷 view threshold
38.39 ops/s
(-6.27%)Baseline: 40.96 ops/s
37.77 ops/s
(98.37%)
unplanned: track.exists(album).exists(genre) with filters📈 view plot
🚷 view threshold
55.53 ops/s
(-3.15%)Baseline: 57.33 ops/s
53.75 ops/s
(96.81%)
unplanned: track.exists(playlists)📈 view plot
🚷 view threshold
4.02 ops/s
(-3.81%)Baseline: 4.18 ops/s
3.88 ops/s
(96.54%)
zpg: all playlists📈 view plot
🚷 view threshold
5.72 ops/s
(-1.14%)Baseline: 5.79 ops/s
5.58 ops/s
(97.47%)
zql: all playlists📈 view plot
🚷 view threshold
7.21 ops/s
(-9.84%)Baseline: 8.00 ops/s
7.10 ops/s
(98.43%)
zql: edit for limited query, inside the bound📈 view plot
🚷 view threshold
211,120.70 ops/s
(-2.88%)Baseline: 217,379.41 ops/s
195,441.66 ops/s
(92.57%)
zql: edit for limited query, outside the bound📈 view plot
🚷 view threshold
223,829.40 ops/s
(-0.98%)Baseline: 226,047.91 ops/s
190,558.94 ops/s
(85.14%)
zql: push into limited query, inside the bound📈 view plot
🚷 view threshold
107,027.58 ops/s
(-4.10%)Baseline: 111,599.83 ops/s
101,358.50 ops/s
(94.70%)
zql: push into limited query, outside the bound📈 view plot
🚷 view threshold
370,111.37 ops/s
(-9.03%)Baseline: 406,828.29 ops/s
338,346.15 ops/s
(91.42%)
zql: push into unlimited query📈 view plot
🚷 view threshold
323,600.57 ops/s
(-4.54%)Baseline: 339,005.57 ops/s
300,190.45 ops/s
(92.77%)
zqlite: all playlists📈 view plot
🚷 view threshold
1.72 ops/s
(-7.52%)Baseline: 1.86 ops/s
1.68 ops/s
(98.08%)
zqlite: edit for limited query, inside the bound📈 view plot
🚷 view threshold
79,123.52 ops/s
(+0.63%)Baseline: 78,628.68 ops/s
67,760.17 ops/s
(85.64%)
zqlite: edit for limited query, outside the bound📈 view plot
🚷 view threshold
79,672.19 ops/s
(+0.32%)Baseline: 79,418.47 ops/s
66,695.89 ops/s
(83.71%)
zqlite: push into limited query, inside the bound📈 view plot
🚷 view threshold
4,077.21 ops/s
(-1.06%)Baseline: 4,120.69 ops/s
3,957.12 ops/s
(97.05%)
zqlite: push into limited query, outside the bound📈 view plot
🚷 view threshold
90,865.19 ops/s
(+0.67%)Baseline: 90,257.11 ops/s
82,124.44 ops/s
(90.38%)
zqlite: push into unlimited query📈 view plot
🚷 view threshold
128,575.14 ops/s
(+0.13%)Baseline: 128,403.15 ops/s
116,477.75 ops/s
(90.59%)
🐰 View full continuous benchmarking report in Bencher

@github-actions
Copy link

github-actions bot commented Jan 9, 2026

🐰 Bencher Report

Branch0xcadams/init-zero
Testbedself-hosted
Click to view all benchmark results
BenchmarkThroughputBenchmark Result
operations / second (ops/s)
(Result Δ%)
Lower Boundary
operations / second (ops/s)
(Limit %)
src/client/custom.bench.ts > big schema📈 view plot
🚷 view threshold
142,575.49 ops/s
(-61.62%)Baseline: 371,478.28 ops/s
-453,272.94 ops/s
(-317.92%)
src/client/zero.bench.ts > basics > All 1000 rows x 10 columns (numbers)📈 view plot
🚷 view threshold
2,530.00 ops/s
(-0.58%)Baseline: 2,544.80 ops/s
2,257.64 ops/s
(89.23%)
src/client/zero.bench.ts > pk compare > pk = N📈 view plot
🚷 view threshold
65,172.97 ops/s
(-0.44%)Baseline: 65,458.79 ops/s
59,064.97 ops/s
(90.63%)
src/client/zero.bench.ts > with filter > Lower rows 500 x 10 columns (numbers)📈 view plot
🚷 view threshold
3,802.00 ops/s
(-1.69%)Baseline: 3,867.23 ops/s
3,496.91 ops/s
(91.98%)
🐰 View full continuous benchmarking report in Bencher

Copy link
Contributor

@aboodman aboodman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some quick thoughts, still reviewing/thinking

import type {schema} from './schema.ts';

export type ZbugsRow = Row<typeof schema>;
export type ZbugsZero = Zero<typeof schema, undefined, AuthData | undefined>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one can just be returned by initZero as it is a class.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The class is created by the ZeroProvider though, not directly in initZero, so those type-only returns aren't really handled in initZero very easily

useQuery,
useSuspenseQuery,
useConnectionState,
} = initZero<typeof schema, AuthData | undefined>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for clarity maybe we'd call this initZeroReact().

import type {AuthData} from './auth.ts';
import type {schema} from './schema.ts';

export type ZbugsRow = Row<typeof schema>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the pattern would be to do it the other way:

import {Row as ZeroRow} ...;

export Row = ZeroRow<typeof schema>;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants