Skip to content

Commit 41d26fb

Browse files
Merge branch 'master' into docs/deploy-getting-started
2 parents a33270d + c57cef4 commit 41d26fb

File tree

103 files changed

+1961
-1682
lines changed

Some content is hidden

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

103 files changed

+1961
-1682
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ branches:
1515

1616
install: yarn
1717

18-
script: yarn build && yarn test:all
18+
script: yarn build && yarn test:all && yarn lint

CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ Providing the following information will increase the chances of your issue bein
8080
* **Angular Version** - what version of Angular, Firebase, and AngularFire are you using?
8181
* **Motivation for or Use Case** - explain what are you trying to do and why the current behavior is a bug for you
8282
* **Browsers and Operating System** - is this a problem with all browsers?
83-
* **Reproduce the Error** - provide a live example (using [Plunker][plunker],
84-
[JSFiddle][jsfiddle] or [Runnable][runnable]) or a unambiguous set of steps
83+
* **Reproduce the Error** - provide a live example (using StackBlitz (https://stackblitz.com/edit/angular-fire-start))
84+
or a unambiguous set of steps
8585
* **Related Issues** - has a similar issue been reported before?
8686
* **Suggest a Fix** - if you can't fix the bug yourself, perhaps you can point to what might be
8787
causing the problem (line of code or commit)

ISSUE_TEMPLATE.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ be fixed in the latest versions. -->
4646

4747
### How to reproduce these conditions
4848

49-
**Failing test unit, Plunkr, or JSFiddle demonstrating the problem**
49+
**Failing test unit, Stackblitz demonstrating the problem**
5050

5151
<!--
5252
Provide a failing test unit, or create a minimal, complete, and
53-
verifiable example (http://stackoverflow.com/help/mcve) using either
54-
Plunker (http://plnkr.co/) or JSFiddle (https://jsfiddle.net/).
53+
verifiable example (http://stackoverflow.com/help/mcve) using
54+
StackBlitz (https://stackblitz.com/edit/angular-fire-start).
5555
-->
5656

5757
**Steps to set up and reproduce**
@@ -60,7 +60,7 @@ Plunker (http://plnkr.co/) or JSFiddle (https://jsfiddle.net/).
6060

6161
**Sample data and security rules**
6262

63-
<-- include/attach/link to some json sample data (or provide credentials to a sanitized, test Firebase project) -->
63+
<!-- include/attach/link to some json sample data (or provide credentials to a sanitized, test Firebase project) -->
6464

6565
### Debug output
6666

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export class MyApp {
5151

5252
[Contributing](CONTRIBUTING.md)
5353

54-
[Stackblitz Template](https://stackblitz.com/edit/angular-1iment) - Remember to set your Firebase configuration in `app/app.module.ts`.
54+
[Stackblitz Template](https://stackblitz.com/edit/angular-fire-start) - Remember to set your Firebase configuration in `app/app.module.ts`.
5555

5656
[Upgrading to v6.0? Check out our guide.](docs/version-6-upgrade.md)
5757

docs/auth/router-guards.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const belongsToAccount = (next) => hasCustomClaim(`account-${next.params.id}`);
3939
export const routes: Routes = [
4040
{ path: '', component: AppComponent },
4141
{ path: 'login', component: LoginComponent, canActivate: [AngularFireAuthGuard], data: { authGuardPipe: redirectLoggedInToItems }},
42-
{ path: 'items', component: ItemListComponent, canActivate: [AngularFireAuthGuard], data: { authGuardPipe: redirectUnauthorizedToLogin },
42+
{ path: 'items', component: ItemListComponent, canActivate: [AngularFireAuthGuard], data: { authGuardPipe: redirectUnauthorizedToLogin }},
4343
{ path: 'admin', component: AdminComponent, canActivate: [AngularFireAuthGuard], data: { authGuardPipe: adminOnly }},
4444
{ path: 'accounts/:id', component: AdminComponent, canActivate: [AngularFireAuthGuard], data: { authGuardPipe: belongsToAccount }}
4545
];

docs/firestore/collections.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ import { Observable } from 'rxjs';
191191
import { map } from 'rxjs/operators';
192192

193193
export interface AccountDeposit { description: string; amount: number; }
194-
export interface AccountDepoistId extends AccountDeposit { id: string; }
194+
export interface AccountDepositId extends AccountDeposit { id: string; }
195195

196196
@Component({
197197
selector: 'app-root',

docs/functions/functions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ import { AngularFireFunctionsModule, ORIGIN } from '@angular/fire/functions';
110110
],
111111
...
112112
providers: [
113-
{ provide: ORIGIN, useValue: 'http://localhost:5005' }
113+
{ provide: ORIGIN, useValue: 'http://localhost:5001' }
114114
]
115115
})
116116
export class AppModule {}

docs/install-and-setup.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ ng serve
146146

147147
Your Angular app will compile and serve locally, visit it we should see an empty list.
148148

149-
In another tab [start adding data to an `items` collection in Firestore](https://firebase.corp.google.com/project/_/database/firestore/data). *As we're not authenticating users yet, be sure to start Firestore in **test mode** or allow reading from the `items` collection in Security Rules (`allow read: if true`).*
149+
In another tab [start adding data to an `items` collection in Firestore](https://console.firebase.google.com/project/_/database/firestore/data). *As we're not authenticating users yet, be sure to start Firestore in **test mode** or allow reading from the `items` collection in Security Rules (`allow read: if true`).*
150150

151151
Once you've created a `items` collection and are inserting documents, you should see data streaming into your Angular application.
152152

package.json

+6
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
"build": "tsc tools/build.ts; node ./tools/build.js",
1717
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1"
1818
},
19+
"husky": {
20+
"hooks": {
21+
"pre-commit": "npm run lint"
22+
}
23+
},
1924
"schematics": "./dist/packages-dist/collection.json",
2025
"builders": "./dist/packages-dist/builders.json",
2126
"keywords": [
@@ -49,6 +54,7 @@
4954
"firebase-tools": "^8.0.0",
5055
"fs-extra": "^8.0.1",
5156
"fuzzy": "^0.1.3",
57+
"husky": "^4.2.5",
5258
"inquirer": "^6.2.2",
5359
"inquirer-autocomplete-prompt": "^1.0.1",
5460
"rxfire": "^3.9.7",

sample/server.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ import { APP_BASE_HREF } from '@angular/common';
99
import { existsSync } from 'fs';
1010

1111
// Polyfill XMLHttpRequest and WS for Firebase
12-
global['XMLHttpRequest'] = require("xhr2");
13-
global['WebSocket'] = require("ws");
12+
/* tslint:disable:no-string-literal */
13+
global['XMLHttpRequest'] = require('xhr2');
14+
global['WebSocket'] = require('ws');
15+
/* tslint:enable:no-string-literal */
1416

1517
// The Express app is exported so that it can be used by serverless Functions.
1618
export function app() {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { NgModule } from '@angular/core';
2-
import { Routes, RouterModule } from '@angular/router';
2+
import { RouterModule, Routes } from '@angular/router';
33

44

55
const routes: Routes = [];

sample/src/app/app.component.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TestBed, async } from '@angular/core/testing';
1+
import { async, TestBed } from '@angular/core/testing';
22
import { RouterTestingModule } from '@angular/router/testing';
33
import { AppComponent } from './app.component';
44

sample/src/app/app.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, ApplicationRef } from '@angular/core';
1+
import { ApplicationRef, Component } from '@angular/core';
22
import { FirebaseApp } from '@angular/fire';
33

44
@Component({

sample/src/app/app.module.ts

+21-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { BrowserModule, BrowserTransferStateModule } from '@angular/platform-browser';
2-
import { NgModule, isDevMode } from '@angular/core';
2+
import { isDevMode, NgModule } from '@angular/core';
33

44
import { AppRoutingModule } from './app-routing.module';
55
import { AppComponent } from './app.component';
@@ -9,7 +9,12 @@ import { environment } from '../environments/environment';
99
import { AngularFireModule } from '@angular/fire';
1010
import { AngularFireStorageModule } from '@angular/fire/storage';
1111

12-
import { AngularFireAnalyticsModule, UserTrackingService, ScreenTrackingService, DEBUG_MODE as ANALYTICS_DEBUG_MODE } from '@angular/fire/analytics';
12+
import {
13+
AngularFireAnalyticsModule,
14+
DEBUG_MODE as ANALYTICS_DEBUG_MODE,
15+
ScreenTrackingService,
16+
UserTrackingService
17+
} from '@angular/fire/analytics';
1318

1419
import { FirestoreComponent } from './firestore/firestore.component';
1520

@@ -28,7 +33,7 @@ import { RemoteConfigComponent } from './remote-config/remote-config.component';
2833
const shouldUseEmulator = () => false;
2934

3035
@NgModule({
31-
declarations: [ AppComponent, StorageComponent, FirestoreComponent, DatabaseComponent, RemoteConfigComponent ],
36+
declarations: [AppComponent, StorageComponent, FirestoreComponent, DatabaseComponent, RemoteConfigComponent],
3237
imports: [
3338
BrowserModule.withServerTransition({ appId: 'serverApp' }),
3439
BrowserTransferStateModule,
@@ -50,12 +55,19 @@ const shouldUseEmulator = () => false;
5055
UserTrackingService,
5156
ScreenTrackingService,
5257
PerformanceMonitoringService,
53-
{ provide: ANALYTICS_DEBUG_MODE, useFactory: () => isDevMode() },
54-
{ provide: DATABASE_URL, useFactory: () => shouldUseEmulator() ? `http://localhost:9000?ns=${environment.firebase.projectId}` : undefined },
55-
{ provide: FIRESTORE_SETTINGS, useFactory: () => shouldUseEmulator() ? { host: 'localhost:8080', ssl: false } : {} },
56-
{ provide: FUNCTIONS_ORIGIN, useFactory: () => shouldUseEmulator() ? 'http://localhost:9999' : undefined },
58+
{
59+
provide: ANALYTICS_DEBUG_MODE,
60+
useFactory: () => isDevMode()
61+
},
62+
{
63+
provide: DATABASE_URL,
64+
useFactory: () => shouldUseEmulator() ? `http://localhost:9000?ns=${environment.firebase.projectId}` : undefined
65+
},
66+
{ provide: FIRESTORE_SETTINGS, useFactory: () => shouldUseEmulator() ? { host: 'localhost:8080', ssl: false } : {} },
67+
{ provide: FUNCTIONS_ORIGIN, useFactory: () => shouldUseEmulator() ? 'http://localhost:9999' : undefined },
5768
{ provide: REMOTE_CONFIG_SETTINGS, useFactory: () => isDevMode() ? { minimumFetchIntervalMillis: 10_000 } : {} }
5869
],
59-
bootstrap: [ AppComponent ]
70+
bootstrap: [AppComponent]
6071
})
61-
export class AppModule { }
72+
export class AppModule {
73+
}

sample/src/app/database/database.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Component, OnInit } from '@angular/core';
22
import { AngularFireDatabase } from '@angular/fire/database';
33
import { Observable } from 'rxjs';
4-
import { TransferState, makeStateKey } from '@angular/platform-browser';
4+
import { makeStateKey, TransferState } from '@angular/platform-browser';
55
import { startWith, tap } from 'rxjs/operators';
66
import { trace } from '@angular/fire/performance';
77

sample/src/app/firestore/firestore.component.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Component, OnInit } from '@angular/core';
22
import { AngularFirestore } from '@angular/fire/firestore';
33
import { Observable } from 'rxjs';
4-
import { tap, startWith } from 'rxjs/operators';
5-
import { TransferState, makeStateKey } from '@angular/platform-browser';
4+
import { startWith, tap } from 'rxjs/operators';
5+
import { makeStateKey, TransferState } from '@angular/platform-browser';
66
import { trace } from '@angular/fire/performance';
77

88
@Component({

sample/src/app/storage/storage.component.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ import { startWith, tap } from 'rxjs/operators';
55
import { makeStateKey, TransferState } from '@angular/platform-browser';
66
import { trace } from '@angular/fire/performance';
77

8-
const TRANSPARENT_PNG = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII='
8+
const TRANSPARENT_PNG
9+
= 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=';
910

1011
@Component({
1112
selector: 'app-storage',
1213
template: `
1314
<p>
1415
Storage!
15-
<img [src]="downloadUrl$ | async" width="64" height="64" />
16+
<img [src]="downloadUrl$ | async" width="64" height="64"/>
1617
</p>
1718
`,
1819
styles: []
+8-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
export const environment = {
22
production: true,
33
firebase: {
4-
apiKey: "AIzaSyA7CNE9aHbcSEbt9y03QReJ-Xr0nwKg7Yg",
5-
authDomain: "aftest-94085.firebaseapp.com",
6-
databaseURL: "https://aftest-94085.firebaseio.com",
7-
projectId: "aftest-94085",
8-
storageBucket: "aftest-94085.appspot.com",
9-
messagingSenderId: "480362569154",
10-
appId: "1:480362569154:web:2fe6f75104cdfb82f50a5b",
11-
measurementId: "G-CBRYER9PJR"
4+
apiKey: 'AIzaSyA7CNE9aHbcSEbt9y03QReJ-Xr0nwKg7Yg',
5+
authDomain: 'aftest-94085.firebaseapp.com',
6+
databaseURL: 'https://aftest-94085.firebaseio.com',
7+
projectId: 'aftest-94085',
8+
storageBucket: 'aftest-94085.appspot.com',
9+
messagingSenderId: '480362569154',
10+
appId: '1:480362569154:web:2fe6f75104cdfb82f50a5b',
11+
measurementId: 'G-CBRYER9PJR'
1212
}
1313
};

sample/src/environments/environment.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
export const environment = {
66
production: false,
77
firebase: {
8-
apiKey: "AIzaSyA7CNE9aHbcSEbt9y03QReJ-Xr0nwKg7Yg",
9-
authDomain: "aftest-94085.firebaseapp.com",
10-
databaseURL: "https://aftest-94085.firebaseio.com",
11-
projectId: "aftest-94085",
12-
storageBucket: "aftest-94085.appspot.com",
13-
messagingSenderId: "480362569154",
14-
appId: "1:480362569154:web:2fe6f75104cdfb82f50a5b",
15-
measurementId: "G-CBRYER9PJR"
8+
apiKey: 'AIzaSyA7CNE9aHbcSEbt9y03QReJ-Xr0nwKg7Yg',
9+
authDomain: 'aftest-94085.firebaseapp.com',
10+
databaseURL: 'https://aftest-94085.firebaseio.com',
11+
projectId: 'aftest-94085',
12+
storageBucket: 'aftest-94085.appspot.com',
13+
messagingSenderId: '480362569154',
14+
appId: '1:480362569154:web:2fe6f75104cdfb82f50a5b',
15+
measurementId: 'G-CBRYER9PJR'
1616
}
1717
};
1818

@@ -23,4 +23,4 @@ export const environment = {
2323
* This import should be commented out in production mode because it will have a negative impact
2424
* on performance if an error is thrown.
2525
*/
26-
import 'zone.js/dist/zone-error'; // Included with Angular CLI.
26+
import 'zone.js/dist/zone-error'; // Included with Angular CLI.

sample/src/polyfills.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
/***************************************************************************************************
5656
* Zone JS is required by default for Angular itself.
5757
*/
58-
import 'zone.js/dist/zone'; // Included with Angular CLI.
58+
import 'zone.js/dist/zone'; // Included with Angular CLI.
5959

6060

6161
/***************************************************************************************************

sample/src/test.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22

33
import 'zone.js/dist/zone-testing';
44
import { getTestBed } from '@angular/core/testing';
5-
import {
6-
BrowserDynamicTestingModule,
7-
platformBrowserDynamicTesting
8-
} from '@angular/platform-browser-dynamic/testing';
5+
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
96

107
declare const require: {
118
context(path: string, deep?: boolean, filter?: RegExp): {

src/analytics/analytics.module.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { NgModule, Optional } from '@angular/core';
2-
import { UserTrackingService, ScreenTrackingService } from './analytics.service';
2+
import { ScreenTrackingService, UserTrackingService } from './analytics.service';
33
import { AngularFireAnalytics } from './analytics';
44

55
@NgModule({
@@ -12,6 +12,7 @@ export class AngularFireAnalyticsModule {
1212
@Optional() userTracking: UserTrackingService
1313
) {
1414
// calling anything on analytics will eagerly load the SDK
15+
// tslint:disable-next-line:no-unused-expression
1516
analytics.app;
1617
}
1718
}

0 commit comments

Comments
 (0)