Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
34d7664
Remove redundant comment about retry behavior
steida Feb 2, 2026
0c4ce6b
Add shutdown-aware createRunner; rename relay API
steida Feb 2, 2026
284d9cc
Update pnpm-lock.yaml
steida Feb 2, 2026
e3739cc
Add browser Task runner with global error handling
steida Feb 2, 2026
6d368c2
Remove re-export of @evolu/web from react-web
steida Feb 2, 2026
364b359
Refactor abort handling in Task and update sizes
steida Feb 2, 2026
fdbc834
Remove Feature.id and use name as key
steida Feb 2, 2026
9b576d1
Enable React strict mode in Next.js config
steida Feb 3, 2026
c75b321
Update browserslist and add @evolu/web dependency
steida Feb 3, 2026
5acfef4
Update pnpm-lock.yaml
steida Feb 3, 2026
2e81edc
Rename TaskDisposableStack to AsyncDisposableStack
steida Feb 3, 2026
c93474f
Fix lint-monorepo
steida Feb 3, 2026
a0d1a8f
Refactor Console docs and expand examples
steida Feb 3, 2026
1d27962
Use default time dep in console formatter
steida Feb 3, 2026
cae05f6
Limit published files to dist/src and src
steida Feb 3, 2026
4d99d53
Remove createTime usage in console formatter
steida Feb 3, 2026
b1b17bc
Add React Native runner and ErrorUtils handling
steida Feb 3, 2026
aea7f85
Bump several package versions in pnpm-lock
steida Feb 3, 2026
e289aa1
Merge upstream/common-v8
miccy Feb 3, 2026
a1b6c59
feat: finalize merge before testing
miccy Feb 3, 2026
32ea98a
refactor: move task runner logic to common package and simplify Node.…
miccy Feb 3, 2026
9af8c5c
fix: bun verify issues solved
miccy Feb 3, 2026
0c15eaa
Initial plan
Copilot Feb 3, 2026
10d882a
Refactor TreeShaking test to avoid type-unsafe cast
Copilot Feb 3, 2026
44902f3
Add comprehensive code review summary document
Copilot Feb 3, 2026
358cb8b
Merge pull request #14 from SQLoot/copilot/fix-web-tests-and-flakiness
miccy Feb 3, 2026
6d3f633
Initial plan
Copilot Feb 3, 2026
1d83994
Reorder package exports and add default entries
steida Feb 3, 2026
16b8937
Use workspace deps in examples
Copilot Feb 3, 2026
750eeda
Adjust tests to use mocked listeners and console
steida Feb 3, 2026
d2684fe
Cherry-pick 3 new upstream commits from common-v8
Copilot Feb 3, 2026
46a9077
Add bun.lock with updated dependencies
Copilot Feb 3, 2026
e152504
Fix React version consistency across monorepo to 19.2.4
Copilot Feb 3, 2026
21ddda9
Merge pull request #15 from SQLoot/copilot/sync-merge-upstream-03-02-26
miccy Feb 3, 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
2 changes: 2 additions & 0 deletions .ai/knowledge/01-project-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ Local-first database with sync capabilities for React, React Native, Svelte, and
- Functional effect system for async operations
- Replaces raw Promise patterns
- Supports dependency injection via `runner.deps`
- Uses `AsyncDisposableStack` for resource management

### Fiber/Runner
- Execution context for Tasks
- Manages abort signals and cleanup
- Structured concurrency
- Platform-specific implementations (`createRunner` for Node/Web)

### Console (Structured Logging)
- JSON-structured log output
Expand Down
50 changes: 50 additions & 0 deletions .ai/knowledge/04-structured-concurrency.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Structured Concurrency in Evolu

## Overview
Evolu uses a custom implementation of structured concurrency to manage async operations, resource lifecycles, and cancellation. This replaces "fire and forget" promises with a strict tree structure where no child outlives its parent.

## Core Concepts

### Task
A functional effect description (lazy promise) that requires a `Runner` to execute.

```typescript
type Task<Success, Error = never, Deps = object> = (run: Runner<Deps>) => Promise<Result<Success, Error>>;
```

### Runner
The execution context. It provides:
- Dependency injection (`run.deps`).
- Abort signaling (cancellation propagation).
- Resource management (via `AsyncDisposableStack`).

### Platform-Specific Runners
As of `upstream/common-v8`, runners are platform-aware:

1. **Web (`packages/web`)**:
- Hooks into `globalThis` for `error` and `unhandledrejection`.
- Cleans up listeners on dispose.

2. **Node.js (`packages/nodejs`)**:
- Hooks into `process` signals (`SIGINT`, `SIGTERM`, `SIGHUP`).
- Provides graceful shutdown capabilities via `run.deps.shutdown`.

## Usage Pattern

### Creating a Runner
**DO NOT** use generic `createRunner` directly for app entry points. Use the platform-specific library.

```typescript
// Web
import { createRunner } from "@evolu/web";
// Node
import { createRunner } from "@evolu/nodejs";

const main = async () => {
await using run = createRunner();
const result = await run(myTask);
};
```

### AsyncDisposableStack
Resources that need cleanup should implement `AsyncDisposable` or be registered with the runner's stack environment.
18 changes: 18 additions & 0 deletions .ai/knowledge/05-test-nuances.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Test Nuances & Known Flakes

## TreeShaking Tests
**File**: `packages/common/test/TreeShaking.test.ts`

### Issue
Bundle size measurements can fluctuate slightly (typically < 20 bytes) between different environments (local dev vs CI vs `bun verify`).

### Cause
Likely differences in compression/minification details or environment-specific overhead in the test runner.

### Mitigation
- If checks fail on size mismatch, use `bun test -u packages/common/test/TreeShaking.test.ts` to update snapshots locally.
- Be aware that `verify` might fail purely due to this flake even if logic is correct.

## Bun Verify vs Bun Test
`bun verify` runs the full monorepo check sequence. Sometimes `bun test` passes in isolation while `verify` fails due to cache/state issues.
**Fix**: Run `bun run clean` in the failing package before retrying verification.
24 changes: 0 additions & 24 deletions .ai/tasks/active/finalize-bun-migration.md

This file was deleted.

23 changes: 23 additions & 0 deletions .ai/tasks/archive/finalize-bun-migration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Bun Migration & Cleanup & Default Branch

> **Status**: ✅ Completed
> **Last Updated**: 2026-02-03
> **Branch**: `main`

## Summary
Complete migration from pnpm/ESLint/Prettier to Bun/Biome across the entire monorepo. This replaces the complex cherry-pick strategy with a "Fresh Start" from `upstream/common-v8`.
Also, set `main` as the default branch on GitHub.

## Tasks

- [x] **Cleanup Legacy Tooling**
- [x] Remove `pnpm`-related files (`pnpm-lock.yaml`, `pnpm-workspace.yaml`, `.npmrc` if any)
- [x] Remove `eslint`-related files (`.eslintrc`, `eslint.config.mjs`, `.eslintignore`, etc.)
- [x] Remove `prettier`-related files (`.prettierrc`, `.prettierignore`, `prettier.config.mjs`)
- [x] Scan and update `package.json` in all packages to remove `eslint`/`prettier` scripts and deps
- [x] Run `bun run clean` & `bun install` to ensure clean state
- [x] **Set Default Branch**
- [x] Set `main` as default branch on `origin` (SQLoot/evolu-plan-b)
- [x] **Verification**
- [x] Verify build passes without legacy tools
- [x] Verify `lint` command runs Biome only
24 changes: 24 additions & 0 deletions .ai/tasks/archive/merge-upstream-03-02-26.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Merge & Integrate Upstream Commits

> **Status**: ✅ Completed
> **Last Updated**: 2026-02-03
> **Branch**: `sync/merge-upstream-03-02-26`

## Summary
Integration of 14 commits from `upstream/common-v8` bringing significant changes to the Task runner architecture and tooling.

## Key Changes
- **Structured Concurrency**:
- `TaskDisposableStack` -> `AsyncDisposableStack`.
- `runMain` -> `createRunner` (platform-specific implementations).
- Web: Uses `globalThis` event listeners for error handling.
- Node.js: Uses `process` signals (SIGINT, SIGTERM) for graceful shutdown.
- **Relay**: `createNodeJsRelay` -> `startRelay`.
- **Tooling**: Full removal of `pnpm` artifacts, reliance on Bun & Biome.

## Verification
- `bun verify` passes (with caveats, see below).
- Manual confirmation of `createRunner` types export.

## Known Issues
- **TreeShaking Test**: `packages/common/test/TreeShaking.test.ts` shows minor bundle size fluctuations (~9 bytes) between local `bun test` and `bun verify` / CI. This is a known environmental flake.
Loading
Loading