Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
37382b7
Use prepare for package build lifecycle
steida Mar 1, 2026
c14c29c
Add monorepo no-emit typecheck graph
steida Mar 1, 2026
ed8b13a
Revert "Use prepare for package build lifecycle"
steida Mar 1, 2026
461979c
Fix typecheck script for project references
steida Mar 2, 2026
fc537a7
Rename App to AppContext and update usages
steida Mar 2, 2026
637655f
Add build:docs entry to README
steida Mar 2, 2026
9469559
Document Kysely relation helpers in Schema
steida Mar 2, 2026
00fb70a
Restore full Evolu playground example
steida Mar 2, 2026
d651aa5
Update deps
steida Mar 2, 2026
327037d
Fixed GitHub source install packaging regressions
steida Mar 3, 2026
d6e35b1
Simplify tsc build scripts, update root build
steida Mar 3, 2026
7e0d689
Use custom DisposableStack polyfills and tests
steida Mar 3, 2026
19030df
Add keyed mutex/semaphore and refactor instances
steida Mar 5, 2026
c96e27a
Update deps
steida Mar 9, 2026
485ea45
Improve require-pure-annotation rule and add tests
steida Mar 9, 2026
9803147
Reduced bundle size with pure annotations
steida Mar 9, 2026
dfc84a4
Expanded Ref and Store operations
steida Mar 9, 2026
ce057ed
Add PURE annotations to retryStrategyAws
steida Mar 9, 2026
4b2d924
Remove Instances registry and tests
steida Mar 9, 2026
864bb43
Refactor Run/Fiber APIs
steida Mar 9, 2026
d30c2ac
Use per-name mutex and map for SharedEvolu
steida Mar 9, 2026
cd6b74d
Rename Evolu Kysely helpers
steida Mar 9, 2026
69a55fb
Use run.orThrow for sqlite driver
steida Mar 9, 2026
a0b7371
Clarify startTransition test comment
steida Mar 9, 2026
ef36be2
Clarify error-handling docs and platform guidance
steida Mar 9, 2026
c803aef
Rollback
steida Mar 9, 2026
617ee37
Add Task style note and fix a bug
steida Mar 10, 2026
768356c
Document imperative Result composition style
steida Mar 10, 2026
a726b7b
Standardize run variable names
steida Mar 10, 2026
75d63ac
Exclude node_modules in VSCode settings
steida Mar 10, 2026
bbf8cd9
Update bun.lock
steida Mar 10, 2026
7fe4ccc
Refactor Relation API: iterators, bulk remove, counts
steida Mar 10, 2026
f8b9ff8
Use Ref in createMutexRef
steida Mar 10, 2026
619e0a8
Fix Vitest VS Code coverage, rename projects
steida Mar 12, 2026
21b6b23
Update bun.lock
steida Mar 12, 2026
1de92ae
Update copilot-instructions.md
steida Mar 16, 2026
51817f1
Update .gitignore
steida Mar 16, 2026
b9df3ee
Update bun.lock
steida Mar 16, 2026
d805a18
Update size for lightweight from 5.2 kB to 5.0 kB
steida Mar 16, 2026
a22f791
Update biome.json
steida Mar 16, 2026
b956a5f
Add StructuralMap for JSON/Uint8Array keys
steida Mar 16, 2026
57c03eb
Add assertNotAborted/assertNotDisposed and tests
steida Mar 16, 2026
761c2dd
Inline listeners in Store; remove Listeners module
steida Mar 16, 2026
4f08d76
Remove Resources module and its tests
steida Mar 16, 2026
93c3661
Ref: prefer 'value' terminology and clarify immutability
steida Mar 16, 2026
d74bb8d
Add resource lifecycle primitives and tests
steida Mar 16, 2026
4d0c16e
Rename CallbackWithCleanup to CallbackWithTeardown
steida Mar 16, 2026
ae61671
Refactor Run resource API and docs
steida Mar 16, 2026
f218890
Update TreeShaking.test.ts
steida Mar 16, 2026
1512d47
Clarify Result docs and usage guidance
steida Mar 16, 2026
30c2a60
Clarify Type.from and JSON type docs
steida Mar 16, 2026
d16d28c
Migrate disposables to async and update resources
steida Mar 16, 2026
e027377
Update StructuralMap types and docs
steida Mar 16, 2026
f12fafc
Remove readonly helper and update docs
steida Mar 16, 2026
6bd7dc2
Update conventions
steida Mar 16, 2026
c2c156d
sync(common-v8): port 619e0a8 Fix Vitest VS Code coverage, rename pro…
miccy Mar 16, 2026
99b4725
sync(common-v8): port 21b6b23 Update bun.lock
miccy Mar 16, 2026
41b8516
sync(common-v8): port 1de92ae Update copilot-instructions.md
miccy Mar 16, 2026
cd07a56
sync(common-v8): port 51817f1 Update .gitignore
miccy Mar 16, 2026
ff1cac1
sync(common-v8): port b9df3ee Update bun.lock
miccy Mar 16, 2026
fb48858
sync(common-v8): port d805a18 Update size for lightweight from 5.2 kB…
miccy Mar 16, 2026
376bce1
sync(common-v8): port a22f791 Update biome.json
miccy Mar 16, 2026
a1cf2a6
sync(common-v8): port b956a5f Add StructuralMap for JSON/Uint8Array keys
miccy Mar 16, 2026
74809fa
sync(common-v8): port 57c03eb Add assertNotAborted/assertNotDisposed …
miccy Mar 16, 2026
402f4ac
sync(common-v8): port 761c2dd Inline listeners in Store; remove Liste…
miccy Mar 16, 2026
741a1ff
sync(common-v8): port 4f08d76 Remove Resources module and its tests
miccy Mar 16, 2026
e415f13
sync(common-v8): port 93c3661 Ref: prefer 'value' terminology and cla…
miccy Mar 16, 2026
c074df0
sync(common-v8): port d74bb8d Add resource lifecycle primitives and t…
miccy Mar 16, 2026
10f4819
sync(common-v8): port 4d0c16e Rename CallbackWithCleanup to CallbackW…
miccy Mar 16, 2026
258ba48
sync(common-v8): port ae61671 Refactor Run resource API and docs
miccy Mar 16, 2026
2d58e76
sync(common-v8): port f218890 Update TreeShaking.test.ts
miccy Mar 16, 2026
2f51543
sync(common-v8): port 1512d47 Clarify Result docs and usage guidance
miccy Mar 16, 2026
b82a10a
sync(common-v8): port 30c2a60 Clarify Type.from and JSON type docs
miccy Mar 16, 2026
aad08ac
sync(common-v8): port d16d28c Migrate disposables to async and update…
miccy Mar 17, 2026
9ee839f
sync(common-v8): port e027377 Update StructuralMap types and docs
miccy Mar 17, 2026
c83166f
sync(common-v8): port f12fafc Remove readonly helper and update docs
miccy Mar 17, 2026
eac77c6
sync(common-v8): port 6bd7dc2 Update conventions
miccy Mar 17, 2026
bbe0cdf
fix: stabilize post-sync verify
miccy Mar 17, 2026
05a9bf3
chore(sync): correct d805a18 source sha metadata
miccy Mar 17, 2026
dd9ee6f
fix: address reviewed post-sync issues
miccy Mar 17, 2026
a538ce8
merge(upstream): record common-v8 ancestry
miccy Mar 17, 2026
f77d080
chore: update patch dependencies and fix verify
miccy Mar 17, 2026
22ef9a8
chore: update minor dependencies and harden resources
miccy Mar 17, 2026
051f4eb
fix: address follow-up review comments
miccy Mar 17, 2026
d1bb1fc
chore: upgrade astro example to astro 6
miccy Mar 17, 2026
e31069e
fix: address final relevant code review feedback
miccy Mar 17, 2026
23c00b4
fix: address additional review feedback
miccy Mar 17, 2026
82b882d
fix: address final code review feedback
miccy Mar 17, 2026
a064298
fix: harden sqlite schema filtering and relay writes
miccy Mar 17, 2026
c41d0e7
fix: harden leader lock acquisition
miccy Mar 17, 2026
042f041
chore: fix import ordering in resource module
miccy Mar 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/structural-map-uint8array.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@evolu/common": minor
---

Added `StructuralMap`, a `Map`-like collection for registries and coordination tables where callers have immutable JSON-like keys or `Uint8Array` keys and do not want to maintain a separate string id.

`StructuralMap` works by deriving a canonical structural id for each key and storing entries in a native `Map` keyed by that id. Repeated lookups of the same object or array instance reuse cached ids through a `WeakMap`.
4 changes: 3 additions & 1 deletion .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,9 @@ const result = await run(fetchUser("123"));

## Test-driven development

- Write a test before implementing a new feature or fixing a bug
- Tests are required for new features and bug fixes
- Prefer writing or updating tests before implementation when behavior or API shape is still being clarified
- When the implementation is straightforward from established patterns, implementation may come first
- Test files are in `packages/*/test/*.test.ts`
- Use `testNames` parameter to run specific tests — uses **substring matching**, so unique names avoid running unrelated tests
- Run only changed/affected tests, not entire describe blocks
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,14 @@ jobs:
- name: Relay smoke tests (Bun runtime)
if: matrix.runtime == 'bun'
run: >
bunx vitest run --project unit
bunx vitest run --project "@evolu/common (nodejs)"
packages/common/test/WebSocket.test.ts
packages/common/test/local-first/Relay.test.ts

- name: Relay smoke tests (Node runtime)
if: matrix.runtime == 'node'
run: >
node ./node_modules/vitest/vitest.mjs run --project unit
node ./node_modules/vitest/vitest.mjs run --project "@evolu/common (nodejs)"
packages/common/test/WebSocket.test.ts
packages/common/test/local-first/Relay.test.ts

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ws-browser-nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- name: Run browser WebSocket tests
run: |
set -o pipefail
bunx vitest run --project browser packages/common/test/WebSocket.test.ts --reporter=verbose 2>&1 | tee ws-browser-nightly.log
bunx vitest run --project "@evolu/common" packages/common/test/WebSocket.test.ts --reporter=verbose 2>&1 | tee ws-browser-nightly.log

- name: Upload browser WebSocket logs
if: always()
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ storybook-static
out
test-identicons
coverage
.vitest-attachments
tmp
__screenshots__
*.tsBuildInfo
Expand Down
2 changes: 1 addition & 1 deletion apps/relay/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"devDependencies": {
"@evolu/tsconfig": "workspace:*",
"@types/node": "^25.3.3",
"@types/node": "^25.5.0",
"typescript": "^5.9.3"
},
"engines": {
Expand Down
32 changes: 15 additions & 17 deletions apps/relay/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { mkdirSync } from "node:fs";
import { createConsole, createConsoleFormatter } from "@evolu/common";
import { createRelayDeps, createRunner, startRelay } from "@evolu/nodejs";
import { startBunRelay } from "./startBunRelay.js";
import { createRelayDeps, createRun, startRelay } from "@evolu/nodejs";

// Ensure the database is created in a predictable location for Docker.
mkdirSync("data", { recursive: true });
Expand All @@ -16,24 +15,23 @@ const console = createConsole({

const deps = { ...createRelayDeps(), console };

await using run = createRunner(deps);
await using stack = run.stack();
await using run = createRun(deps);
await using stack = new AsyncDisposableStack();

const isBunRuntime = (globalThis as { readonly Bun?: unknown }).Bun != null;
const startRelayTask = isBunRuntime ? startBunRelay : startRelay;
stack.use(
await run.orThrow(
startRelay({
port: 4000,

await stack.use(
startRelayTask({
port: 4000,
// Note: Relay requires URL in format ws://host:port/<ownerId>
// isOwnerAllowed: (_ownerId) => true,

// Note: Relay requires URL in format ws://host:port/<ownerId>
// isOwnerAllowed: (_ownerId) => true,

isOwnerWithinQuota: (_ownerId, requiredBytes) => {
const maxBytes = 1024 * 1024; // 1MB
return requiredBytes <= maxBytes;
},
}),
isOwnerWithinQuota: (_ownerId, requiredBytes) => {
const maxBytes = 1024 * 1024; // 1MB
return requiredBytes <= maxBytes;
},
}),
),
);

await run.deps.shutdown;
20 changes: 7 additions & 13 deletions apps/relay/src/startBunRelay.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import {
type CreateSqliteDriverDep,
callback,
createSqlite,
getOrThrow,
isPromiseLike,
type OwnerId,
ok,
Expand Down Expand Up @@ -95,11 +93,11 @@ export const startBunRelay =
throw new Error("startBunRelay requires Bun runtime.");
}

await using stack = _run.stack();
await using stack = new AsyncDisposableStack();
const console = _run.deps.console.child("relay");

const relayName = name ?? SimpleName.orThrow("evolu-relay");
const sqlite = getOrThrow(await stack.use(createSqlite(relayName)));
const sqlite = stack.use(await _run.orThrow(createSqlite(relayName)));
const deps = { ..._run.deps, sqlite };

createBaseSqliteStorageTables(deps);
Expand Down Expand Up @@ -255,17 +253,13 @@ export const startBunRelay =

stack.defer(() => {
console.info("Shutdown complete");
return ok();
});

stack.defer(
callback(({ ok }) => {
console.info("Shutting down...");
server.stop(true);
console.info("Bun server stopped");
ok();
}),
);
stack.defer(() => {
console.info("Shutting down...");
server.stop(true);
console.info("Bun server stopped");
});

console.info(`Started on port ${port} (Bun native runtime)`);

Expand Down
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/2.4.6/schema.json",
"$schema": "https://biomejs.dev/schemas/2.4.7/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
Expand Down
Loading
Loading