diff --git a/.changeset/active-clients.md b/.changeset/active-clients.md deleted file mode 100644 index 52efe83850..0000000000 --- a/.changeset/active-clients.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'zero-swift': patch ---- - -Two `Zero` instances of one client group in one process (the same user, `storageKey`, and storage, such as two windows) no longer drop each other's queries: `initConnection` lists every running client of the group in `activeClients`, as in JS, so zero-cache doesn't delete the other one. When one closes, the others send `deleteClients` for it once. diff --git a/.changeset/client-fixes.md b/.changeset/client-fixes.md deleted file mode 100644 index 78df638c99..0000000000 --- a/.changeset/client-fixes.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'zero-swift': patch ---- - -A first poke that changes nothing after a reconnect or relaunch completes the got queries, as in JS. `<=` and `>=` filters no longer match `NaN`. Storage: every client sharing a database hears about a write failure, and a closed client doesn't; writes queued before a failure no longer land after it; a database busy past the busy timeout is retried by the next write instead of being a storage failure; a read failure loading the client group is reported through `onStorageFailure` and moves the client to memory; and the memory fallback after a failed open is shared by name in the process, like `.memory`. diff --git a/.changeset/codegen-names.md b/.changeset/codegen-names.md deleted file mode 100644 index 15e506fa7f..0000000000 --- a/.changeset/codegen-names.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'zero-swift': patch ---- - -`codegen` generates Swift that compiles for any table, column, relationship, JSON field, or enumeration value name. A name that is taken, a keyword Swift doesn't allow even backticked, a member the generated code declares, or a type it uses is renamed by a documented rule, and keeps its original name in the schema, `CodingKeys`, and raw values. Names outside ASCII are kept where Swift allows them, enumeration values with control characters are escaped as Swift allows, and a recursive `json()` type is `JSONValue` where it recurs instead of overflowing the stack. diff --git a/.changeset/json-object-keys.md b/.changeset/json-object-keys.md deleted file mode 100644 index 5fcfba1a5c..0000000000 --- a/.changeset/json-object-keys.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'zero-swift': minor ---- - -`JSONValue.object` holds a `JSONObject` instead of a `[String: JSONValue]`. A `JSONObject` keeps its keys as a JS object does: integer-like keys first in ascending order, then the others in the order they were set, so JSON is written as `JSON.stringify` writes it. Keys are compared by UTF-16 code unit, so keys that differ only in Unicode normalization (`"é"` and `"e\u{301}"`) stay apart instead of one overwriting the other. Before, they merged in pokes (row values, primary keys, merges, client IDs), and custom-query and AST hashes of such keys differed from JS. Dictionary literals, `object[key]`, and `for (key, value) in object` work as before, and `Row(_:)` and `Row.object` convert both ways. - -Migration: where code builds `.object(dict)` from a `[String: JSONValue]` variable, write `.object(JSONObject(dict))` or declare the variable as `JSONObject`. `objectValue` and `ZeroObjectReader.object`/`ZeroObjectWriter.object` are now `JSONObject`; use `.dictionary` where a `[String: JSONValue]` is needed. `AST.Bound.row` is a `JSONObject`, and `AnyQuery.start`, `TableMutator`, and `LoopbackServer.put` take a `JSONObject` as well as a dictionary. diff --git a/packages/zero-swift-cli/CHANGELOG.md b/packages/zero-swift-cli/CHANGELOG.md index 205b09fc61..6c902d63b3 100644 --- a/packages/zero-swift-cli/CHANGELOG.md +++ b/packages/zero-swift-cli/CHANGELOG.md @@ -1,5 +1,19 @@ # zero-swift +## 0.4.0 + +### Minor Changes + +- 76312e4: `JSONValue.object` holds a `JSONObject` instead of a `[String: JSONValue]`. A `JSONObject` keeps its keys as a JS object does: integer-like keys first in ascending order, then the others in the order they were set, so JSON is written as `JSON.stringify` writes it. Keys are compared by UTF-16 code unit, so keys that differ only in Unicode normalization (`"é"` and `"e\u{301}"`) stay apart instead of one overwriting the other. Before, they merged in pokes (row values, primary keys, merges, client IDs), and custom-query and AST hashes of such keys differed from JS. Dictionary literals, `object[key]`, and `for (key, value) in object` work as before, and `Row(_:)` and `Row.object` convert both ways. + + Migration: where code builds `.object(dict)` from a `[String: JSONValue]` variable, write `.object(JSONObject(dict))` or declare the variable as `JSONObject`. `objectValue` and `ZeroObjectReader.object`/`ZeroObjectWriter.object` are now `JSONObject`; use `.dictionary` where a `[String: JSONValue]` is needed. `AST.Bound.row` is a `JSONObject`, and `AnyQuery.start`, `TableMutator`, and `LoopbackServer.put` take a `JSONObject` as well as a dictionary. + +### Patch Changes + +- fcc95f0: Two `Zero` instances of one client group in one process (the same user, `storageKey`, and storage, such as two windows) no longer drop each other's queries: `initConnection` lists every running client of the group in `activeClients`, as in JS, so zero-cache doesn't delete the other one. When one closes, the others send `deleteClients` for it once. +- 48ca692: A first poke that changes nothing after a reconnect or relaunch completes the got queries, as in JS. `<=` and `>=` filters no longer match `NaN`. Storage: every client sharing a database hears about a write failure, and a closed client doesn't; writes queued before a failure no longer land after it; a database busy past the busy timeout is retried by the next write instead of being a storage failure; a read failure loading the client group is reported through `onStorageFailure` and moves the client to memory; and the memory fallback after a failed open is shared by name in the process, like `.memory`. +- a548803: `codegen` generates Swift that compiles for any table, column, relationship, JSON field, or enumeration value name. A name that is taken, a keyword Swift doesn't allow even backticked, a member the generated code declares, or a type it uses is renamed by a documented rule, and keeps its original name in the schema, `CodingKeys`, and raw values. Names outside ASCII are kept where Swift allows them, enumeration values with control characters are escaped as Swift allows, and a recursive `json()` type is `JSONValue` where it recurs instead of overflowing the stack. + ## 0.3.0 ### Minor Changes diff --git a/packages/zero-swift-cli/package.json b/packages/zero-swift-cli/package.json index 3a9d286872..797994d3b0 100644 --- a/packages/zero-swift-cli/package.json +++ b/packages/zero-swift-cli/package.json @@ -1,6 +1,6 @@ { "name": "zero-swift", - "version": "0.3.0", + "version": "0.4.0", "description": "Generates the Swift row types and schema of a Zero app for the Zero Swift client.", "license": "Apache-2.0", "repository": { diff --git a/swift/VERSION b/swift/VERSION index 0d91a54c7d..1d0ba9ea18 100644 --- a/swift/VERSION +++ b/swift/VERSION @@ -1 +1 @@ -0.3.0 +0.4.0