Skip to content

Commit

Permalink
Update to Angular 16, TypeScript 5, and latest Firebase SDK (#3402)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
davideast authored Aug 28, 2023
1 parent 34e89a4 commit e04cd7f
Show file tree
Hide file tree
Showing 99 changed files with 5,721 additions and 7,509 deletions.
51 changes: 12 additions & 39 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,20 @@ jobs:
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '16'
node-version: '18'
check-latest: true
- name: node_modules cache
uses: actions/cache@v3
id: node_modules_cache
with:
path: ./node_modules
key: ${{ runner.os }}-16-12-9-9-6-node_modules-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-16-12-9-9-6-node_modules-
${{ runner.os }}-16-12-9-9-
${{ runner.os }}-16-12-9-
${{ runner.os }}-16-12-
${{ runner.os }}-16-
- name: Yarn offline cache
if: steps.node_modules_cache.outputs.cache-hit != 'true'
uses: actions/cache@v3
with:
path: ~/.npm-packages-offline-cache
key: yarn-offline-${{ hashFiles('**/yarn.lock') }}
restore-keys: yarn-offline
- name: Install deps
if: steps.node_modules_cache.outputs.cache-hit != 'true'
run: |
Expand All @@ -70,7 +63,7 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
node: ["16", "18", "20"]
node: ["18", "20"]
fail-fast: false
name: Test Node ${{ matrix.node }} (${{ matrix.os }})
steps:
Expand All @@ -86,19 +79,12 @@ jobs:
uses: actions/cache@v3
with:
path: ./node_modules
key: ${{ runner.os }}-${{ matrix.node }}-16-9-12-7-node_modules-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.node }}-16-9-12-7-node_modules-
${{ runner.os }}-${{ matrix.node }}-16-9-12-
${{ runner.os }}-${{ matrix.node }}-16-9-
${{ runner.os }}-${{ matrix.node }}-16-
${{ runner.os }}-${{ matrix.node }}-
key: ${{ runner.os }}-${{ matrix.node }}-16-9-12-8-node_modules-${{ hashFiles('yarn.lock') }}
- name: Yarn offline cache
uses: actions/cache@v3
with:
path: ~/.npm-packages-offline-cache
key: yarn-offline-${{ hashFiles('**/yarn.lock') }}
restore-keys: yarn-offline
- name: Configure yarn
run: |
yarn config set yarn-offline-mirror ~/.npm-packages-offline-cache
Expand Down Expand Up @@ -132,16 +118,17 @@ jobs:
matrix:
os: [ ubuntu-latest ]
browser: [ chrome-headless, firefox-headless ]
include:
- os: macos-latest
browser: safari
# TODO(davideast): Figure out why Safari tests timeout only on CI
# include:
# - os: macos-latest
# browser: safari
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
check-latest: true
- name: Setup java
uses: actions/setup-java@v3
Expand All @@ -153,19 +140,12 @@ jobs:
uses: actions/cache@v3
with:
path: ./node_modules
key: ${{ runner.os }}-${{ matrix.node }}-16-9-12-7-node_modules-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.node }}-16-9-12-7-node_modules-
${{ runner.os }}-${{ matrix.node }}-16-9-12-
${{ runner.os }}-${{ matrix.node }}-16-9-
${{ runner.os }}-${{ matrix.node }}-16-
${{ runner.os }}-${{ matrix.node }}-
key: ${{ runner.os }}-${{ matrix.node }}-16-9-12-8-node_modules-${{ hashFiles('yarn.lock') }}
- name: Yarn offline cache
uses: actions/cache@v3
with:
path: ~/.npm-packages-offline-cache
key: yarn-offline-${{ hashFiles('**/yarn.lock') }}
restore-keys: yarn-offline
- name: Configure yarn
run: |
yarn config set yarn-offline-mirror ~/.npm-packages-offline-cache
Expand All @@ -192,7 +172,7 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
node: ["16"]
node: ["18"]
fail-fast: false
steps:
- name: Checkout
Expand All @@ -208,19 +188,12 @@ jobs:
with:
path: ./node_modules
key: ${{ runner.os }}-${{ matrix.node }}-12-9-9-6-node_modules-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.node }}-12-9-9-6-node_modules-
${{ runner.os }}-${{ matrix.node }}-12-9-9-
${{ runner.os }}-${{ matrix.node }}-12-9-
${{ runner.os }}-${{ matrix.node }}-12-
${{ runner.os }}-${{ matrix.node }}-
- name: Yarn offline cache
if: steps.node_modules_cache.outputs.cache-hit != 'true'
uses: actions/cache@v3
with:
path: ~/.npm-packages-offline-cache
key: yarn-offline-${{ hashFiles('**/yarn.lock') }}
restore-keys: yarn-offline
- name: Install deps
if: steps.node_modules_cache.outputs.cache-hit != 'true'
run: |
Expand Down Expand Up @@ -268,7 +241,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '16'
node-version: '18'
registry-url: 'https://registry.npmjs.org'
check-latest: true
- name: 'Download Artifacts'
Expand All @@ -279,4 +252,4 @@ jobs:
chmod +x publish.sh
./publish.sh
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

# AngularFire
The official [Angular](https://angular.io/) library for [Firebase](https://firebase.google.com/).

Expand Down
90 changes: 46 additions & 44 deletions angular.json
Original file line number Diff line number Diff line change
@@ -1,47 +1,49 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": ".",
"projects": {
"angularfire": {
"projectType": "library",
"root": "src",
"sourceRoot": "src",
"prefix": "angularfire",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"tsConfig": "tsconfig.json",
"project": "src/package.json"
}
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": ".",
"projects": {
"angularfire": {
"projectType": "library",
"root": "src",
"sourceRoot": "src",
"prefix": "angularfire",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"tsConfig": "tsconfig.json",
"project": "src/ng-package.json"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"polyfills": [
"zone.js",
"zone.js/testing"
],
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"tsconfig.json",
"tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"tsconfig.json",
"tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"defaultProject": "angularfire",
"cli": {
"packageManager": "yarn",
"analytics": "86795b8f-9036-4a53-929c-a7303453d677"
}
"cli": {
"packageManager": "yarn",
"analytics": "86795b8f-9036-4a53-929c-a7303453d677"
}
}
6 changes: 3 additions & 3 deletions firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
},
"emulators": {
"auth": {
"port": 9099
"port": 9098
},
"functions": {
"port": 5001
},
"firestore": {
"port": 8080
"port": 8089
},
"database": {
"port": 9000
"port": 9002
},
"storage": {
"port": 9199
Expand Down
7 changes: 7 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
const dns = require('node:dns');

// The emulator suite fails in CI, only on Node 18.
// This apparently fixes it.
// https://github.com/firebase/firebase-tools/issues/5755#issuecomment-1535445383
dns.setDefaultResultOrder('ipv4first')

// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
Expand Down
Loading

0 comments on commit e04cd7f

Please sign in to comment.