Skip to content

Commit 57eb5ed

Browse files
authored
Merge pull request #51 from SQLoot/sync/common-v8-2026-02-26
Sync/common v8 2026 02 26
2 parents 7a27f38 + 3fd4528 commit 57eb5ed

36 files changed

+3467
-2055
lines changed

.changeset/sqlite-refactor.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ Refactored SQLite integration to use Task and throw-first semantics
1313
- Changed `Sqlite.exec` to return `SqliteExecResult` directly (no `Result<..., SqliteError>`)
1414
- Changed `Sqlite.transaction` to support callbacks returning either `Result<T, E>` or `void` (no `SqliteError` in the error channel)
1515
- Changed `Sqlite.export` to return `Uint8Array` directly (no `Result<..., SqliteError>`)
16-
- Simplified `SqliteDriver.exec` by removing the `isMutation` parameter the driver now determines read vs write internally
16+
- Simplified `SqliteDriver.exec` by removing the `isMutation` parameter, so the driver determines read vs write internally
1717
- Replaced `options.memory` and `options.encryptionKey` with a discriminated `options.mode` field (`"memory"` | `"encrypted"`)
1818
- Updated Expo and op-sqlite drivers to match the new API
19+
- Added SQLite schema metadata primitives (`SqliteSchema`, `SqliteIndex`, `eqSqliteIndex`, `getSqliteSchema`, `getSqliteSnapshot`)
20+
- Added `testCreateRunWithSqlite` helper for SQLite tests
1921

2022
Why `SqliteError` was removed:
2123

@@ -29,7 +31,3 @@ Boundary handling:
2931
- At protocol boundaries (for example Protocol ↔ Storage), error handling remains explicit.
3032
- Since storage implementations may throw, boundary code uses `try/catch`, logs with `console.error(error)`, and returns protocol-level outcomes.
3133
- Protocol handles all thrown errors as boundary concerns, without coupling to SQLite-specific error types.
32-
33-
Developer experience:
34-
35-
- This change reduces boilerplate (`if (!result.ok)` branches and `SqliteError` plumbing), making infrastructure code less verbose and easier to follow.

bun.lock

Lines changed: 126 additions & 162 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"repository": "https://github.com/SQLoot/evolu-plan-b",
55
"author": "SQLoot",
66
"license": "MIT",
7-
"packageManager": "bun@1.3.9",
7+
"packageManager": "bun@1.3.10",
88
"workspaces": [
99
"apps/*",
1010
"packages/*",
@@ -34,7 +34,7 @@
3434
"sync:guard:common-v8:strict": "bun ./scripts/sync-guard-common-v8.mts --strict",
3535
"verify:fast": "bun run build && bun run test && bun run lint && bun run lint-monorepo",
3636
"verify": "bun run format && bun run build && bun run test && bun run test:coverage && bun run lint && bun run lint-monorepo",
37-
"clean": "turbo clean && rimraf node_modules bun.lock .turbo out",
37+
"clean": "turbo clean && rimraf node_modules bun.lock .turbo out coverage",
3838
"version": "changeset version",
3939
"release": "bun run build && changeset publish",
4040
"ios": "cd examples/react-expo && bun ios",
@@ -57,7 +57,7 @@
5757
"@vitest/browser-playwright": "^4.0.18",
5858
"@vitest/coverage-v8": "^4.0.18",
5959
"rimraf": "^6.1.3",
60-
"turbo": "^2.8.10",
60+
"turbo": "^2.8.11",
6161
"typedoc": "^0.28.17",
6262
"typedoc-plugin-markdown": "^4.10.0",
6363
"typescript": "^5.9.3",

packages/common/src/Platform.ts

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
/**
2-
* Runtime platform detection utilities.
2+
* Platform runtime utilities and capability abstractions.
33
*
44
* @module
55
*/
66

7-
import type { Task } from "./Task.js";
8-
import type { SimpleName } from "./Type.js";
9-
107
/** Returns true if running in React Native with Hermes engine. */
118
export const isHermes = "HermesInternal" in globalThis;
129

@@ -49,26 +46,11 @@ export interface FlushSyncDep {
4946
* Use this after purging persistent storage to clear in-memory state and ensure
5047
* the app starts fresh. It does not purge storage itself.
5148
*
52-
* - **Web**: Redirects to the specified URL (defaults to `/`)
53-
* - **React Native**: Restarts the app (URL ignored)
49+
* - Web: Redirects to the specified URL (defaults to `/`)
50+
* - React Native: Restarts the app (URL ignored)
5451
*/
5552
export type ReloadApp = (url?: string) => void;
5653

5754
export interface ReloadAppDep {
5855
readonly reloadApp: ReloadApp;
5956
}
60-
61-
/**
62-
* Cross-platform leader lock abstraction.
63-
*
64-
* `acquire` waits until leadership is acquired.
65-
*
66-
* Returns a {@link Disposable} lease. Dispose it to release leadership.
67-
*/
68-
export interface LeaderLock {
69-
readonly acquire: (name: SimpleName) => Task<Disposable>;
70-
}
71-
72-
export interface LeaderLockDep {
73-
readonly leaderLock: LeaderLock;
74-
}

0 commit comments

Comments
 (0)