Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
69 changes: 69 additions & 0 deletions .agent/cherry_candidates.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
+ 01d1e9983171d8e25984a6ac4ed5a298f784881a Disable web docs test
+ 8cb8edd906136cb044a32330aad6d9b437e5a716 Increase Node.js memory limit for build script
+ cd9d4b4ecbbec587ff015aaea23b20d792d5350e Rename searchUtils.js to searchUtils.mjs and update imports
+ fc869c3b8e3b2737ca69a1f2232f283d39c8c19a Update pnpm-lock.yaml
+ 4ff6fb9f35b1938593d134f7a14cb8c7440ed109 Update build script memory option in package.json
+ bfa58a0632d512e45673bff330dd011f9df46833 Comment out glob import and dynamic MDX loading
+ 2e4fd77c0f4877e84ce6aa82d6fe22242040cb10 Add 'out' directory to ESLint ignore patterns
+ 91695e12cac0196ca774baae0eefe651eeb48fe2 Enable verbatimModuleSyntax
+ d56abd068f5209620558dd6d0f349dc3c812393e Update pnpm-lock.yaml
+ a17ebfa0ea7448344509e3bcc7c59e336f2692d3 Add module-level JSDoc comments to all source files
+ 00a22d62f04c01aef0e09df00a14e746e4d9857e Add test helpers for seeded random generation
+ ca7f45753446ea794167cb5d7a1a187e6c1f874d Refactor test dependencies to use createTestDeps
+ e85390a23a031d32287dd5fd878acbd409b4750e Refactor imports to use 'type' for type-only imports
+ 07005cf4443ac69604d1334f2da839d3cdb372cc Reorder and clean up import statements across modules
+ aa854aad29e855fdb4ce3c6042ae83e025ffe3ea Refactor and flatten schedule module API
+ d669519371da43dde76bdb40f52bfd3e4e18d3e7 Improve formatting and terminology in API reference fixer
+ 10c21286d1f87d170bdf26edbe3b79826337267a Update TypeDoc configuration for improved entry points
+ 7b37a923c301f8d1ec648d5e0cd71f3112f3b3c2 Refactor local-first exports and rename PublicKysely
+ bf6388638d3f1a7897cfb26660f0ecc7ebc28c0a Rename SharedWorker to Worker and update references
+ 2a71c9ba7415874ed6f01ddc30c4324890c9c5f6 Update deps
+ b4cc1f9a6231975e94126c24535bd633a5c88d82 Enhance retry API with typed attempts and onRetry info
+ b3387c5bbe4d30964a89b9a6c4f1f61b47975a28 Rename Semaphore and Mutex interfaces to SemaphoreOld and MutexOld
+ a00d3e398ae2ba9e3ec9a27f8e61e722048a330b Add minPositiveInt constant and refactor usages
+ 4175f2657d89beb48231b6a55d77703fe3e6285d Refactor to use concise arrow function bodies
+ 4f7db540877bd26763b49047b1ab7e58f40522cb Fix typo in clean script for coverage directory
+ 4563c4894e4ef6042dd9bca11c2a4361cfe0270b Improve MDX search error handling and API title formatting
+ 4cd00329a993f412120bd96faaae805b1cf9b44f Add custom TypeDoc plugin for Evolu Type
+ d786ab915c6412ca2082dccfd4dab39c14066c28 Update pnpm-lock.yaml
+ e52efe403982b46bbc9df923c41b1b5506afd30c Refactor 404 pages and remove legacy redirects
+ 50649957460072d25f0b5d16a5051ea218738670 Refactor type assertion tests to use property access
+ 2489f8ae198999ac0bbc5025ffa8231f8cc5b8a7 Promote interface usage for object types and update docs
+ 89833138fc1160bba410b4dc6ad908583c713350 Include 'out' directory in clean script
+ c85732d015ce822622741c11973563f759facdea Add LLM-friendly markdown routes and links for docs, Close #632
+ b02fefaf56b329e6317cf1d926acf82214b3a1c5 Update pnpm-lock.yaml
+ f16af10273fe6daeefec2271a11b74e916b581cc Add concurrency primitives: Deferred, Gate, Semaphore, Mutex
+ 5c1e129056fe5a42d9faca31de4dff009363484e Generate sections.json and update MDX plugin types
+ e01133a7d3aaf1b92010dec0cc8510acedaa5fb4 Update section heading to 'API overview'
+ 7f7fa4ee3b5ac15959b70417d8f6ffb149aeb8c8 Clarify Array sorting documentation comments
+ 27a50155ae3ab827f2473362c7c62cf8ef6c3062 Update browserslist configuration in package.json
+ 9b381f845f910aac8e79ae1347ca0230a8150182 Update pnpm-lock.yaml
+ d4fcf661595620debda2bd7f07382659b759e0c2 Refactor error and event types to interfaces
+ 63034dcfe0f441bf85e5792407822653e7e0bdf4 Refactor docs and code: clarify composition, update tags
+ f379c4e6849a45d3b81742aebffc3772c13f36e7 Add DistributiveOmit utility type and tests
+ 87780a3ec8a47b99542be71cf895c1359a5c0e51 Rename lazy helpers and update usages to new names
+ fcaf9203cc874a1de4a774ef8eceb33d8d04c55a Add Typedoc link for TypeScript Omit utility type
+ 6fc3bba2b165d82180609bc5c1ee5642ad578f86 Add `todo` development placeholder function
+ 1e095e80e2d56bd267fefcb3887452a2a1f41726 Enforce arrow function style in ESLint config
+ 5751fed8784ab5c42f479f65c84b5c7e5bb77f6b Enable browser test configuration in Vitest
+ f155910c04e56e08bd446ce159c2f6a562f69638 Refactor EvoluSchema to use AnyType
+ ce83b24957096fe5a9e7716efd0dddc133d9846a Add assertType helper for type assertions
+ 0e4c79e234fa403c3d5faeeadecfd2d66806b89b Add ConsoleDep to TestDeps and createTestDeps
+ 972bc6114c7c65c3e787366be4a042312b239a27 Refactor AbortError to use 'cause' and improve Semaphore
+ c78657ce2ff49fac0a83758a184d6fc21cce6e2d Update deps
+ f2a2d4233235ec210cc75c46d3b336fd03069d6a Add FAQ and test for generic interface with Type factory
+ b7e3bf147dfa1995b3f0ebeda181d8aa1b1ecb03 Refactor Runner and Fiber state management and events
+ e356918ebb0b80e9040c7b7a72b3b3835f2d5814 Add isIterable utility and tests
+ 2efb0a80d04f1b951ff83e23717b9d91572e9602 Add numeric literal types Int1To99 and Int1To100
+ 34bac2f8223e3e9a9df021ea3145d5d101f8d5ac Add isFunction utility and improve getProperty typing
+ 4025cddca26737ddf6a12bd20592411445aa8aae Cache ok() result to avoid repeated allocations
+ a912d90e07c77029b17d044db79c300e6ce61850 Update Iterable doc and add MDN link in typedoc config
+ c0ed4acf12c4dff6ceaeb0f83a547fa3a7cc4e4f Add tests for isOk and isErr utility functions
+ beb6fd0d0a928ea27abbfca4d3f779d76d023897 Remove IntentionalNever type and update casts to never
+ df47475e2f7450200d1752a7b86d88aa56128d9e Add objectFromEntries utility and expand object tests
+ f6eac2eba8f17464424750e539d5534f6ffcdb80 Reorder imports in vitest.config.ts
+ aa6111fbef23d5132b8a792273e98cd6ed9d1231 Implement all() and withConcurrency for Task composition
+ ba4cbe36d45d99de4cff242ef8fa1332c2b8030f Fix typo in expo-sqlite config key in app.json
+ be80a5c885cc3b8427bb3b227b07901481e86850 Remove object enum style guidelines from instructions
+ e013cfd07d4fae324d734feb916e2b21759942a6 Replace createArray and ensureArray with arrayFrom
+ a4656957a5d7fb73c5a1e9c859300b0a85e5577b Add task composition helpers and improve concurrency
17 changes: 17 additions & 0 deletions .agent/phase1_subjects.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
fix(common): re-export emptyRows and fix IDE resolution issues
fix(test): update Assert.test.ts to match AbortError schema
fix(react-native): replace remaining constVoid usage
fix(packages): globally replace missing constant utils
fix(nodejs): replace missing constVoid with no-op function
fix(ci): migrate Web Build workflow to Bun
fix(ci): migrate CI workflow to Bun
chore: finalize common-v8 cherry-pick (build fixes, docs, settings)
feat: refactor phase 1
Add numeric literal types Int1To99 and Int1To100
fix(Common): Resolve cherry-pick conflicts, types, and formatting for common-v8
Add task composition helpers and improve concurrency
Fix typo in expo-sqlite config key in app.json
Add Promise.try polyfill to react-expo example
Clarify function overloads guidance in conventions docs
Improve documentation for lazy utility function
Implement all() and withConcurrency for Task composition
8 changes: 8 additions & 0 deletions .changeset/cherry-pick-common-v8.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@evolu/common": minor
---

Added `allSettled`, `forEach`, `any`, and `withConcurrency` to `Task` module.
Updates documentation conventions and improved lazy docs.
Polyfilled `Promise.withResolvers` and `Promise.try` for compatibility.
Fixed build errors related to strict type checking.
13 changes: 9 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,16 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup-node-pnpm-install
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install dependencies
run: bun install

- name: Install Playwright browsers
run: npx playwright install --with-deps
run: bun x playwright install --with-deps

- name: Verify
run: pnpm verify
run: bun run verify
11 changes: 8 additions & 3 deletions .github/workflows/web-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,15 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup-node-pnpm-install
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install dependencies
run: bun install

- name: Build Web
env:
NODE_OPTIONS: "--max_old_space_size=8192"
run: pnpm build && pnpm build:web
run: bun run build && bun run build:web
23 changes: 12 additions & 11 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"editor.defaultFormatter": "biomejs.biome",
// "editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"quickfix.biome": "explicit",
"source.organizeImports.biome": "explicit"
},
"[json]": {
"editor.defaultFormatter": "biomejs.biome"
// "editor.defaultFormatter": "biomejs.biome"
},
"[jsonc]": {
"editor.defaultFormatter": "biomejs.biome"
"editor.defaultFormatter": "vscode.json-language-features"
},
"[markdown]": {
"editor.defaultFormatter": "biomejs.biome"
"editor.defaultFormatter": "yzhang.markdown-all-in-one"
},
"[yaml]": {
"editor.defaultFormatter": "redhat.vscode-yaml"
},
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome"
// "editor.defaultFormatter": "biomejs.biome"
},
"[typescriptreact]": {
"editor.defaultFormatter": "biomejs.biome"
// "editor.defaultFormatter": "biomejs.biome"
},
"[javascript]": {
"editor.defaultFormatter": "biomejs.biome"
// "editor.defaultFormatter": "biomejs.biome"
},
"[javascriptreact]": {
"editor.defaultFormatter": "biomejs.biome"
// "editor.defaultFormatter": "biomejs.biome"
},
"[svelte]": {
"editor.defaultFormatter": "svelte.svelte-vscode"
// "editor.defaultFormatter": "svelte.svelte-vscode"
},
"files.associations": {
"*.mdx": "mdx"
Expand All @@ -43,5 +43,6 @@
"**/.turbo": true,
"**/coverage": true,
"**/out": true
}
}
},
"vitest.disableWorkspaceWarning": true
}
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ Evolu is a local-first platform designed for privacy, ease of use, and no vendor
- [Bun](https://bun.sh) (latest)
- Node.js >= 22

## Roadmap

See [ROADMAP.md](./ROADMAP.md) for current progress and future plans.

## Development

Evolu is a monorepo managed by **Turbo** and **Bun**. We use **Biome** for linting and formatting.
Expand Down
15 changes: 15 additions & 0 deletions ROADMAP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Roadmap

## Phase 1: Cherry-pick common-v8 (Completed)
- [x] Integrate `all`, `withConcurrency` (aa6111fb)
- [x] Integrate `allSettled`, `forEach`, `any` (a4656957)
- [x] Documentation updates
- [x] Strict build fixes (Test.ts, Task.test.ts)

## Phase 2: Refactoring (Upcoming)
- [ ] `arrayFrom` refactor (Commit `e013cfd0`)
- **Breaking Change**: Replace `createArray`/`ensureArray` with `arrayFrom`.
- Requires updates across all packages.

## Phase 3: Future
- [ ] Further common-v8 synchronizations.
7 changes: 3 additions & 4 deletions apps/web/src/app/(docs)/docs/conventions/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,9 @@ Why arrow functions?
- **No hoisting** - Combined with `const`, arrow functions aren't hoisted, which enforces top-down code organization
- **Currying** - Arrow functions make currying natural for [dependency injection](/docs/dependency-injection)

**Exception: function overloads.** TypeScript requires the `function` keyword for overloaded signatures:
**Exception: function overloads.** While overloading with arrow functions is possible (using a type with multiple call signatures), it can be hard to type properly because the implementation must satisfy all overloads at once, which TypeScript often can't verify without assertions. Use the `function` keyword instead:

```ts
````ts
function mapArray<T, U>(
array: NonEmptyReadonlyArray<T>,
mapper: (item: T) => U,
Expand All @@ -209,7 +209,6 @@ function mapArray<T, U>(
): ReadonlyArray<U> {
return array.map(mapper) as ReadonlyArray<U>;
}
```

**In interfaces too.** Use arrow function syntax for interface methods—otherwise ESLint won't allow passing them as references due to JavaScript's `this` binding issues.

Expand All @@ -225,7 +224,7 @@ interface FooAvoid {
bar(value: string): void;
baz(): number;
}
```
````

## Function options

Expand Down
110 changes: 55 additions & 55 deletions examples/react-expo/app.json
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
{
"expo": {
"name": "expo-app",
"slug": "expo-app",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/images/icon.png",
"scheme": "myapp",
"userInterfaceStyle": "automatic",
"newArchEnabled": true,
"ios": {
"supportsTablet": true,
"bundleIdentifier": "com.evolu.expo"
},
"android": {
"package": "com.evolu.expo",
"adaptiveIcon": {
"foregroundImage": "./assets/images/adaptive-icon.png",
"backgroundColor": "#ffffff"
}
},
"web": {
"bundler": "metro",
"output": "static",
"favicon": "./assets/images/favicon.png"
},
"plugins": [
"expo-router",
[
"expo-splash-screen",
{
"image": "./assets/images/splash-icon.png",
"imageWidth": 200,
"resizeMode": "contain",
"backgroundColor": "#ffffff"
}
],
[
"expo-secure-store",
{
"configureAndroidBackup": true,
"faceIDPermission": "Allow $(PRODUCT_NAME) to access your Face ID biometric data."
}
],
[
"expo-sqlite",
{
"useSQLCipher": true
}
]
],
"experiments": {
"typedRoutes": true,
"reactCanary": true
}
}
"expo": {
"name": "expo-app",
"slug": "expo-app",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/images/icon.png",
"scheme": "myapp",
"userInterfaceStyle": "automatic",
"newArchEnabled": true,
"ios": {
"supportsTablet": true,
"bundleIdentifier": "com.evolu.expo"
},
"android": {
"package": "com.evolu.expo",
"adaptiveIcon": {
"foregroundImage": "./assets/images/adaptive-icon.png",
"backgroundColor": "#ffffff"
}
},
"web": {
"bundler": "metro",
"output": "static",
"favicon": "./assets/images/favicon.png"
},
"plugins": [
"expo-router",
[
"expo-splash-screen",
{
"image": "./assets/images/splash-icon.png",
"imageWidth": 200,
"resizeMode": "contain",
"backgroundColor": "#ffffff"
}
],
[
"expo-secure-store",
{
"configureAndroidBackup": true,
"faceIDPermission": "Allow $(PRODUCT_NAME) to access your Face ID biometric data."
}
],
[
"expo-sqlite",
{
"useSQLCipher": true
}
]
],
"experiments": {
"typedRoutes": true,
"reactCanary": true
}
}
}
9 changes: 9 additions & 0 deletions examples/react-expo/polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,13 @@ export const installPolyfills = (): void => {
return { promise, resolve, reject };
};
}

// @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/try
if (typeof Promise.try === "undefined") {
// @ts-expect-error This is OK.
Promise.try = (
func: (...args: ReadonlyArray<unknown>) => unknown,
...args: ReadonlyArray<unknown>
): Promise<unknown> => new Promise((resolve) => resolve(func(...args)));
}
};
Loading