Skip to content

Commit a6abd1d

Browse files
authored
Update Firebase, make it a dep rather than peer (#3159)
* 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
1 parent 4c877b1 commit a6abd1d

File tree

96 files changed

+11004
-1395
lines changed

Some content is hidden

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

96 files changed

+11004
-1395
lines changed

.github/workflows/test.yml

+103-16
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ jobs:
4949
if: steps.node_modules_cache.outputs.cache-hit != 'true'
5050
run: |
5151
yarn config set yarn-offline-mirror ~/.npm-packages-offline-cache
52+
yarn config set network-timeout 300000
5253
yarn config set yarn-offline-mirror-pruning true
5354
yarn install --frozen-lockfile --prefer-offline
5455
- name: Build
@@ -67,9 +68,9 @@ jobs:
6768
strategy:
6869
matrix:
6970
os: [ ubuntu-latest, macos-latest, windows-latest ]
70-
node: ["12", "14", "16"]
71+
node: [ "14", "16"]
7172
firebase: ["9"]
72-
firebaseTools: ["9", "10"]
73+
firebaseTools: ["10"]
7374
rxjs: ["6", "7"]
7475
ng: ["12", "13"]
7576
exclude:
@@ -110,6 +111,7 @@ jobs:
110111
- name: Configure yarn
111112
run: |
112113
yarn config set yarn-offline-mirror ~/.npm-packages-offline-cache
114+
yarn config set network-timeout 300000
113115
yarn config set ignore-engines true
114116
- name: Yarn install
115117
if: steps.node_modules_cache.outputs.cache-hit != 'true'
@@ -119,7 +121,15 @@ jobs:
119121
yarn add firebase@${{ matrix.firebase }}
120122
yarn add firebase-tools@${{ matrix.firebaseTools }}
121123
yarn add rxjs@${{ matrix.rxjs }} --prefer-offline
122-
npx ng update @angular/core@${{ matrix.ng }} @angular/cli@${{ matrix.ng }} --allow-dirty --force || true
124+
# Can't update more than one major at a times, take the incremental step
125+
- name: Update to ng@13
126+
run: npx @angular/cli@13 update @angular/core@13 @angular/cli@13 --allow-dirty --force
127+
if: matrix.ng == '14' || matrix.ng == 'next'
128+
continue-on-error: ${{ matrix.os == 'windows-latest' }}
129+
- name: Update to ng@${{ matrix.ng }}
130+
run: npx @angular/cli@${{ matrix.ng }} update @angular/core@${{ matrix.ng }} @angular/cli@${{ matrix.ng }} --allow-dirty --force
131+
if: matrix.ng != '12'
132+
continue-on-error: ${{ matrix.os == 'windows-latest' }}
123133
- name: Firebase emulator cache
124134
uses: actions/cache@v2
125135
with:
@@ -129,25 +139,53 @@ jobs:
129139
uses: actions/download-artifact@v2
130140
- name: Relocate Artifacts
131141
run: mv angularfire-${{ github.run_id }} dist
132-
- name: Test node
142+
- name: Test Node (CJS)
133143
run: |
134144
yarn build:jasmine
135145
yarn test:node
146+
if: matrix.ng == '12'
147+
- name: Test Node (ESM)
148+
run: |
149+
yarn build:jasmine
150+
yarn test:node-esm
151+
if: matrix.ng != '12' && matrix.rxjs == '7'
136152
- name: Test browser
137-
if: matrix.os == 'ubuntu-latest' && matrix.node == '14' && matrix.firebaseTools == '9'
153+
if: matrix.os == 'ubuntu-latest' && matrix.node == '14' && matrix.firebaseTools == '10'
138154
run: yarn test:chrome-headless
155+
- name: ng-build yarn install
156+
run: |
157+
cd ./test/ng-build
158+
yarn --prefer-offline
159+
yarn add firebase@${{ matrix.firebase }}
160+
- name: Update ng-build to ng@13
161+
run: |
162+
cd ./test/ng-build
163+
npx @angular/cli@13 update @angular/core@13 @angular/cli@13 @nguniversal/express-engine@13 --allow-dirty --force
164+
if: matrix.ng == '14' || matrix.ng == 'next'
165+
continue-on-error: ${{ matrix.os == 'windows-latest' }}
166+
- name: Update ng-build to ng@${{ matrix.ng }}
167+
run: |
168+
cd ./test/ng-build
169+
npx @angular/cli@${{ matrix.ng }} update @angular/core@${{ matrix.ng }} @angular/cli@${{ matrix.ng }} @nguniversal/express-engine@${{ matrix.ng }} --allow-dirty --force
170+
if: matrix.ng != '12'
171+
continue-on-error: ${{ matrix.os == 'windows-latest' }}
172+
- name: ng-build prerender
173+
run: |
174+
cd ./test/ng-build
175+
yarn prerender
139176
140177
# TODO dry up
141178
canary:
142179
runs-on: ${{ matrix.os }}
143-
if: ${{ github.ref == 'refs/heads/master' }}
144-
needs: [ 'build', 'test' ]
180+
# if: ${{ github.ref == 'refs/heads/master' }}
181+
# needs: [ 'build', 'test' ]
182+
needs: [ 'build' ]
145183
strategy:
146184
matrix:
147185
os: [ ubuntu-latest ]
148186
node: ["14"]
149187
firebase: ["9", "canary", "next"]
150-
firebaseTools: ["9", "10"]
188+
firebaseTools: ["10"]
151189
rxjs: ["7"]
152190
ng: ["12", "13", "next"]
153191
exclude:
@@ -187,6 +225,7 @@ jobs:
187225
- name: Configure yarn
188226
run: |
189227
yarn config set yarn-offline-mirror ~/.npm-packages-offline-cache
228+
yarn config set network-timeout 300000
190229
yarn config set ignore-engines true
191230
- name: Yarn install
192231
if: steps.node_modules_cache.outputs.cache-hit != 'true'
@@ -196,7 +235,13 @@ jobs:
196235
yarn add firebase@${{ matrix.firebase }}
197236
yarn add firebase-tools@${{ matrix.firebaseTools }}
198237
yarn add rxjs@${{ matrix.rxjs }} --prefer-offline
199-
npx ng update @angular/core@${{ matrix.ng }} @angular/cli@${{ matrix.ng }} --allow-dirty --force || true
238+
# Can't update more than one major at a times, take the incremental step
239+
- name: Update to ng@13
240+
run: npx @angular/cli@13 update @angular/core@13 @angular/cli@13 --allow-dirty --force
241+
if: matrix.ng == '14' || matrix.ng == 'next'
242+
- name: Update to ng@${{ matrix.ng }}
243+
run: npx @angular/cli@${{ matrix.ng }} update @angular/core@${{ matrix.ng }} @angular/cli@${{ matrix.ng }} --allow-dirty --force
244+
if: matrix.ng != '12'
200245
- name: Firebase emulator cache
201246
uses: actions/cache@v2
202247
with:
@@ -206,21 +251,51 @@ jobs:
206251
uses: actions/download-artifact@v2
207252
- name: Relocate Artifacts
208253
run: mv angularfire-${{ github.run_id }} dist
209-
- name: Test node
254+
- name: Test Node (CJS)
210255
run: |
211256
yarn build:jasmine
212257
yarn test:node
258+
if: matrix.ng == '12'
259+
- name: Test Node (ESM)
260+
run: |
261+
yarn build:jasmine
262+
yarn test:node-esm
263+
if: matrix.ng != '12'
213264
- name: Test browser
214-
if: matrix.os == 'ubuntu-latest' && matrix.node == '14' && matrix.firebaseTools == '9'
215265
run: yarn test:chrome-headless
266+
- name: ng-build yarn install
267+
run: |
268+
cd ./test/ng-build
269+
yarn --prefer-offline
270+
yarn add firebase@${{ matrix.firebase }}
271+
# on @canary firebase-admin and firebase database-types conflict, skip the lib check for now
272+
- name: ng-build skipLibCheck
273+
run: |
274+
cd ./test/ng-build
275+
sed -i 's/"skipLibCheck": false,/"skipLibCheck": true,/g' tsconfig.json
276+
if: matrix.firebase == 'canary'
277+
- name: Update ng-build to ng@13
278+
run: |
279+
cd ./test/ng-build
280+
npx @angular/cli@13 update @angular/core@13 @angular/cli@13 @nguniversal/express-engine@13 --allow-dirty --force
281+
if: matrix.ng == 'next'
282+
- name: Update ng-build to ng@${{ matrix.ng }}
283+
run: |
284+
cd ./test/ng-build
285+
npx @angular/cli@${{ matrix.ng }} update @angular/core@${{ matrix.ng }} @angular/cli@${{ matrix.ng }} @nguniversal/express-engine@${{ matrix.ng }} --allow-dirty --force
286+
if: matrix.ng != '12'
287+
- name: ng-build prerender
288+
run: |
289+
cd ./test/ng-build
290+
yarn prerender
216291
217292
contribute:
218293
runs-on: ${{ matrix.os }}
219294
name: Contribute ${{ matrix.os }} on Node.js ${{ matrix.node }}
220295
strategy:
221296
matrix:
222297
os: [ ubuntu-latest, macos-latest, windows-latest ]
223-
node: ["12", "14", "16"]
298+
node: ["14", "16"]
224299
exclude:
225300
# we build with this combination, safely skip
226301
- os: ubuntu-latest
@@ -257,14 +332,18 @@ jobs:
257332
if: steps.node_modules_cache.outputs.cache-hit != 'true'
258333
run: |
259334
yarn config set yarn-offline-mirror ~/.npm-packages-offline-cache
335+
yarn config set network-timeout 300000
260336
yarn config set ignore-engines true
261337
yarn install --frozen-lockfile --prefer-offline
262338
- name: Build
263339
run: yarn build
264-
- name: Test
265-
# TODO figure out why tests are flaking
266-
continue-on-error: true
267-
run: yarn test
340+
- name: Test Node
341+
run: |
342+
npm run build:jasmine
343+
npm run test:node
344+
- name: Test headless
345+
run: yarn test:chrome-headless
346+
continue-on-error: ${{ matrix.os == 'windows-latest' }}
268347

269348
# Break the branch protection test into a seperate step, so we can manage the matrix more easily
270349
test_and_contribute:
@@ -294,3 +373,11 @@ jobs:
294373
./publish.sh
295374
env:
296375
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
376+
377+
notify:
378+
runs-on: ubuntu-latest
379+
name: Notify
380+
needs: ['build', 'test', 'contribute', 'canary']
381+
if: always()
382+
steps:
383+
- run: echo ${{ github.run_id }}

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ angularfire.tgz
2323
unpack.sh
2424
publish.sh
2525
.firebase
26+
.angular
27+
.vscode

CHANGELOG.md

+13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
<a name="7.3.0"></a>
2+
# [7.3.0](https://github.com/angular/angularfire/compare/7.2.1...7.3.0) (2022-03-23)
3+
4+
### Features
5+
6+
* **storage:** adding wrappers for getBlob, getBytes, and getStream ([#3159](https://github.com/angular/angularfire/pull/3159))
7+
8+
### Misc.
9+
10+
* **core:** update firebase dependency ([#3159](https://github.com/angular/angularfire/pull/3159))
11+
* **core:** mark firebase-tools 10 as compatible ([#3159](https://github.com/angular/angularfire/pull/3159))
12+
* **firestore-protos:** no longer needed ([#3159](https://github.com/angular/angularfire/pull/3159))
13+
114
<a name="7.2.1"></a>
215
# [7.2.1](https://github.com/angular/angularfire/compare/7.2.0...7.2.1) (2022-02-10)
316

package.json

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
{
22
"name": "@angular/fire",
3-
"version": "7.2.1",
3+
"version": "7.3.0",
44
"description": "The official Angular library for Firebase.",
55
"private": true,
66
"scripts": {
77
"test": "npm run build:jasmine && npm run test:node && npm run test:chrome-headless",
8-
"test:watch": "firebase emulators:exec --project=angularfire2-test \"ng test --watch=true --browsers=Chrome\"",
9-
"test:chrome": "firebase emulators:exec --project=angularfire2-test \"ng test --watch=false --browsers=Chrome\"",
10-
"test:firefox": "firebase emulators:exec --project=angularfire2-test \"ng test --watch=false --browsers=Firefox\"",
11-
"test:safari": "firebase emulators:exec --project=angularfire2-test \"ng test --watch=false --browsers=SafariNative\"",
12-
"test:chrome-headless": "firebase emulators:exec --project=angularfire2-test \"ng test --watch=false --browsers=ChromeHeadless\"",
13-
"test:firefox-headless": "firebase emulators:exec --project=angularfire2-test \"ng test --watch=false --browsers=FirefoxHeadless\"",
8+
"test:watch": "npx firebase-tools@latest emulators:exec --project=angularfire2-test \"ng test --watch=true --browsers=Chrome\"",
9+
"test:chrome": "npx firebase-tools@latest emulators:exec --project=angularfire2-test \"ng test --watch=false --browsers=Chrome\"",
10+
"test:firefox": "npx firebase-tools@latest emulators:exec --project=angularfire2-test \"ng test --watch=false --browsers=Firefox\"",
11+
"test:safari": "npx firebase-tools@latest emulators:exec --project=angularfire2-test \"ng test --watch=false --browsers=SafariNative\"",
12+
"test:chrome-headless": "npx firebase-tools@latest emulators:exec --project=angularfire2-test \"ng test --watch=false --browsers=ChromeHeadless\"",
13+
"test:firefox-headless": "npx firebase-tools@latest emulators:exec --project=angularfire2-test \"ng test --watch=false --browsers=FirefoxHeadless\"",
1414
"lint": "ng lint",
15-
"test:node": "node -r tsconfig-paths/register ./tools/load-jasmine.js",
15+
"test:node": "node -r tsconfig-paths/register ./dist/out-tsc/jasmine/tools/jasmine.js --input-type=commonjs",
16+
"test:node-esm": "node -r tsconfig-paths/register ./dist/out-tsc/jasmine/tools/jasmine.mjs --input-type=commonjs",
1617
"test:typings": "node ./tools/run-typings-test.js",
1718
"test:build": "bash ./test/ng-build/build.sh",
1819
"test:all": "npm run test:node && npm run test:chrome-headless && npm run test:typings && npm run test:build",
1920
"build": "rimraf dist && ttsc -p tsconfig.build.json && node --trace-warnings ./tools/build.js && npm pack ./dist/packages-dist",
20-
"build:jasmine": "tsc -p tsconfig.jasmine.json && cp ./dist/packages-dist/schematics/versions.json ./dist/out-tsc/jasmine/schematics",
21+
"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",
2122
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1"
2223
},
2324
"husky": {
@@ -53,7 +54,7 @@
5354
"@angular/platform-browser-dynamic": "^12.0.0",
5455
"@angular/router": "^12.0.0",
5556
"@schematics/angular": "^12.0.0",
56-
"firebase": "^9.4.0",
57+
"firebase": "^9.6.9",
5758
"firebase-admin": "^9.11.1",
5859
"firebase-functions": "^3.6.0",
5960
"firebase-tools": "^9.0.0",

samples/advanced/package.json

+3-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/advanced/server.ts

-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)