Skip to content

Commit 38539d0

Browse files
fix(various): Putting together 6.0.1 (#2386)
* Fixing SSR ng deploy on Windows * Don't duplicate @firebase/firestore in externalDeps * Don't duplicate the firebase.json entry on ng add if already present * Warn on incompatible peers * Adding NG 10 support * CSS/JS immutable deployed with ng deploy are immutable * import from firebase/app * cross-browser open URL Co-authored-by: NothingEverHappens <[email protected]>
1 parent da2584a commit 38539d0

32 files changed

+1928
-1053
lines changed

package.json

+18-17
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@angular/fire",
3-
"version": "6.0.0",
3+
"version": "6.0.1",
44
"description": "The official library of Firebase and Angular.",
55
"private": true,
66
"scripts": {
@@ -39,15 +39,15 @@
3939
},
4040
"homepage": "https://github.com/angular/angularfire2#readme",
4141
"dependencies": {
42-
"@angular-devkit/architect": "~0.900",
43-
"@angular-devkit/core": "^9.0.0",
44-
"@angular-devkit/schematics": "^9.0.0",
45-
"@angular/common": "^9.0.0",
46-
"@angular/compiler": "^9.0.0",
47-
"@angular/core": "^9.0.0",
48-
"@angular/platform-browser": "^9.0.0",
49-
"@angular/platform-browser-dynamic": "^9.0.0",
50-
"@angular/router": "^9.0.0",
42+
"@angular-devkit/architect": ">= 0.900 < 0.1100",
43+
"@angular-devkit/core": "^9.0.0 || ^10.0.0",
44+
"@angular-devkit/schematics": "^9.0.0 || ^10.0.0",
45+
"@angular/common": "^9.0.0 || ^10.0.0",
46+
"@angular/compiler": "^9.0.0 || ^10.0.0",
47+
"@angular/core": "^9.0.0 || ^10.0.0",
48+
"@angular/platform-browser": "^9.0.0 || ^10.0.0",
49+
"@angular/platform-browser-dynamic": "^9.0.0 || ^10.0.0",
50+
"@angular/router": "^9.0.0 || ^10.0.0",
5151
"firebase": "^7.13.1",
5252
"firebase-admin": "^8.10.0",
5353
"firebase-functions": "^3.6.0",
@@ -57,6 +57,7 @@
5757
"husky": "^4.2.5",
5858
"inquirer": "^6.2.2",
5959
"inquirer-autocomplete-prompt": "^1.0.1",
60+
"open": "^7.0.3",
6061
"rxfire": "^3.9.7",
6162
"rxjs": "^6.5.3",
6263
"semver": "^7.1.3",
@@ -70,12 +71,12 @@
7071
"utf-8-validate": "^5.0.2"
7172
},
7273
"devDependencies": {
73-
"@angular-devkit/build-angular": "~0.900",
74-
"@angular-devkit/build-ng-packagr": "~0.900",
75-
"@angular/animations": " ^9.0.0",
76-
"@angular/cli": "^9.0.0",
77-
"@angular/compiler-cli": "^9.0.0",
78-
"@angular/platform-server": "^9.0.0",
74+
"@angular-devkit/build-angular": ">= 0.900 < 0.1100",
75+
"@angular-devkit/build-ng-packagr": ">= 0.900 < 0.1100",
76+
"@angular/animations": " ^9.0.0 || ^10.0.0",
77+
"@angular/cli": "^9.0.0 || ^10.0.0",
78+
"@angular/compiler-cli": "^9.0.0 || ^10.0.0",
79+
"@angular/platform-server": "^9.0.0 || ^10.0.0",
7980
"@types/fs-extra": "^7.0.0",
8081
"@types/gzip-size": "^5.1.1",
8182
"@types/inquirer": "^0.0.44",
@@ -86,7 +87,7 @@
8687
"codelyzer": "^5.0.0",
8788
"concurrently": "^2.2.0",
8889
"conventional-changelog-cli": "^1.2.0",
89-
"firebase-functions-test": "^0.1.7",
90+
"firebase-functions-test": "^0.2.0",
9091
"gzip-size": "^5.1.1",
9192
"jasmine": "^3.4.0",
9293
"jasmine-core": "^3.4.0",

sample/angular.json

-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@
126126
"tsConfig": "tsconfig.server.json",
127127
"bundleDependencies": false,
128128
"externalDependencies": [
129-
"@firebase/firestore",
130129
"@firebase/firestore"
131130
]
132131
},

sample/firebase.json

+8-3
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@
44
"target": "sample",
55
"public": "dist/sample/dist/sample/browser",
66
"ignore": [
7-
"firebase.json",
8-
"**/.*",
9-
"**/node_modules/**"
7+
"**/.*"
108
],
9+
"headers": [{
10+
"source": "*.[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f].+(css|js)",
11+
"headers": [{
12+
"key": "Cache-Control",
13+
"value": "public,max-age=31536000,immutable"
14+
}]
15+
}],
1116
"rewrites": [
1217
{
1318
"source": "**",

sample/package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,16 @@
1919
"@angular/common": "~9.1.0",
2020
"@angular/compiler": "~9.1.0",
2121
"@angular/core": "~9.1.0",
22-
"@angular/fire": "file:../dist/packages-dist",
22+
"@angular/fire": "../dist/packages-dist",
2323
"@angular/forms": "~9.1.0",
2424
"@angular/platform-browser": "~9.1.0",
2525
"@angular/platform-browser-dynamic": "~9.1.0",
2626
"@angular/platform-server": "~9.1.0",
2727
"@angular/router": "~9.1.0",
2828
"@angular/service-worker": "~9.1.0",
2929
"@nguniversal/express-engine": "~9.1.0",
30-
"firebase": "^7.13.1",
30+
"firebase": "^7.13.2",
31+
"proxy-polyfill": "^0.3.1",
3132
"rxjs": "~6.5.4",
3233
"tslib": "^1.10.0",
3334
"zone.js": "~0.10.2"

sample/src/app/app-routing.module.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
import { NgModule } from '@angular/core';
2-
import { RouterModule, Routes } from '@angular/router';
2+
import { Routes, RouterModule } from '@angular/router';
3+
import { HomeComponent } from './home/home.component';
34

45

5-
const routes: Routes = [];
6+
const routes: Routes = [
7+
{ path: '', component: HomeComponent, pathMatch: 'full' }
8+
];
69

710
@NgModule({
811
imports: [RouterModule.forRoot(routes, {
912
initialNavigation: 'enabled'
10-
})],
13+
})],
1114
exports: [RouterModule]
1215
})
1316
export class AppRoutingModule { }

sample/src/app/app.component.ts

+1-7
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,11 @@ import { FirebaseApp } from '@angular/fire';
44
@Component({
55
selector: 'app-root',
66
template: `
7-
Hello world!
8-
{{ firebaseApp.name }}
9-
<app-database></app-database>
10-
<app-firestore></app-firestore>
11-
<app-remote-config></app-remote-config>
12-
<app-storage></app-storage>
7+
<router-outlet></router-outlet>
138
`,
149
styles: [``]
1510
})
1611
export class AppComponent {
17-
title = 'sample';
1812
constructor(public readonly firebaseApp: FirebaseApp, appRef: ApplicationRef) {
1913
appRef.isStable.subscribe(it => console.log('isStable', it));
2014
}

sample/src/app/app.module.ts

+11-1
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,21 @@ import { AngularFireAuthGuardModule } from '@angular/fire/auth-guard';
2929
import { DatabaseComponent } from './database/database.component';
3030
import { StorageComponent } from './storage/storage.component';
3131
import { RemoteConfigComponent } from './remote-config/remote-config.component';
32+
import { HomeComponent } from './home/home.component';
33+
import { AuthComponent } from './auth/auth.component';
3234

3335
const shouldUseEmulator = () => false;
3436

3537
@NgModule({
36-
declarations: [AppComponent, StorageComponent, FirestoreComponent, DatabaseComponent, RemoteConfigComponent],
38+
declarations: [
39+
AppComponent,
40+
StorageComponent,
41+
FirestoreComponent,
42+
DatabaseComponent,
43+
RemoteConfigComponent,
44+
HomeComponent,
45+
AuthComponent
46+
],
3747
imports: [
3848
BrowserModule.withServerTransition({ appId: 'serverApp' }),
3949
BrowserTransferStateModule,

sample/src/app/auth/auth.component.ts

+37-5
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,51 @@
1-
import { Component, OnInit } from '@angular/core';
1+
import { Component, OnInit, OnDestroy } from '@angular/core';
2+
import { AngularFireAuth } from '@angular/fire/auth';
3+
import { auth as rawAuth } from 'firebase/app';
4+
import { Subscription } from 'rxjs';
5+
import { map } from 'rxjs/operators';
6+
import { trace } from '@angular/fire/performance';
27

38
@Component({
49
selector: 'app-auth',
510
template: `
611
<p>
7-
auth works!
12+
Auth!
13+
{{ (auth.user | async)?.uid | json }}
14+
<button (click)="login()" *ngIf="showLoginButton">Log in with Google</button>
15+
<button (click)="logout()" *ngIf="showLogoutButton">Log out</button>
816
</p>
917
`,
1018
styles: []
1119
})
12-
export class AuthComponent implements OnInit {
20+
export class AuthComponent implements OnInit, OnDestroy {
1321

14-
constructor() { }
22+
private readonly userDisposable: Subscription;
1523

16-
ngOnInit(): void {
24+
showLoginButton = false;
25+
showLogoutButton = false;
26+
27+
constructor(public readonly auth: AngularFireAuth) {
28+
this.userDisposable = this.auth.authState.pipe(
29+
trace('auth'),
30+
map(u => !!u)
31+
).subscribe(isLoggedIn => {
32+
this.showLoginButton = !isLoggedIn;
33+
this.showLogoutButton = isLoggedIn;
34+
});
35+
}
36+
37+
ngOnInit(): void { }
38+
39+
ngOnDestroy(): void {
40+
this.userDisposable.unsubscribe();
41+
}
42+
43+
login() {
44+
this.auth.signInWithPopup(new rawAuth.GoogleAuthProvider());
45+
}
46+
47+
logout() {
48+
this.auth.signOut();
1749
}
1850

1951
}

sample/src/app/home/home.component.ts

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { Component } from '@angular/core';
2+
import { FirebaseApp } from '@angular/fire';
3+
4+
@Component({
5+
selector: 'app-home',
6+
template: `
7+
Hello world!
8+
{{ firebaseApp.name }}
9+
<app-database></app-database>
10+
<app-firestore></app-firestore>
11+
<app-remote-config></app-remote-config>
12+
<app-storage></app-storage>
13+
<app-auth></app-auth>
14+
`,
15+
styles: [``]
16+
})
17+
export class HomeComponent {
18+
constructor(public readonly firebaseApp: FirebaseApp) {
19+
}
20+
}

sample/src/app/remote-config/remote-config.component.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Component, OnInit } from '@angular/core';
2-
import { AngularFireRemoteConfig } from '@angular/fire/remote-config';
2+
import { AngularFireRemoteConfig, mapToObject } from '@angular/fire/remote-config';
33
import { trace } from '@angular/fire/performance';
44
import { Observable } from 'rxjs';
55

@@ -18,7 +18,7 @@ export class RemoteConfigComponent implements OnInit {
1818
readonly change$: Observable<any>;
1919

2020
constructor(public readonly remoteConfig: AngularFireRemoteConfig) {
21-
this.change$ = remoteConfig.changes.pipe(trace('remote-config'));
21+
this.change$ = remoteConfig.parameters.pipe(trace('remote-config'), mapToObject({}));
2222
}
2323

2424
ngOnInit(): void {

sample/src/polyfills.ts

+2
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,5 @@ import 'zone.js/dist/zone'; // Included with Angular CLI.
6161
/***************************************************************************************************
6262
* APPLICATION IMPORTS
6363
*/
64+
65+
import 'proxy-polyfill/proxy.min.js';

0 commit comments

Comments
 (0)