Skip to content

Commit 3d94861

Browse files
jamesdanielsdavideast
authored andcommitted
Cleaning up the upgrade copy
1 parent c4fbcda commit 3d94861

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

docs/version-4-upgrade.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ AngularFire2 4.0 is a refactor of the AngularFire2 package which implements
55

66
### Removing `AngularFire` for Modularity
77

8-
Prior to 4.0, AngularFire2 not take advantage of the Firebase SDK's modularity for tree shaking. The way we fixed this is to remove the `AngularFire` service and break up the library into smaller @NgModules:
8+
Prior to 4.0, AngularFire2 not take advantage of the Firebase SDK's modularity for tree shaking. The `AngularFire` service has now been removed and the library broken up into smaller @NgModules:
99

1010
* `AngularFireModule`
1111
* `AngularFireDatabaseModule`
@@ -25,7 +25,7 @@ constructor(db: AngularFireDatabase) {
2525

2626
### Simplified Authentication API
2727

28-
In 4.0 we've further cut the complexity of the package by auth module down to a [`firebase.User`](https://firebase.google.com/docs/reference/js/firebase.User) observer to simplify the package.
28+
In 4.0 we've reduced the complexity of the auth module by providing a [`firebase.User`](https://firebase.google.com/docs/reference/js/firebase.User) observer and cutting the methods that were wrapping the Firebase SDK.
2929

3030
```typescript
3131
import { AngularFireAuth } from 'angularfire2/auth';
@@ -38,11 +38,11 @@ constructor(afAuth: AngularFireAuth) {
3838
}
3939
```
4040

41-
#### Removing pre-configured login
41+
AngularFire2 exposes the raw Firebase Auth object via `AngularFireAuth.auth`. For actions like login, logout, user creation, etc. you should use the [methods available to `firebase.auth.Auth`](https://firebase.google.com/docs/reference/js/firebase.auth.Auth).
4242

43-
While convenient, the pre-configure login feature added unneeded complexity into our codebase.
43+
#### Removing pre-configured login
4444

45-
In 4.0 you can now trigger login using the Firebase SDK:
45+
While convenient, the pre-configure login feature added unneeded complexity. `AngularFireModule.initializeApp` no longer takes a default sign in method. Sign in should be done with the Firebase SDK via `firebase.auth.Auth`:
4646

4747
```typescript
4848
login() {
@@ -53,8 +53,6 @@ logout() {
5353
}
5454
```
5555

56-
[See what methods are available to `firebase.auth.Auth` in the Firebase reference guide](https://firebase.google.com/docs/reference/js/firebase.auth.Auth).
57-
5856
### FirebaseListFactory and FirebaseObjectFactory API Changes
5957

6058
If you directly use `FirebaseListFactory` or `FirebaseObjectFactory` you will no longer be able to pass in a string, it will instead expect a Firebase database reference.
@@ -69,7 +67,8 @@ import { Observable } from 'rxjs/Observable';
6967
import { AngularFireModule } from 'angularfire2';
7068
import { AngularFireDatabaseModule, AngularFireDatabase, FirebaseListObservable } from 'angularfire2/database';
7169
import { AngularFireAuthModule, AngularFireAuth } from 'angularfire2/auth';
72-
import { GoogleAuthProvider, User as FirebaseUser } from 'firebase/auth';
70+
import { GoogleAuthProvider } from 'firebase/auth';
71+
import { User } from 'firebase';
7372
import { environment } from '../environments/environment';
7473

7574
@NgModule({
@@ -94,7 +93,7 @@ export class MyModule { }
9493
`
9594
})
9695
export class App {
97-
user: Observable<FirebaseUser>;
96+
user: Observable<User>;
9897
items: FirebaseListObservable<any[]>;
9998
constructor(afAuth: AngularFireAuth, db: AngularFireDatabase) {
10099
this.user = afAuth.authState;
@@ -107,4 +106,4 @@ export class App {
107106
this.afAuth.auth.signOut();
108107
}
109108
}
110-
```
109+
```

0 commit comments

Comments
 (0)