Skip to content

Commit 504303b

Browse files
authored
Docs and fixes for 6.0 (#2316)
* Brought a fix in from `5.4.2` ([#2315](#2315)) * Fixed `@angular/fire/analytics` attempting to use `global` ([#2303](#2303)) * Fix the error message on storage ([#2313](#2313)) * Starting on documentation for 6.0
1 parent 014911b commit 504303b

18 files changed

+178
-161
lines changed

CHANGELOG.md

+50-13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1+
<a name="6.0.0-rc.1"></a>
2+
# [6.0.0-rc.1](https://github.com/angular/angularfire2/compare/6.0.0-rc.0...6.0.0-rc.1) (2020-02-06)
3+
4+
Continued work on version 6.
5+
6+
* Brought a fix in `5.4.2` ([#2315](https://github.com/angular/angularfire2/issues/2315))
7+
* Fixed `@angular/fire/analytics` attempting to use `global` ([#2303](https://github.com/angular/angularfire/issues/2303))
8+
* Fix the error message on storage ([#2313](https://github.com/angular/angularfire/issues/2313))
9+
* Starting on documentation for 6.0
10+
111
<a name="6.0.0-rc.0"></a>
2-
# [6.0.0-rc.0](https://github.com/angular/angularfire2/compare/5.3.0...6.0.0-rc.0) (2020-01-30)
12+
# [6.0.0-rc.0](https://github.com/angular/angularfire2/compare/5.4.1...6.0.0-rc.0) (2020-01-30)
313

414
Version 6 of AngularFire drops support for Angular version 8 and below, older versions of typescript, Firebase, drops `firebase-node`, `database-deprecated`, and more.
515

@@ -11,9 +21,6 @@ Version 6 of AngularFire drops support for Angular version 8 and below, older ve
1121
* Using `ng-packagr` to build the library, bringing us back up to speed on APF
1222
* All of our `@NgModules` are now `providedIn: 'any'` rather than singletons
1323
* We make use of Proxy in more modules, you'll need to polyfill if you want to support IE 11
14-
* Fixed the `ng add` and `ng deploy` commands
15-
* `ng deploy` now supports a `buildTarget` option
16-
* We've addressed a number of memory leaks and Zone.js issues in SSR applications
1724

1825
#### `@angular/fire`
1926

@@ -26,7 +33,8 @@ Version 6 of AngularFire drops support for Angular version 8 and below, older ve
2633

2734
#### `@angular/fire/auth`
2835

29-
* `AngularFireAuthModule` no longer imports `firebase/auth` on it's own to remain side-effect free, you'll need to `import 'firebase/auth'` on your own
36+
* `AngularFireAuthModule` is now side-effect free and `AngularFireAuth` will dynamically import `firebase/auth` when a request is made
37+
* `AngularFireAuth` has dropped the `auth` property and instead Promise Proxies the underlying Firebase `auth.Auth` instance
3038

3139
#### `@angular/fire/auth-guard`
3240

@@ -48,27 +56,56 @@ Version 6 of AngularFire drops support for Angular version 8 and below, older ve
4856

4957
* Dropped the `FunctionsRegionToken` and `FUNCTIONS_REGION` DI tokens in favor of `REGION`
5058
* Dropped the `FUNCTIONS_ORIGIN` DI token in favor of `ORIGIN`
51-
* `AngularFireFunctions` is now side-effect free and now lazy loads `firebase/functions` when a request is made
52-
* `AngularFireFunctions` has dropped the `functions` property and instead Proxies the underlying Firebase `functions.Functions` instance
59+
* `AngularFireFunctionsModule` is now side-effect free and `AngularFireFunctions` will dynamically import `firebase/functions` when a request is made
60+
* `AngularFireFunctions` has dropped the `functions` property and instead Promise Proxies the underlying Firebase `functions.Functions` instance
5361

5462
#### `@angular/fire/messaging`
5563

5664
* `AngularFireMessaging`'s dynamic import of `firebase/messaging` is now lazy, if you don't call any methods the SDK will not be loaded
57-
* `AngularFireMessaging` has dropped the `messaging` property and instead Proxies the underlying Firebase `messaging.Messaging` instance
65+
* `AngularFireMessaging` has dropped the `messaging` property and instead Promise Proxies the underlying Firebase `messaging.Messaging` instance
5866

5967
#### `@angular/fire/performance`
6068

61-
* `AngularFirePerformance` now Proxies the underlying Firebase `messaging.Messaging` instance
62-
63-
#### `@angular/fire/remote-config`
64-
65-
* `AngularFireRemoteConfig` now uses `ensureInitialized()` in it's observables, protecting their value emissions better against race conditions
69+
* `AngularFirePerformance` has dropped the `performance` property and instead Promise Proxies the underlying Firebase `performance.Performance` instance
6670

6771
#### `@angular/fire/storage`
6872

6973
* `AngularFireStorageModule` no longer imports `firebase/storage` on it's own to remain side-effect free, you'll need to `import 'firebase/storage'` on your own
7074
* Dropped `StorageBucket` DI token in favor of `BUCKET`
7175

76+
<a name="5.4.2"></a>
77+
## [5.4.2](https://github.com/angular/angularfire2/compare/5.4.1...5.4.2) (2020-02-06)
78+
79+
### Bug Fixes
80+
81+
* **core:** fixing a problem with hot/cold observables resulting in missed events ([#2315](https://github.com/angular/angularfire2/issues/2315)) ([f24df35](https://github.com/angular/angularfire2/commit/f24df35))
82+
83+
84+
<a name="5.4.1"></a>
85+
## [5.4.1](https://github.com/angular/angularfire2/compare/5.4.0...5.4.1) (2020-02-05)
86+
87+
### Bug Fixes
88+
89+
* **auth:** `authState` should be using `onAuthStateChanged` ([#2308](https://github.com/angular/angularfire2/issues/2308)) ([9506f85](https://github.com/angular/angularfire2/commit/9506f85))
90+
91+
<a name="5.4.0"></a>
92+
# [5.4.0](https://github.com/angular/angularfire2/compare/5.3.1...5.4.0) (2020-02-01)
93+
94+
### Features
95+
96+
* **core:** Register AngularFire and Angular versions with the JS SDK ([6096c95](https://github.com/angular/angularfire2/commit/6096c95))
97+
* **ng-deploy:** add option for buildTarget ([#2281](https://github.com/angular/angularfire2/issues/2281)) ([28a4e54](https://github.com/angular/angularfire2/commit/28a4e54))
98+
* **core:** Major changes to the Zone.js wrapping to address SSR memory leaks and more ([#2294](https://github.com/angular/angularfire2/issues/2294)) ([56df941](https://github.com/angular/angularfire2/commit/56df941))
99+
100+
101+
<a name="5.3.1"></a>
102+
# [5.3.1](https://github.com/angular/angularfire2/compare/5.3.0...5.3.1) (2020-02-01)
103+
104+
### Bug Fixes
105+
* **schematics**: The schematics should be functional again. The version of `firebase-tools` we were installing when you called `ng add @angular/fire` was using deprecated API. ([#2285](https://github.com/angular/angularfire2/issues/2285)) ([5867eeb](https://github.com/angular/angularfire2/commit/5867eebbd2ec7eaad0bbc8da94e38aca1fe7580b))
106+
* **schematics**: fix issues with FS and Devkit Paths ([#2279](https://github.com/angular/angularfire2/issues/2279)) ([5ccf5db](https://github.com/angular/angularfire2/commit/5ccf5db3302be4a77529c33eda9ce39e5503b3c4))
107+
* **rc**: Need to `ensureInitialized()` ([#2290](https://github.com/angular/angularfire2/issues/2290)) ([0d95523](https://github.com/angular/angularfire2/commit/0d955231a0c91d8abd4effe0e02044f40451a891))
108+
72109
<a name="5.3.0"></a>
73110
# [5.3.0](https://github.com/angular/angularfire2/compare/5.2.3...5.3.0) (2020-01-07)
74111

CONTRIBUTING.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@ and help you to craft the change so that it is successfully accepted into the pr
5656

5757
```shell
5858
$ git clone <your fork SSH/HTTPS from GitHub>
59-
$ yarn install
60-
$ yarn test
59+
$ cd angularfire
60+
$ yarn
61+
$ yarn build
62+
$ yarn test:all
6163
```
6264

6365
3) Make your changes in a new git branch:

README.md

+20-24
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
<p align="center">
2-
<h1 align="center">AngularFire</h1>
3-
<p align="center">The official library for Firebase and Angular</p>
4-
</p>
1+
# AngularFire
2+
The official Angular library for Firebase
53

6-
[![Build Status](https://travis-ci.org/angular/angularfire.svg?branch=master)](https://travis-ci.org/angular/angularfire) [![Join the chat at https://gitter.im/angular/angularfire2](https://badges.gitter.im/angular/angularfire2.svg)](https://gitter.im/angular/angularfire2?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
4+
```bash
5+
ng add @angular/fire@next
6+
```
77

88
---
99

@@ -22,29 +22,19 @@
2222
- **Manage binary data** - Upload, download, and delete binary files like images, videos, and other blobs.
2323
- **Call server code** - Directly call serverless Cloud Functions with user context automatically passed.
2424
- **Push notifications** - Register and listen for push notifications
25-
- **Modular** - Include only what's needed. No AngularFire package is above 3kb with most under 2kb (gzipped).
26-
27-
#### Quick links
28-
[Contributing](CONTRIBUTING.md)
29-
30-
[Stackblitz Template](https://stackblitz.com/edit/angular-1iment) - Remember to set your Firebase configuration in `app/app.module.ts`.
31-
32-
[Upgrading to v5.0? Check out our guide.](docs/version-5-upgrade.md)
25+
- **Modular** - Include only what's needed. No AngularFire package is above 4kb with most under 2kb (gzipped).
3326

34-
**Having troubles?** Get help on the [Firebase Mailing List](https://groups.google.com/forum/#!forum/firebase-talk) (officially supported), the [Firebase Community Slack](https://firebase.community/) (look for the `#angularfire2` room), [Gitter](https://gitter.im/angular/angularfire2), or [Stack Overflow](https://stackoverflow.com/questions/tagged/angularfire2).
27+
## Quickstart
3528

36-
## Install
37-
38-
```bash
39-
npm install firebase @angular/fire --save
40-
```
29+
Get your first application up and running by following [our quickstart guide](docs/install-and-setup.md).
4130

4231
## Example use:
4332

4433
```ts
4534
import { Component } from '@angular/core';
4635
import { AngularFirestore } from '@angular/fire/firestore';
4736
import { Observable } from 'rxjs';
37+
import 'firebase/firestore';
4838

4939
@Component({
5040
selector: 'app-root',
@@ -58,17 +48,23 @@ import { Observable } from 'rxjs';
5848
})
5949
export class MyApp {
6050
items: Observable<any[]>;
61-
constructor(db: AngularFirestore) {
62-
this.items = db.collection('items').valueChanges();
51+
constructor(firestore: AngularFirestore) {
52+
this.items = firestore.collection('items').valueChanges();
6353
}
6454
}
6555
```
6656

67-
## Developer Guide
57+
## Resources
6858

69-
### Getting started
59+
[Contributing](CONTRIBUTING.md)
60+
61+
[Stackblitz Template](https://stackblitz.com/edit/angular-1iment) - Remember to set your Firebase configuration in `app/app.module.ts`.
7062

71-
- [Installation & Setup](docs/install-and-setup.md)
63+
[Upgrading to v6.0? Check out our guide.](docs/version-6-upgrade.md)
64+
65+
**Having troubles?** Get help on the [Firebase Mailing List](https://groups.google.com/forum/#!forum/firebase-talk) (officially supported), the [Firebase Community Slack](https://firebase.community/) (look for the `#angularfire2` room), [Gitter](https://gitter.im/angular/angularfire2), or [Stack Overflow](https://stackoverflow.com/questions/tagged/angularfire2).
66+
67+
## Developer Guide
7268

7369
### **NEW:** Monitor usage of your application in production
7470

docs/auth/getting-started.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
`AngularFireAuth.user` provides you an `Observable<User|null>` to monitor your application's authentication State.
44

5-
`AngularFireAuth.auth` returns an initialized
5+
`AngularFireAuth` promise proxies an initialized
66
`firebase.auth.Auth` instance, allowing you to log users in, out, etc. [See
77
the Firebase docs for more information on what methods are available.](https://firebase.google.com/docs/reference/js/firebase.auth.Auth)
88

@@ -16,7 +16,7 @@ import { auth } from 'firebase/app';
1616
@Component({
1717
selector: 'app-root',
1818
template: `
19-
<div *ngIf="afAuth.user | async as user; else showLogin">
19+
<div *ngIf="auth.user | async as user; else showLogin">
2020
<h1>Hello {{ user.displayName }}!</h1>
2121
<button (click)="logout()">Logout</button>
2222
</div>
@@ -27,13 +27,13 @@ import { auth } from 'firebase/app';
2727
`,
2828
})
2929
export class AppComponent {
30-
constructor(public afAuth: AngularFireAuth) {
30+
constructor(public auth: AngularFireAuth) {
3131
}
3232
login() {
33-
this.afAuth.auth.signInWithPopup(new auth.GoogleAuthProvider());
33+
this.auth.signInWithPopup(new auth.GoogleAuthProvider());
3434
}
3535
logout() {
36-
this.afAuth.auth.signOut();
36+
this.auth.signOut();
3737
}
3838
}
3939
```

docs/auth/router-guards.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ import { map } from 'rxjs/operators';
6868

6969
// This pipe redirects a user to their "profile edit" page or the "login page" if they're unauthenticated
7070
// { path: 'profile', ...canActivate(redirectToProfileEditOrLogin) }
71-
const redirectToProfileEditOrLogin = map(user => user ? ['profiles', user.uid, 'edit'] : ['login']);
71+
const redirectToProfileEditOrLogin = () => map(user => user ? ['profiles', user.uid, 'edit'] : ['login']);
7272
```
7373
7474
The `auth-guard` modules provides a `customClaims` operator to reduce boiler plate when checking a user's claims:
@@ -80,7 +80,7 @@ import { customClaims } from '@angular/fire/auth-guard';
8080

8181
// This pipe will only allow users with the editor role to access the route
8282
// { path: 'articles/:id/edit', component: ArticleEditComponent, ...canActivate(editorOnly) }
83-
const editorOnly = pipe(customClaims, map(claims => claims.role === "editor"));
83+
const editorOnly = () => pipe(customClaims, map(claims => claims.role === "editor"));
8484
```
8585
8686
### Using router state

docs/firestore/collections.md

+6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ The `AngularFirestoreCollection` service is a wrapper around the native Firestor
1111
import { Component } from '@angular/core';
1212
import { AngularFirestore, AngularFirestoreCollection } from '@angular/fire/firestore';
1313
import { Observable } from 'rxjs';
14+
import 'firebase/firestore';
1415

1516
export interface Item { name: string; }
1617

@@ -89,6 +90,7 @@ There are multiple ways of streaming collection data from Firestore.
8990
import { Component } from '@angular/core';
9091
import { AngularFirestore, AngularFirestoreCollection } from '@angular/fire/firestore';
9192
import { Observable } from 'rxjs';
93+
import 'firebase/firestore';
9294

9395
export interface Item { id: string; name: string; }
9496

@@ -141,6 +143,7 @@ import { Component } from '@angular/core';
141143
import { AngularFirestore, AngularFirestoreCollection } from '@angular/fire/firestore';
142144
import { Observable } from 'rxjs';
143145
import { map } from 'rxjs/operators';
146+
import 'firebase/firestore';
144147

145148
export interface Shirt { name: string; price: number; }
146149
export interface ShirtId extends Shirt { id: string; }
@@ -189,6 +192,7 @@ import { Component } from '@angular/core';
189192
import { AngularFirestore, AngularFirestoreCollection } from '@angular/fire/firestore';
190193
import { Observable } from 'rxjs';
191194
import { map } from 'rxjs/operators';
195+
import 'firebase/firestore';
192196

193197
export interface AccountDeposit { description: string; amount: number; }
194198
export interface AccountDepoistId extends AccountDeposit { id: string; }
@@ -234,6 +238,7 @@ import { Component } from '@angular/core';
234238
import { AngularFirestore, AngularFirestoreCollection } from '@angular/fire/firestore';
235239
import { Observable } from 'rxjs';
236240
import { map } from 'rxjs/operators';
241+
import 'firebase/firestore';
237242

238243
export interface AccountLogItem { description: string; amount: number; }
239244
export interface AccountLogItemId extends AccountLogItem { id: string; }
@@ -283,6 +288,7 @@ There are three `DocumentChangeType`s in Firestore: `added`, `removed`, and `mod
283288
import { Component } from '@angular/core';
284289
import { AngularFirestore, AngularFirestoreCollection } from '@angular/fire/firestore';
285290
import { Observable } from 'rxjs';
291+
import 'firebase/firestore';
286292

287293
@Component({
288294
selector: 'app-root',

docs/firestore/documents.md

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ The `AngularFirestoreDocument` service is a wrapper around the native Firestore
1111
import { Component } from '@angular/core';
1212
import { AngularFirestore, AngularFirestoreDocument } from '@angular/fire/firestore';
1313
import { Observable } from 'rxjs';
14+
import 'firebase/firestore';
1415

1516
export interface Item { name: string; }
1617

docs/firestore/querying-collections.md

+1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ import { Component } from '@angular/core';
8686
import { AngularFirestore } from '@angular/fire/firestore';
8787
import { Observable, BehaviorSubject, combineLatest } from 'rxjs';
8888
import { switchMap } from 'rxjs/operators';
89+
import 'firebase/firestore';
8990

9091
export interface Item {
9192
text: string;

docs/functions/functions.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ Notice that calling `httpsCallable()` does not initiate the request. It creates
7373

7474
### Functions Region
7575

76-
Allow configuration of the Function's region by adding `FUNCTIONS_REGION` to the `providers` section of your `NgModule`. The default is `us-central1`.
76+
Allow configuration of the Function's region by adding `REGION` to the `providers` section of your `NgModule`. The default is `us-central1`.
7777

7878
```ts
7979
import { NgModule } from '@angular/core';
80-
import { AngularFireFunctionsModule, FUNCTIONS_REGION } from '@angular/fire/functions';
80+
import { AngularFireFunctionsModule, REGION } from '@angular/fire/functions';
8181

8282
@NgModule({
8383
imports: [
@@ -87,7 +87,7 @@ import { AngularFireFunctionsModule, FUNCTIONS_REGION } from '@angular/fire/func
8787
],
8888
...
8989
providers: [
90-
{ provide: FUNCTIONS_REGION, useValue: 'asia-northeast1' }
90+
{ provide: REGION, useValue: 'asia-northeast1' }
9191
]
9292
})
9393
export class AppModule {}
@@ -96,11 +96,11 @@ export class AppModule {}
9696

9797
### Cloud Functions emulator
9898

99-
Point callable Functions to the Cloud Function emulator by adding `FUNCTIONS_ORIGIN` to the `providers` section of your `NgModule`.
99+
Point callable Functions to the Cloud Function emulator by adding `ORIGIN` to the `providers` section of your `NgModule`.
100100

101101
```ts
102102
import { NgModule } from '@angular/core';
103-
import { AngularFireFunctionsModule, FUNCTIONS_ORIGIN } from '@angular/fire/functions';
103+
import { AngularFireFunctionsModule, ORIGIN } from '@angular/fire/functions';
104104

105105
@NgModule({
106106
imports: [
@@ -110,7 +110,7 @@ import { AngularFireFunctionsModule, FUNCTIONS_ORIGIN } from '@angular/fire/func
110110
],
111111
...
112112
providers: [
113-
{ provide: FUNCTIONS_ORIGIN, useValue: 'http://localhost:5005' }
113+
{ provide: ORIGIN, useValue: 'http://localhost:5005' }
114114
]
115115
})
116116
export class AppModule {}
@@ -155,7 +155,7 @@ import { AngularFireFunctionsModule, FUNCTIONS_ORIGIN } from '@angular/fire/func
155155
],
156156
...
157157
providers: [
158-
{ provide: FUNCTIONS_ORIGIN, useValue: 'https://project-name.web.app' }
158+
{ provide: ORIGIN, useValue: 'https://project-name.web.app' }
159159
]
160160
})
161161
export class AppModule {}

0 commit comments

Comments
 (0)