Skip to content

Commit cd4a624

Browse files
committed
v0.11
1 parent 219fbe7 commit cd4a624

File tree

5 files changed

+67
-4
lines changed

5 files changed

+67
-4
lines changed

contents/docs/permissions/index.mdx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,22 @@ Each operation on a policy has a _ruleset_ containing zero or more _rules_.
4848

4949
A rule is just a TypeScript function that receives the logged in user's `AuthData` and generates a ZQL [where expression](reading-data#compound-filters). At least one rule in a ruleset must return a row for the operation to be allowed.
5050

51+
<Note type="warning">
52+
Although they look like normal TypeScript functions, permission rules are "compiled" into a [JSON/ZQL format](zero-cache-config#schema-file) at compile-time. Those JSON rules are uploaded to zero-cache and *that's* what is evaluated.
53+
54+
These functions aren't really ever run against a real auth token. They are instead run against a "placeholder" auth token at compile time. We track which fields are accessed and create a ZQL expression that extracts the right fields out of the real auth token at runtime.
55+
56+
This is confusing and we will be reworking it to make what's really happening more clear.
57+
58+
In the meantime, what you need to understand is that the only JS that is supported in these rules is accessing fields and subfields.
59+
60+
Specifically:
61+
62+
* Iterate over properties or array elements in the auth token
63+
* Use any JS features beyond property access
64+
* Use any conditional or global state
65+
</Note>
66+
5167
## Select Permissions
5268

5369
You can limit the data a user can read by specifying a `select` ruleset.

contents/docs/reading-data/index.mdx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -282,10 +282,6 @@ if (issueResult.type === 'complete') {
282282
}
283283
```
284284

285-
<Note type="warning" heading="`resultType` is only implemented for React.">
286-
Sorry about that. Ping us in Discord if you need this in SolidJS.
287-
</Note>
288-
289285
The possible values of `result.type` are currently `complete` and `unknown`.
290286

291287
The `complete` value is currently only returned when Zero has received the server result. But in the future, Zero will be able to return this result type when it _knows_ that all possible data for this query is already available locally. Additionally, we plan to add a `prefix` result for when the data is known to be a prefix of the complete result. See [Consistency](/docs/preloading#consistency) for more information.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
title: Zero 0.11
3+
description: Windows
4+
---
5+
6+
## Install
7+
8+
```bash
9+
npm install @rocicorp/zero@0.11
10+
```
11+
12+
## Features
13+
14+
- Windows should work a lot better now. Thank you very much to [aexylus](https://aexylus.com/) and [Sergio Leon](https://www.cbnsndwch.io/) for the testing and contributions here.
15+
- Support nested property access in JWT auth tokens ([docs](/docs/permissions#rules)).
16+
- Make initial sync configurable ([docs](/docs/zero-cache-config#initial-sync-table-copy-workers)).
17+
- Add query result type to SolidJS ([docs](/docs/reading-data#completeness))
18+
- Docker image now contains native amd64 and arm64 binaries.
19+
- Add `storageKey` constructor parameter to enable multiple `Zero` instances for same `userID`.
20+
21+
## Fixes
22+
23+
Many, many fixes, including:
24+
25+
- Fix downstream replication of primitive values
26+
- Fix replication of `TRUNCATE` messages
27+
- Fix large storage use for idle pg instances
28+
- Add runtime sanity checks for when a table is referenced but not synced
29+
- Fix `zero-cache-dev` for multitenant
30+
31+
32+
## Breaking Changes
33+
34+
- The addition of result types to SolidJS is a breaking API change on SolidJS only. See the changes to [`hello-zero-solid`](https://github.com/rocicorp/hello-zero-solid/commit/7c6c3a47479f037f8323b102013244881c74fe9e) for upgrade example.

contents/docs/release-notes/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: Release Notes
33
---
44

5+
- [Zero 0.11: Windows](/docs/release-notes/0.11)
56
- [Zero 0.10: Remove Top-Level Await](/docs/release-notes/0.10)
67
- [Zero 0.9: JWK Support](/docs/release-notes/0.9)
78
- [Zero 0.8: Schema Autobuild, Result Types, and Enums](/docs/release-notes/0.8)

contents/docs/zero-cache-config/index.mdx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,22 @@ flag: `--storage-db-tmp-dir`<br/>
234234
env: `ZERO_STORAGE_DB_TMP_DIR`<br/>
235235
optional: `true`
236236

237+
## Initial Sync Table Copy Workers
238+
239+
The number of parallel workers used to copy tables during initial sync. Each worker copies a single table at a time, fetching rows in batches of `initial-sync-row-batch-size`.
240+
241+
flag: `--initial-sync-table-copy-workers`<br/>
242+
env: `ZERO_INITIAL_SYNC_TABLE_COPY_WORKERS`<br/>
243+
default: `5`
244+
245+
## Initial Sync Row Batch Size
246+
247+
The number of rows each table copy worker fetches at a time during initial sync. This can be increased to speed up initial sync, or decreased to reduce the amount of heap memory used during initial sync (e.g. for tables with large rows).
248+
249+
flag: `--initial-sync-row-batch-size`<br/>
250+
env: `ZERO_INITIAL_SYNC_ROW_BATCH_SIZE`<br/>
251+
default: `10000`
252+
237253
## Tenants JSON
238254

239255
JSON encoding of per-tenant configs for running the server in multi-tenant mode:

0 commit comments

Comments
 (0)