Skip to content

Commit 705505a

Browse files
authored
feat: Support Angular 9 and bump to version 6.0.0 (#2282)
BREAKING CHANGE: version 6 of AngularFire drops support for Angular version 8 and below, older versions of typescript, Firebase, drops `firebase-node`, `database-deprecated`, and more. See CHANGELOG for more details.
1 parent d454cf0 commit 705505a

File tree

313 files changed

+8641
-33059
lines changed

Some content is hidden

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

313 files changed

+8641
-33059
lines changed

.firebaserc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"projects": {
3+
"default": "angularfire2-test"
4+
}
5+
}

.gitignore

+5-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,8 @@ angularfire2-*.tgz
1414
yarn-error.log
1515
*.bak
1616
package-lock.json
17-
test/ng-build/**/yarn.lock
17+
test/ng-build/**/yarn.lock
18+
tools/build.js
19+
coverage
20+
*.log
21+
api-*.json

.npmignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
*.spec.*
2-
bundles/test.umd.js
32
test-config.*

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lts/*

.travis.yml

+1-7
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,4 @@ install:
3838
fi
3939
fi
4040
41-
script:
42-
- yarn build
43-
- |
44-
./node_modules/.bin/karma start --single-run --browsers ChromeHeadlessTravis --reporters mocha &&
45-
yarn test:node &&
46-
node tools/run-typings-test.js &&
47-
bash ./test/ng-build/build.sh
41+
script: yarn build && yarn test:all

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55

66
[![Build Status](https://travis-ci.org/angular/angularfire.svg?branch=master)](https://travis-ci.org/angular/angularfire) [![Join the chat at https://gitter.im/angular/angularfire2](https://badges.gitter.im/angular/angularfire2.svg)](https://gitter.im/angular/angularfire2?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
77

8+
---
9+
10+
> **WARNING**: Master branch is the work in progress for version 6 of AngularFire. [You can find version 5 here](https://github.com/angular/angularfire/tree/v5), if you're looking for documentation or to contribute to stable. [Learn more about the road toward version 6 here](https://github.com/angular/angularfire/issues/2267).
11+
12+
---
13+
814
## What is AngularFire?
915

1016
- **Observable based** - Use the power of RxJS, Angular, and Firebase.

angular.json

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": ".",
5+
"projects": {
6+
"angularfire": {
7+
"projectType": "library",
8+
"root": "src",
9+
"sourceRoot": "src",
10+
"prefix": "angularfire",
11+
"architect": {
12+
"build": {
13+
"builder": "@angular-devkit/build-ng-packagr:build",
14+
"options": {
15+
"tsConfig": "tsconfig.json",
16+
"project": "src/package.json"
17+
}
18+
},
19+
"test": {
20+
"builder": "@angular-devkit/build-angular:karma",
21+
"options": {
22+
"main": "src/test.ts",
23+
"tsConfig": "tsconfig.spec.json",
24+
"karmaConfig": "karma.conf.js"
25+
}
26+
},
27+
"lint": {
28+
"builder": "@angular-devkit/build-angular:tslint",
29+
"options": {
30+
"tsConfig": [
31+
"tsconfig.json",
32+
"tsconfig.spec.json"
33+
],
34+
"exclude": [
35+
"**/node_modules/**"
36+
]
37+
}
38+
}
39+
}
40+
}},
41+
"defaultProject": "angularfire"
42+
}

angularfire2.ts

-6
This file was deleted.

cloudbuild.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# See go/angularfire-releasing for details on the AngularFire release process.
22
# If you need to trigger a release manually, be sure to use substitutions like so:
33
# @canary `gcloud builds submit --substitutions=SHORT_SHA="9b0a0b0"`
4-
# @next `gcloud builds submit --substitutions=TAG_NAME="v1.2.3-rc.1"`
5-
# @latest `gcloud builds submit --substitutions=TAG_NAME="v1.2.3"`
4+
# @next `gcloud builds submit --substitutions=TAG_NAME="1.2.3-rc.1"`
5+
# @latest `gcloud builds submit --substitutions=TAG_NAME="1.2.3"`
66
steps:
77
- name: node:lts
88
entrypoint: bash

firebase.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"database": {
3+
"rules": "test/database.rules.json"
4+
},
5+
"firestore": {
6+
"rules": "test/firestore.rules",
7+
"indexes": "test/firestore.indexes.json"
8+
},
9+
"storage": {
10+
"rules": "test/storage.rules"
11+
}
12+
}

karma-test-shim.js

-8
This file was deleted.

karma.conf.js

+22-58
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,37 @@
1-
// Karma configuration
2-
module.exports = function(config) {
1+
// Karma configuration file, see link for more information
2+
// https://karma-runner.github.io/1.0/config/configuration-file.html
3+
module.exports = function (config) {
34
config.set({
4-
55
basePath: '',
6-
7-
frameworks: ['jasmine'],
8-
9-
files: [
10-
// Polyfills.
11-
'node_modules/es6-shim/es6-shim.js',
12-
13-
'node_modules/reflect-metadata/Reflect.js',
14-
15-
// Zone.js dependencies
16-
'node_modules/zone.js/dist/zone.js',
17-
'node_modules/zone.js/dist/proxy.js',
18-
'node_modules/zone.js/dist/sync-test.js',
19-
'node_modules/zone.js/dist/jasmine-patch.js',
20-
'node_modules/zone.js/dist/async-test.js',
21-
'node_modules/zone.js/dist/fake-async-test.js',
22-
'node_modules/zone.js/dist/task-tracking.js',
23-
24-
'node_modules/rxjs/bundles/rxjs.umd.{js,map}',
25-
26-
...getAngularFiles(['core','common','compiler','platform-browser','platform-browser-dynamic']),
27-
28-
'karma-test-shim.js',
29-
'node_modules/firebase/firebase-app.js',
30-
'node_modules/firebase/firebase-auth.js',
31-
'node_modules/firebase/firebase-database.js',
32-
'node_modules/firebase/firebase-firestore.js',
33-
'node_modules/firebase/firebase-functions.js',
34-
'node_modules/firebase/firebase-performance.js',
35-
'node_modules/firebase/firebase-storage.js',
36-
'dist/packages-dist/bundles/core.umd.{js,map}',
37-
'dist/packages-dist/bundles/auth.umd.{js,map}',
38-
'dist/packages-dist/bundles/analytics.umd.{js,map}',
39-
'dist/packages-dist/bundles/auth-guard.umd.{js,map}',
40-
'dist/packages-dist/bundles/database.umd.{js,map}',
41-
'dist/packages-dist/bundles/firestore.umd.{js,map}',
42-
'dist/packages-dist/bundles/functions.umd.{js,map}',
43-
'dist/packages-dist/bundles/messaging.umd.{js,map}',
44-
'dist/packages-dist/bundles/remote-config.umd.{js,map}',
45-
'dist/packages-dist/bundles/storage.umd.{js,map}',
46-
'dist/packages-dist/bundles/performance.umd.{js,map}',
47-
'dist/packages-dist/bundles/database-deprecated.umd.{js,map}',
48-
'dist/packages-dist/bundles/test.umd.{js,map}',
6+
frameworks: ['jasmine', '@angular-devkit/build-angular'],
7+
plugins: [
8+
require('karma-jasmine'),
9+
require('karma-chrome-launcher'),
10+
require('karma-jasmine-html-reporter'),
11+
require('karma-coverage-istanbul-reporter'),
12+
require('@angular-devkit/build-angular/plugins/karma')
4913
],
50-
14+
client: {
15+
clearContext: false // leave Jasmine Spec Runner output visible in browser
16+
},
17+
coverageIstanbulReporter: {
18+
dir: `${process.cwd()}/coverage`,
19+
reports: ['html', 'lcovonly'],
20+
fixWebpackSourcePaths: true
21+
},
22+
reporters: ['progress', 'kjhtml'],
5123
port: 9876,
5224
colors: true,
5325
logLevel: config.LOG_INFO,
5426
autoWatch: true,
55-
reporters: ['mocha'],
56-
browsers: ['ChromeHeadless'],
27+
browsers: ['Chrome', 'ChromeHeadless'],
5728
singleRun: false,
29+
restartOnFileChange: true,
5830
customLaunchers: {
5931
ChromeHeadlessTravis: {
6032
base: 'ChromeHeadless',
6133
flags: ['--no-sandbox']
6234
}
6335
},
64-
})
36+
});
6537
};
66-
67-
function getAngularFiles(packages) {
68-
return packages.reduce((files, pkg) => {
69-
files.push(`node_modules/@angular/${pkg}/bundles/${pkg}.umd.js`);
70-
files.push(`node_modules/@angular/${pkg}/bundles/${pkg}-testing.umd.js`);
71-
return files;
72-
}, []);
73-
}

package.json

+57-53
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
{
22
"name": "@angular/fire",
3-
"version": "5.3.0",
3+
"version": "6.0.0",
44
"description": "The official library of Firebase and Angular.",
55
"private": true,
66
"scripts": {
7-
"test": "npm run build && karma start --single-run && npm run test:node",
8-
"test:node": "jasmine 'dist/packages-dist/schematics/**/*[sS]pec.js'",
9-
"test:watch": "concurrently \"npm run build:watch\" \"npm run delayed_karma\"",
10-
"test:debug": "npm run build && karma start",
11-
"karma": "karma start",
12-
"test:universal": "npm run build && cd test/universal-test && yarn && npm run prerender",
13-
"delayed_karma": "sleep 10 && karma start",
14-
"build": "rimraf dist && node tools/build.js && npm pack ./dist/packages-dist",
15-
"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"
7+
"test": "npm run test:node",
8+
"test:watch": "npx firebase emulators:exec --project=angularfire2-test \"npx ng test --watch=true --browsers=Chrome\"",
9+
"test:chrome": "npx firebase emulators:exec --project=angularfire2-test \"npx ng test --watch=false --browsers=Chrome\"",
10+
"test:chrome-headless": "npx firebase emulators:exec --project=angularfire2-test \"npx ng test --watch=false --browsers=ChromeHeadless\"",
11+
"lint": "npx ng lint",
12+
"test:node": "npx tsc -p tsconfig.jasmine.json; cp ./dist/packages-dist/schematics/versions.json ./dist/out-tsc/jasmine/schematics && npx firebase emulators:exec --project=angularfire2-test \"node -r tsconfig-paths/register ./tools/jasmine.js\"",
13+
"test:typings": "node ./tools/run-typings-test.js",
14+
"test:build": "bash ./test/ng-build/build.sh",
15+
"test:all": "npm run test:node && npm run test:chrome-headless && npm run test:typings && npm run test:build",
16+
"build": "tsc tools/build.ts; node ./tools/build.js",
17+
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1"
1718
},
1819
"schematics": "./dist/packages-dist/collection.json",
1920
"builders": "./dist/packages-dist/builders.json",
@@ -33,70 +34,73 @@
3334
},
3435
"homepage": "https://github.com/angular/angularfire2#readme",
3536
"dependencies": {
36-
"@angular-devkit/architect": "<0.900 || ^0.900.0-0 || ^9.0.0-0",
37-
"@angular-devkit/core": ">=6.0.0 <9 || ^9.0.0-0",
38-
"@angular-devkit/schematics": ">=6.0.0 <9 || ^9.0.0-0",
39-
"@angular/common": ">=6.0.0 <9 || ^9.0.0-0",
40-
"@angular/compiler": ">=6.0.0 <9 || ^9.0.0-0",
41-
"@angular/core": ">=6.0.0 <9 || ^9.0.0-0",
42-
"@angular/platform-browser": ">=6.0.0 <9 || ^9.0.0-0",
43-
"@angular/platform-browser-dynamic": ">=6.0.0 <9 || ^9.0.0-0",
44-
"@angular/router": ">=6.0.0 <9 || ^9.0.0-0",
45-
"firebase": ">= 5.5.7 <8",
46-
"firebase-tools": "^6.10.0",
37+
"@angular-devkit/architect": "^0.900.0-0 || ^0.900.0",
38+
"@angular-devkit/core": "^9.0.0-0 || ^9.0.0 || ^10.0.0-0",
39+
"@angular-devkit/schematics": "^9.0.0-0 || ^9.0.0 || ^10.0.0-0",
40+
"@angular/common": "^9.0.0-0 || ^9.0.0 || ^10.0.0-0",
41+
"@angular/compiler": "^9.0.0-0 || ^9.0.0 || ^10.0.0-0",
42+
"@angular/core": "^9.0.0-0 || ^9.0.0 || ^10.0.0-0",
43+
"@angular/platform-browser": "^9.0.0-0 || ^9.0.0 || ^10.0.0-0",
44+
"@angular/platform-browser-dynamic": "^9.0.0-0 || ^9.0.0 || ^10.0.0-0",
45+
"@angular/router": "^9.0.0-0 || ^9.0.0 || ^10.0.0-0",
46+
"firebase": "^7.6.2",
47+
"firebase-tools": "^7.11.0",
4748
"fuzzy": "^0.1.3",
4849
"inquirer": "^6.2.2",
4950
"inquirer-autocomplete-prompt": "^1.0.1",
50-
"rxjs": "^6.0.0",
51-
"ws": "^3.3.2",
51+
"rxfire": "^3.9.7",
52+
"rxjs": "^6.5.3",
53+
"tslib": "^1.10.0",
54+
"ws": "^7.2.1",
5255
"xhr2": "^0.1.4",
53-
"zone.js": "^0.8.0 || ^0.9.0"
56+
"zone.js": "~0.10.2"
5457
},
5558
"optionalDependencies": {
56-
"bufferutil": "~3.0.0",
57-
"utf-8-validate": "~4.0.0"
59+
"bufferutil": "^4.0.1",
60+
"utf-8-validate": "^5.0.2"
5861
},
5962
"devDependencies": {
60-
"@angular/animations": ">=6.0.0 <9 || ^9.0.0-0",
61-
"@angular/compiler-cli": ">=6.0.0 <9 || ^9.0.0-0",
62-
"@angular/platform-server": ">=6.0.0 <9 || ^9.0.0-0",
63+
"@angular-devkit/build-angular": "^0.900.0-0 || ^0.900.0",
64+
"@angular-devkit/build-ng-packagr": "^0.900.0-0 || ^0.900.0",
65+
"@angular/animations": "^9.0.0-0 || ^9.0.0 || ^10.0.0-0",
66+
"@angular/cli": "^9.0.0-0 || ^9.0.0 || ^10.0.0-0",
67+
"@angular/compiler-cli": "^9.0.0-0 || ^9.0.0 || ^10.0.0-0",
68+
"@angular/platform-server": "^9.0.0-0 || ^9.0.0 || ^10.0.0-0",
69+
"@types/fs-extra": "^7.0.0",
70+
"@types/gzip-size": "^5.1.1",
6371
"@types/inquirer": "^0.0.44",
64-
"@types/jasmine": "^2.5.36",
72+
"@types/jasmine": "^3.3.13",
73+
"@types/node": "^12.6.2",
6574
"@types/request": "0.0.30",
75+
"codelyzer": "^5.0.0",
6676
"concurrently": "^2.2.0",
6777
"conventional-changelog-cli": "^1.2.0",
68-
"es6-module-loader": "^0.17.10",
69-
"es6-shim": "^0.35.0",
70-
"fs-extra": "^4.0.0",
71-
"gulp": "^3.9.0",
72-
"gulp-jasmine": "^2.2.1",
73-
"gulp-typescript": "^2.10.0",
74-
"gzip-size": "^4.0.0",
75-
"http-server": "^0.8.5",
76-
"jasmine": "^2.4.1",
77-
"jasmine-core": "^2.4.1",
78-
"json": "^9.0.3",
79-
"karma": "^2.0.0",
78+
"fs-extra": "^8.0.1",
79+
"gzip-size": "^5.1.1",
80+
"jasmine": "^3.4.0",
81+
"jasmine-core": "^3.4.0",
82+
"karma": "^4.1.0",
8083
"karma-chrome-launcher": "^2.2.0",
81-
"karma-firefox-launcher": "^1.1.0",
82-
"karma-jasmine": "^0.3.6",
83-
"karma-mocha-reporter": "^2.0.2",
84-
"karma-systemjs": "^0.10.0",
84+
"karma-coverage-istanbul-reporter": "^2.0.5",
85+
"karma-jasmine": "^2.0.1",
86+
"karma-jasmine-html-reporter": "^1.4.2",
8587
"ncp": "^2.0.0",
86-
"parse5": "^1.3.2",
88+
"ng-packagr": "^9.0.0-0 || ^9.0.0",
8789
"pretty-size": "^2.0.0",
8890
"protractor": "3.0.0",
8991
"reflect-metadata": "0.1.2",
92+
"replace-in-file": "^5.0.2",
9093
"rimraf": "^2.5.4",
91-
"rollup": "^0.64.1",
92-
"rollup-plugin-node-resolve": "^3.3.0",
93-
"rollup-watch": "^4.3.1",
94-
"schematics-utilities": "^1.1.1",
94+
"schematics-utilities": "^2.0.1",
9595
"shelljs": "^0.8.0",
9696
"systemjs": "^0.19.16",
9797
"systemjs-builder": "^0.15.7",
9898
"traceur": "0.0.96",
99-
"typescript": ">=3.4.0 <3.5.0"
99+
"tsconfig-paths": "^3.8.0",
100+
"tsickle": "^0.35.0",
101+
"tslint": "^5.17.0",
102+
"typedoc": "^0.16.4",
103+
"typescript": "~3.6.4"
100104
},
101105
"typings": "index.d.ts"
102106
}

publish.sh

-10
This file was deleted.

0 commit comments

Comments
 (0)