PR: Sync new upstream commits 03-02-2026 - #16
Conversation
Replace the old runMain pattern with a shutdown-aware createRunner that injects a shutdown promise into deps and installs global signal and error handlers (SIGINT, SIGTERM, SIGHUP, uncaughtException, unhandledRejection). Move Node.js runner wiring into packages/nodejs/src/Task.ts, resolve shutdown via process signals, and ensure listeners are cleaned up on runner dispose. Rename relay APIs: createNodeJsRelayBetterSqliteDeps -> createRelayDeps and createNodeJsRelay -> startRelay, update examples and the apps/relay entry to use startRelay and createRunner. Simplify task typing in packages/common (introduce AnyTask and use it in InferTask* helpers, add CreateRunner type, remove MainTask), and adjust the local-first Relay implementation to handle sqlite errors by logging and returning ok(stack). Update tests to reflect the new createRunner/shutdown behavior and to verify signal/error handling and listener cleanup. README updated to reflect the API rename.
Introduce a browser-specific Task runner and tests. Implements createRunner in packages/web/src/Task.ts that composes the common runner, creates a console child named "global", registers global "error" and "unhandledrejection" handlers (logging via createUnknownError), and removes those listeners when the runner is disposed. Adds vitest tests in packages/web/test/Task.test.ts to verify custom deps merging, mocked listener registration/removal, real-event logging for ErrorEvent and PromiseRejectionEvent, and that handlers are detached after disposal.
Update packages/nodejs/package.json to change the "files" entry from "dist/**" to "dist/src/**". This restricts what gets packaged/published (avoiding unrelated files under dist), reducing package size and ensuring only the compiled source artifacts and src are included.
Consolidate imports and stop passing a custom time provider to createConsoleEntryFormatter in apps/relay/src/index.ts. The createTime import and its usage were removed so the formatter uses its default time handling, and the import statement was simplified.
Update pnpm-lock.yaml to refresh multiple dependency versions and integrity hashes. Notable bumps: @algolia/autocomplete-core/plugin/shared 1.19.4 -> 1.19.5, framer-motion & motion 12.30.1 -> 12.31.0, enhanced-resolve 5.18.4 -> 5.19.0, and dotenv 16.4.7 -> 16.6.1. Snapshots/resolutions updated accordingly — this is an automated lockfile refresh to keep transitive deps in sync.
…js implementation.
Co-authored-by: miccy <9729864+miccy@users.noreply.github.com>
Co-authored-by: miccy <9729864+miccy@users.noreply.github.com>
refactor: Remove type-unsafe cast in TreeShaking test normalization
Adapted from upstream e57edbe to use workspace:* for @evolu/* packages. Used explicit React versions (^19.2.3) instead of catalog:react19 since Bun doesn't support pnpm catalogs. Skipped pnpm-lock.yaml as we use bun.lockb.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
Note 🎁 Summarized by CodeRabbit FreeThe PR author is not assigned a seat. To perform a comprehensive line-by-line review, please assign a seat to the pull request author through the subscription management page by visiting https://app.coderabbit.ai/login. Comment |
Co-authored-by: miccy <9729864+miccy@users.noreply.github.com>
Co-authored-by: miccy <9729864+miccy@users.noreply.github.com>
Co-authored-by: miccy <9729864+miccy@users.noreply.github.com>
Sync 3 upstream commits from common-v8: workspace deps, export reordering, test mocking
There was a problem hiding this comment.
Pull request overview
This pull request syncs 14 commits from the upstream common-v8 branch, implementing a comprehensive structured concurrency migration across the Evolu monorepo. The changes modernize the Task runner architecture with platform-specific implementations and improve type safety throughout.
Changes:
- Migrated to structured concurrency with platform-specific
createRunnerimplementations for Web, Node.js, and React Native - Introduced
CreateRunner<BaseDeps>interface for better type safety and extensibility - Simplified relay API from
createNodeJsRelaytostartRelaywith improved error handling - Made
TimeDepoptional increateConsoleEntryFormatterwith sensible defaults - Aligned all packages to use
@vitest/coverage-v8@^4.0.18and updated test configurations - Updated example applications to use
workspace:*dependencies for consistency - Removed re-export of
@evolu/webfrom@evolu/react-web(breaking change, acknowledged)
Reviewed changes
Copilot reviewed 45 out of 47 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/web/src/Task.ts | New browser-specific runner with global error event handlers |
| packages/web/test/Task.test.ts | Comprehensive tests for web runner event listener cleanup |
| packages/nodejs/src/Task.ts | Node.js runner with process signal handling and shutdown promise |
| packages/nodejs/test/Task.test.ts | Tests for Node.js signal handling and listener cleanup |
| packages/react-native/src/Task.ts | React Native runner with ErrorUtils integration |
| packages/react-native/test/Task.test.ts | Tests for React Native error handling |
| packages/common/src/Task.ts | Core structured concurrency improvements with CreateRunner interface |
| packages/common/src/Console.ts | Made TimeDep optional with default value for better DX |
| packages/nodejs/src/local-first/Relay.ts | Simplified to startRelay with better error handling pattern |
| packages/web/vitest.config.ts | Browser test configuration with multi-browser support |
| packages/react-web/src/index.ts | Removed re-export of @evolu/web (breaking change) |
| packages/common/test/TreeShaking.test.ts | Normalized bundle size checks for environmental stability |
| apps/relay/src/index.ts | Updated to use new startRelay API |
| apps/web/src/components/Features.tsx | Simplified feature list removing unused id field |
| Example applications | Aligned dependencies to workspace:* pattern |
Description
Type of Change
Checklist
bun run check)Related Issues
Summary by CodeRabbit
Release Notes
New Features
API Changes
createRunnerwith updated factory pattern for platform-agnostic runner creation.runMainwith newcreateRunnerarchitecture.createNodeJsRelaytostartRelay.MainTasktype.Improvements
Documentation