Skip to content

Commit 3ad4046

Browse files
Merge pull request #76 from angular/master
Compare changes
2 parents 8b07ce4 + 0ee659e commit 3ad4046

Some content is hidden

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

55 files changed

+1157
-10189
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: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
<a name="5.2.2"></a>
2+
# [5.2.2](https://github.com/angular/angularfire2/compare/5.2.1...5.2.2) (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+
110
<a name="5.2.1"></a>
211
# [5.2.1](https://github.com/angular/angularfire2/compare/5.2.0...5.2.1) (2019-06-01)
312

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@angular/fire",
3-
"version": "5.2.1",
3+
"version": "5.2.2",
44
"description": "The official library of Firebase and Angular.",
55
"private": true,
66
"scripts": {
@@ -13,7 +13,7 @@
1313
"delayed_karma": "sleep 10 && karma start",
1414
"build": "rimraf dist && node tools/build.js && npm pack ./dist/packages-dist",
1515
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1",
16-
"build:wrapper": "npm i --prefix wrapper && npm run --prefix wrapper build && npm pack ./dist/wrapper-dist"
16+
"build:wrapper": "npm i --prefix wrapper && VERSION=5.2.2 npm run --prefix wrapper build && npm pack ./dist/wrapper-dist"
1717
},
1818
"schematics": "./dist/packages-dist/collection.json",
1919
"builders": "./dist/packages-dist/builders.json",
@@ -42,7 +42,7 @@
4242
"@angular/platform-browser": ">=6.0.0 <9 || ^9.0.0-0",
4343
"@angular/platform-browser-dynamic": ">=6.0.0 <9 || ^9.0.0-0",
4444
"@angular/router": ">=6.0.0 <9 || ^9.0.0-0",
45-
"firebase": ">= 5.5.7 <7",
45+
"firebase": ">= 5.5.7 <8",
4646
"firebase-tools": "^6.10.0",
4747
"fuzzy": "^0.1.3",
4848
"inquirer": "^6.2.2",

src/auth/auth.ts

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

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 } 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
@@ -32,22 +32,23 @@ export class FirebaseApp {
3232
functions: (region?: string) => FirebaseFunctions;
3333
}
3434

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

4646
const FirebaseAppProvider = {
4747
provide: FirebaseApp,
4848
useFactory: _firebaseAppFactory,
4949
deps: [
5050
FirebaseOptionsToken,
51+
NgZone,
5152
[new Optional(), FirebaseNameOrConfigToken]
5253
]
5354
};

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
@@ -125,7 +125,7 @@ export class AngularFirestore {
125125
) {
126126
this.scheduler = new FirebaseZoneScheduler(zone, platformId);
127127
this.firestore = zone.runOutsideAngular(() => {
128-
const app = _firebaseAppFactory(options, nameOrConfig);
128+
const app = _firebaseAppFactory(options, zone, nameOrConfig);
129129
const firestore = app.firestore();
130130
firestore.settings(settings || DefaultFirestoreSettings);
131131
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/performance/performance.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export class AngularFirePerformance {
3131
) {
3232

3333
// @ts-ignore zapping in the UMD in the build script
34-
const requirePerformance = from(import('firebase/performance'));
34+
const requirePerformance = from(zone.runOutsideAngular(() => import('firebase/performance')));
3535

3636
this.performance = requirePerformance.pipe(
3737
// SEMVER while < 6 need to type, drop next major

src/storage/storage.ts

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

test/ng-build/build.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
cd ./test/ng-build/ng6 && yarn && npx ng build --prod &&
2-
cd ../ng7 && yarn && npx ng build --prod &&
3-
cd ../ng8 && yarn && npx ng build --prod
1+
cd ./test/ng-build/ng6 && yarn && yarn build:prod &&
2+
cd ../ng7 && yarn && yarn build:prod &&
3+
cd ../ng8 && yarn && yarn build:prod

test/ng-build/ng6/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"@angular/platform-browser": "6.0.1",
2424
"@angular/platform-browser-dynamic": "6.0.1",
2525
"@angular/router": "6.0.1",
26+
"firebase": "<7",
2627
"core-js": "^2.4.1",
2728
"rxjs": "^6.0.0",
2829
"zone.js": "^0.8.14"

test/ng-build/ng6/src/app/app.component.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { AngularFirestore } from '@angular/fire/firestore';
66
import { AngularFireStorage } from '@angular/fire/storage';
77
import { AngularFireMessaging } from '@angular/fire/messaging';
88
import { AngularFireFunctions } from '@angular/fire/functions';
9+
import { AngularFirePerformance } from '@angular/fire/performance';
910

1011
@Component({
1112
selector: 'app-root',
@@ -38,8 +39,9 @@ export class AppComponent {
3839
private readonly afStore: AngularFirestore,
3940
private readonly storage: AngularFireStorage,
4041
private readonly messaging: AngularFireMessaging,
41-
private readonly functions: AngularFireFunctions
42+
private readonly functions: AngularFireFunctions,
43+
private readonly perf: AngularFirePerformance
4244
) {
43-
console.log(app, db, auth, afStore, storage, messaging, functions);
45+
console.log(app, db, auth, afStore, storage, messaging, functions, perf);
4446
}
4547
}

test/ng-build/ng6/src/app/app.module.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { AngularFirestoreModule } from '@angular/fire/firestore';
77
import { AngularFireStorageModule } from '@angular/fire/storage';
88
import { AngularFireFunctionsModule } from '@angular/fire/functions';
99
import { AngularFireMessagingModule } from '@angular/fire/messaging';
10+
import { AngularFirePerformanceModule } from '@angular/fire/performance';
1011

1112
import { AppComponent } from './app.component';
1213

@@ -29,7 +30,8 @@ import { AppComponent } from './app.component';
2930
AngularFirestoreModule,
3031
AngularFireStorageModule,
3132
AngularFireMessagingModule,
32-
AngularFireFunctionsModule
33+
AngularFireFunctionsModule,
34+
AngularFirePerformanceModule
3335
],
3436
bootstrap: [AppComponent]
3537
})

test/ng-build/ng7/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"ng": "ng",
66
"start": "ng serve",
77
"build": "ng build",
8+
"build:prod": "ng build --prod",
89
"test": "ng test",
910
"lint": "ng lint",
1011
"e2e": "ng e2e"

test/ng-build/ng7/src/app/app.component.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { AngularFirestore } from '@angular/fire/firestore';
77
import { AngularFireStorage } from '@angular/fire/storage';
88
import { AngularFireMessaging } from '@angular/fire/messaging';
99
import { AngularFireFunctions } from '@angular/fire/functions';
10+
import { AngularFirePerformance } from '@angular/fire/performance';
1011

1112
@Component({
1213
selector: 'app-root',
@@ -22,8 +23,9 @@ export class AppComponent {
2223
private readonly afStore: AngularFirestore,
2324
private readonly storage: AngularFireStorage,
2425
private readonly messaging: AngularFireMessaging,
25-
private readonly functions: AngularFireFunctions
26+
private readonly functions: AngularFireFunctions,
27+
private readonly perf: AngularFirePerformance
2628
) {
27-
console.log(app, db, auth, afStore, storage, messaging, functions);
29+
console.log(app, db, auth, afStore, storage, messaging, functions, perf);
2830
}
2931
}

test/ng-build/ng7/src/app/app.module.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import { AngularFirestoreModule } from '@angular/fire/firestore';
88
import { AngularFireStorageModule } from '@angular/fire/storage';
99
import { AngularFireMessagingModule } from '@angular/fire/messaging';
1010
import { AngularFireFunctionsModule } from '@angular/fire/functions';
11+
import { AngularFirePerformanceModule } from '@angular/fire/performance';
12+
import { AngularFireAuthGuardModule } from '@angular/fire/auth-guard';
1113

1214
import { AppComponent } from './app.component';
1315

@@ -30,7 +32,9 @@ import { AppComponent } from './app.component';
3032
AngularFirestoreModule,
3133
AngularFireStorageModule,
3234
AngularFireMessagingModule,
33-
AngularFireFunctionsModule
35+
AngularFireFunctionsModule,
36+
AngularFirePerformanceModule,
37+
AngularFireAuthGuardModule
3438
],
3539
providers: [],
3640
bootstrap: [AppComponent]

0 commit comments

Comments
 (0)