Skip to content

Commit e689ff6

Browse files
Removing RxFire (#4332)
* RxFire is moving to its own repo * Updating link Co-authored-by: Feiyang1 <[email protected]>
1 parent 1f3bdec commit e689ff6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+14
-3196
lines changed

.github/CODEOWNERS

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,6 @@ packages/auth-types @bojeil-google @avolkovi @sam-gc @yuchenshi @firebase/jssdk
6262
packages/testing @avolkovi @sam-gc @yuchenshi @firebase/jssdk-global-approvers
6363
packages/rules-unit-testing @avolkovi @sam-gc @yuchenshi @firebase/jssdk-global-approvers
6464

65-
# RxFire Code
66-
packages/rxfire @davideast @jamesdaniels @firebase/jssdk-global-approvers
67-
6865
# Installations
6966
packages/installations @andirayo @ChaoqunCHEN @firebase/jssdk-global-approvers
7067
packages/installations-types @andirayo @ChaoqunCHEN @firebase/jssdk-global-approvers

.github/workflows/canary-deploy.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,4 @@ jobs:
6060
NPM_TOKEN_UTIL: ${{secrets.NPM_TOKEN_UTIL}}
6161
NPM_TOKEN_WEBCHANNEL_WRAPPER: ${{secrets.NPM_TOKEN_WEBCHANNEL_WRAPPER}}
6262
NPM_TOKEN_FIREBASE: ${{secrets.NPM_TOKEN_FIREBASE}}
63-
NPM_TOKEN_RXFIRE: ${{secrets.NPM_TOKEN_RXFIRE}}
6463
CI: true

.github/workflows/prerelease-manual-deploy.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,5 @@ jobs:
6161
NPM_TOKEN_UTIL: ${{secrets.NPM_TOKEN_UTIL}}
6262
NPM_TOKEN_WEBCHANNEL_WRAPPER: ${{secrets.NPM_TOKEN_WEBCHANNEL_WRAPPER}}
6363
NPM_TOKEN_FIREBASE: ${{secrets.NPM_TOKEN_FIREBASE}}
64-
NPM_TOKEN_RXFIRE: ${{secrets.NPM_TOKEN_RXFIRE}}
6564
CI: true
6665

.github/workflows/test-changed-misc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test rxFire and @firebase/rules-unit-testing
1+
name: Test @firebase/rules-unit-testing
22

33
on: pull_request
44

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
"performance"
2222
],
2323
"scripts": {
24-
"dev": "lerna run --parallel --scope @firebase/* --scope firebase --scope rxfire dev",
25-
"build": "lerna run --scope @firebase/app-exp build:deps && lerna run --scope @firebase/* --scope firebase --scope rxfire --ignore @firebase/app-exp build",
24+
"dev": "lerna run --parallel --scope @firebase/* --scope firebase dev",
25+
"build": "lerna run --scope @firebase/app-exp build:deps && lerna run --scope @firebase/* --scope firebase --ignore @firebase/app-exp build",
2626
"build:exp": "lerna run --scope @firebase/*-exp --scope @firebase/*-compat --scope firebase-exp build",
27-
"build:release": "lerna run --scope @firebase/app-exp build:deps && lerna run --scope @firebase/* --scope firebase --scope rxfire --ignore @firebase/*-exp --ignore @firebase/*-compat build",
27+
"build:release": "lerna run --scope @firebase/app-exp build:deps && lerna run --scope @firebase/* --scope firebase --ignore @firebase/*-exp --ignore @firebase/*-compat build",
2828
"build:changed": "ts-node-script scripts/ci-test/build_changed.ts",
29-
"link:packages": "lerna exec --scope @firebase/* --scope firebase --scope rxfire -- yarn link",
29+
"link:packages": "lerna exec --scope @firebase/* --scope firebase -- yarn link",
3030
"stage:packages": "./scripts/prepublish.sh",
3131
"repl": "node tools/repl.js",
3232
"release": "ts-node-script scripts/release/cli.ts",
@@ -46,8 +46,8 @@
4646
"docgen:node": "node scripts/docgen/generate-docs.js --api node",
4747
"docgen": "yarn docgen:js; yarn docgen:node",
4848
"prettier": "prettier --config .prettierrc --write '**/*.{ts,js}'",
49-
"lint": "lerna run --scope @firebase/* --scope rxfire lint",
50-
"lint:fix": "lerna run --scope @firebase/* --scope rxfire lint:fix",
49+
"lint": "lerna run --scope @firebase/* lint",
50+
"lint:fix": "lerna run --scope @firebase/* lint:fix",
5151
"size-report": "ts-node-script scripts/size_report/report_binary_size.ts",
5252
"modular-export-size-report": "ts-node-script scripts/size_report/report_modular_export_binary_size.ts",
5353
"api-report": "lerna run --scope @firebase/*-exp --scope @firebase/firestore --scope @firebase/storage --scope @firebase/storage-types --scope @firebase/database api-report",

packages/rules-unit-testing/src/api/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,9 @@ export function initializeAdminApp(options: AdminAppOptions): app.App {
263263
* @param options options object.
264264
*/
265265
export function useEmulators(options: FirebaseEmulatorOptions): void {
266-
if (!(options.database || options.firestore || options.storage || options.hub)) {
266+
if (
267+
!(options.database || options.firestore || options.storage || options.hub)
268+
) {
267269
throw new Error(
268270
"Argument to useEmulators must contain at least one of 'database', 'firestore', 'storage', or 'hub'."
269271
);
@@ -429,7 +431,7 @@ function getHubHost() {
429431
}
430432

431433
function parseHost(host: string): { hostname: string; port: number } {
432-
const withProtocol = host.startsWith("http") ? host : `http://${host}`;
434+
const withProtocol = host.startsWith('http') ? host : `http://${host}`;
433435
const u = new URL(withProtocol);
434436
return {
435437
hostname: u.hostname,

packages/rules-unit-testing/test/database.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ describe('Testing Module Tests', function () {
279279
// TODO: This test cannot be enabled without adding credentials to the test environment
280280
// due to an underlying issue with firebase-admin storage. For now we will run it
281281
// locally but not in CI.
282-
if (process.env.CI !== "true") {
282+
if (process.env.CI !== 'true') {
283283
await firebase.assertSucceeds(
284284
app.storage().bucket().file('/foo/bar.txt').save('Hello, World!')
285285
);

packages/rxfire/.eslintrc.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

packages/rxfire/.gitignore

Lines changed: 0 additions & 7 deletions
This file was deleted.

packages/rxfire/CHANGELOG.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

packages/rxfire/README.md

Lines changed: 1 addition & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -1,126 +1,3 @@
11
# RxFire
22

3-
Firebase and RxJS for all frameworks.
4-
5-
## What is RxFire?
6-
7-
- **Observable creators** - Observables bindings for most Firebase web libraries.
8-
- **Portable** - Use across any framework or no framework at all.
9-
- **Tree shake-able** - Import only what you need. Shake the rest out with your favorite module bundler like Webpack or Rollup.
10-
- **Combine multiple data sources** - Need to join two Firestore references? Want to combine an image from Cloud Storage with a Firestore document? Super easy with observables and operators.
11-
- **Simplify code-splitting of Firebase** - Using RxFire with Webpack makes it easy to load Firebase features on-demand.
12-
13-
Status: Beta
14-
15-
## Install
16-
17-
```bash
18-
# npm
19-
npm i rxfire firebase rxjs --save
20-
# yarn
21-
yarn add rxfire firebase rxjs
22-
```
23-
24-
Make sure to install Firebase and RxJS individually as they are peer dependencies of RxFire.
25-
26-
## Example use:
27-
28-
```ts
29-
import firebase from 'firebase/app';
30-
import 'firebase/firestore';
31-
import { collectionData } from 'rxfire/firestore';
32-
import { tap } from 'rxjs/operators';
33-
34-
const app = firebase.initializeApp({ /* config */ });
35-
const citiesRef = app.firestore().collection('cities');
36-
citiesRef.where('state', '==', 'CO');
37-
38-
collectionData(citiesRef, 'id')
39-
.pipe(
40-
tap(cities => console.log('This is just an observable!'))
41-
)
42-
.subscribe(cities => { /* update UI */ })
43-
```
44-
45-
## Easily combine multiple Firebase data sources
46-
47-
RxJS provides multiple operators and creation methods for combining observable streams. This makes it easy to combine data from multiple Firebase resources. You can also handle simplify high asynchronous tasks like joins into a flat stream.
48-
49-
The example below streams a list of "cities" from Firestore and then retrieves their image from a Cloud Storage bucket. Both tasks are asynchronous but RxJS makes it easy to combine these tasks together.
50-
51-
```ts
52-
import firebase from 'firebase/app';
53-
import 'firebase/firestore';
54-
import 'firebase/storage';
55-
import { collectionData } from 'rxfire/firestore';
56-
import { getDownloadURL } from 'rxfire/storage';
57-
import { switchMap } from 'rxjs/operators';
58-
59-
const app = firebase.initializeApp({ /* config */ });
60-
const citiesRef = app.firestore().collection('cities');
61-
citiesRef.where('state', '==', 'CO');
62-
63-
collectionData(citiesRef, 'id')
64-
.pipe(
65-
switchMap(cities => {
66-
return combineLatest(...cities.map(c => {
67-
const ref = storage.ref(`/cities/${c.id}.png`);
68-
return getDownloadURL(ref).pipe(map(imageURL => ({ imageURL, ...c })));
69-
}));
70-
})
71-
)
72-
.subscribe(cities => {
73-
cities.forEach(c => console.log(c.imageURL));
74-
});
75-
```
76-
77-
## Understanding RxFire imports
78-
79-
RxFire is a complementary library to Firebase. It is not meant to wrap the entire Firebase SDK. RxFire's purpose is to simplify async streams from Firebase. You need to import the Firebase SDK and initialize an app before using RxFire.
80-
81-
```ts
82-
import firebase from 'firebase/app';
83-
import 'firebase/storage'; // import only the features needed
84-
import { getDownloadURL } from 'rxfire/storage';
85-
86-
const app = firebase.initializeApp({ /* config */ });
87-
const ref = app.storage().ref('data.json');
88-
89-
// Now you can use RxFire!
90-
const url$ = getDownloadURL(ref);
91-
```
92-
93-
RxFire contains multiple entry points for module imports. Each Firebase library is an entry point.
94-
95-
```ts
96-
import { } from 'rxfire/firestore';
97-
import { } from 'rxfire/database';
98-
import { } from 'rxfire/storage';
99-
import { } from 'rxfire/auth';
100-
import { } from 'rxfire/functions';
101-
```
102-
103-
## Simple functions
104-
RxFire is a set of functions. Most functions create observables and from there you can use regular RxJS operators. Some functions are custom operators. But at the end of the day, it's all just functions. This is important for **tree shaking**. Any unused functions are stripped from your final build if you use a module bundler like Webpack or Rollup.
105-
106-
```ts
107-
import firebase from 'firebase/app';
108-
import 'firebase/storage';
109-
import { getDownloadURL, put /* not used! */ } 'rxfire/storage';
110-
111-
const app = firebase.initializeApp({ /* config */ });
112-
const ref = app.storage().ref('data.json');
113-
114-
const url$ = getDownloadURL(ref);
115-
```
116-
117-
## Documentation
118-
119-
- [Firestore](https://github.com/firebase/firebase-js-sdk/blob/master/packages/rxfire/docs/firestore.md)
120-
- [Authentication](https://github.com/firebase/firebase-js-sdk/blob/master/packages/rxfire/docs/auth.md)
121-
- [Storage](https://github.com/firebase/firebase-js-sdk/blob/master/packages/rxfire/docs/storage.md)
122-
- [Realtime Database](https://github.com/firebase/firebase-js-sdk/blob/master/packages/rxfire/docs/database.md)
123-
124-
## Examples
125-
126-
[Examples](https://github.com/davideast/rxfire-samples): See this example repository for a list of ways to configure and use RxFire.
3+
RxFire has moved to its own repository, you can find it here [firebaseextended/rxfire](https://github.com/firebaseextended/rxfire).

packages/rxfire/auth/index.ts

Lines changed: 0 additions & 60 deletions
This file was deleted.

packages/rxfire/auth/package.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

packages/rxfire/database/fromRef.ts

Lines changed: 0 additions & 51 deletions
This file was deleted.

packages/rxfire/database/index.ts

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)