Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Move to monorepo ❗ ❗ ❗ #7342

Merged
merged 17 commits into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ If your PR is the addition of a new operator, please make sure all these boxes a
- [ ] It must have a `-spec.ts` tests file covering the canonical corner cases, with marble diagram tests
- [ ] The spec file should have a type definition test at the end of the spec to verify type definition for various use cases
- [ ] The operator must be documented in JSDoc style in the implementation file, including also the PNG marble diagram image
- [ ] The operator should be listed in `docs_app/content/guide/operators.md` in a category of operators
- [ ] The operator should be listed in `apps/rxjs.dev/content/guide/operators.md` in a category of operators
- [ ] The operator should also be documented. See [Documentation Guidelines](../CONTRIBUTING.md).
- [ ] You may need to update `MIGRATION.md` if the operator differs from the corresponding one in RxJS v4
-->
Expand Down
43 changes: 21 additions & 22 deletions .github/workflows/ci_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: ['16', '18']
node: ['18', '20']

name: Node ${{ matrix.node }} build

Expand All @@ -24,24 +24,23 @@ jobs:
cache: npm
- name: install
run: |
npm install -g npm@latest
npm ci
- name: lint
run: npm run lint
- name: build
run: npm run build:package
- name: test
run: npm test
- name: dtslint
run: npm run dtslint
- name: import
if: ${{ matrix.node == '18' }}
run: npm run test:import
- name: import
if: ${{ matrix.node == '16' || matrix.node == '18' }}
run: npm run test:esm
- name: docs
run: |
cd docs_app
npm run setup
npm run build
npm install -g yarn@latest
yarn install
- name: rxjs lint
run: yarn workspace rxjs lint
- name: rxjs build
run: yarn workspace rxjs build
- name: rxjs test
run: yarn workspace rxjs test
- name: rxjs dtslint
run: yarn workspace rxjs dtslint
- name: rxjs test:import
if: ${{ matrix.node == '18' || matrix.node == '20' }}
run: yarn workspace rxjs test:import
- name: rxjs test:esm
if: ${{ matrix.node == '18' || matrix.node == '20' }}
run: yarn workspace rxjs test:esm
- name: rxjs.dev build
run: yarn workspace rxjs.dev build --prod
- name: rxjs.dev test
run: yarn workspace rxjs.dev test --watch=false --browsers=ChromeHeadless
10 changes: 5 additions & 5 deletions .github/workflows/ci_ts_latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: ['18']
node: ['20']

name: ts@latest

Expand All @@ -24,7 +24,7 @@ jobs:
cache: npm
- name: build
run: |
npm install -g npm@latest
npm ci
npm install --legacy-peer-deps --no-save typescript@latest @types/node@latest
npm run compile
npm install -g yarn@latest
yarn install
yarn workspace rxjs add typescript@latest @types/node@latest --peer --no-save
yarn workspace rxjs compile
24 changes: 10 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,18 @@ node_modules/
typings/

# Generated
/dist/
/dist-compat/
tmp/
coverage/
img/
spec-js/
spec-build/
.out/
.tmp/
dist/

# Import location artifacts
/ajax/
/fetch/
/operators/
/testing/
/webSocket/
packages/rxjs/ajax/
packages/rxjs/fetch/
packages/rxjs/operators/
packages/rxjs/testing/
packages/rxjs/webSocket/

# Copied Package Files
packages/**/LICENSE.txt
packages/**/CODE_OF_CONDUCT.md

# Misc
npm-debug.log
Expand Down
42 changes: 0 additions & 42 deletions .make-helpers.js

This file was deleted.

16 changes: 8 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Contents
---

- Related documents
- [Creating Operators](docs_app/content/guide/operators.md#creating-custom-operators)
- [Writing Marble Tests](docs_app/content/guide/testing/marble-testing.md)
- [Creating Operators](apps/rxjs.dev/content/guide/operators.md#creating-custom-operators)
- [Writing Marble Tests](apps/rxjs.dev/content/guide/testing/marble-testing.md)

---

Expand Down Expand Up @@ -122,15 +122,15 @@ from the main (upstream) repository:

- The documentation is auto-generated directly from the source code.
- In short: From the source code we generate JSON documents, describing each operator, function ... and render this JSON within an Angular application
- The folder `docs_app` contains everything you need for building and developing the docs
- The [Documentation README](docs_app/README.md) will support you
- The folder `apps/rxjs.dev` contains everything you need for building and developing the docs
- The [Documentation README](apps/rxjs.dev/README.md) will support you
- After a PR is merged to master the docs will be published to https://rxjs.dev/

## Unit Tests

Unit tests are located under the [spec directory](/spec). Unit tests over synchronous operators and operations
can be written in a standard [chai](https://www.chaijs.com/) style. Unit tests written against any
asynchronous operator should be written in [Marble Test Style outlined in detail here](docs_app/content/guide/testing/marble-testing.md).
asynchronous operator should be written in [Marble Test Style outlined in detail here](apps/rxjs.dev/content/guide/testing/marble-testing.md).

Each operator under test must be in its own file to cover the following cases:

Expand Down Expand Up @@ -184,7 +184,7 @@ Macro performance tests can be run by hosting the root directory with any web se
then running:

```sh
npm run build_all
yarn build_all
protractor protractor.conf.js
```

Expand All @@ -196,7 +196,7 @@ relative performance of our operators versus prior versions. All operators shoul
Micro performance test can be run with:

```sh
npm run build_all
yarn build_all
node perf/micro
```

Expand All @@ -210,7 +210,7 @@ node perf/micro zip

We have very precise rules over how our git commit messages can be formatted. This leads to **more
readable messages** that are easy to follow when looking through the **project history**. But also,
we use the git commit messages to **generate the RxJS change log**. Helper script `npm run commit`
we use the git commit messages to **generate the RxJS change log**. Helper script `yarn commit`
provides command line based wizard to format commit message easily.

### Commit Message Format
Expand Down
69 changes: 12 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# <img src="docs_app/src/assets/images/logos/Rx_Logo_S.png" alt="RxJS Logo" width="86" height="86"> RxJS: Reactive Extensions For JavaScript
# <img src="apps/rxjs.dev/src/assets/images/logos/Rx_Logo_S.png" alt="RxJS Logo" width="86" height="86"> RxJS: Reactive Extensions For JavaScript

benlesh marked this conversation as resolved.
Show resolved Hide resolved
![CI](https://github.com/reactivex/rxjs/workflows/CI/badge.svg)
[![npm version](https://badge.fury.io/js/rxjs.svg)](http://badge.fury.io/js/rxjs)
[![Join the chat at https://gitter.im/Reactive-Extensions/RxJS](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Reactive-Extensions/RxJS?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

# RxJS 8
# RxJS 8 Monorepo

### FOR 7.X PLEASE GO TO [THE 7.x BRANCH](https://github.com/ReactiveX/rxjs/tree/7.x)

Reactive Extensions Library for JavaScript. This is a rewrite of [Reactive-Extensions/RxJS](https://github.com/Reactive-Extensions/RxJS) and is the latest production-ready version of RxJS. This rewrite is meant to have better performance, better modularity, better debuggable call stacks, while staying mostly backwards compatible, with some breaking changes that reduce the API surface.
Look for RxJS and related packages under the [/packages](/packages/) directory. Applications like the [rxjs.dev](https://rxjs.dev) documentation site are under the [/apps](/apps/) directory.

[Apache 2.0 License](LICENSE.txt)

- [Code of Conduct](CODE_OF_CONDUCT.md)
- [Contribution Guidelines](CONTRIBUTING.md)
- [Maintainer Guidelines](docs_app/content/maintainer-guidelines.md)
- [Maintainer Guidelines](apps/rxjs.dev/content/maintainer-guidelines.md)
- [API Documentation](https://rxjs.dev/)

Reactive Extensions Library for JavaScript. This is a rewrite of [Reactive-Extensions/RxJS](https://github.com/Reactive-Extensions/RxJS) and is the latest production-ready version of RxJS. This rewrite is meant to have better performance, better modularity, better debuggable call stacks, while staying mostly backwards compatible, with some breaking changes that reduce the API surface.

## Versions In This Repository

- [master](https://github.com/ReactiveX/rxjs/commits/master) - This is all of the current work, which is against v8 of RxJS right now
Expand All @@ -29,56 +29,11 @@ Most PRs should be made to **master**.

By contributing or commenting on issues in this repository, whether you've read them or not, you're agreeing to the [Contributor Code of Conduct](CODE_OF_CONDUCT.md). Much like traffic laws, ignorance doesn't grant you immunity.

## Installation and Usage

### ES6 via npm

```shell
npm install rxjs
```

It's recommended to pull in the Observable creation methods you need directly from `'rxjs'` as shown below with `range`.
If you're using RxJS version 7.2 or above, you can pull in any operator you need from the same spot, `'rxjs'`.

```ts
import { range, filter, map } from 'rxjs';

range(1, 200)
.pipe(
filter((x) => x % 2 === 1),
map((x) => x + x)
)
.subscribe((x) => console.log(x));
```

If you're using RxJS version below 7.2, you can pull in any operator you need from one spot, under `'rxjs/operators'`.

```ts
import { range } from 'rxjs';
import { filter, map } from 'rxjs/operators';

range(1, 200)
.pipe(
filter((x) => x % 2 === 1),
map((x) => x + x)
)
.subscribe((x) => console.log(x));
```

## Goals

- Smaller overall bundles sizes
- Provide better performance than preceding versions of RxJS
- To model/follow the [Observable Spec Proposal](https://github.com/zenparsing/es-observable) to the observable
- Provide more modular file structure in a variety of formats
- Provide more debuggable call stacks than preceding versions of RxJS

## Building/Testing

- `npm run compile` build everything
- `npm test` run tests
- `npm run dtslint` run dtslint tests
## Development

## Adding documentation
Because of [this issue](https://github.com/npm/rfcs/issues/287#issuecomment-1727960500) we're using `yarn`. (Basically the docs app uses `@types/jasmine`, and the package uses `@types/mocha` and they get hoisted to the top level by `npm install` with workspaces, and then TypeScript vomits everywhere when you try to build).

We appreciate all contributions to the documentation of any type. All of the information needed to get the docs app up and running locally as well as how to contribute can be found in the [documentation directory](./docs_app).
1. `cd` to the repository root
2. `yarn install` to install all dependencies
3. `yarn workspace rxjs test` will run the RxJS test suite
4. `yarn workspace rxjs.dev start` will start the rxjs.dev documentation site local development server
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Loading