Skip to content

Commit e04cd7f

Browse files
authored
Update to Angular 16, TypeScript 5, and latest Firebase SDK (#3402)
* Update dependencies * es2020 output. refactor build.ts * Update to TS 5, Angular 16, and ng-packagr 16 formats. * db typing * use ts-ignore for zones.ts hack * drop ttsc for main build script * ci * disable caching to test CI * Actually use valid YAML * break that cache * restore restore-keys * Update build to handle main package.json * update more deps * test infra changes * break the cache * actually break the cache * build fix * Fix type errors. Successful but incomplete build. * Drop node 16 * Get tests to run * Fix firestore tests * must test perf with the default app * skip flake for safari * Safari flakes * Remove Safari tests for now * resolving comments * testing with rxfire canary * testing with another canary * new rxfire release
1 parent 34e89a4 commit e04cd7f

File tree

99 files changed

+5721
-7509
lines changed

Some content is hidden

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

99 files changed

+5721
-7509
lines changed

.github/workflows/test.yml

+12-39
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,20 @@ jobs:
2525
- name: Setup node
2626
uses: actions/setup-node@v3
2727
with:
28-
node-version: '16'
28+
node-version: '18'
2929
check-latest: true
3030
- name: node_modules cache
3131
uses: actions/cache@v3
3232
id: node_modules_cache
3333
with:
3434
path: ./node_modules
3535
key: ${{ runner.os }}-16-12-9-9-6-node_modules-${{ hashFiles('yarn.lock') }}
36-
restore-keys: |
37-
${{ runner.os }}-16-12-9-9-6-node_modules-
38-
${{ runner.os }}-16-12-9-9-
39-
${{ runner.os }}-16-12-9-
40-
${{ runner.os }}-16-12-
41-
${{ runner.os }}-16-
4236
- name: Yarn offline cache
4337
if: steps.node_modules_cache.outputs.cache-hit != 'true'
4438
uses: actions/cache@v3
4539
with:
4640
path: ~/.npm-packages-offline-cache
4741
key: yarn-offline-${{ hashFiles('**/yarn.lock') }}
48-
restore-keys: yarn-offline
4942
- name: Install deps
5043
if: steps.node_modules_cache.outputs.cache-hit != 'true'
5144
run: |
@@ -70,7 +63,7 @@ jobs:
7063
strategy:
7164
matrix:
7265
os: [ ubuntu-latest, macos-latest, windows-latest ]
73-
node: ["16", "18", "20"]
66+
node: ["18", "20"]
7467
fail-fast: false
7568
name: Test Node ${{ matrix.node }} (${{ matrix.os }})
7669
steps:
@@ -86,19 +79,12 @@ jobs:
8679
uses: actions/cache@v3
8780
with:
8881
path: ./node_modules
89-
key: ${{ runner.os }}-${{ matrix.node }}-16-9-12-7-node_modules-${{ hashFiles('yarn.lock') }}
90-
restore-keys: |
91-
${{ runner.os }}-${{ matrix.node }}-16-9-12-7-node_modules-
92-
${{ runner.os }}-${{ matrix.node }}-16-9-12-
93-
${{ runner.os }}-${{ matrix.node }}-16-9-
94-
${{ runner.os }}-${{ matrix.node }}-16-
95-
${{ runner.os }}-${{ matrix.node }}-
82+
key: ${{ runner.os }}-${{ matrix.node }}-16-9-12-8-node_modules-${{ hashFiles('yarn.lock') }}
9683
- name: Yarn offline cache
9784
uses: actions/cache@v3
9885
with:
9986
path: ~/.npm-packages-offline-cache
10087
key: yarn-offline-${{ hashFiles('**/yarn.lock') }}
101-
restore-keys: yarn-offline
10288
- name: Configure yarn
10389
run: |
10490
yarn config set yarn-offline-mirror ~/.npm-packages-offline-cache
@@ -132,16 +118,17 @@ jobs:
132118
matrix:
133119
os: [ ubuntu-latest ]
134120
browser: [ chrome-headless, firefox-headless ]
135-
include:
136-
- os: macos-latest
137-
browser: safari
121+
# TODO(davideast): Figure out why Safari tests timeout only on CI
122+
# include:
123+
# - os: macos-latest
124+
# browser: safari
138125
steps:
139126
- name: Checkout
140127
uses: actions/checkout@v3
141128
- name: Setup node
142129
uses: actions/setup-node@v3
143130
with:
144-
node-version: 16
131+
node-version: 18
145132
check-latest: true
146133
- name: Setup java
147134
uses: actions/setup-java@v3
@@ -153,19 +140,12 @@ jobs:
153140
uses: actions/cache@v3
154141
with:
155142
path: ./node_modules
156-
key: ${{ runner.os }}-${{ matrix.node }}-16-9-12-7-node_modules-${{ hashFiles('yarn.lock') }}
157-
restore-keys: |
158-
${{ runner.os }}-${{ matrix.node }}-16-9-12-7-node_modules-
159-
${{ runner.os }}-${{ matrix.node }}-16-9-12-
160-
${{ runner.os }}-${{ matrix.node }}-16-9-
161-
${{ runner.os }}-${{ matrix.node }}-16-
162-
${{ runner.os }}-${{ matrix.node }}-
143+
key: ${{ runner.os }}-${{ matrix.node }}-16-9-12-8-node_modules-${{ hashFiles('yarn.lock') }}
163144
- name: Yarn offline cache
164145
uses: actions/cache@v3
165146
with:
166147
path: ~/.npm-packages-offline-cache
167148
key: yarn-offline-${{ hashFiles('**/yarn.lock') }}
168-
restore-keys: yarn-offline
169149
- name: Configure yarn
170150
run: |
171151
yarn config set yarn-offline-mirror ~/.npm-packages-offline-cache
@@ -192,7 +172,7 @@ jobs:
192172
strategy:
193173
matrix:
194174
os: [ ubuntu-latest, macos-latest, windows-latest ]
195-
node: ["16"]
175+
node: ["18"]
196176
fail-fast: false
197177
steps:
198178
- name: Checkout
@@ -208,19 +188,12 @@ jobs:
208188
with:
209189
path: ./node_modules
210190
key: ${{ runner.os }}-${{ matrix.node }}-12-9-9-6-node_modules-${{ hashFiles('yarn.lock') }}
211-
restore-keys: |
212-
${{ runner.os }}-${{ matrix.node }}-12-9-9-6-node_modules-
213-
${{ runner.os }}-${{ matrix.node }}-12-9-9-
214-
${{ runner.os }}-${{ matrix.node }}-12-9-
215-
${{ runner.os }}-${{ matrix.node }}-12-
216-
${{ runner.os }}-${{ matrix.node }}-
217191
- name: Yarn offline cache
218192
if: steps.node_modules_cache.outputs.cache-hit != 'true'
219193
uses: actions/cache@v3
220194
with:
221195
path: ~/.npm-packages-offline-cache
222196
key: yarn-offline-${{ hashFiles('**/yarn.lock') }}
223-
restore-keys: yarn-offline
224197
- name: Install deps
225198
if: steps.node_modules_cache.outputs.cache-hit != 'true'
226199
run: |
@@ -268,7 +241,7 @@ jobs:
268241
- name: Setup node
269242
uses: actions/setup-node@v3
270243
with:
271-
node-version: '16'
244+
node-version: '18'
272245
registry-url: 'https://registry.npmjs.org'
273246
check-latest: true
274247
- name: 'Download Artifacts'
@@ -279,4 +252,4 @@ jobs:
279252
chmod +x publish.sh
280253
./publish.sh
281254
env:
282-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
255+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
# AngularFire
23
The official [Angular](https://angular.io/) library for [Firebase](https://firebase.google.com/).
34

angular.json

+46-44
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,49 @@
11
{
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-angular:ng-packagr",
14-
"options": {
15-
"tsConfig": "tsconfig.json",
16-
"project": "src/package.json"
17-
}
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-angular:ng-packagr",
14+
"options": {
15+
"tsConfig": "tsconfig.json",
16+
"project": "src/ng-package.json"
17+
}
18+
},
19+
"test": {
20+
"builder": "@angular-devkit/build-angular:karma",
21+
"options": {
22+
"polyfills": [
23+
"zone.js",
24+
"zone.js/testing"
25+
],
26+
"tsConfig": "tsconfig.spec.json",
27+
"karmaConfig": "karma.conf.js"
28+
}
29+
},
30+
"lint": {
31+
"builder": "@angular-devkit/build-angular:tslint",
32+
"options": {
33+
"tsConfig": [
34+
"tsconfig.json",
35+
"tsconfig.spec.json"
36+
],
37+
"exclude": [
38+
"**/node_modules/**"
39+
]
40+
}
41+
}
42+
}
43+
}
1844
},
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-
},
42-
"defaultProject": "angularfire",
43-
"cli": {
44-
"packageManager": "yarn",
45-
"analytics": "86795b8f-9036-4a53-929c-a7303453d677"
46-
}
45+
"cli": {
46+
"packageManager": "yarn",
47+
"analytics": "86795b8f-9036-4a53-929c-a7303453d677"
48+
}
4749
}

firebase.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@
1111
},
1212
"emulators": {
1313
"auth": {
14-
"port": 9099
14+
"port": 9098
1515
},
1616
"functions": {
1717
"port": 5001
1818
},
1919
"firestore": {
20-
"port": 8080
20+
"port": 8089
2121
},
2222
"database": {
23-
"port": 9000
23+
"port": 9002
2424
},
2525
"storage": {
2626
"port": 9199

karma.conf.js

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
const dns = require('node:dns');
2+
3+
// The emulator suite fails in CI, only on Node 18.
4+
// This apparently fixes it.
5+
// https://github.com/firebase/firebase-tools/issues/5755#issuecomment-1535445383
6+
dns.setDefaultResultOrder('ipv4first')
7+
18
// Karma configuration file, see link for more information
29
// https://karma-runner.github.io/1.0/config/configuration-file.html
310
module.exports = function (config) {

0 commit comments

Comments
 (0)