Skip to content

Commit 2f5340a

Browse files
committed
Update to Zero 0.17
1 parent 5bfc4ba commit 2f5340a

7 files changed

+26
-26
lines changed

.env

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
VITE_PUBLIC_SERVER='http://localhost:4848'
22
ZERO_UPSTREAM_DB="postgresql://user:[email protected]:5430/postgres"
3-
ZERO_CVR_DB="postgresql://user:[email protected]:5430/postgres"
4-
ZERO_CHANGE_DB="postgresql://user:[email protected]:5430/postgres"
53
ZERO_AUTH_SECRET="secretkey"
6-
ZERO_REPLICA_FILE="/tmp/zstart_replica.db"
4+
ZERO_REPLICA_FILE="/tmp/hello_zero_replica.db"

package-lock.json

+12-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"lint": "eslint ."
1414
},
1515
"dependencies": {
16-
"@rocicorp/zero": "0.16.2025022800",
16+
"@rocicorp/zero": "0.17.2025031400",
1717
"jose": "^5.9.6",
1818
"js-cookie": "^3.0.5",
1919
"react": "^18.3.1",

src/App.tsx

+10-3
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,21 @@ import { formatDate } from "./date";
1010

1111
function App() {
1212
const z = useZero<Schema>();
13-
const [users] = useQuery(z.query.user);
14-
const [mediums] = useQuery(z.query.medium);
13+
const [users] = useQuery(z.query.user, {
14+
ttl: "forever",
15+
});
16+
17+
const [mediums] = useQuery(z.query.medium, {
18+
ttl: "forever",
19+
});
1520

1621
const [filterUser, setFilterUser] = useState<string>("");
1722
const [filterText, setFilterText] = useState<string>("");
1823

1924
const all = z.query.message;
20-
const [allMessages] = useQuery(all);
25+
const [allMessages] = useQuery(all, {
26+
ttl: "forever",
27+
});
2128

2229
let filtered = all
2330
.related("medium")

src/main.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ const z = new Zero({
1717
auth: () => encodedJWT,
1818
server: import.meta.env.VITE_PUBLIC_SERVER,
1919
schema,
20-
// This is often easier to develop with if you're frequently changing
21-
// the schema. Switch to 'idb' for local-persistence.
2220
kvStore: "idb",
2321
});
2422

src/schema.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const messageRelationships = relationships(message, ({ one }) => ({
5757
}),
5858
}));
5959

60-
export const schema = createSchema(1, {
60+
export const schema = createSchema({
6161
tables: [user, medium, message],
6262
relationships: [messageRelationships],
6363
});

sst.config.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,13 @@ export default $config({
4040
// Common environment variables
4141
const commonEnv = {
4242
ZERO_UPSTREAM_DB: conn.value,
43-
ZERO_CVR_DB: conn.value,
44-
ZERO_CHANGE_DB: conn.value,
4543
ZERO_AUTH_SECRET: zeroAuthSecret.value,
4644
ZERO_REPLICA_FILE: "sync-replica.db",
4745
ZERO_LITESTREAM_BACKUP_URL: $interpolate`s3://${replicationBucket.name}/backup`,
4846
ZERO_IMAGE_URL: `rocicorp/zero:${zeroVersion}`,
47+
ZERO_CHANGE_MAX_CONNS: "3",
4948
ZERO_CVR_MAX_CONNS: "10",
5049
ZERO_UPSTREAM_MAX_CONNS: "10",
51-
ZERO_AUTO_RESET: "true",
5250
};
5351

5452
// Replication Manager Service
@@ -66,7 +64,6 @@ export default $config({
6664
},
6765
environment: {
6866
...commonEnv,
69-
ZERO_CHANGE_MAX_CONNS: "3",
7067
ZERO_NUM_SYNC_WORKERS: "0",
7168
},
7269
loadBalancer: {

0 commit comments

Comments
 (0)