Skip to content

Commit 23464c2

Browse files
jamesdanielsdavideast
authored andcommitted
5.1 release: support Firebase 5.5, multi-tab sync, function region selection, and Angular 7 (#1920)
* feat(afs): Support Firebase 5.5 and Firestore PersistenceSettings * chore(): Now that app types are mostly fixed, pull from those * chore(): Changelog entry for 5.1 * chore(): Use PersistenceSettings from interfaces, also fix types in firestore.ts * fix(afs): Fix constructor ordering so this isn't a break * feat(functions): Support region configuration via FunctionsRegionToken * chore(): Changelog entry for region selection * chore(): Support Angular 7 without peer dependency warnings * chore(): Changelog for Angular 7
1 parent d6f59c7 commit 23464c2

26 files changed

+1318
-162
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
<a name="5.1.0"></a>
2+
# [5.1.0](https://github.com/angular/angularfire2/compare/5.0.0-rc.12...5.1.0) (2018-10-17)
3+
4+
### Features
5+
6+
* **core:** Support Angular 7 without peer dependency warnings ([ed92c45](https://github.com/angular/angularfire2/commit/ed92c45))
7+
* **afs:** Support Firebase 5.5 and Firestore PersistenceSettings ([a9cf1ca](https://github.com/angular/angularfire2/commit/a9cf1ca))
8+
* **functions:** Support region configuration via `FunctionsRegionToken` ([8901617](https://github.com/angular/angularfire2/commit/8901617))
9+
10+
111
<a name="5.0.2"></a>
212
## [5.0.2](https://github.com/angular/angularfire2/compare/5.0.1...5.0.2) (2018-09-21)
313

package.json

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angularfire2",
3-
"version": "5.0.2",
3+
"version": "5.1.0",
44
"description": "The official library of Firebase and Angular.",
55
"private": true,
66
"scripts": {
@@ -12,7 +12,7 @@
1212
"delayed_karma": "sleep 10 && karma start",
1313
"build": "rm -rf dist && node tools/build.js",
1414
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1",
15-
"build:wrapper": "npm i --prefix wrapper && VERSION=5.0.2 npm run --prefix wrapper build"
15+
"build:wrapper": "npm i --prefix wrapper && VERSION=5.1.0 npm run --prefix wrapper build"
1616
},
1717
"keywords": [
1818
"angular",
@@ -30,12 +30,12 @@
3030
},
3131
"homepage": "https://github.com/angular/angularfire2#readme",
3232
"dependencies": {
33-
"@angular/common": "^6.0.0",
34-
"@angular/compiler": "^6.0.0",
35-
"@angular/core": "^6.0.0",
36-
"@angular/platform-browser": "^6.0.0",
37-
"@angular/platform-browser-dynamic": "^6.0.0",
38-
"firebase": "^5.0.3",
33+
"@angular/common": ">=6.0.0 <8",
34+
"@angular/compiler": ">=6.0.0 <8",
35+
"@angular/core": ">=6.0.0 <8",
36+
"@angular/platform-browser": ">=6.0.0 <8",
37+
"@angular/platform-browser-dynamic": ">=6.0.0 <8",
38+
"firebase": "^5.5.0",
3939
"rxjs": "^6.0.0",
4040
"ws": "^3.3.2",
4141
"xhr2": "^0.1.4",
@@ -46,8 +46,9 @@
4646
"utf-8-validate": "~4.0.0"
4747
},
4848
"devDependencies": {
49-
"@angular/compiler-cli": "^6.0.0",
50-
"@angular/platform-server": "^6.0.0",
49+
"@angular/compiler-cli": ">=6.0.0 <8",
50+
"@angular/platform-server": ">=6.0.0 <8",
51+
"@angular/animations": ">=6.0.0 <8",
5152
"@types/jasmine": "^2.5.36",
5253
"@types/request": "0.0.30",
5354
"concurrently": "^2.2.0",
@@ -82,7 +83,7 @@
8283
"systemjs": "^0.19.16",
8384
"systemjs-builder": "^0.15.7",
8485
"traceur": "0.0.96",
85-
"typescript": ">=2.7.2 <2.8.0"
86+
"typescript": ">=2.7.2 <2.8.0, >=3.1.1 <3.2"
8687
},
8788
"typings": "index.d.ts"
8889
}

src/auth/auth.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { User } from 'firebase';
1+
import { User } from 'firebase/app';
22
import { Observable, Subject } from 'rxjs'
33
import { TestBed, inject } from '@angular/core/testing';
44
import { FirebaseApp, FirebaseOptionsToken, AngularFireModule, FirebaseNameOrConfigToken } from '@angular/fire';

src/auth/auth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Injectable, Inject, Optional, NgZone, PLATFORM_ID } from '@angular/core
22
import { Observable, of, from } from 'rxjs';
33
import { switchMap } from 'rxjs/operators';
44
import { FirebaseAppConfig, FirebaseOptions } from '@angular/fire';
5-
import { User, auth } from 'firebase';
5+
import { User, auth } from 'firebase/app';
66

77
import { FirebaseAuth, FirebaseOptionsToken, FirebaseNameOrConfigToken, _firebaseAppFactory, FirebaseZoneScheduler } from '@angular/fire';
88

src/core/angularfire2.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { FirebaseApp, AngularFireModule } from '@angular/fire';
44
import { Subscription } from 'rxjs';
55
import { COMMON_CONFIG } from './test-config';
66
import { BrowserModule } from '@angular/platform-browser';
7-
import { database } from 'firebase';
7+
import { database } from 'firebase/app';
88

99
describe('angularfire', () => {
1010
let subscription:Subscription;

src/core/firebase.app.module.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { InjectionToken, NgModule, Optional } from '@angular/core';
2-
import {app, auth, database, firestore, functions, messaging, storage } from 'firebase';
2+
import { app, auth, database, firestore, functions, messaging, storage } from 'firebase/app';
33
// @ts-ignore (https://github.com/firebase/firebase-js-sdk/pull/1206)
4-
import firebase from 'firebase/app';
4+
import firebase from 'firebase/app'; // once fixed can pull in as "default as firebase" above
55

66
// Public types don't expose FirebaseOptions or FirebaseAppConfig
77
export type FirebaseOptions = {[key:string]: any};
@@ -17,6 +17,8 @@ export type FirebaseStorage = storage.Storage;
1717
export type FirebaseFirestore = firestore.Firestore;
1818
export type FirebaseFunctions = functions.Functions;
1919

20+
// Have to implement as we need to return a class from the provider, we should consider exporting
21+
// this in the firebase/app types as this is our highest risk of breaks
2022
export class FirebaseApp implements app.App {
2123
name: string;
2224
options: {};
@@ -29,7 +31,7 @@ export class FirebaseApp implements app.App {
2931
storage: (storageBucket?: string) => FirebaseStorage;
3032
delete: () => Promise<void>;
3133
firestore: () => FirebaseFirestore;
32-
functions: () => FirebaseFunctions;
34+
functions: (region?: string) => FirebaseFunctions;
3335
}
3436

3537
export function _firebaseAppFactory(options: FirebaseOptions, nameOrConfig?: string | FirebaseAppConfig) {

src/database-deprecated/firebase_object_observable.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Observable, Operator, Subscriber, Subscription } from 'rxjs';
22
import { Reference } from './interfaces';
3-
import { database } from 'firebase';
3+
import { database } from 'firebase/app';
44

55
export class FirebaseObjectObservable<T> extends Observable<T> {
66
constructor(subscribe?: <R>(subscriber: Subscriber<R>) => Subscription | Function | void, public $ref?:Reference) {

src/database-deprecated/interfaces.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Observable } from 'rxjs';
2-
import { database } from 'firebase';
2+
import { database } from 'firebase/app';
33

44
export type Reference = database.Reference;
55
export type DataSnapshot = database.DataSnapshot;

src/database/interfaces.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Observable } from 'rxjs';
2-
import { database } from 'firebase';
2+
import { database } from 'firebase/app';
33

44
export type FirebaseOperation = string | database.Reference | database.DataSnapshot;
55

src/database/list/changes.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { database } from 'firebase';
1+
import { database } from 'firebase/app';
22
import { FirebaseApp, AngularFireModule } from '@angular/fire';
33
import { AngularFireDatabase, AngularFireDatabaseModule, listChanges } from '@angular/fire/database';
44
import { TestBed, inject } from '@angular/core/testing';

0 commit comments

Comments
 (0)