Skip to content

Commit 7875df9

Browse files
authored
chore(release): 7.0.1 (#2908)
### Bug fixes * **messaging:** `onMessage` will no longer destablize the Angular Zone * **core:** Injected Classes now have a better fallback pattern for finding defaults, [#2909](#2909) allowing use of emulators and other config options as expected * **schematic:** upgrade schematic will no longer rewrite `.ts` files outside of your project root, [#2907](#2907) ### Misc * **changelog(7.0.0):** break notice for `compat/auth#useEmulator` * **changelog(7.0.0):** feature of `compat/storage#useEmulator` * **changelog(7.0.1):** Added entry * **sample(modular):** Adding `connectEmulator` examples * **sample(compat):** Cleaned up the service worker registration * **functions:** defensively load auth first, if provided * **storage:** defensively load auth first, if provided * **compat/firestore:** clean up how auth is initialized * **compat/database:** clean up how auth is initialized
1 parent b32f463 commit 7875df9

30 files changed

+1064
-856
lines changed

CHANGELOG.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
<a name="7.0.1"></a>
2+
# [7.0.1](https://github.com/angular/angularfire2/compare/7.0.0...7.0.1) (2021-08-30)
3+
4+
### Bug fixes
5+
6+
* **messaging:** `onMessage` will no longer destablize the Angular Zone
7+
* **core:** Injected Classes now have a better fallback pattern for finding defaults, [#2909](https://github.com/angular/angularfire/issues/2909) allowing use of emulators and other config options as expected
8+
* **schematic:** upgrade schematic will no longer rewrite `.ts` files outside of your project root, [#2907](https://github.com/angular/angularfire/issues/2907)
9+
110
<a name="7.0.0"></a>
211
# [7.0.0](https://github.com/angular/angularfire2/compare/6.1.5...7.0.0) (2021-08-25)
312

@@ -7,8 +16,12 @@
716
* AngularFire now only works in Ivy applications
817
* Firebase JS SDK v9 is required
918
* The existing AngularFire v6 API surface has moved from `@angular/fire/*` to `@angular/fire/compat/*` (see compatibility mode)
19+
* **compat/auth:** `USE_EMULATOR` DI token is now in the form of `['http://localhost:9099']`
20+
21+
### Features
22+
1023
* New modular API surface available at `@angular/fire/*`
11-
* Various cleanup
24+
* **compat/storage:** `USE_EMULATOR` DI token
1225

1326
[See the v7 upgrade guide for more information.](https://github.com/angular/angularfire/blob/master/docs/version-7-upgrade.md)
1427

docs/version-7-upgrade.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Intended to be run with Angular 12, AngularFire 7.0 allows you to take full advt
1010
* AngularFire now only works in Ivy applications
1111
* Firebase JS SDK v9 is required
1212
* The existing AngularFire v6 API surface has moved from `@angular/fire/*` to `@angular/fire/compat/*` (see compatibility mode)
13+
* **compat/auth:** `USE_EMULATOR` DI token is now in the form of `['http://localhost:9099']`
1314

1415
## Compatibility mode
1516

@@ -216,7 +217,7 @@ collection<T>(docRef, 'bar') // CollectionReference<T>
216217

217218
```ts
218219
import { docSnapshots } from '@angular/fire/firestore';
219-
docSnapshot<T>(docRef) // Observable<DocumentSnapshot<T>>
220+
docSnapshots<T>(docRef) // Observable<DocumentSnapshot<T>>
220221
```
221222
</td>
222223

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@angular/fire",
3-
"version": "7.0.0",
3+
"version": "7.0.1",
44
"description": "The official Angular library for Firebase.",
55
"private": true,
66
"scripts": {

sample-compat/firebase.json

+3
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@
5252
"auth": {
5353
"port": 9099
5454
},
55+
"storage": {
56+
"port": 9199
57+
},
5558
"ui": {
5659
"enabled": true
5760
}

sample-compat/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@
3333
"@nguniversal/express-engine": "12.1.0",
3434
"core-js": "^3.6.5",
3535
"cross-fetch": "^3.1.4",
36-
"firebase": "9.0.0-202172505352",
36+
"firebase": "^9.0.0",
3737
"first-input-delay": "^0.1.3",
3838
"proxy-polyfill": "^0.3.2",
39-
"rxfire": "6.0.0-rc.1",
39+
"rxfire": "^6.0.0",
4040
"rxjs": "~6.6.0",
4141
"tslib": "^2.1.0",
4242
"whatwg-fetch": "^3.4.1",

sample-compat/src/app/app.module.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
import { FirestoreComponent } from './firestore/firestore.component';
2222
import { AngularFireDatabaseModule, USE_EMULATOR as USE_DATABASE_EMULATOR } from '@angular/fire/compat/database';
2323
import { AngularFirestoreModule, USE_EMULATOR as USE_FIRESTORE_EMULATOR, SETTINGS as FIRESTORE_SETTINGS } from '@angular/fire/compat/firestore';
24-
import { AngularFireStorageModule } from '@angular/fire/compat/storage';
24+
import { AngularFireStorageModule, USE_EMULATOR as USE_STORAGE_EMULATOR } from '@angular/fire/compat/storage';
2525
import { AngularFireAuthModule, USE_DEVICE_LANGUAGE, USE_EMULATOR as USE_AUTH_EMULATOR } from '@angular/fire/compat/auth';
2626
import { AngularFireMessagingModule, SERVICE_WORKER, VAPID_KEY } from '@angular/fire/compat/messaging';
2727
import { AngularFireFunctionsModule, USE_EMULATOR as USE_FUNCTIONS_EMULATOR, ORIGIN as FUNCTIONS_ORIGIN } from '@angular/fire/compat/functions';
@@ -78,19 +78,19 @@ import { UpboatsComponent } from './upboats/upboats.component';
7878
{ provide: FIRESTORE_SETTINGS, useValue: { ignoreUndefinedProperties: true } },
7979
{ provide: ANALYTICS_DEBUG_MODE, useValue: true },
8080
{ provide: COLLECTION_ENABLED, useValue: true },
81-
{ provide: USE_AUTH_EMULATOR, useValue: environment.useEmulators ? ['localhost', 9099] : undefined },
81+
{ provide: USE_AUTH_EMULATOR, useValue: environment.useEmulators ? ['http://localhost:9099'] : undefined },
8282
{ provide: USE_DATABASE_EMULATOR, useValue: environment.useEmulators ? ['localhost', 9000] : undefined },
8383
{ provide: USE_FIRESTORE_EMULATOR, useValue: environment.useEmulators ? ['localhost', 8080] : undefined },
8484
{ provide: USE_FUNCTIONS_EMULATOR, useValue: environment.useEmulators ? ['localhost', 5001] : undefined },
85+
{ provide: USE_STORAGE_EMULATOR, useValue: environment.useEmulators ? ['localhost', 9199] : undefined },
8586
{ provide: FUNCTIONS_ORIGIN, useFactory: () => isDevMode() || typeof location === 'undefined' ? undefined : location.origin },
8687
{ provide: REMOTE_CONFIG_SETTINGS, useFactory: () => isDevMode() ? { minimumFetchIntervalMillis: 10_000 } : {} },
8788
{ provide: REMOTE_CONFIG_DEFAULTS, useValue: { background_color: 'red' } },
8889
{ provide: USE_DEVICE_LANGUAGE, useValue: true },
8990
{ provide: VAPID_KEY, useValue: environment.vapidKey },
90-
{ provide: SERVICE_WORKER, useFactory: () => typeof navigator !== 'undefined' && navigator.serviceWorker?.getRegistration('firebase-messaging-sw.js') || undefined },
91+
{ provide: SERVICE_WORKER, useFactory: () => typeof navigator !== 'undefined' && navigator.serviceWorker?.register('firebase-messaging-sw.js') || undefined },
9192
{ provide: APP_VERSION, useValue: '0.0.0' },
9293
{ provide: APP_NAME, useValue: 'Angular' },
93-
{ provide: APP_INITIALIZER, useValue: () => typeof navigator !== 'undefined' && navigator.serviceWorker?.register('firebase-messaging-sw.js').catch(() => undefined) || Promise.resolve(), multi: true },
9494
],
9595
bootstrap: [AppComponent]
9696
})

0 commit comments

Comments
 (0)