effect

Effect-TSMIT活跃维护

一套 TypeScript 函数式编程框架,内置并发、依赖注入、错误处理和可观测性等能力,帮你在生产环境里写出类型安全、易维护的应用。

Build production-ready applications in TypeScript

[email protected]发布于 2026-11-02 04:03 UTC17,522star +22 / 7 天901fork同步于 2026-11-10 05:23 UTC

怎么上手

由 README 提炼,执行前请确认
npm install effect
硬件要求按 README 说明

README 未说明

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

TypeScript 生产级应用库,用类型化错误、依赖注入和结构化并发解决规模化难题

一套 TypeScript 函数式编程框架,内置并发、依赖注入、错误处理和可观测性等能力,帮你在生产环境里写出类型安全、易维护的应用。

核心能力

  • 用类型化错误在编译期追踪失败分支
  • 内置依赖注入管理服务与上下文
  • 提供结构化并发与调度能力
  • 统一 Schema 校验与追踪(tracing)
  • 按运行时拆分 platform 包,覆盖 Node、Bun、Deno、浏览器

容易踩的坑

需 TypeScript 5.9 及以上并在 tsconfig.json 中开启 strict;Node.js 需 22.19 及以上;从 3.x 升级需按 MIGRATION.md 迁移,且 v3 代码在 v3 分支

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本[email protected]
  1. @effect/[email protected]2026-11-02 · 2026-11-02 04:04 UTC
    查看更新说明
  2. @effect/[email protected]2026-11-02 · 2026-11-02 04:04 UTC
    查看更新说明
  3. @effect/[email protected]2026-11-02 · 2026-11-02 04:04 UTC
    查看更新说明
  4. @effect/[email protected]2026-11-02 · 2026-11-02 04:04 UTC
    查看更新说明
  5. [email protected]最新正式版2026-11-02 · 2026-11-02 04:03 UTC

    Patch Changes

    • #10217 5216684 Thanks @devangpratap! - Fix ByteSize decimal unit constructors such as megabytes(2.01) throwing or returning the wrong byte count, and reject fractional-byte quantities instead of rounding them.

    • #10261 b707ad1 Thanks @effect-bot! - Fix cluster entity defect restart backoff being shared by all entities of a type and never resetting.

    • #10249 46f48af Thanks @effect-bot! - Prevent an interrupted cluster request that keeps defecting from stalling message delivery to other entities.

    • #10218 92201bc Thanks @sbking! - Defer the runner notification for a discarded persisted send made inside a ClusterSchema.WithTransaction handler until the transaction commits. The message was invisible to the runner before the commit, so delivery waited for the next storage poll.

    • #10260 cf329f3 Thanks @effect-bot! - Fix ClusterWorkflowEngine turning transient storage failures while saving durable clocks or deferred completions into workflow defects; they are now retried.

    • #10262 1d25d78 Thanks @effect-bot! - Fix ClusterWorkflowEngine blocking shard reacquisition indefinitely after a forced shard release interrupted a workflow resume waiting on its active run.

    • #10226 d190d97 Thanks @tim-smart! - Fix ClusterWorkflowEngine letting a runner that lost its shard delete a newer activity result, which could run the activity again and change the workflow's history.

    • #10241 d7b3b6b Thanks @Marve10s! - Fix HttpClient.withCookiesRef not sending cookies when the request URL is completed after it, for example by the baseUrl of HttpApiClient. Cookies are now selected for the final URL of each request, including redirect hops.

    • #10211 a478745 Thanks @effect-bot! - Keep EventLogServer session 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 69eaa29 Thanks @clean99! - Fix Iterable.filterMapWhile iterators yielding values or pulling from the source after they have returned done.

    • #10233 3711ba6 Thanks @clean99! - Fix Iterable.unfold iterators calling the generating function again after they have returned done.

    • #9972 715c5e4 Thanks @eugene1g! - Add Json5.parse and Jsonc.parse to effect/encoding, returning a `Resul

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    pkg.pr.new

    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 strict flag must be enabled in your tsconfig.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.

    PackageDescriptionAPI Reference
    effectThe core packagedocs
    @effect/platform-browserPlatform services for the browserdocs
    @effect/platform-bunPlatform services for Bundocs
    @effect/platform-denoPlatform services for Denodocs
    @effect/platform-nodePlatform services for Node.jsdocs
    @effect/platform-node-sharedShared services for Node.js-compatible runtimesdocs
    @effect/sql-clickhouseSQL client for ClickHousedocs
    @effect/sql-d1SQL client for Cloudflare D1docs
    @effect/sql-libsqlSQL client for libSQLdocs
    @effect/sql-mssqlSQL client for Microsoft SQL Serverdocs
    @effect/sql-mysql2SQL client for MySQLdocs
    @effect/sql-pgSQL client for PostgreSQLdocs
    @effect/sql-pgliteSQL client for PGlitedocs
    @effect/sql-sqlite-bunSQL client for SQLite via bun:sqlitedocs
    @effect/sql-sqlite-doSQL client for Cloudflare Durable Objects SQLitedocs
    @effect/sql-sqlite-nodeSQL client for SQLite via node:sqlitedocs
    @effect/sql-sqlite-react-nativeSQL client for SQLite in React Nativedocs
    @effect/sql-sqlite-wasmSQL client for SQLite compiled to WebAssemblydocs
    @effect/ai-anthropicAnthropic provider for the Effect AI modulesdocs
    @effect/ai-openaiOpenAI provider for the Effect AI modulesdocs
    @effect/ai-cloudflareCloudflare decision provider for the Effect AI modulesdocs
    @effect/ai-typesafeTypeSafe decision provider for the Effect AI modulesdocs
    @effect/ai-openai-compatOpenAI-compatible API provider for the Effect AI modulesdocs
    @effect/ai-openrouterOpenRouter provider for the Effect AI modulesdocs
    @effect/atom-reactReact bindings for Effect Atomdocs
    @effect/atom-solidSolidJS bindings for Effect Atomdocs
    @effect/atom-vueVue bindings for Effect Atomdocs
    @effect/opentelemetryOpenTelemetry integrationdocs
    @effect/vitestHelpers for testing with Vitestdocs
    @effect/docgenDocumentation generator for Effect projectsdocs
    @effect/doctestRuns JSDoc examples as Vitest testsdocs
    @effect/openapi-generatorGenerate Effect code from OpenAPI specificationsdocs
    @effect/graphql-generatorGenerate Effect code from GraphQL documentsdocs

    License

    MIT