PR: Sync with Evolu upstream/common-v8 07-02-2026#28
Conversation
(cherry picked from commit 4a67e14)
(cherry picked from commit 82c941a)
- Enabled composite mode in base tsconfig with incremental builds - Added references between packages matching their dependency graph - Changed build scripts from tsc to tsc --build - Removed dev scripts from library packages (no longer needed) - Simplified pnpm dev to only start relay and web servers - Added pnpm relay for mobile development workflow - Updated turbo.json schema URL and removed ^dev dependency - Added .tsBuildInfo to gitignore After pnpm build, the IDE has full cross-package types without needing a background watcher. This reduces CPU/memory usage and eliminates delays waiting for Turbo to rebuild on changes. (cherry picked from commit f79f9f8)
(cherry picked from commit 585a79a)
(cherry picked from commit cadf5c0) # Conflicts: # pnpm-lock.yaml
Removed allowJs (not needed since all source is TypeScript), removed moduleResolution: "node" from base tsconfig, removed redundant exclude: ["node_modules"] from base, fixed rootDir from "src" to "." where needed, and added test + vitest config to include arrays (cherry picked from commit 6cf8870)
Updated types, exports, and files fields from dist/ to dist/src/ to match the new rootDir: "." tsconfig layout (cherry picked from commit bba6488)
Added dependsOn: ["^build"] so dependent packages are built before starting dev servers (cherry picked from commit 9950864)
Consistent wording pattern "Creates Run for X with Y" and expanded descriptions for Node.js, web, and React Native createRun functions. Removed redundant JSDoc from CreateRun interface (cherry picked from commit 0618f54)
(cherry picked from commit 30ee124) # Conflicts: # packages/common/test/Task.test.ts
Replaced class-style creation with Task-based createEvolu returning Task<Evolu<S>, never, EvoluPlatformDeps>. Simplified Evolu interface: made AsyncDisposable, changed appOwner from Promise to direct value, renamed externalAppOwner config to appOwner, commented out mutations and error store pending reimplementation. Added tests for new API (cherry picked from commit eff36aa)
Simplified createEvoluDeps across platforms to pass through ReloadAppDep directly. Commented out SharedWorker, MessageChannel, and localAuth code pending redesign. Added createEvoluDeps to React Web with flushSync. Updated React Native shared module and Expo entry points (cherry picked from commit 26bc572)
Moved hooks from src/ to src/local-first/ to mirror common package structure. Replaced EvoluProvider/useEvolu/createUseEvolu pattern with createEvoluContext using React use() and Context. Added createRunContext for typed Run context. Removed useEvoluError (error store redesign). Updated index exports (cherry picked from commit ccf4da1)
Changed appOwnerState to use evolu.appOwner directly instead of awaiting a promise (cherry picked from commit 83f6d3d) # Conflicts: # packages/svelte/src/lib/index.svelte.ts
Deleted useEvoluError (error store being redesigned) and alphabetically sorted exports in index.ts (cherry picked from commit 304da2d)
(cherry picked from commit 6c793b2)
(cherry picked from commit 6d98bd2)
(cherry picked from commit 1563099)
(cherry picked from commit 5b7f2f9)
(cherry picked from commit 84f907e)
Refactor the note in the dependency-injection docs to a single concise sentence. Removed the clause suggesting Console likely replaces a Logger and reflowed the text for clarity. (cherry picked from commit cdf7f89)
(cherry picked from commit 53c2ce9)
📝 WalkthroughWalkthroughConverts Evolu to a Task-based local-first API with new platform deps, shifts React hooks to context-based usage, standardizes TypeScript build/configs across the monorepo, renames owner test fixtures to appOwner variants, and updates package scripts/exports and several platform wiring helpers. Changes
Sequence Diagram(s)sequenceDiagram
participant Client as Client (app)
participant createEvolu as createEvolu (Task factory)
participant PlatformDeps as EvoluPlatformDeps
participant Worker as Worker / Storage
rect rgba(180,220,255,0.5)
Client->>createEvolu: call createEvolu(config)
createEvolu->>PlatformDeps: assemble platform deps (reloadApp, console, randomBytes, etc.)
createEvolu->>Worker: initialize or delegate worker via Task run
Worker-->>createEvolu: worker ready (Task resolves Evolu)
createEvolu-->>Client: returns Task/fiber resolving to Evolu
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
There was a problem hiding this comment.
Pull request overview
This PR syncs/refactors several parts of the monorepo (tests, platform adapters, and build config) to improve consistency with upstream naming and to move more packages to tsc --build project references.
Changes:
- Refactors owner-related test fixtures to a unified
testAppOwner*naming and expandscreateEvolutests. - Introduces backward-compatible aliases (
RunforRunner,testCreateRunfortestCreateRunner) and starts migrating React usage toward a context/fiber-based API. - Updates TS build configuration across packages (project references,
tsBuildInfoFile, composite builds) and tweaks Turbo/workspace scripts.
Reviewed changes
Copilot reviewed 66 out of 68 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| turbo.json | Updates Turbo schema URL and changes dev task dependency behavior. |
| packages/web/tsconfig.json | Adds project references/build-info settings for TS build mode. |
| packages/web/src/local-first/Evolu.ts | Simplifies web deps creation (commented-out legacy worker/auth wiring). |
| packages/web/src/Task.ts | JSDoc wording change. |
| packages/web/package.json | Switches to tsc --build for dev/build scripts. |
| packages/vue/tsconfig.json | Adds project references/build-info settings; narrows includes. |
| packages/vue/src/useEvoluError.ts | Removes Vue useEvoluError hook implementation. |
| packages/vue/src/index.ts | Stops exporting useEvoluError. |
| packages/vue/package.json | Switches to tsc --build; removes dev script. |
| packages/tsconfig/nextjs.json | Updates target and trims options/include/exclude to be a pure base config. |
| packages/tsconfig/base.json | Enables composite/incremental by default; tweaks compiler options. |
| packages/tsconfig.json | Adds solution-style TS project references for packages. |
| packages/svelte/tsconfig.json | Adds rootDir, composite/incremental, references, tsBuildInfoFile. |
| packages/svelte/src/lib/index.svelte.ts | Updates app owner state docs and makes appOwner handling promise-like. |
| packages/svelte/package.json | Switches to tsc --build for dev/build. |
| packages/react/tsconfig.json | Adds rootDir/references/tsBuildInfoFile; narrows includes. |
| packages/react/src/useEvolu.ts | Points to new context location and simplifies JSDoc. |
| packages/react/src/local-first/useSyncState.ts | Switches from useEvolu() to use(EvoluContext). |
| packages/react/src/local-first/useQuerySubscription.ts | Switches from useEvolu() to use(EvoluContext). |
| packages/react/src/local-first/useQuery.ts | Switches from useEvolu() to use(EvoluContext). |
| packages/react/src/local-first/useQueries.ts | Switches from useEvolu() to use(EvoluContext); minor formatting. |
| packages/react/src/local-first/useOwner.ts | Switches from useEvolu() to use(EvoluContext). |
| packages/react/src/local-first/useIsSsr.ts | Adds SSR detection hook to avoid hydration mismatches. |
| packages/react/src/local-first/EvoluContext.tsx | Adds new React context factory/provider for Evolu fiber. |
| packages/react/src/index.ts | Re-exports reshuffled modules; removes previous provider/hook exports. |
| packages/react/src/createUseEvolu.ts | Removes typed hook helper. |
| packages/react/src/Task.tsx | Adds Run context factory/provider. |
| packages/react/src/EvoluProvider.tsx | Removes old provider component. |
| packages/react/src/EvoluContext.ts | Removes old context definition. |
| packages/react/package.json | Switches to tsc --build; removes dev script. |
| packages/react-web/tsconfig.json | Adds references/build-info settings. |
| packages/react-web/src/local-first/Evolu.ts | Adds React-web deps helper injecting flushSync. |
| packages/react-web/package.json | Switches to tsc --build for dev/build. |
| packages/react-native/tsconfig.json | Adds references/build-info settings; adjusts rootDir. |
| packages/react-native/src/shared.ts | Refactors RN deps creation and local auth helper; comments out legacy code. |
| packages/react-native/src/exports/expo-sqlite.ts | Reworks Expo entrypoint to export createEvoluDeps. |
| packages/react-native/src/exports/expo-op-sqlite.ts | Comments out all exports (entrypoint becomes empty). |
| packages/react-native/src/exports/bare-op-sqlite.ts | Switches to new shared deps function name. |
| packages/react-native/src/createExpoDeps.ts | Comments out previous Expo deps factory implementation. |
| packages/react-native/src/Task.ts | JSDoc wording change. |
| packages/react-native/package.json | Switches to tsc --build; removes dev script. |
| packages/nodejs/tsconfig.json | Adds references/build-info settings; adjusts rootDir. |
| packages/nodejs/src/Task.ts | Updates JSDoc wording/structure for Node Runner. |
| packages/nodejs/package.json | Adjusts package exports map; switches to tsc --build. |
| packages/common/tsconfig.json | Adds tsBuildInfoFile and removes allowJs. |
| packages/common/test/local-first/_fixtures.ts | Renames owner fixtures to testAppOwner*. |
| packages/common/test/local-first/Storage.test.ts | Updates tests to use renamed owner fixtures. |
| packages/common/test/local-first/Relay.test.ts | Updates tests to use renamed owner fixtures. |
| packages/common/test/local-first/Protocol.test.ts | Updates tests to use renamed owner fixtures. |
| packages/common/test/local-first/Owner.test.ts | Updates tests to use renamed owner fixtures. |
| packages/common/test/local-first/Evolu.test.ts | Replaces placeholder with tests for deps identity + appOwner behavior. |
| packages/common/test/Crypto.test.ts | Updates crypto test to use renamed owner fixture. |
| packages/common/src/Test.ts | Adds testCreateRun alias for upstream naming. |
| packages/common/src/Task.ts | Adds Run type alias and minor JSDoc tweaks. |
| packages/common/package.json | Switches to tsc --build; removes dev script. |
| package.json | Updates root dev script and adds relay script. |
| examples/react-expo/package.json | Renames start script to _start. |
| examples/react-expo/app/index.tsx | Replaces full demo with minimal context/run sample; keeps old code commented. |
| apps/web/tsconfig.json | Minor config cleanup (removes strictNullChecks, adjusts include). |
| apps/web/src/app/(playgrounds)/playgrounds/minimal/EvoluMinimalExample.tsx | Replaces minimal playground with placeholder + new context/run wiring. |
| apps/web/src/app/(playgrounds)/playgrounds/full/EvoluFullExample.tsx | Replaces full playground with TODO placeholder. |
| apps/web/src/app/(docs)/docs/dependency-injection/page.mdx | Minor wording cleanup. |
| apps/relay/tsconfig.json | Simplifies compilerOptions. |
| apps/relay/package.json | Fixes start path to match emitted output structure. |
| .vscode/settings.json | Adds Turbo JSON schema association for VS Code. |
| .gitignore | Adds *.tsBuildInfo ignore pattern. |
| .github/copilot-instructions.md | Updates project guidelines doc structure/content. |
| export * from "./local-first/EvoluContext.js"; | ||
| export * from "./local-first/useIsSsr.js"; | ||
| export * from "./local-first/useOwner.js"; | ||
| export * from "./local-first/useQueries.js"; | ||
| export * from "./local-first/useQuery.js"; | ||
| export * from "./local-first/useQuerySubscription.js"; | ||
| export * from "./Task.js"; | ||
| export * from "./useEvolu.js"; | ||
| export * from "./useEvoluError.js"; | ||
| // TODO: Re-enable useSyncState export after owner-api refactoring is complete | ||
| // export * from "./useSyncState.js"; | ||
| export * from "./useIsSsr.js"; | ||
| export * from "./useOwner.js"; | ||
| export * from "./useQueries.js"; | ||
| export * from "./useQuery.js"; | ||
| export * from "./useQuerySubscription.js"; | ||
|
|
||
| // export * from "./local-first/useSyncState.js"; TODO: Update it for the owner-api |
There was a problem hiding this comment.
This index no longer re-exports createUseEvolu/EvoluProvider, but the repo still imports them (e.g. apps/web/.../multitenant/EvoluMultitenantExample.tsx and multiple examples). As-is, the monorepo won’t typecheck/build. Either restore the exports (possibly as backward-compatible aliases) or update all downstream call sites to the new context-based API in the same PR.
| export * from "./EvoluProvider.js"; | ||
| export * from "./provideEvolu.js"; | ||
| export * from "./useEvolu.js"; | ||
| export * from "./useEvoluError.js"; | ||
| export * from "./useOwner.js"; | ||
| export * from "./useQueries.js"; |
There was a problem hiding this comment.
useEvoluError was removed from the package entrypoint (and the implementation file deleted). This is a breaking public API change; either keep a deprecated alias export or update all documented/public usage accordingly and bump appropriately.
apps/web/src/app/(playgrounds)/playgrounds/minimal/EvoluMinimalExample.tsx
Outdated
Show resolved
Hide resolved
apps/web/src/app/(playgrounds)/playgrounds/full/EvoluFullExample.tsx
Outdated
Show resolved
Hide resolved
|
@copilot open a new pull request to apply changes based on the comments in this thread |
Co-authored-by: miccy <9729864+miccy@users.noreply.github.com>
…ntroduce `encryptionKey` to Evolu config.
…ration - Uncommented Evolu interface methods: insert/update/upsert/resetAppOwner/reloadApp/exportDatabase - Changed appOwner to Promise<AppOwner> for async resolution - Added createLoadingPromises, createErrorStore helpers - Refactored react-expo components to top-level with prop drilling - Fixed Biome linting: import organization, unused variables Worker integration still TODO - mutations validate but don't persist
- New packages/tsconfig/react-native.json for bare RN projects - New packages/tsconfig/expo.json extending react-native config - Update examples/react-expo to use our expo.json instead of expo/tsconfig.base - Self-contained configs without erasableSyntaxOnly for better IDE compatibility - Fix Biome import ordering in index.tsx
… the React Expo example.
…cies across various packages and examples.
Description
This pull request introduces several improvements and refactorings across the codebase, focusing on test reliability, naming consistency, developer experience, and minor build and config tweaks. The most notable changes are the unification of test fixtures for owner-related tests, the introduction of backward-compatible aliases for upstream naming, and enhancements to developer tooling.
Test and Fixture Refactoring:
Replaced all uses of
testOwnerand related variables in test files withtestAppOwnerand corresponding secrets, ensuring a single, consistent test fixture for owner-related tests. This affects files such asCrypto.test.ts,Owner.test.ts, andProtocol.test.ts, as well as all usages of encryption keys and owner IDs in protocol and crypto tests. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19]Expanded the test suite for
Evoluby replacing a placeholder test with comprehensive tests for dependency handling and owner configuration inEvolu.test.ts.API and Naming Consistency:
Runas an alias forRunnerandtestCreateRunas an alias fortestCreateRunner, improving compatibility and clarity. [1] [2]Developer Experience and Tooling:
turbo.jsonin VSCode by updating.vscode/settings.json, enhancing editor support for TurboRepo configuration files.package.jsonand workspace scripts for more targeted and convenient development workflows, including a newrelayscript and refineddevscript.buildscript inpackages/common/package.jsonto use TypeScript project references with--build.Build and Config Tweaks:
tsconfig.jsonandpackage.jsonfiles for better alignment with build output and workspace conventions. [1] [2] [3] [4]Documentation:
Type of Change
Checklist
bun run check)Related Issues
Summary by CodeRabbit
New Features
Refactoring
Bug Fixes
Documentation
Chores