Skip to content

Commit

Permalink
Update Firebase, make it a dep rather than peer (#3159)
Browse files Browse the repository at this point in the history
* Update Firebase, wrap the storage APIs introduced in 9.5
* Move rxfire and firebase to dep, rather than peers, to better model the NPM requirements for wrapping
* Bump minor, changelog
* Mark firebase-tools 10 peer as compatible
* Clean up the test suite
* Drop the .proto references from firestore-protos and mark as deprecated
  • Loading branch information
jamesdaniels committed Mar 23, 2022
1 parent 4c877b1 commit a6abd1d
Show file tree
Hide file tree
Showing 96 changed files with 11,004 additions and 1,395 deletions.
119 changes: 103 additions & 16 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ jobs:
if: steps.node_modules_cache.outputs.cache-hit != 'true'
run: |
yarn config set yarn-offline-mirror ~/.npm-packages-offline-cache
yarn config set network-timeout 300000
yarn config set yarn-offline-mirror-pruning true
yarn install --frozen-lockfile --prefer-offline
- name: Build
Expand All @@ -67,9 +68,9 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
node: ["12", "14", "16"]
node: [ "14", "16"]
firebase: ["9"]
firebaseTools: ["9", "10"]
firebaseTools: ["10"]
rxjs: ["6", "7"]
ng: ["12", "13"]
exclude:
Expand Down Expand Up @@ -110,6 +111,7 @@ jobs:
- name: Configure yarn
run: |
yarn config set yarn-offline-mirror ~/.npm-packages-offline-cache
yarn config set network-timeout 300000
yarn config set ignore-engines true
- name: Yarn install
if: steps.node_modules_cache.outputs.cache-hit != 'true'
Expand All @@ -119,7 +121,15 @@ jobs:
yarn add firebase@${{ matrix.firebase }}
yarn add firebase-tools@${{ matrix.firebaseTools }}
yarn add rxjs@${{ matrix.rxjs }} --prefer-offline
npx ng update @angular/core@${{ matrix.ng }} @angular/cli@${{ matrix.ng }} --allow-dirty --force || true
# Can't update more than one major at a times, take the incremental step
- name: Update to ng@13
run: npx @angular/cli@13 update @angular/core@13 @angular/cli@13 --allow-dirty --force
if: matrix.ng == '14' || matrix.ng == 'next'
continue-on-error: ${{ matrix.os == 'windows-latest' }}
- name: Update to ng@${{ matrix.ng }}
run: npx @angular/cli@${{ matrix.ng }} update @angular/core@${{ matrix.ng }} @angular/cli@${{ matrix.ng }} --allow-dirty --force
if: matrix.ng != '12'
continue-on-error: ${{ matrix.os == 'windows-latest' }}
- name: Firebase emulator cache
uses: actions/cache@v2
with:
Expand All @@ -129,25 +139,53 @@ jobs:
uses: actions/download-artifact@v2
- name: Relocate Artifacts
run: mv angularfire-${{ github.run_id }} dist
- name: Test node
- name: Test Node (CJS)
run: |
yarn build:jasmine
yarn test:node
if: matrix.ng == '12'
- name: Test Node (ESM)
run: |
yarn build:jasmine
yarn test:node-esm
if: matrix.ng != '12' && matrix.rxjs == '7'
- name: Test browser
if: matrix.os == 'ubuntu-latest' && matrix.node == '14' && matrix.firebaseTools == '9'
if: matrix.os == 'ubuntu-latest' && matrix.node == '14' && matrix.firebaseTools == '10'
run: yarn test:chrome-headless
- name: ng-build yarn install
run: |
cd ./test/ng-build
yarn --prefer-offline
yarn add firebase@${{ matrix.firebase }}
- name: Update ng-build to ng@13
run: |
cd ./test/ng-build
npx @angular/cli@13 update @angular/core@13 @angular/cli@13 @nguniversal/express-engine@13 --allow-dirty --force
if: matrix.ng == '14' || matrix.ng == 'next'
continue-on-error: ${{ matrix.os == 'windows-latest' }}
- name: Update ng-build to ng@${{ matrix.ng }}
run: |
cd ./test/ng-build
npx @angular/cli@${{ matrix.ng }} update @angular/core@${{ matrix.ng }} @angular/cli@${{ matrix.ng }} @nguniversal/express-engine@${{ matrix.ng }} --allow-dirty --force
if: matrix.ng != '12'
continue-on-error: ${{ matrix.os == 'windows-latest' }}
- name: ng-build prerender
run: |
cd ./test/ng-build
yarn prerender
# TODO dry up
canary:
runs-on: ${{ matrix.os }}
if: ${{ github.ref == 'refs/heads/master' }}
needs: [ 'build', 'test' ]
# if: ${{ github.ref == 'refs/heads/master' }}
# needs: [ 'build', 'test' ]
needs: [ 'build' ]
strategy:
matrix:
os: [ ubuntu-latest ]
node: ["14"]
firebase: ["9", "canary", "next"]
firebaseTools: ["9", "10"]
firebaseTools: ["10"]
rxjs: ["7"]
ng: ["12", "13", "next"]
exclude:
Expand Down Expand Up @@ -187,6 +225,7 @@ jobs:
- name: Configure yarn
run: |
yarn config set yarn-offline-mirror ~/.npm-packages-offline-cache
yarn config set network-timeout 300000
yarn config set ignore-engines true
- name: Yarn install
if: steps.node_modules_cache.outputs.cache-hit != 'true'
Expand All @@ -196,7 +235,13 @@ jobs:
yarn add firebase@${{ matrix.firebase }}
yarn add firebase-tools@${{ matrix.firebaseTools }}
yarn add rxjs@${{ matrix.rxjs }} --prefer-offline
npx ng update @angular/core@${{ matrix.ng }} @angular/cli@${{ matrix.ng }} --allow-dirty --force || true
# Can't update more than one major at a times, take the incremental step
- name: Update to ng@13
run: npx @angular/cli@13 update @angular/core@13 @angular/cli@13 --allow-dirty --force
if: matrix.ng == '14' || matrix.ng == 'next'
- name: Update to ng@${{ matrix.ng }}
run: npx @angular/cli@${{ matrix.ng }} update @angular/core@${{ matrix.ng }} @angular/cli@${{ matrix.ng }} --allow-dirty --force
if: matrix.ng != '12'
- name: Firebase emulator cache
uses: actions/cache@v2
with:
Expand All @@ -206,21 +251,51 @@ jobs:
uses: actions/download-artifact@v2
- name: Relocate Artifacts
run: mv angularfire-${{ github.run_id }} dist
- name: Test node
- name: Test Node (CJS)
run: |
yarn build:jasmine
yarn test:node
if: matrix.ng == '12'
- name: Test Node (ESM)
run: |
yarn build:jasmine
yarn test:node-esm
if: matrix.ng != '12'
- name: Test browser
if: matrix.os == 'ubuntu-latest' && matrix.node == '14' && matrix.firebaseTools == '9'
run: yarn test:chrome-headless
- name: ng-build yarn install
run: |
cd ./test/ng-build
yarn --prefer-offline
yarn add firebase@${{ matrix.firebase }}
# on @canary firebase-admin and firebase database-types conflict, skip the lib check for now
- name: ng-build skipLibCheck
run: |
cd ./test/ng-build
sed -i 's/"skipLibCheck": false,/"skipLibCheck": true,/g' tsconfig.json
if: matrix.firebase == 'canary'
- name: Update ng-build to ng@13
run: |
cd ./test/ng-build
npx @angular/cli@13 update @angular/core@13 @angular/cli@13 @nguniversal/express-engine@13 --allow-dirty --force
if: matrix.ng == 'next'
- name: Update ng-build to ng@${{ matrix.ng }}
run: |
cd ./test/ng-build
npx @angular/cli@${{ matrix.ng }} update @angular/core@${{ matrix.ng }} @angular/cli@${{ matrix.ng }} @nguniversal/express-engine@${{ matrix.ng }} --allow-dirty --force
if: matrix.ng != '12'
- name: ng-build prerender
run: |
cd ./test/ng-build
yarn prerender
contribute:
runs-on: ${{ matrix.os }}
name: Contribute ${{ matrix.os }} on Node.js ${{ matrix.node }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
node: ["12", "14", "16"]
node: ["14", "16"]
exclude:
# we build with this combination, safely skip
- os: ubuntu-latest
Expand Down Expand Up @@ -257,14 +332,18 @@ jobs:
if: steps.node_modules_cache.outputs.cache-hit != 'true'
run: |
yarn config set yarn-offline-mirror ~/.npm-packages-offline-cache
yarn config set network-timeout 300000
yarn config set ignore-engines true
yarn install --frozen-lockfile --prefer-offline
- name: Build
run: yarn build
- name: Test
# TODO figure out why tests are flaking
continue-on-error: true
run: yarn test
- name: Test Node
run: |
npm run build:jasmine
npm run test:node
- name: Test headless
run: yarn test:chrome-headless
continue-on-error: ${{ matrix.os == 'windows-latest' }}

# Break the branch protection test into a seperate step, so we can manage the matrix more easily
test_and_contribute:
Expand Down Expand Up @@ -294,3 +373,11 @@ jobs:
./publish.sh
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

notify:
runs-on: ubuntu-latest
name: Notify
needs: ['build', 'test', 'contribute', 'canary']
if: always()
steps:
- run: echo ${{ github.run_id }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ angularfire.tgz
unpack.sh
publish.sh
.firebase
.angular
.vscode
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
<a name="7.3.0"></a>
# [7.3.0](https://github.com/angular/angularfire/compare/7.2.1...7.3.0) (2022-03-23)

### Features

* **storage:** adding wrappers for getBlob, getBytes, and getStream ([#3159](https://github.com/angular/angularfire/pull/3159))

### Misc.

* **core:** update firebase dependency ([#3159](https://github.com/angular/angularfire/pull/3159))
* **core:** mark firebase-tools 10 as compatible ([#3159](https://github.com/angular/angularfire/pull/3159))
* **firestore-protos:** no longer needed ([#3159](https://github.com/angular/angularfire/pull/3159))

<a name="7.2.1"></a>
# [7.2.1](https://github.com/angular/angularfire/compare/7.2.0...7.2.1) (2022-02-10)

Expand Down
21 changes: 11 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
{
"name": "@angular/fire",
"version": "7.2.1",
"version": "7.3.0",
"description": "The official Angular library for Firebase.",
"private": true,
"scripts": {
"test": "npm run build:jasmine && npm run test:node && npm run test:chrome-headless",
"test:watch": "firebase emulators:exec --project=angularfire2-test \"ng test --watch=true --browsers=Chrome\"",
"test:chrome": "firebase emulators:exec --project=angularfire2-test \"ng test --watch=false --browsers=Chrome\"",
"test:firefox": "firebase emulators:exec --project=angularfire2-test \"ng test --watch=false --browsers=Firefox\"",
"test:safari": "firebase emulators:exec --project=angularfire2-test \"ng test --watch=false --browsers=SafariNative\"",
"test:chrome-headless": "firebase emulators:exec --project=angularfire2-test \"ng test --watch=false --browsers=ChromeHeadless\"",
"test:firefox-headless": "firebase emulators:exec --project=angularfire2-test \"ng test --watch=false --browsers=FirefoxHeadless\"",
"test:watch": "npx firebase-tools@latest emulators:exec --project=angularfire2-test \"ng test --watch=true --browsers=Chrome\"",
"test:chrome": "npx firebase-tools@latest emulators:exec --project=angularfire2-test \"ng test --watch=false --browsers=Chrome\"",
"test:firefox": "npx firebase-tools@latest emulators:exec --project=angularfire2-test \"ng test --watch=false --browsers=Firefox\"",
"test:safari": "npx firebase-tools@latest emulators:exec --project=angularfire2-test \"ng test --watch=false --browsers=SafariNative\"",
"test:chrome-headless": "npx firebase-tools@latest emulators:exec --project=angularfire2-test \"ng test --watch=false --browsers=ChromeHeadless\"",
"test:firefox-headless": "npx firebase-tools@latest emulators:exec --project=angularfire2-test \"ng test --watch=false --browsers=FirefoxHeadless\"",
"lint": "ng lint",
"test:node": "node -r tsconfig-paths/register ./tools/load-jasmine.js",
"test:node": "node -r tsconfig-paths/register ./dist/out-tsc/jasmine/tools/jasmine.js --input-type=commonjs",
"test:node-esm": "node -r tsconfig-paths/register ./dist/out-tsc/jasmine/tools/jasmine.mjs --input-type=commonjs",
"test:typings": "node ./tools/run-typings-test.js",
"test:build": "bash ./test/ng-build/build.sh",
"test:all": "npm run test:node && npm run test:chrome-headless && npm run test:typings && npm run test:build",
"build": "rimraf dist && ttsc -p tsconfig.build.json && node --trace-warnings ./tools/build.js && npm pack ./dist/packages-dist",
"build:jasmine": "tsc -p tsconfig.jasmine.json && cp ./dist/packages-dist/schematics/versions.json ./dist/out-tsc/jasmine/schematics",
"build:jasmine": "npx tsc -p tsconfig.jasmine.json --module es2015 && cp ./dist/out-tsc/jasmine/tools/jasmine.js ./dist/out-tsc/jasmine/tools/jasmine.mjs && npx tsc -p tsconfig.jasmine.json && cp ./dist/packages-dist/schematics/versions.json ./dist/out-tsc/jasmine/schematics",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1"
},
"husky": {
Expand Down Expand Up @@ -53,7 +54,7 @@
"@angular/platform-browser-dynamic": "^12.0.0",
"@angular/router": "^12.0.0",
"@schematics/angular": "^12.0.0",
"firebase": "^9.4.0",
"firebase": "^9.6.9",
"firebase-admin": "^9.11.1",
"firebase-functions": "^3.6.0",
"firebase-tools": "^9.0.0",
Expand Down
7 changes: 3 additions & 4 deletions samples/advanced/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions samples/advanced/server.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a6abd1d

Please sign in to comment.