Skip to content

Commit f89cf90

Browse files
authored
Merge pull request #42 from SQLoot/sync/common-v8-2026-02-22
PR: sync/common-v8 2026-02-22
2 parents 1c2bcfb + 7cf30cc commit f89cf90

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+4968
-3175
lines changed

.ai/knowledge/common-v8-parity-plan-2026-02-16.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,41 @@ Reach practical `upstream/common-v8` compatibility for architecture/API/behavior
2525
- `bun run verify:fast`
2626
- `SYNC_GUARD_MAIN_REF=miccy-dev bun run sync:guard:common-v8:strict`
2727

28+
## Sync Wave 2026-02-22 (Latest)
29+
30+
Source range:
31+
32+
- `sync/common-v8-2026-02-22..upstream/common-v8`
33+
- 16 upstream commits (`2026-02-19` to `2026-02-21`)
34+
35+
Resolution summary:
36+
37+
| Upstream | Subject | Status | Local Note |
38+
|---|---|---|---|
39+
| `0ccedcf` | Add top-down code ordering guidance | `verified-equivalent` | Cherry-picked (`-x`). |
40+
| `c8d1bf9` | Bump pnpm to 10.30.0 in package.json | `intentional-divergence` | Bun-first fork (`packageManager: bun@...`). |
41+
| `01e588d` | Update pnpm-lock.yaml | `intentional-divergence` | Bun lockfile authoritative. |
42+
| `ae95d0e` | Make MicrotaskBatch disposable | `verified-equivalent` | Cherry-picked (`-x`). |
43+
| `e047437` | Wrap mutateBatch with stack.use and add test | `verified-equivalent` | Superseded by `21203bb` (same behavior present after refactor). |
44+
| `ebf0d31` | Bump pnpm packageManager to 10.30.1 | `intentional-divergence` | Bun-first fork. |
45+
| `1ab01ab` | Update pnpm-lock.yaml | `intentional-divergence` | Bun lockfile authoritative. |
46+
| `43ba3f2` | Add TODO: Example to Instances | `verified-equivalent` | Cherry-picked (`-x`). |
47+
| `5c163a9` | Add ExtractType utility and tests | `verified-equivalent` | Cherry-picked (`-x`) with import conflict resolution only. |
48+
| `cec27bc` | Clarify exhaustiveCheck docs and add example | `verified-equivalent` | Cherry-picked (`-x`). |
49+
| `ec8a83b` | Add ArrayBuffer external link in typedoc | `verified-equivalent` | Cherry-picked (`-x`). |
50+
| `121ee93` | Update pnpm-lock.yaml | `intentional-divergence` | Bun lockfile authoritative. |
51+
| `f81b896` | Update biome.json | `verified-equivalent` | Already covered by local Biome update (empty cherry-pick). |
52+
| `42dcbd5` | Ensure exported SQLite bytes use ArrayBuffer backing | `verified-equivalent` | Cherry-picked (`-x`) with Node test import conflict resolution only. |
53+
| `e6997a1` | Alias int factory; use TypeName for typed tags | `verified-equivalent` | Cherry-picked (`-x`). |
54+
| `21203bb` | Refactor DbWorker, storage, and messaging | `verified-equivalent` | Cherry-picked (`-x`), core runtime files aligned; `apps/web` hunk intentionally dropped (website docs live outside this repo). |
55+
56+
Post-pick local compat fix:
57+
58+
- `2cc68d85` (`fix(sync): adapt common-v8 worker logging to Task/Console APIs`)
59+
- Adapts upstream subscription cleanup to local `Task` stack contract.
60+
- Replays `ConsoleEntry` through local `Console` API (no `console.write` in fork interface).
61+
- Fixes `Shared.test.ts` import path drift (`testName` from `Test.ts`).
62+
2863
## Upstream Commit Matrix (Current Snapshot)
2964

3065
Source: `git cherry -v miccy-dev upstream/common-v8`

.github/copilot-instructions.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,19 @@ Key directories:
6262
- **Organize code top-down** - public interfaces first, then implementation, then implementation details. If a helper must be defined before the public export that uses it (due to JavaScript hoisting), place it immediately before that export.
6363
- **Reference globals explicitly with `globalThis`** - when a name clashes with global APIs (e.g., `SharedWorker`, `Worker`), use `globalThis.SharedWorker` instead of aliasing imports
6464

65+
### Order (top-down readability)
66+
67+
Write code top-down: public API first (interfaces and types), then implementation, then implementation details.
68+
69+
Evolu optimizes for reading, not writing. Source code is read far more often than it is written, so developer-facing contracts should appear before low-level helpers.
70+
71+
Think from whole to detail:
72+
73+
1. Public contract (`interface`, exported types)
74+
2. Supporting types
75+
3. Implementation
76+
4. Implementation details
77+
6578
```ts
6679
// Good
6780
import { bar, baz } from "Foo.ts";

.github/workflows/ci.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
merge_group:
99
workflow_dispatch:
1010

11+
permissions:
12+
contents: read
13+
1114
concurrency:
1215
group: ${{ github.workflow }}-${{ github.ref }}
1316
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
@@ -31,6 +34,8 @@ jobs:
3134

3235
- name: Setup Bun
3336
uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5 # v2.0.1
37+
with:
38+
bun-version: "1.3.9"
3439

3540
- name: Install dependencies
3641
run: bun install
@@ -60,3 +65,39 @@ jobs:
6065
echo "- Bun test: not available"
6166
fi
6267
} >> "$GITHUB_STEP_SUMMARY"
68+
69+
relay-runtime-smoke:
70+
runs-on: ubuntu-latest
71+
strategy:
72+
matrix:
73+
node-version: [24]
74+
runtime: [bun, node]
75+
steps:
76+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
77+
78+
- name: Using Node.js ${{ matrix.node-version }}
79+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
80+
with:
81+
node-version: ${{ matrix.node-version }}
82+
83+
- name: Setup Bun
84+
uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5 # v2.0.1
85+
with:
86+
bun-version: "1.3.9"
87+
88+
- name: Install dependencies
89+
run: bun install
90+
91+
- name: Relay smoke tests (Bun runtime)
92+
if: matrix.runtime == 'bun'
93+
run: >
94+
bunx vitest run --project unit
95+
packages/common/test/WebSocket.test.ts
96+
packages/common/test/local-first/Relay.test.ts
97+
98+
- name: Relay smoke tests (Node runtime)
99+
if: matrix.runtime == 'node'
100+
run: >
101+
node ./node_modules/vitest/vitest.mjs run --project unit
102+
packages/common/test/WebSocket.test.ts
103+
packages/common/test/local-first/Relay.test.ts

biome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.4.2/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.4.4/schema.json",
33
"vcs": {
44
"enabled": true,
55
"clientKind": "git",

0 commit comments

Comments
 (0)