Skip to content

Commit 494dfc0

Browse files
authored
Release v6 (#28)
1 parent d81a565 commit 494dfc0

File tree

6 files changed

+217
-222
lines changed

6 files changed

+217
-222
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ jobs:
2929
id: node_modules_cache
3030
with:
3131
path: ./node_modules
32-
key: ${{ runner.os }}-14-next-7-node_modules-${{ hashFiles('yarn.lock') }}
32+
key: ${{ runner.os }}-14-9-7-node_modules-${{ hashFiles('yarn.lock') }}
3333
restore-keys: |
34-
${{ runner.os }}-14-next-7-node_modules-
34+
${{ runner.os }}-14-9-7-node_modules-
3535
${{ runner.os }}-14-node_modules-
3636
- name: Yarn offline cache
3737
if: steps.node_modules_cache.outputs.cache-hit != 'true'
@@ -62,7 +62,7 @@ jobs:
6262
strategy:
6363
matrix:
6464
node: ["12", "14", "16"]
65-
firebase: ["next"]
65+
firebase: ["9"]
6666
rxjs: ["6", "7"]
6767
fail-fast: false
6868
name: Test firebase@${{ matrix.firebase }} rxjs@${{ matrix.rxjs }} on Node.js ${{ matrix.node }}
@@ -126,7 +126,7 @@ jobs:
126126
runs-on: ubuntu-latest
127127
name: Publish (NPM)
128128
needs: ['build']
129-
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/exp' || github.event_name == 'release' }}
129+
if: ${{ github.ref == 'refs/heads/main' || github.event_name == 'release' }}
130130
steps:
131131
- name: Setup node
132132
uses: actions/setup-node@v2-beta

README.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,13 @@ Firebase and RxJS for all frameworks.
1212

1313
Status: Beta
1414

15-
16-
---
17-
18-
> **WARNING**: This branch is the work in progress for version 6 of RxFire. [You can find version 5 here](https://github.com/FirebaseExtended/rxfire/tree/v5), if you're looking for documentation or to contribute to stable.
19-
20-
---
21-
2215
## Install
2316

2417
```bash
2518
# npm
26-
npm i rxfire@next firebase@next rxjs --save
19+
npm i rxfire firebase rxjs --save
2720
# yarn
28-
yarn add rxfire@next firebase@next rxjs
21+
yarn add rxfire firebase rxjs
2922
```
3023

3124
Make sure to install Firebase and RxJS individually as they are peer dependencies of RxFire.
@@ -45,7 +38,7 @@ const citiesRef = query(
4538
where('state', '==', 'CO')
4639
);
4740

48-
collectionData(citiesRef, 'id')
41+
collectionData(citiesRef, { idField: 'id' })
4942
.pipe(
5043
tap(cities => console.log('This is just an observable!'))
5144
)
@@ -75,7 +68,7 @@ const citiesRef = query(
7568
where('state', '==', 'CO')
7669
);
7770

78-
collectionData(citiesRef, 'id')
71+
collectionData(citiesRef, { idField: 'id' })
7972
.pipe(
8073
switchMap(cities => {
8174
return combineLatest(...cities.map(c => {
@@ -114,6 +107,8 @@ import { } from 'rxfire/database';
114107
import { } from 'rxfire/storage';
115108
import { } from 'rxfire/auth';
116109
import { } from 'rxfire/functions';
110+
import { } from 'rxfire/performance';
111+
import { } from 'rxfire/remote-config';
117112
```
118113

119114
## Simple functions

docs/database.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ The `list()` function creates an observable that emits a sorted array for each c
4848
| | |
4949
|-----------------|-------------------------------------------------------|
5050
| **function** | `list()` |
51-
| **params** | ref: `import('firebase/database').Reference` or `import('firebase/database').Query`, events?: `ListenEvent[]` |
51+
| **params** | ref: `import('firebase/database').Reference` or `import('firebase/database').Query`, options?: { events?: `ListenEvent[]` } |
5252
| **import path** | `rxfire/database` |
5353
| **return** | `Observable<QueryChange[]>` |
5454

@@ -86,11 +86,11 @@ list(ref)
8686
.subscribe(users => { console.log(users); })
8787

8888
// Listen only to 'child_added' events
89-
list(ref, [ListenEvent.added] /* 'child_added' for js */)
89+
list(ref, { events: [ListenEvent.added] } /* 'child_added' for js */)
9090
.subscribe(addedChanges => { console.log(addedChanges); });
9191

9292
// Listen only to 'child_added' and 'child_removed' events
93-
list(ref, [ListenEvent.added, ListenEvent.removed] /* 'child_added', 'child_removed' for js */)
93+
list(ref, { events: [ListenEvent.added, ListenEvent.removed] } /* 'child_added', 'child_removed' for js */)
9494
.subscribe(addedChanges => { console.log(addedChanges); });
9595
```
9696
@@ -100,7 +100,7 @@ The `stateChanges()` function creates an observable that emits each time a chang
100100
| | |
101101
|-----------------|------------------------------------------------------|
102102
| **function** | `stateChanges()` |
103-
| **params** | ref: `import('firebase/database').Reference` or `import('firebase/database').Query`, events?: `ListenEvent[]` |
103+
| **params** | ref: `import('firebase/database').Reference` or `import('firebase/database').Query`, options:? { events?: `ListenEvent[]` } |
104104
| **import path** | `rxfire/database` |
105105
| **return** | `Observable<QueryChange>` |
106106
@@ -137,11 +137,11 @@ stateChanges(ref).pipe(
137137
).subscribe(data => { console.log(data); });
138138

139139
// Listen only to 'child_added' events
140-
stateChanges(ref, [ListenEvent.added] /* 'child_added' for js */)
140+
stateChanges(ref, { events: [ListenEvent.added] } /* 'child_added' for js */)
141141
.subscribe(addedChanges => { console.log(addedChanges); });
142142

143143
// Listen only to 'child_added' and 'child_removed' events
144-
stateChanges(ref, [ListenEvent.added, ListenEvent.removed] /* 'child_added', 'child_removed' for js */)
144+
stateChanges(ref, { events: [ListenEvent.added, ListenEvent.removed] } /* 'child_added', 'child_removed' for js */)
145145
.subscribe(addedChanges => { console.log(addedChanges); });
146146

147147
```
@@ -152,7 +152,7 @@ The `auditTrail()` function creates an observable that emits the entire state tr
152152
| | |
153153
|-----------------|------------------------------------------------------|
154154
| **function** | `auditTrail()` |
155-
| **params** | ref: `import('firebase/database').Reference` or `import('firebase/database').Query`, events?: `ListenEvent[]` |
155+
| **params** | ref: `import('firebase/database').Reference` or `import('firebase/database').Query`, options?: { events?: `ListenEvent[]` } |
156156
| **import path** | `rxfire/database` |
157157
| **return** | `Observable<QueryChange[]>` |
158158

docs/firestore.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ The `docData()` function creates an observable that returns a stream of a docume
3737
| | |
3838
|-----------------|------------------------------------------|
3939
| **function** | `docData()` |
40-
| **params** | ref: `import('firebase/firestore').DocumentReference` <br> idField?: `string` |
40+
| **params** | ref: `import('firebase/firestore').DocumentReference` <br> options?: { idField?: `string` } |
4141
| **import path** | `rxfire/firestore` |
4242
| **return** | `Observable<T>` |
4343

@@ -55,7 +55,7 @@ const davidDocRef = doc(db, 'users/david');
5555
// Seed the firestore
5656
setDoc(davidDocRef, { name: 'David' });
5757

58-
docData(davidDocRef,'uid').subscribe(userData => {
58+
docData(davidDocRef, { idField: 'uid' }).subscribe(userData => {
5959
console.log(`${userData.name} has id ${userData.uid}`);
6060
});
6161
```
@@ -68,7 +68,7 @@ The `collection()` function creates an observable that emits changes to the spec
6868
| | |
6969
|-----------------|------------------------------------------|
7070
| **function** | `collection()` |
71-
| **params** | query: `import('firebase/firestore').CollectionReference | import('firebase/firestore').Query` |
71+
| **params** | query: `import('firebase/firestore').CollectionReference \| import('firebase/firestore').Query` |
7272
| **import path** | `rxfire/firestore` |
7373
| **return** | `Observable<import('firebase/firestore').QueryDocumentSnapshot[]>` |
7474

@@ -94,7 +94,7 @@ The `collectionData()` function creates an observable that emits a stream of doc
9494
| | |
9595
|-----------------|------------------------------------------|
9696
| **function** | `collectionData()` |
97-
| **params** | query: `import('firebase/firestore').CollectionReference | import('firebase/firestore').Query` <br> idField?: `string` |
97+
| **params** | query: `import('firebase/firestore').CollectionReference \| import('firebase/firestore').Query` <br> options?: { idField?: `string` } |
9898
| **import path** | `rxfire/firestore` |
9999
| **return** | `Observable<T[]>` |
100100

@@ -109,7 +109,7 @@ const app = initializeApp({ /* config */ });
109109
const db = getFirestore(app);
110110
const collectionRef = collection(db, 'users');
111111

112-
collectionData(collectionRef, 'uid')
112+
collectionData(collectionRef, { idField: 'uid' })
113113
.subscribe(users => { console.log(users) });
114114
```
115115

@@ -119,7 +119,7 @@ The `collectionChanges()` function creates an observable that emits the changes
119119
| | |
120120
|-----------------|------------------------------------------|
121121
| **function** | `collectionChanges()` |
122-
| **params** | query: `import('firebase/firestore').CollectionReference | import('firebase/firestore').Query` <br> events?: `import('firebase/firestore').DocumentChangeType[]` |
122+
| **params** | query: `import('firebase/firestore').CollectionReference \| import('firebase/firestore').Query` <br> options?: { events?: `import('firebase/firestore').DocumentChangeType[]` } |
123123
| **import path** | `rxfire/firestore` |
124124
| **return** | `Observable<import('firebase/firestore').DocumentChange[]>` |
125125

@@ -140,7 +140,7 @@ collectionChanges(collectionRef)
140140
.subscribe(changes => { console.log(changes) });
141141

142142
// Listen to only 'added' events
143-
collectionChanges(collectionRef, ['added'])
143+
collectionChanges(collectionRef, { events: ['added'] })
144144
.subscribe(addedEvents => { console.log(addedEvents) });
145145
```
146146

@@ -150,7 +150,7 @@ The `sortedChanges()` function creates an observable that emits the reduced stat
150150
| | |
151151
|-----------------|------------------------------------------|
152152
| **function** | `sortedChanges()` |
153-
| **params** | query: `import('firebase/firestore').CollectionReference | import('firebase/firestore').Query`<br> events?: `import('firebase/firestore').DocumentChangeType[]` |
153+
| **params** | query: `import('firebase/firestore').CollectionReference \| import('firebase/firestore').Query` <br> options?: { events?: `import('firebase/firestore').DocumentChangeType[]` } |
154154
| **import path** | `rxfire/firestore` |
155155
| **return** | `Observable<import('firebase/firestore').DocumentChange[]>` |
156156

@@ -171,7 +171,7 @@ sortedChanges(collectionRef)
171171
.subscribe(changes => { console.log(changes) });
172172

173173
// Listen to only 'added' events
174-
docChanges(collectionRef, ['added'])
174+
docChanges(collectionRef, { events: ['added'] })
175175
.subscribe(addedEvents => { console.log(addedEvents) });
176176
```
177177

@@ -181,7 +181,7 @@ The `auditTrail()` function creates an observable that emits the entire state tr
181181
| | |
182182
|-----------------|------------------------------------------------------|
183183
| **function** | `auditTrail()` |
184-
| **params** | ref: `import('firebase/firestore').Reference | import('firebase/firestore').Query`<br> events?: `import('firebase/firestore').DocumentChangeType[]` |
184+
| **params** | ref: `import('firebase/firestore').Reference \| import('firebase/firestore').Query` <br> options?: { events?: `import('firebase/firestore').DocumentChangeType[]` } |
185185
| **import path** | `rxfire/firestore` |
186186
| **return** | `Observable<import('firebase/firestore').DocumentChange[]>` |
187187

@@ -267,7 +267,7 @@ The `fromCollectionRef()` function creates an observable that emits changes to t
267267
| | |
268268
|-----------------|------------------------------------------|
269269
| **function** | `fromCollectionRef()` |
270-
| **params** | ref: `import('firebase/firestore').Reference | import('firebase/firestore').Query`<br> options?: `import('firebase/firestore').SnapshotListenOptions` |
270+
| **params** | ref: `import('firebase/firestore').Reference \| import('firebase/firestore').Query` <br> options?: `import('firebase/firestore').SnapshotListenOptions` |
271271
| **import path** | `rxfire/firestore` |
272272
| **return** | `Observable<import('firebase/firestore').QuerySnapshot>` |
273273

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
"tslib": "^1.9.0 || ~2.1.0"
8181
},
8282
"peerDependencies": {
83-
"firebase": "^9.0.0-0",
83+
"firebase": "^9.0.0",
8484
"rxjs": "^6.0.0 || ^7.0.0"
8585
},
8686
"devDependencies": {
@@ -97,7 +97,7 @@
9797
"cross-fetch": "^3.1.4",
9898
"eslint": "^7.17.0",
9999
"eslint-config-google": "^0.14.0",
100-
"firebase": "9.0.0-202172505352",
100+
"firebase": "^9.0.0",
101101
"firebase-tools": "^9.10.2",
102102
"glob": "^7.1.6",
103103
"jest": "^26.6.3",

0 commit comments

Comments
 (0)