Skip to content

Commit c8f2806

Browse files
authored
Merge branch 'master' into master
2 parents e5e3d9a + 11b36ad commit c8f2806

File tree

85 files changed

+3266
-862
lines changed

Some content is hidden

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

85 files changed

+3266
-862
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ before_script:
2626

2727
script:
2828
- npm run build
29-
- ./node_modules/.bin/karma start --single-run --browsers Chrome --reporters mocha
29+
- ./node_modules/.bin/karma start --single-run --browsers Firefox --reporters mocha
3030
# Run integration test to make sure our typings are correct for user-land.
3131
- node tools/run-typings-test.js
3232

CHANGELOG.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
1+
<a name="5.0.0-rc.4"></a>
2+
# [5.0.0-rc.4](https://github.com/angular/angularfire2/compare/5.0.0-rc.3...5.0.0-rc.4) (2017-11-17)
3+
4+
5+
### Bug Fixes
6+
7+
* **afs:** added missing type to doc() ([#1286](https://github.com/angular/angularfire2/issues/1286)) ([3e00e16](https://github.com/angular/angularfire2/commit/3e00e16))
8+
* **afs:** allow document set options ([#1333](https://github.com/angular/angularfire2/issues/1333)) ([81018ed](https://github.com/angular/angularfire2/commit/81018ed)), closes [#1332](https://github.com/angular/angularfire2/issues/1332)
9+
* **afs:** catch error when enabling persistence ([#1300](https://github.com/angular/angularfire2/issues/1300)) ([61245a3](https://github.com/angular/angularfire2/commit/61245a3))
10+
* **afs:** export interfaces ([#1277](https://github.com/angular/angularfire2/issues/1277)) ([4a21857](https://github.com/angular/angularfire2/commit/4a21857))
11+
* **db:** inherit generics in valueChanges interface ([10afd64](https://github.com/angular/angularfire2/commit/10afd64)), closes [#1214](https://github.com/angular/angularfire2/issues/1214)
12+
* **db:** update should take a Partial<T> object ([#1330](https://github.com/angular/angularfire2/issues/1330)) ([20e66f5](https://github.com/angular/angularfire2/commit/20e66f5)), closes [#1329](https://github.com/angular/angularfire2/issues/1329)
13+
14+
115
<a name="5.0.0-rc.3"></a>
2-
# [5.0.0-rc.3](https://github.com/angular/angularfire2/compare/2.0.0-beta.8...5.0.0-rc.3) (2017-10-14)
16+
# [5.0.0-rc.3](https://github.com/angular/angularfire2/compare/5.0.0-rc.2...5.0.0-rc.3) (2017-10-14)
317

418

519
### Bug Fixes

docs/auth/getting-started.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,13 @@ the Firebase docs for more information on what methods are available.](https://f
1010

1111
```ts
1212
import { Component } from '@angular/core';
13-
import { Observable } from 'rxjs/Observable';
1413
import { AngularFireAuth } from 'angularfire2/auth';
1514
import * as firebase from 'firebase/app';
1615

1716
@Component({
1817
selector: 'app-root',
1918
template: `
20-
<div *ngIf="afAuth.authState | async; let user; else showLogin">
19+
<div *ngIf="afAuth.authState | async as user; else showLogin">
2120
<h1>Hello {{ user.displayName }}!</h1>
2221
<button (click)="logout()">Logout</button>
2322
</div>

docs/firestore/collections.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export class AppComponent {
3737
}
3838
```
3939

40-
The `AngularFirestoreCollection` is service you use to create streams of the collection and perform data operations on the underyling collection.
40+
The `AngularFirestoreCollection` is a service you use to create streams of the collection and perform data operations on the underyling collection.
4141

4242
### The `DocumentChangeAction` type
4343

@@ -78,7 +78,7 @@ There are multiple ways of streaming collection data from Firestore.
7878

7979
**Why would you use it?** - When you just need a list of data. No document metadata is attached to the resulting array which makes it simple to render to a view.
8080

81-
**When would you not use it?** - When you need a more complex data structure than an array or you need the `id` of each document to use data manipulation metods. This method assumes you either are saving the `id` to the document data or using a "readonly" approach.
81+
**When would you not use it?** - When you need a more complex data structure than an array or you need the `id` of each document to use data manipulation methods. This method assumes you either are saving the `id` to the document data or using a "readonly" approach.
8282

8383
**Best practices** - Use this method to display data on a page. It's simple but effective. Use `.snapshotChanges()` once your needs become more complex.
8484

@@ -220,8 +220,6 @@ export class AppComponent {
220220

221221
**When would you not use it?** - When you just need a list of data. This is a more advanced usage of AngularFirestore.
222222

223-
**Best Practices** -
224-
225223
#### Example
226224
```ts
227225
import { Component } from '@angular/core';
@@ -262,16 +260,14 @@ export class AppComponent {
262260

263261
There are three `DocumentChangeType`s in Firestore: `added`, `removed`, and `modified`. Each streaming method listens to all three by default. However, you may only be intrested in one of these events. You can specify which events you'd like to use through the first parameter of each method:
264262

265-
#### Basic smaple
263+
#### Basic sample
266264
```ts
267265
constructor(private afs: AngularFirestore): {
268266
this.itemsCollection = afs.collection<Item>('items');
269267
this.items = this.itemsCollection.snapshotChanges(['added', 'removed']);
270268
}
271269
```
272270

273-
**Note:** Using
274-
275271
#### Component Sample
276272
```ts
277273
import { Component } from '@angular/core';

docs/ionic/v3.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ Alternatively you can open `package.json` to ensure you've got the following Ang
125125
"@ionic-native/splash-screen": "3.12.1",
126126
"@ionic-native/status-bar": "3.12.1",
127127
"@ionic/storage": "2.0.1",
128-
"ionic-angular": "3.5.0",
128+
"ionic-angular": "3.6.0",
129129
"ionicons": "3.0.0",
130130
"rxjs": "5.4.0",
131131
"sw-toolbox": "3.6.0",

docs/rtdb/lists.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ AngularFire provides methods that stream data back as redux compatible actions.
9191
**When would you not use it?** - When you need a more complex data structure than an array or if you need to process changes as they occur. This array is synchronized with the remote and local changes in the Firebase Database.
9292

9393
### `stateChanges()`
94-
**What is it?** - Returns an Observable of the most recent changes as a `AngularFireAction[]`.
94+
**What is it?** - Returns an Observable of the most recent change as an `AngularFireAction`.
9595

96-
**Why would you use it?** - The above methods return a synchronized array sorted in query order. `stateChanges()` emits changes as they occur rather than syncing the query order. This works well for ngrx integrations as you can build your own data structure in your reducer methods.
96+
**Why would you use it?** - The above methods return a singular `AngularFireAction` from each child event that occurs. `stateChanges()` emits changes as they occur rather than syncing the query order. This works well for ngrx integrations as you can build your own data structure in your reducer methods.
9797

9898
**When would you not use it?** - When you just need a list of data. This is a more advanced usage of `AngularFireDatabase`.
9999

docs/rtdb/objects.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -157,17 +157,8 @@ export class AppComponent {
157157
}
158158
```
159159

160-
## Meta-fields on the object
161-
Data retrieved from the object binding contains special properties retrieved from the unwrapped Firebase DataSnapshot.
162-
163-
| property | |
164-
| ---------|--------------------|
165-
| `$key` | The key for each record. This is equivalent to each record's path in our database as it would be returned by `ref.key()`.|
166-
| `$value` | If the data for this child node is a primitive (number, string, or boolean), then the record itself will still be an object. The primitive value will be stored under `$value` and can be changed and saved like any other field.|
167-
168-
169160
## Retrieving the snapshot
170-
AngularFire unwraps the Firebase DataSnapshot by default, but you can get the data as the original snapshot by specifying the `preserveSnapshot` option.
161+
AngularFire `valueChanges()` unwraps the Firebase DataSnapshot by default, but you can get the data as the original snapshot by using the `snapshotChanges()` option.
171162

172163
```ts
173164
this.itemRef = db.object('item');

docs/version-5-upgrade.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,20 @@ Calling `.valueChanges()` returns an Observable without any metadata. If you are
3434
### 4.0
3535
```ts
3636
constructor(afDb: AngularFireDatabase) {
37-
afDb.object('items/1').subscribe(item => console.log(item.$key));
37+
afDb.list('items').subscribe(items => {
38+
const allKeys = items.map(item => item.$key);
39+
});
3840
}
3941
```
4042

4143
### 5.0
4244
```ts
4345
constructor(afDb: AngularFireDatabase) {
44-
afDb.object('items/1').snapshotChanges().map(action => {
45-
const $key = action.payload.key;
46-
const data = { $key, ...action.payload.val() };
47-
return data;
48-
}).subscribe(item => console.log(item.$key));
46+
afDb.list('items').snapshotChanges().map(actions => {
47+
return actions.map(action => ({ key: action.key, ...action.payload.val() }));
48+
}).subscribe(items => {
49+
return items.map(item => item.key);
50+
});
4951
}
5052
```
5153

karma.conf.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ module.exports = function(config) {
3131
'dist/packages-dist/bundles/auth.umd.{js,map}',
3232
'dist/packages-dist/bundles/database.umd.{js,map}',
3333
'dist/packages-dist/bundles/firestore.umd.{js,map}',
34+
'dist/packages-dist/bundles/storage.umd.{js,map}',
3435
'dist/packages-dist/bundles/database-deprecated.umd.{js,map}',
3536
'dist/packages-dist/bundles/test.umd.{js,map}',
3637
],
@@ -40,7 +41,7 @@ module.exports = function(config) {
4041
logLevel: config.LOG_INFO,
4142
autoWatch: true,
4243
reporters: ['mocha'],
43-
browsers: ['Chrome'],
44+
browsers: ['Firefox'],
4445
singleRun: false
4546
})
4647
};

package.json

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
"name": "angularfire2",
3-
"version": "5.0.0-rc.3",
3+
"version": "5.0.0-rc.6",
44
"description": "The official library of Firebase and Angular.",
55
"private": true,
66
"scripts": {
77
"test": "npm run build && karma start --single-run",
88
"test:watch": "concurrently \"npm run build:watch\" \"npm run delayed_karma\"",
99
"test:debug": "npm run build && karma start",
10+
"karma": "karma start",
1011
"test:universal": "npm run build && cp -R dist/packages-dist test/universal-test/node_modules/angularfire2 && cd test/universal-test && npm run prerender",
1112
"delayed_karma": "sleep 10 && karma start",
1213
"build": "rm -rf dist && node tools/build.js",
@@ -28,18 +29,29 @@
2829
},
2930
"homepage": "https://github.com/angular/angularfire2#readme",
3031
"dependencies": {
31-
"@angular/common": "^4.0.0",
32-
"@angular/compiler": "^4.0.0",
33-
"@angular/core": "^4.0.0",
34-
"@angular/platform-browser": "^4.0.0",
35-
"@angular/platform-browser-dynamic": "^4.0.0",
36-
"firebase": "^4.5.0",
37-
"rxjs": "^5.0.1",
32+
"@angular/common": "^5.0.0",
33+
"@angular/compiler": "^5.0.0",
34+
"@angular/core": "^5.0.0",
35+
"@angular/platform-browser": "^5.0.0",
36+
"@angular/platform-browser-dynamic": "^5.0.0",
37+
"@firebase/app": "^0.1.6",
38+
"@firebase/app-types": "^0.1.1",
39+
"@firebase/auth": "^0.3.2",
40+
"@firebase/auth-types": "^0.1.1",
41+
"@firebase/database": "^0.1.7",
42+
"@firebase/database-types": "^0.1.1",
43+
"@firebase/firestore": "^0.2.3",
44+
"@firebase/firestore-types": "^0.1.1",
45+
"@firebase/messaging-types": "^0.1.1",
46+
"@firebase/storage": "^0.1.6",
47+
"@firebase/storage-types": "^0.1.1",
48+
"firebase": "^4.8.2",
49+
"rxjs": "^5.5.4",
3850
"zone.js": "^0.8.0"
3951
},
4052
"devDependencies": {
41-
"@angular/compiler-cli": "^4.0.0",
42-
"@angular/platform-server": "^4.0.0-rc.5",
53+
"@angular/compiler-cli": "^5.0.0",
54+
"@angular/platform-server": "^5.0.0",
4355
"@types/jasmine": "^2.5.36",
4456
"@types/request": "0.0.30",
4557
"concurrently": "^2.2.0",
@@ -55,9 +67,9 @@
5567
"jasmine": "^2.4.1",
5668
"jasmine-core": "^2.4.1",
5769
"json": "^9.0.3",
58-
"karma": "^0.13.19",
59-
"karma-chrome-launcher": "^0.2.2",
60-
"karma-firefox-launcher": "^0.1.7",
70+
"karma": "^2.0.0",
71+
"karma-chrome-launcher": "^2.2.0",
72+
"karma-firefox-launcher": "^1.1.0",
6173
"karma-jasmine": "^0.3.6",
6274
"karma-mocha-reporter": "^2.0.2",
6375
"karma-systemjs": "^0.10.0",
@@ -70,10 +82,11 @@
7082
"rollup": "^0.35.11",
7183
"rollup-plugin-node-resolve": "^3.0.0",
7284
"rollup-watch": "^2.5.0",
85+
"shelljs": "^0.8.0",
7386
"systemjs": "^0.19.16",
7487
"systemjs-builder": "^0.15.7",
7588
"traceur": "0.0.96",
76-
"typescript": "^2.5.3"
89+
"typescript": ">=2.4.2 <2.5"
7790
},
7891
"typings": "index.d.ts"
7992
}

0 commit comments

Comments
 (0)