Skip to content

Commit 6638b9d

Browse files
authored
Merge branch 'master' into firebase-v7
2 parents 6f71d46 + fc9c7e4 commit 6638b9d

Some content is hidden

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

53 files changed

+908
-10030
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ angularfire2-*.tgz
1313
.DS_Store
1414
yarn-error.log
1515
*.bak
16-
package-lock.json
16+
package-lock.json
17+
test/ng-build/**/yarn.lock

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
<a name="5.2.3"></a>
2+
# [5.2.3](https://github.com/angular/angularfire2/compare/5.2.1...5.2.3) (2019-11-12)
3+
4+
### Bug Fixes
5+
6+
* **build:** Make the build work on windows ([#2231](https://github.com/angular/angularfire2/issues/2231)) ([97d8532](https://github.com/angular/angularfire2/commit/97d8532))
7+
* **core:** Support Firebase 7 peer and fix zone instabilities with `AngularFirePerformanceModule` and the injectable `FirebaseApp` ([#2240](https://github.com/angular/angularfire2/issues/2240)) ([60fd575](https://github.com/angular/angularfire2/commit/60fd575))
8+
* **rtdb:** Allow update to take "Partial<T>" ([#2169](https://github.com/angular/angularfire2/issues/2169)) ([ca43c8b](https://github.com/angular/angularfire2/commit/ca43c8b))
9+
10+
<a name="5.2.2"></a>
11+
# [5.2.2](https://github.com/angular/angularfire2/compare/5.2.1...5.2.2) (2019-11-12)
12+
13+
`5.2.2` was mistakenly released to `@canary` due to a CI/CD bug. It was republished to `@latest` as `5.2.3`.
14+
115
<a name="5.2.1"></a>
216
# [5.2.1](https://github.com/angular/angularfire2/compare/5.2.0...5.2.1) (2019-06-01)
317

src/auth/auth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class AngularFireAuth {
4242
) {
4343
const scheduler = new FirebaseZoneScheduler(zone, platformId);
4444
this.auth = zone.runOutsideAngular(() => {
45-
const app = _firebaseAppFactory(options, nameOrConfig);
45+
const app = _firebaseAppFactory(options, zone, nameOrConfig);
4646
return app.auth();
4747
});
4848

src/core/firebase.app.module.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { InjectionToken, NgModule, Optional } from '@angular/core';
1+
import { InjectionToken, NgModule, Optional, NgZone } from '@angular/core';
22
import { auth, database, firestore, functions, messaging, storage, analytics, remoteConfig } from 'firebase/app';
33
// @ts-ignore (https://github.com/firebase/firebase-js-sdk/pull/1206)
44
import firebase from 'firebase/app'; // once fixed can pull in as "default as firebase" above
@@ -39,22 +39,23 @@ export class FirebaseApp {
3939
remoteConfig: () => FirebaseRemoteConfig;
4040
}
4141

42-
export function _firebaseAppFactory(options: FirebaseOptions, nameOrConfig?: string|FirebaseAppConfig|null) {
42+
export function _firebaseAppFactory(options: FirebaseOptions, zone: NgZone, nameOrConfig?: string|FirebaseAppConfig|null) {
4343
const name = typeof nameOrConfig === 'string' && nameOrConfig || '[DEFAULT]';
4444
const config = typeof nameOrConfig === 'object' && nameOrConfig || {};
4545
config.name = config.name || name;
4646
// Added any due to some inconsistency between @firebase/app and firebase types
4747
const existingApp = firebase.apps.filter(app => app && app.name === config.name)[0] as any;
4848
// We support FirebaseConfig, initializeApp's public type only accepts string; need to cast as any
4949
// Could be solved with https://github.com/firebase/firebase-js-sdk/pull/1206
50-
return (existingApp || firebase.initializeApp(options, config as any)) as FirebaseApp;
50+
return (existingApp || zone.runOutsideAngular(() => firebase.initializeApp(options, config as any))) as FirebaseApp;
5151
}
5252

5353
const FirebaseAppProvider = {
5454
provide: FirebaseApp,
5555
useFactory: _firebaseAppFactory,
5656
deps: [
5757
FIREBASE_OPTIONS,
58+
NgZone,
5859
[new Optional(), FIREBASE_APP_NAME]
5960
]
6061
};

src/database-deprecated/database.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class AngularFireDatabase {
2222
zone: NgZone
2323
) {
2424
this.database = zone.runOutsideAngular(() => {
25-
const app = _firebaseAppFactory(options, nameOrConfig);
25+
const app = _firebaseAppFactory(options, zone, nameOrConfig);
2626
return app.database(databaseURL || undefined);
2727
});
2828
}

src/database/database.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class AngularFireDatabase {
2020
) {
2121
this.scheduler = new FirebaseZoneScheduler(zone, platformId);
2222
this.database = zone.runOutsideAngular(() => {
23-
const app = _firebaseAppFactory(options, nameOrConfig);
23+
const app = _firebaseAppFactory(options, zone, nameOrConfig);
2424
return app.database(databaseURL || undefined);
2525
});
2626
}

src/firestore/firestore.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export class AngularFirestore {
129129
) {
130130
this.scheduler = new FirebaseZoneScheduler(zone, platformId);
131131
this.firestore = zone.runOutsideAngular(() => {
132-
const app = _firebaseAppFactory(options, nameOrConfig);
132+
const app = _firebaseAppFactory(options, zone, nameOrConfig);
133133
const firestore = app.firestore();
134134
firestore.settings(settings || DefaultFirestoreSettings);
135135
return firestore;

src/functions/functions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export class AngularFireFunctions {
3030
this.scheduler = new FirebaseZoneScheduler(zone, platformId);
3131

3232
this.functions = zone.runOutsideAngular(() => {
33-
const app = _firebaseAppFactory(options, nameOrConfig);
33+
const app = _firebaseAppFactory(options, zone, nameOrConfig);
3434
return app.functions(region || undefined);
3535
});
3636

src/messaging/messaging.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class AngularFireMessaging {
2727
const requireMessaging = from(import('firebase/messaging'));
2828

2929
this.messaging = requireMessaging.pipe(
30-
map(() => _firebaseAppFactory(options, nameOrConfig)),
30+
map(() => _firebaseAppFactory(options, zone, nameOrConfig)),
3131
map(app => app.messaging()),
3232
runOutsideAngular(zone)
3333
);

src/storage/storage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export class AngularFireStorage {
3131
) {
3232
this.scheduler = new FirebaseZoneScheduler(zone, platformId);
3333
this.storage = zone.runOutsideAngular(() => {
34-
const app = _firebaseAppFactory(options, nameOrConfig);
34+
const app = _firebaseAppFactory(options, zone, nameOrConfig);
3535
return app.storage(storageBucket || undefined);
3636
});
3737
}

0 commit comments

Comments
 (0)