需 TypeScript 5.9 及以上并在 tsconfig.json 中开启 strict;Node.js 需 22.19 及以上;从 3.x 升级需按 MIGRATION.md 迁移,且 v3 代码在 v3 分支
effect
Effect-TSMIT活跃维护一套 TypeScript 函数式编程框架,内置并发、依赖注入、错误处理和可观测性等能力,帮你在生产环境里写出类型安全、易维护的应用。
Build production-ready applications in TypeScript
TypeScript 生产级应用库,用类型化错误、依赖注入和结构化并发解决规模化难题
一套 TypeScript 函数式编程框架,内置并发、依赖注入、错误处理和可观测性等能力,帮你在生产环境里写出类型安全、易维护的应用。
核心能力
- 用类型化错误在编译期追踪失败分支
- 内置依赖注入管理服务与上下文
- 提供结构化并发与调度能力
- 统一 Schema 校验与追踪(tracing)
- 按运行时拆分 platform 包,覆盖 Node、Bun、Deno、浏览器
容易踩的坑
- @effect/[email protected]2026-11-02 · 2026-11-02 04:04 UTC
- @effect/[email protected]2026-11-02 · 2026-11-02 04:04 UTC
- @effect/[email protected]2026-11-02 · 2026-11-02 04:04 UTC
- @effect/[email protected]2026-11-02 · 2026-11-02 04:04 UTC
Patch Changes
-
#10217
5216684Thanks @devangpratap! - FixByteSizedecimal unit constructors such asmegabytes(2.01)throwing or returning the wrong byte count, and reject fractional-byte quantities instead of rounding them. -
#10261
b707ad1Thanks @effect-bot! - Fix cluster entity defect restart backoff being shared by all entities of a type and never resetting. -
#10249
46f48afThanks @effect-bot! - Prevent an interrupted cluster request that keeps defecting from stalling message delivery to other entities. -
#10218
92201bcThanks @sbking! - Defer the runner notification for a discarded persisted send made inside aClusterSchema.WithTransactionhandler until the transaction commits. The message was invisible to the runner before the commit, so delivery waited for the next storage poll. -
#10260
cf329f3Thanks @effect-bot! - FixClusterWorkflowEngineturning transient storage failures while saving durable clocks or deferred completions into workflow defects; they are now retried. -
#10262
1d25d78Thanks @effect-bot! - FixClusterWorkflowEngineblocking shard reacquisition indefinitely after a forced shard release interrupted a workflow resume waiting on its active run. -
#10226
d190d97Thanks @tim-smart! - FixClusterWorkflowEngineletting a runner that lost its shard delete a newer activity result, which could run the activity again and change the workflow's history. -
#10241
d7b3b6bThanks @Marve10s! - FixHttpClient.withCookiesRefnot sending cookies when the request URL is completed after it, for example by thebaseUrlofHttpApiClient. Cookies are now selected for the final URL of each request, including redirect hops. -
#10211
a478745Thanks @effect-bot! - KeepEventLogServersession auth challenges on their RPC connection, so a challenge is released when its client disconnects instead of being retained by the server after an unauthenticated disconnect. -
#10221
69eaa29Thanks @clean99! - FixIterable.filterMapWhileiterators yielding values or pulling from the source after they have returneddone. -
#10233
3711ba6Thanks @clean99! - FixIterable.unfolditerators calling the generating function again after they have returneddone. -
#9972
715c5e4Thanks @eugene1g! - AddJson5.parseandJsonc.parsetoeffect/encoding, returning a `Resul
-
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
Effect
Effect is a library for building robust, maintainable, type-safe, and production grade applications in TypeScript. It helps you handle the hard problems at scale: typed errors, dependency injection, structured concurrency, scheduling, tracing, and unified schema validation.
Effect 4.x is a long-term support (LTS) release. If you are upgrading from Effect 3.x, follow the migration guide.
Installation
npm install effect
Requirements
- TypeScript 5.9 or newer. TypeScript 7 is recommended for the best performance and compatibility with Effect's TypeScript tooling.
- Node.js 22.19 or newer is the general minimum for running Effect on Node.js.
- Strict type-checking: the
strictflag must be enabled in yourtsconfig.json.
Links
- Website: documentation, guides, and news
- Discord: ask questions, share what you're building, and talk to the core team
- Community: meetups and events, or bring Effect to your own
- Issues: bug reports and feature requests
- Jobs: companies hiring Effect developers
- Follow us on X, Bluesky, and LinkedIn
Let's talk
Whether your team is considering Effect, rolling it out, or already running it in production, we'd love to hear from you: what you're building, what works, and what you need from Effect next.
- Talk to the maintainers. Introduce your team on Discord or email [email protected]. We're happy to connect privately on Slack or Discord for feedback and help with adoption.
- Production support. We're exploring how to better support teams running Effect in production. If your organization has specific support needs, let's discuss them.
- Adoption help. Our adoption partners offer implementation, consulting, team extension, training, and commercial support.
Feedback from teams using and evaluating Effect directly shapes what we stabilize and build next.
Long-term support
Teams depend on Effect for systems they expect to run for years. Effect 4.x is a long-term support (LTS) release with the following guarantees:
- At least three years of support, including bug and security fixes.
- Bug fixes for one year after the next major version is released.
- Security fixes for two years after the next major version is released.
Stable APIs reserve breaking changes for major releases. APIs marked unstable may change in minor releases, and experimental APIs may change in patch releases.
Effect v3
The Effect v3 source code is available on the v3 branch, which is also where issues and pull requests meant for Effect v3 should be targeted. To upgrade, see the migration guide.
Packages
This monorepo contains the core effect package alongside integration packages that extend it. All packages listed below are released together with synchronized versions.
| Package | Description | API Reference |
|---|---|---|
effect | The core package | docs |
@effect/platform-browser | Platform services for the browser | docs |
@effect/platform-bun | Platform services for Bun | docs |
@effect/platform-deno | Platform services for Deno | docs |
@effect/platform-node | Platform services for Node.js | docs |
@effect/platform-node-shared | Shared services for Node.js-compatible runtimes | docs |
@effect/sql-clickhouse | SQL client for ClickHouse | docs |
@effect/sql-d1 | SQL client for Cloudflare D1 | docs |
@effect/sql-libsql | SQL client for libSQL | docs |
@effect/sql-mssql | SQL client for Microsoft SQL Server | docs |
@effect/sql-mysql2 | SQL client for MySQL | docs |
@effect/sql-pg | SQL client for PostgreSQL | docs |
@effect/sql-pglite | SQL client for PGlite | docs |
@effect/sql-sqlite-bun | SQL client for SQLite via bun:sqlite | docs |
@effect/sql-sqlite-do | SQL client for Cloudflare Durable Objects SQLite | docs |
@effect/sql-sqlite-node | SQL client for SQLite via node:sqlite | docs |
@effect/sql-sqlite-react-native | SQL client for SQLite in React Native | docs |
@effect/sql-sqlite-wasm | SQL client for SQLite compiled to WebAssembly | docs |
@effect/ai-anthropic | Anthropic provider for the Effect AI modules | docs |
@effect/ai-openai | OpenAI provider for the Effect AI modules | docs |
@effect/ai-cloudflare | Cloudflare decision provider for the Effect AI modules | docs |
@effect/ai-typesafe | TypeSafe decision provider for the Effect AI modules | docs |
@effect/ai-openai-compat | OpenAI-compatible API provider for the Effect AI modules | docs |
@effect/ai-openrouter | OpenRouter provider for the Effect AI modules | docs |
@effect/atom-react | React bindings for Effect Atom | docs |
@effect/atom-solid | SolidJS bindings for Effect Atom | docs |
@effect/atom-vue | Vue bindings for Effect Atom | docs |
@effect/opentelemetry | OpenTelemetry integration | docs |
@effect/vitest | Helpers for testing with Vitest | docs |
@effect/docgen | Documentation generator for Effect projects | docs |
@effect/doctest | Runs JSDoc examples as Vitest tests | docs |
@effect/openapi-generator | Generate Effect code from OpenAPI specifications | docs |
@effect/graphql-generator | Generate Effect code from GraphQL documents | docs |
License
MIT