rxjs README

The project's README from github.com/ReactiveX/rxjs. As one markdown file: README.md.

RxJS

CI Release readiness Observable WPT npm stable npm next npm downloads Apache 2.0

Observable: platform native Extensions: Symbol keyed

RxJS is a library for composing asynchronous and event-based programs with Observable values. This repository contains the platform-based next generation of RxJS, planned for release as RxJS 9.

RxJS 9 is prerelease work in development. The planned first beta is 9.0.0-beta.0, but it has not been published to npm yet. The next tag still points to the earlier RxJS 8 prerelease, while RxJS 7 remains the production latest line and continues to be maintained.

Why RxJS 9? What happened to RxJS 8?

RxJS 8 was real work, not a skipped release. Development began years ago and was paused while the Web Platform Observable proposal was finalized. The new implementation is a platform-based generation rather than a continuation of that paused RxJS 8 branch, so it starts at version 9 to make the architectural break unmistakable and avoid presenting the old RxJS 8 work as the released product.

What is different in RxJS 9?

Preview the RxJS 9 API

The following example shows the planned beta API. Until 9.0.0-beta.0 is published, do not use npm's next tag to install RxJS 9.

import { ColdObservable } from 'rxjs';
import { map } from 'rxjs/map';

const source = new ColdObservable<number>((subscriber) => {
  subscriber.next(1);
  subscriber.next(2);
  subscriber.complete();
});

source[map]((value) => value * 2).subscribe(console.log);

Import the Symbol and call it with bracket syntax. A platform method such as observable.map(project) remains the platform contract; observable[map](project) is the separately versioned RxJS contract.

Packages and documentation

Package Purpose Documentation
rxjs Symbol extensions and intentional RxJS primitives Package guide · API · RxJS 7 migration
@rxjs/observable-polyfill Conditional platform Observable fallback Package guide
@rxjs/test Implementation-neutral virtual-time and marble testing Package guide
@rxjs/migrate Deterministic migration engine and canonical agent Skill Package guide

Release support, budgets, and exact environment gates are documented in the rxjs package. The irreversible npm publication process is the public secure release runbook. The RxJS 9 security-assurance document explains the release evidence, verification commands, sole-maintainer model, and OpenSSF Scorecard in context. Repository-wide design records live in docs/rxjs-next.

Supported environments

The planned beta supports Node 22.13+ and Node 24 as blocking lanes, with Node 26 in an advisory lane. Current Chrome, Firefox, desktop Safari, Mobile Safari, Deno, Bun, and Webpack 5 are blocking. Every supported consumer receives the same ESM implementation, so Deno and Bun support adds no runtime-specific package or application-bundle code.

Contributing

Requires Node 22.13+ and pnpm 10.34.5. Run commands from the repository root.

pnpm install
pnpm --filter rxjs exec vitest --run src
pnpm --filter rxjs run test:package
pnpm run release:check

Start with the repository contribution guide and the rxjs package contribution guide. The active execution queue is PROJECT_PLAN.md.

The complete source-pinned RxJS 7 corpus intentionally retains reviewed lifecycle and compatibility divergences, so it is migration evidence rather than a blanket RxJS 9 compatibility gate. Focused source, package, runtime, browser, performance, and WPT commands are the release gates.

Community and governance

rxjs (ReactiveX/rxjs)

Searching Database…

31.7K ·GitHub
这是什么?RxJS 是一个 JavaScript 库,用于通过 Observable 值来组合异步和基于事件的程序。这个仓库是 RxJS 基于平台技术的下一代版本,计划作为 RxJS 9 发布。
还有 CommonJS 构建吗?还是现在只有 ESM 了?没有重复提供 CommonJS 构建:发布的 JavaScript 只有 ESM 格式,现在的 Node 可以把 require() 桥接到同一批 ESM 文件上。
那我要怎么才能拿到它?对于应用项目,请继续留在 RxJS 7 的生产版本上,在 9.0.0-beta.0 发布之前不要使用 npm 的 next 标签。如果你想构建这个仓库或参与贡献,需要 Node 22.13+ 和 pnpm 10.34.5,并在仓库根目录下运行命令。
这就是我现在应该在生产环境中用的版本吗?不是。RxJS 9 还处于开发中的预发布阶段:计划中的第一个 beta(9.0.0-beta.0)还没发布到 npm,next 标签目前仍然指向较旧的 RxJS 8 预发布版本,而 RxJS 7 仍是持续维护的生产环境最新版本线。
那 RxJS 9 到底有什么不一样?当运行环境本身提供原生的 Web 平台 Observable 时,它会直接使用它,只有在需要时才安装一个符合规范的兜底实现。操作符和工厂函数改为由各模块精确持有的 Symbol,需要用方括号语法来调用,而不是以字符串命名的平台方法,取消操作则基于 AbortSignal 构建。
这个仓库里包含哪些包?一共四个:rxjs(Symbol 扩展和刻意保留的 RxJS 特性)、@rxjs/observable-polyfill(按需生效的平台 Observable 兜底实现)、@rxjs/test(与具体实现无关的虚拟时间和弹珠图测试),以及 @rxjs/migrate(带有规范化 agent Skill 的确定性迁移引擎)。
为什么版本号从 7 直接跳到 9——RxJS 8 去哪了?RxJS 8 确实开发过,但在 Web 平台 Observable 提案定稿期间,开发工作被暂停了。新版本线是基于平台技术的全新一代,而不是那个分支的延续,所以从 9 开始编号,让这次架构上的彻底改变一目了然。
我能把现有的 RxJS 7 代码库迁移到 9 吗?有专门的工具:@rxjs/migrate 是一个确定性迁移引擎。不过要有心理准备,差异是真实存在的——保留下来的 RxJS 7 语料刻意保留了一些经过审阅的生命周期和兼容性上的分歧,所以它更适合作为迁移时的参考依据,而不是一刀切的兼容性门槛。
What are similar projects?RxJS, cyclejs, es-toolkit, vueuse, router, comlink, marked, core-js
Creator
ReactiveX
Size
52.1 MB
Stars
31.7K
Updated
CommitAug 05
Age
11y
Commits · 90 Days