Skip to content

Commit 4df1939

Browse files
jamesdanielsdavideast
authored andcommitted
feat(): support Angular and rxjs 6 (#1625)
* fix(): Angular/rxjs 6 and dropping database-depricated Co-authored-by: Yuki Kawamoto <kawamoto62@gmail.com> * Brought database-deprecated back in * Changelog and version update for rc8 * Had some bad merges and updating build test * Drop package-lock from test/ng6 * fixed the ng-build yarn command
1 parent 7d2fd53 commit 4df1939

Some content is hidden

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

47 files changed

+2170
-1612
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,5 @@ script:
4343
- ./node_modules/.bin/karma start --single-run --browsers ChromeHeadlessTravis --reporters mocha
4444
# Run integration test to make sure our typings are correct for user-land.
4545
- node tools/run-typings-test.js
46+
# Run the ng6 build test
47+
- cd test/ng-build/ng6 && yarn && yarn build:prod

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
<a name="5.0.0-rc.8"></a>
2+
# [5.0.0-rc.8](https://github.com/angular/angularfire2/compare/5.0.0-rc.7...5.0.0-rc.8) (2018-05-12)
3+
4+
### Bug Fixes
5+
6+
* Zone was already loaded, type is implied ([#1631](https://github.com/angular/angularfire2/issues/1631)) ([7d2fd53](https://github.com/angular/angularfire2/commit/7d2fd53)), closes [#1599](https://github.com/angular/angularfire2/issues/1599)
7+
8+
### Features
9+
10+
* Supporting Angular and rxjs 6 ([dd4a36c](https://github.com/angular/angularfire2/commit/dd4a36c))
11+
* Support Firebase JS SDK 5.0 ([#1628](https://github.com/angular/angularfire2/issues/1628)) ([b99bfa3](https://github.com/angular/angularfire2/commit/b99bfa3))
12+
* Support FirebaseAppConfig, clean up injection tokens ([#1627](https://github.com/angular/angularfire2/issues/1627)) ([57906bd](https://github.com/angular/angularfire2/commit/57906bd))
13+
* **firestore:** Support Firestore Settings, timestampsInSnapshots default to true ([#1629](https://github.com/angular/angularfire2/issues/1629)) ([570c0a7](https://github.com/angular/angularfire2/commit/570c0a7))
14+
* **auth:** Update to rxjs pipeable operators ([#1621](https://github.com/angular/angularfire2/issues/1621)) ([0c3b215](https://github.com/angular/angularfire2/commit/0c3b215))
15+
* **core:** Update to rxjs pipeable operators ([#1620](https://github.com/angular/angularfire2/issues/1620)) ([3fbbb7d](https://github.com/angular/angularfire2/commit/3fbbb7d))
16+
* **database:** Update to rxjs pipeable operators ([#1622](https://github.com/angular/angularfire2/issues/1622)) ([5c3681d](https://github.com/angular/angularfire2/commit/5c3681d))
17+
* **firestore:** Update to rxjs pipeable operators ([#1623](https://github.com/angular/angularfire2/issues/1623)) ([97b26e3](https://github.com/angular/angularfire2/commit/97b26e3))
18+
* **storage:** Update to rxjs pipeable operators ([#1624](https://github.com/angular/angularfire2/issues/1624)) ([014be21](https://github.com/angular/angularfire2/commit/014be21))
19+
20+
### Breaking changes
21+
22+
* Due to the addition of a conflicting `FirebaseAppConfig` interface in Firebase 4.13 we've now changed our `FirebaseAppConfig` Injection Token to be `FirebaseOptionsToken`
23+
* For consistency the `FirebaseAppName` Injection Token is now `FirebaseAppNameToken`
24+
* rxjs 5 is no longer supported, upgrade to 6 ([see the rxjs migration guide for more information](https://github.com/ReactiveX/rxjs/blob/master/MIGRATION.md))
25+
* Firebase JS SDK 4.x is no longer supported, upgrade to 5 ([see the changelog for more information](https://firebase.google.com/support/release-notes/js#version_500_may_8_2018))
26+
127
<a name="5.0.0-rc.7"></a>
228
# [5.0.0-rc.7](https://github.com/angular/angularfire2/compare/5.0.0-rc.6...5.0.0-rc.7) (2018-05-04)
329

karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module.exports = function(config) {
2020
'node_modules/zone.js/dist/async-test.js',
2121
'node_modules/zone.js/dist/fake-async-test.js',
2222

23-
'node_modules/rxjs/bundles/Rx.{js,map}',
23+
'node_modules/rxjs/bundles/rxjs.umd.{js,map}',
2424

2525
...getAngularFiles(['core','common','compiler','platform-browser','platform-browser-dynamic']),
2626

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angularfire2",
3-
"version": "5.0.0-rc.7",
3+
"version": "5.0.0-rc.8",
44
"description": "The official library of Firebase and Angular.",
55
"private": true,
66
"scripts": {
@@ -29,11 +29,11 @@
2929
},
3030
"homepage": "https://github.com/angular/angularfire2#readme",
3131
"dependencies": {
32-
"@angular/common": "^5.0.0",
33-
"@angular/compiler": "^5.0.0",
34-
"@angular/core": "^5.0.0",
35-
"@angular/platform-browser": "^5.0.0",
36-
"@angular/platform-browser-dynamic": "^5.0.0",
32+
"@angular/common": "^6.0.0",
33+
"@angular/compiler": "^6.0.0",
34+
"@angular/core": "^6.0.0",
35+
"@angular/platform-browser": "^6.0.0",
36+
"@angular/platform-browser-dynamic": "^6.0.0",
3737
"@firebase/app": "^0.3.1",
3838
"@firebase/app-types": "^0.3.1",
3939
"@firebase/auth": "^0.5.2",
@@ -47,15 +47,15 @@
4747
"@firebase/storage-types": "^0.2.2",
4848
"bufferutil": "^3.0.3",
4949
"firebase": "^5.0.2",
50-
"rxjs": "^5.5.4",
50+
"rxjs": "^6.0.0",
5151
"utf-8-validate": "^4.0.0",
5252
"ws": "^3.3.2",
5353
"xmlhttprequest": "^1.8.0",
5454
"zone.js": "^0.8.0"
5555
},
5656
"devDependencies": {
57-
"@angular/compiler-cli": "^5.0.0",
58-
"@angular/platform-server": "^5.0.0",
57+
"@angular/compiler-cli": "^6.0.0",
58+
"@angular/platform-server": "^6.0.0",
5959
"@types/jasmine": "^2.5.36",
6060
"@types/request": "0.0.30",
6161
"concurrently": "^2.2.0",
@@ -90,7 +90,7 @@
9090
"systemjs": "^0.19.16",
9191
"systemjs-builder": "^0.15.7",
9292
"traceur": "0.0.96",
93-
"typescript": ">=2.4.2 <2.5"
93+
"typescript": ">=2.7.2 <2.8.0"
9494
},
9595
"typings": "index.d.ts"
9696
}

src/auth/auth.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import { FirebaseAuth, User } from '@firebase/auth-types';
22
import { FirebaseOptions, FirebaseAppConfig } from '@firebase/app-types';
33
import { Injectable, Inject, Optional, NgZone, PLATFORM_ID } from '@angular/core';
4-
import { Observable } from 'rxjs';
4+
import { Observable, of, from } from 'rxjs';
55
import { switchMap } from 'rxjs/operators';
6-
import { of } from 'rxjs/observable/of';
7-
import { from } from 'rxjs/observable/from';
86

97
import { FirebaseOptionsToken, FirebaseAppConfigToken, FirebaseAppNameToken, _firebaseAppFactory, FirebaseZoneScheduler } from 'angularfire2';
108

src/core/angularfire2.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { InjectionToken, NgZone } from '@angular/core';
22
import { isPlatformServer } from '@angular/common';
3-
import { Observable, Subscription } from 'rxjs';
4-
import { queue } from 'rxjs/scheduler/queue';
3+
import { Observable, Subscription, queueScheduler as queue } from 'rxjs';
54
import { first } from 'rxjs/operators';
65

76
import firebase from '@firebase/app';

src/database-deprecated/database.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class AngularFireDatabase {
2525
zone: NgZone
2626
) {
2727
this.database = zone.runOutsideAngular(() => {
28-
const app = _firebaseAppFactory(config, name);
28+
const app = _firebaseAppFactory(options, name, config);
2929
return app.database(databaseURL || undefined);
3030
});
3131
}

src/database-deprecated/firebase_list_factory.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@ import { FirebaseZoneScheduler } from 'angularfire2';
44
import * as utils from './utils';
55
import { AFUnwrappedDataSnapshot } from './interfaces';
66
import { FirebaseListObservable } from './firebase_list_observable';
7-
import { Observer } from 'rxjs/Observer';
8-
import { observeOn } from 'rxjs/operator/observeOn';
7+
import { Observer } from 'rxjs';
8+
import { observeOn, switchMap, map } from 'rxjs/operators';
99
import { observeQuery } from './query_observable';
1010
import { Query, FirebaseListFactoryOpts, DatabaseReference, DatabaseQuery, DatabaseSnapshot } from './interfaces';
11-
import { switchMap } from 'rxjs/operator/switchMap';
12-
import { map } from 'rxjs/operator/map';
1311

1412
export function FirebaseListFactory (
1513
ref: DatabaseReference,

src/database-deprecated/firebase_list_observable.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import { Observable } from 'rxjs/Observable';
2-
import { Operator } from 'rxjs/Operator';
3-
import { Subscriber } from 'rxjs/Subscriber';
4-
import { Subscription } from 'rxjs/Subscription';
1+
import { Observable, Operator, Subscriber, Subscription } from 'rxjs';
52
import { Reference, DataSnapshot, ThenableReference } from '@firebase/database-types';
63
import * as utils from './utils';
74
import { AFUnwrappedDataSnapshot, FirebaseOperationCases, QueryReference, DatabaseSnapshot, DatabaseReference } from './interfaces';

src/database-deprecated/firebase_object_factory.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { NgZone } from '@angular/core';
22
import { FirebaseObjectObservable } from './firebase_object_observable';
33
import { FirebaseZoneScheduler } from 'angularfire2';
4-
import { Observer } from 'rxjs/Observer';
5-
import { observeOn } from 'rxjs/operator/observeOn';
4+
import { Observer } from 'rxjs';
5+
import { observeOn } from 'rxjs/operators';
66
import { DataSnapshot } from '@firebase/database-types';
77
import * as utils from './utils';
88
import { FirebaseObjectFactoryOpts, DatabaseReference } from './interfaces';

0 commit comments

Comments
 (0)