@angular/fire 7.6.1 → 16.0.0-canary.e04cd7f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/analytics/is-analytics-supported-factory.d.ts +4 -0
- package/auth-guard/auth-guard.d.ts +4 -4
- package/compat/auth/auth.d.ts +1 -1
- package/compat/auth-guard/auth-guard.d.ts +6 -4
- package/compat/database/interfaces.d.ts +12 -12
- package/compat/firestore/interfaces.d.ts +17 -17
- package/compat/proxy.d.ts +8 -8
- package/compat/remote-config/interfaces.d.ts +1 -1
- package/compat/storage/interfaces.d.ts +8 -8
- package/compat/storage/pipes/storageUrl.pipe.d.ts +1 -1
- package/core.d.ts +1 -12
- package/esm2022/analytics/analytics.module.mjs +94 -0
- package/esm2022/analytics/is-analytics-supported-factory.mjs +16 -0
- package/esm2022/analytics/overrides.mjs +3 -0
- package/esm2022/analytics/screen-tracking.service.mjs +147 -0
- package/esm2022/analytics/user-tracking.service.mjs +44 -0
- package/esm2022/app/app.module.mjs +84 -0
- package/esm2022/app-check/app-check.module.mjs +80 -0
- package/{esm2015/auth/auth.module.js → esm2022/auth/auth.module.mjs} +8 -8
- package/esm2022/auth-guard/auth-guard.mjs +51 -0
- package/{esm2015/auth-guard/auth-guard.module.js → esm2022/auth-guard/auth-guard.module.mjs} +5 -5
- package/esm2022/compat/analytics/analytics.mjs +161 -0
- package/{esm2015/compat/analytics/analytics.module.js → esm2022/compat/analytics/analytics.module.mjs} +5 -5
- package/esm2022/compat/analytics/screen-tracking.service.mjs +49 -0
- package/esm2022/compat/analytics/user-tracking.service.mjs +53 -0
- package/esm2022/compat/auth/auth.mjs +161 -0
- package/{esm2015/compat/auth/auth.module.js → esm2022/compat/auth/auth.module.mjs} +5 -5
- package/{esm2015/compat/auth/public_api.js → esm2022/compat/auth/public_api.mjs} +1 -1
- package/esm2022/compat/auth-guard/auth-guard.mjs +51 -0
- package/{esm2015/compat/auth-guard/auth-guard.module.js → esm2022/compat/auth-guard/auth-guard.module.mjs} +5 -5
- package/{esm2015/compat/cache.js → esm2022/compat/cache.mjs} +3 -3
- package/esm2022/compat/database/database.mjs +119 -0
- package/{esm2015/compat/database/database.module.js → esm2022/compat/database/database.module.mjs} +5 -5
- package/esm2022/compat/database/list/create-reference.mjs +44 -0
- package/{esm2015/compat/firebase.app.module.js → esm2022/compat/firebase.app.module.mjs} +11 -11
- package/esm2022/compat/firestore/collection/changes.mjs +108 -0
- package/esm2022/compat/firestore/collection/collection.mjs +123 -0
- package/esm2022/compat/firestore/collection-group/collection-group.mjs +86 -0
- package/esm2022/compat/firestore/document/document.mjs +87 -0
- package/esm2022/compat/firestore/firestore.mjs +257 -0
- package/{esm2015/compat/firestore/firestore.module.js → esm2022/compat/firestore/firestore.module.mjs} +5 -5
- package/esm2022/compat/firestore/interfaces.mjs +2 -0
- package/esm2022/compat/firestore/observable/fromRef.mjs +40 -0
- package/esm2022/compat/functions/functions.mjs +69 -0
- package/{esm2015/compat/functions/functions.module.js → esm2022/compat/functions/functions.module.mjs} +5 -5
- package/{esm2015/compat/functions/public_api.js → esm2022/compat/functions/public_api.mjs} +1 -1
- package/esm2022/compat/messaging/messaging.mjs +80 -0
- package/{esm2015/compat/messaging/messaging.module.js → esm2022/compat/messaging/messaging.module.mjs} +5 -5
- package/{esm2015/compat/performance/performance.js → esm2022/compat/performance/performance.mjs} +7 -6
- package/{esm2015/compat/performance/performance.module.js → esm2022/compat/performance/performance.module.mjs} +5 -5
- package/esm2022/compat/performance/performance.service.mjs +27 -0
- package/esm2022/compat/proxy.mjs +59 -0
- package/esm2022/compat/remote-config/remote-config.mjs +207 -0
- package/{esm2015/compat/remote-config/remote-config.module.js → esm2022/compat/remote-config/remote-config.module.mjs} +5 -5
- package/esm2022/compat/storage/pipes/storageUrl.pipe.mjs +58 -0
- package/esm2022/compat/storage/storage.mjs +95 -0
- package/{esm2015/compat/storage/storage.module.js → esm2022/compat/storage/storage.module.mjs} +5 -5
- package/esm2022/core.mjs +37 -0
- package/{esm2015/database/database.module.js → esm2022/database/database.module.mjs} +8 -8
- package/{esm2015/firestore/firestore.module.js → esm2022/firestore/firestore.module.mjs} +8 -8
- package/{esm2015/firestore/lite/lite.module.js → esm2022/firestore/lite/lite.module.mjs} +8 -8
- package/esm2022/firestore/rxfire.mjs +15 -0
- package/{esm2015/functions/functions.module.js → esm2022/functions/functions.module.mjs} +8 -8
- package/esm2022/messaging/is-messaging-supported-factory.mjs +16 -0
- package/esm2022/messaging/messaging.module.mjs +86 -0
- package/esm2022/messaging/overrides.mjs +3 -0
- package/{esm2015/performance/performance.module.js → esm2022/performance/performance.module.mjs} +8 -8
- package/esm2022/remote-config/is-remote-config-supported-factory.mjs +16 -0
- package/esm2022/remote-config/overrides.mjs +3 -0
- package/esm2022/remote-config/remote-config.module.mjs +86 -0
- package/{esm2015/storage/storage.module.js → esm2022/storage/storage.module.mjs} +8 -8
- package/esm2022/zones.mjs +196 -0
- package/{fesm2015/angular-fire-analytics.js → fesm2022/angular-fire-analytics.mjs} +61 -38
- package/fesm2022/angular-fire-analytics.mjs.map +1 -0
- package/{fesm2015/angular-fire-app-check.js → fesm2022/angular-fire-app-check.mjs} +9 -10
- package/fesm2022/angular-fire-app-check.mjs.map +1 -0
- package/{fesm2015/angular-fire-app.js → fesm2022/angular-fire-app.mjs} +8 -8
- package/fesm2022/angular-fire-app.mjs.map +1 -0
- package/{fesm2015/angular-fire-auth-guard.js → fesm2022/angular-fire-auth-guard.mjs} +25 -23
- package/fesm2022/angular-fire-auth-guard.mjs.map +1 -0
- package/{fesm2015/angular-fire-auth.js → fesm2022/angular-fire-auth.mjs} +8 -8
- package/fesm2022/angular-fire-auth.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat-analytics.js → fesm2022/angular-fire-compat-analytics.mjs} +28 -28
- package/fesm2022/angular-fire-compat-analytics.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat-auth-guard.js → fesm2022/angular-fire-compat-auth-guard.mjs} +25 -23
- package/fesm2022/angular-fire-compat-auth-guard.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat-auth.js → fesm2022/angular-fire-compat-auth.mjs} +32 -10
- package/fesm2022/angular-fire-compat-auth.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat-database.js → fesm2022/angular-fire-compat-database.mjs} +17 -12
- package/fesm2022/angular-fire-compat-database.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat-firestore.js → fesm2022/angular-fire-compat-firestore.mjs} +37 -16
- package/fesm2022/angular-fire-compat-firestore.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat-functions.js → fesm2022/angular-fire-compat-functions.mjs} +10 -9
- package/fesm2022/angular-fire-compat-functions.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat-messaging.js → fesm2022/angular-fire-compat-messaging.mjs} +20 -15
- package/fesm2022/angular-fire-compat-messaging.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat-performance.js → fesm2022/angular-fire-compat-performance.mjs} +16 -15
- package/fesm2022/angular-fire-compat-performance.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat-remote-config.js → fesm2022/angular-fire-compat-remote-config.mjs} +33 -19
- package/fesm2022/angular-fire-compat-remote-config.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat-storage.js → fesm2022/angular-fire-compat-storage.mjs} +23 -18
- package/fesm2022/angular-fire-compat-storage.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat.js → fesm2022/angular-fire-compat.mjs} +15 -17
- package/fesm2022/angular-fire-compat.mjs.map +1 -0
- package/{fesm2015/angular-fire-database.js → fesm2022/angular-fire-database.mjs} +8 -8
- package/fesm2022/angular-fire-database.mjs.map +1 -0
- package/{fesm2015/angular-fire-firestore-lite.js → fesm2022/angular-fire-firestore-lite.mjs} +8 -8
- package/fesm2022/angular-fire-firestore-lite.mjs.map +1 -0
- package/{fesm2015/angular-fire-firestore.js → fesm2022/angular-fire-firestore.mjs} +12 -10
- package/fesm2022/angular-fire-firestore.mjs.map +1 -0
- package/{fesm2015/angular-fire-functions.js → fesm2022/angular-fire-functions.mjs} +8 -8
- package/fesm2022/angular-fire-functions.mjs.map +1 -0
- package/{fesm2015/angular-fire-messaging.js → fesm2022/angular-fire-messaging.mjs} +33 -19
- package/fesm2022/angular-fire-messaging.mjs.map +1 -0
- package/{fesm2015/angular-fire-performance.js → fesm2022/angular-fire-performance.mjs} +8 -8
- package/fesm2022/angular-fire-performance.mjs.map +1 -0
- package/{fesm2015/angular-fire-remote-config.js → fesm2022/angular-fire-remote-config.mjs} +34 -20
- package/fesm2022/angular-fire-remote-config.mjs.map +1 -0
- package/{fesm2015/angular-fire-storage.js → fesm2022/angular-fire-storage.mjs} +8 -8
- package/fesm2022/angular-fire-storage.mjs.map +1 -0
- package/{fesm2015/angular-fire.js → fesm2022/angular-fire.mjs} +23 -52
- package/fesm2022/angular-fire.mjs.map +1 -0
- package/firestore/rxfire.d.ts +3 -1
- package/messaging/is-messaging-supported-factory.d.ts +4 -0
- package/package.json +158 -7
- package/publish.sh +1 -0
- package/remote-config/is-remote-config-supported-factory.d.ts +4 -0
- package/schematics/add/index.js +1 -1
- package/schematics/common.js +8 -4
- package/schematics/deploy/actions.js +59 -59
- package/schematics/deploy/builder.js +5 -5
- package/schematics/firebaseTools.js +9 -5
- package/schematics/setup/index.js +24 -23
- package/schematics/setup/prompts.js +20 -15
- package/schematics/update/v7/index.js +5 -5
- package/schematics/utils.js +30 -30
- package/README.md +0 -216
- package/analytics/package.json +0 -11
- package/app/package.json +0 -11
- package/app-check/package.json +0 -11
- package/auth/package.json +0 -11
- package/auth-guard/package.json +0 -11
- package/bundles/angular-fire-analytics.umd.js +0 -673
- package/bundles/angular-fire-analytics.umd.js.map +0 -1
- package/bundles/angular-fire-app-check.umd.js +0 -465
- package/bundles/angular-fire-app-check.umd.js.map +0 -1
- package/bundles/angular-fire-app.umd.js +0 -477
- package/bundles/angular-fire-app.umd.js.map +0 -1
- package/bundles/angular-fire-auth-guard.umd.js +0 -109
- package/bundles/angular-fire-auth-guard.umd.js.map +0 -1
- package/bundles/angular-fire-auth.umd.js +0 -557
- package/bundles/angular-fire-auth.umd.js.map +0 -1
- package/bundles/angular-fire-compat-analytics.umd.js +0 -672
- package/bundles/angular-fire-compat-analytics.umd.js.map +0 -1
- package/bundles/angular-fire-compat-auth-guard.umd.js +0 -112
- package/bundles/angular-fire-compat-auth-guard.umd.js.map +0 -1
- package/bundles/angular-fire-compat-auth.umd.js +0 -559
- package/bundles/angular-fire-compat-auth.umd.js.map +0 -1
- package/bundles/angular-fire-compat-database.umd.js +0 -799
- package/bundles/angular-fire-compat-database.umd.js.map +0 -1
- package/bundles/angular-fire-compat-firestore.umd.js +0 -1073
- package/bundles/angular-fire-compat-firestore.umd.js.map +0 -1
- package/bundles/angular-fire-compat-functions.umd.js +0 -443
- package/bundles/angular-fire-compat-functions.umd.js.map +0 -1
- package/bundles/angular-fire-compat-messaging.umd.js +0 -465
- package/bundles/angular-fire-compat-messaging.umd.js.map +0 -1
- package/bundles/angular-fire-compat-performance.umd.js +0 -212
- package/bundles/angular-fire-compat-performance.umd.js.map +0 -1
- package/bundles/angular-fire-compat-remote-config.umd.js +0 -605
- package/bundles/angular-fire-compat-remote-config.umd.js.map +0 -1
- package/bundles/angular-fire-compat-storage.umd.js +0 -598
- package/bundles/angular-fire-compat-storage.umd.js.map +0 -1
- package/bundles/angular-fire-compat.umd.js +0 -535
- package/bundles/angular-fire-compat.umd.js.map +0 -1
- package/bundles/angular-fire-database.umd.js +0 -557
- package/bundles/angular-fire-database.umd.js.map +0 -1
- package/bundles/angular-fire-firestore-lite.umd.js +0 -531
- package/bundles/angular-fire-firestore-lite.umd.js.map +0 -1
- package/bundles/angular-fire-firestore.umd.js +0 -565
- package/bundles/angular-fire-firestore.umd.js.map +0 -1
- package/bundles/angular-fire-functions.umd.js +0 -461
- package/bundles/angular-fire-functions.umd.js.map +0 -1
- package/bundles/angular-fire-messaging.umd.js +0 -473
- package/bundles/angular-fire-messaging.umd.js.map +0 -1
- package/bundles/angular-fire-performance.umd.js +0 -473
- package/bundles/angular-fire-performance.umd.js.map +0 -1
- package/bundles/angular-fire-remote-config.umd.js +0 -499
- package/bundles/angular-fire-remote-config.umd.js.map +0 -1
- package/bundles/angular-fire-storage.umd.js +0 -485
- package/bundles/angular-fire-storage.umd.js.map +0 -1
- package/bundles/angular-fire.umd.js +0 -308
- package/bundles/angular-fire.umd.js.map +0 -1
- package/compat/analytics/package.json +0 -11
- package/compat/auth/package.json +0 -11
- package/compat/auth-guard/package.json +0 -11
- package/compat/database/package.json +0 -11
- package/compat/firestore/package.json +0 -11
- package/compat/functions/package.json +0 -11
- package/compat/messaging/package.json +0 -11
- package/compat/package.json +0 -11
- package/compat/performance/package.json +0 -11
- package/compat/remote-config/package.json +0 -11
- package/compat/storage/package.json +0 -11
- package/database/package.json +0 -11
- package/docs/analytics.md +0 -67
- package/docs/app-check.md +0 -53
- package/docs/auth.md +0 -165
- package/docs/compat/analytics/getting-started.md +0 -137
- package/docs/compat/auth/getting-started.md +0 -162
- package/docs/compat/auth/router-guards.md +0 -104
- package/docs/compat/emulators/emulators.md +0 -134
- package/docs/compat/firestore/collections.md +0 -326
- package/docs/compat/firestore/documents.md +0 -115
- package/docs/compat/firestore/offline-data.md +0 -39
- package/docs/compat/firestore/querying-collections.md +0 -204
- package/docs/compat/functions/functions.md +0 -166
- package/docs/compat/messaging/messaging.md +0 -232
- package/docs/compat/performance/getting-started.md +0 -132
- package/docs/compat/remote-config/getting-started.md +0 -134
- package/docs/compat/rtdb/lists.md +0 -257
- package/docs/compat/rtdb/objects.md +0 -182
- package/docs/compat/rtdb/querying-lists.md +0 -155
- package/docs/compat/storage/storage.md +0 -257
- package/docs/compat.md +0 -70
- package/docs/database.md +0 -175
- package/docs/deploy/getting-started.md +0 -204
- package/docs/firebase.json +0 -16
- package/docs/firestore.md +0 -148
- package/docs/functions.md +0 -52
- package/docs/images/analytics-illo_1x.png +0 -0
- package/docs/images/auth-illo_1x.png +0 -0
- package/docs/images/cloud-messaging-illo_1x.png +0 -0
- package/docs/images/database-illo_1x.png +0 -0
- package/docs/images/firestore-illo_1x.png +0 -0
- package/docs/images/functions-illo_1x.png +0 -0
- package/docs/images/hosting-illo_1x.png +0 -0
- package/docs/images/performance-illo_1x.png +0 -0
- package/docs/images/reCAPTCHA-logo@1x.png +0 -0
- package/docs/images/remote-config-illo_1x.png +0 -0
- package/docs/images/storage-illo_1x.png +0 -0
- package/docs/install-and-setup.md +0 -114
- package/docs/install-angular-cli-windows10.md +0 -82
- package/docs/messaging.md +0 -25
- package/docs/performance.md +0 -57
- package/docs/remote-config.md +0 -53
- package/docs/storage.md +0 -90
- package/docs/universal/cloud-functions.md +0 -75
- package/docs/universal/getting-started.md +0 -153
- package/docs/universal/prerendering.md +0 -72
- package/docs/version-4-upgrade.md +0 -119
- package/docs/version-5-upgrade.md +0 -82
- package/docs/version-6-upgrade.md +0 -16
- package/docs/version-7-upgrade.md +0 -298
- package/esm2015/analytics/analytics.module.js +0 -93
- package/esm2015/analytics/overrides.js +0 -3
- package/esm2015/analytics/screen-tracking.service.js +0 -139
- package/esm2015/analytics/user-tracking.service.js +0 -43
- package/esm2015/app/app.module.js +0 -84
- package/esm2015/app-check/app-check.module.js +0 -81
- package/esm2015/auth-guard/auth-guard.js +0 -49
- package/esm2015/compat/analytics/analytics.js +0 -163
- package/esm2015/compat/analytics/screen-tracking.service.js +0 -49
- package/esm2015/compat/analytics/user-tracking.service.js +0 -52
- package/esm2015/compat/auth/auth.js +0 -139
- package/esm2015/compat/auth-guard/auth-guard.js +0 -49
- package/esm2015/compat/database/database.js +0 -117
- package/esm2015/compat/database/list/create-reference.js +0 -41
- package/esm2015/compat/firestore/collection/changes.js +0 -107
- package/esm2015/compat/firestore/collection/collection.js +0 -117
- package/esm2015/compat/firestore/collection-group/collection-group.js +0 -81
- package/esm2015/compat/firestore/document/document.js +0 -82
- package/esm2015/compat/firestore/firestore.js +0 -254
- package/esm2015/compat/firestore/interfaces.js +0 -2
- package/esm2015/compat/firestore/observable/fromRef.js +0 -39
- package/esm2015/compat/functions/functions.js +0 -68
- package/esm2015/compat/messaging/messaging.js +0 -75
- package/esm2015/compat/performance/performance.service.js +0 -27
- package/esm2015/compat/proxy.js +0 -61
- package/esm2015/compat/remote-config/remote-config.js +0 -193
- package/esm2015/compat/storage/pipes/storageUrl.pipe.js +0 -54
- package/esm2015/compat/storage/storage.js +0 -94
- package/esm2015/core.js +0 -79
- package/esm2015/firestore/rxfire.js +0 -13
- package/esm2015/messaging/messaging.module.js +0 -85
- package/esm2015/messaging/overrides.js +0 -3
- package/esm2015/remote-config/overrides.js +0 -3
- package/esm2015/remote-config/remote-config.module.js +0 -85
- package/esm2015/zones.js +0 -183
- package/fesm2015/angular-fire-analytics.js.map +0 -1
- package/fesm2015/angular-fire-app-check.js.map +0 -1
- package/fesm2015/angular-fire-app.js.map +0 -1
- package/fesm2015/angular-fire-auth-guard.js.map +0 -1
- package/fesm2015/angular-fire-auth.js.map +0 -1
- package/fesm2015/angular-fire-compat-analytics.js.map +0 -1
- package/fesm2015/angular-fire-compat-auth-guard.js.map +0 -1
- package/fesm2015/angular-fire-compat-auth.js.map +0 -1
- package/fesm2015/angular-fire-compat-database.js.map +0 -1
- package/fesm2015/angular-fire-compat-firestore.js.map +0 -1
- package/fesm2015/angular-fire-compat-functions.js.map +0 -1
- package/fesm2015/angular-fire-compat-messaging.js.map +0 -1
- package/fesm2015/angular-fire-compat-performance.js.map +0 -1
- package/fesm2015/angular-fire-compat-remote-config.js.map +0 -1
- package/fesm2015/angular-fire-compat-storage.js.map +0 -1
- package/fesm2015/angular-fire-compat.js.map +0 -1
- package/fesm2015/angular-fire-database.js.map +0 -1
- package/fesm2015/angular-fire-firestore-lite.js.map +0 -1
- package/fesm2015/angular-fire-firestore.js.map +0 -1
- package/fesm2015/angular-fire-functions.js.map +0 -1
- package/fesm2015/angular-fire-messaging.js.map +0 -1
- package/fesm2015/angular-fire-performance.js.map +0 -1
- package/fesm2015/angular-fire-remote-config.js.map +0 -1
- package/fesm2015/angular-fire-storage.js.map +0 -1
- package/fesm2015/angular-fire.js.map +0 -1
- package/firestore/lite/package.json +0 -11
- package/firestore/package.json +0 -11
- package/firestore-protos.js +0 -4
- package/functions/package.json +0 -11
- package/messaging/package.json +0 -11
- package/performance/package.json +0 -11
- package/remote-config/package.json +0 -11
- package/schematics/add/schema.json +0 -16
- package/schematics/builders.json +0 -10
- package/schematics/collection.json +0 -15
- package/schematics/deploy/schema.json +0 -119
- package/schematics/migration.json +0 -15
- package/schematics/setup/schema.json +0 -16
- package/storage/package.json +0 -11
- /package/analytics/{angular-fire-analytics.d.ts → index.d.ts} +0 -0
- /package/app/{angular-fire-app.d.ts → index.d.ts} +0 -0
- /package/app-check/{angular-fire-app-check.d.ts → index.d.ts} +0 -0
- /package/auth/{angular-fire-auth.d.ts → index.d.ts} +0 -0
- /package/auth-guard/{angular-fire-auth-guard.d.ts → index.d.ts} +0 -0
- /package/compat/analytics/{angular-fire-compat-analytics.d.ts → index.d.ts} +0 -0
- /package/compat/auth/{angular-fire-compat-auth.d.ts → index.d.ts} +0 -0
- /package/compat/auth-guard/{angular-fire-compat-auth-guard.d.ts → index.d.ts} +0 -0
- /package/compat/database/{angular-fire-compat-database.d.ts → index.d.ts} +0 -0
- /package/compat/firestore/{angular-fire-compat-firestore.d.ts → index.d.ts} +0 -0
- /package/compat/functions/{angular-fire-compat-functions.d.ts → index.d.ts} +0 -0
- /package/compat/{angular-fire-compat.d.ts → index.d.ts} +0 -0
- /package/compat/messaging/{angular-fire-compat-messaging.d.ts → index.d.ts} +0 -0
- /package/compat/performance/{angular-fire-compat-performance.d.ts → index.d.ts} +0 -0
- /package/compat/remote-config/{angular-fire-compat-remote-config.d.ts → index.d.ts} +0 -0
- /package/compat/storage/{angular-fire-compat-storage.d.ts → index.d.ts} +0 -0
- /package/database/{angular-fire-database.d.ts → index.d.ts} +0 -0
- /package/{esm2015/analytics/analytics.js → esm2022/analytics/analytics.mjs} +0 -0
- /package/{esm2015/analytics/angular-fire-analytics.js → esm2022/analytics/angular-fire-analytics.mjs} +0 -0
- /package/{esm2015/analytics/firebase.js → esm2022/analytics/firebase.mjs} +0 -0
- /package/{esm2015/analytics/public_api.js → esm2022/analytics/public_api.mjs} +0 -0
- /package/{esm2015/angular-fire.js → esm2022/angular-fire.mjs} +0 -0
- /package/{esm2015/app/angular-fire-app.js → esm2022/app/angular-fire-app.mjs} +0 -0
- /package/{esm2015/app/app.js → esm2022/app/app.mjs} +0 -0
- /package/{esm2015/app/firebase.js → esm2022/app/firebase.mjs} +0 -0
- /package/{esm2015/app/public_api.js → esm2022/app/public_api.mjs} +0 -0
- /package/{esm2015/app-check/angular-fire-app-check.js → esm2022/app-check/angular-fire-app-check.mjs} +0 -0
- /package/{esm2015/app-check/app-check.js → esm2022/app-check/app-check.mjs} +0 -0
- /package/{esm2015/app-check/firebase.js → esm2022/app-check/firebase.mjs} +0 -0
- /package/{esm2015/app-check/public_api.js → esm2022/app-check/public_api.mjs} +0 -0
- /package/{esm2015/auth/angular-fire-auth.js → esm2022/auth/angular-fire-auth.mjs} +0 -0
- /package/{esm2015/auth/auth.js → esm2022/auth/auth.mjs} +0 -0
- /package/{esm2015/auth/firebase.js → esm2022/auth/firebase.mjs} +0 -0
- /package/{esm2015/auth/public_api.js → esm2022/auth/public_api.mjs} +0 -0
- /package/{esm2015/auth/rxfire.js → esm2022/auth/rxfire.mjs} +0 -0
- /package/{esm2015/auth-guard/angular-fire-auth-guard.js → esm2022/auth-guard/angular-fire-auth-guard.mjs} +0 -0
- /package/{esm2015/auth-guard/public_api.js → esm2022/auth-guard/public_api.mjs} +0 -0
- /package/{esm2015/compat/analytics/angular-fire-compat-analytics.js → esm2022/compat/analytics/angular-fire-compat-analytics.mjs} +0 -0
- /package/{esm2015/compat/analytics/base.js → esm2022/compat/analytics/base.mjs} +0 -0
- /package/{esm2015/compat/analytics/public_api.js → esm2022/compat/analytics/public_api.mjs} +0 -0
- /package/{esm2015/compat/angular-fire-compat.js → esm2022/compat/angular-fire-compat.mjs} +0 -0
- /package/{esm2015/compat/auth/angular-fire-compat-auth.js → esm2022/compat/auth/angular-fire-compat-auth.mjs} +0 -0
- /package/{esm2015/compat/auth/base.js → esm2022/compat/auth/base.mjs} +0 -0
- /package/{esm2015/compat/auth-guard/angular-fire-compat-auth-guard.js → esm2022/compat/auth-guard/angular-fire-compat-auth-guard.mjs} +0 -0
- /package/{esm2015/compat/auth-guard/public_api.js → esm2022/compat/auth-guard/public_api.mjs} +0 -0
- /package/{esm2015/compat/database/angular-fire-compat-database.js → esm2022/compat/database/angular-fire-compat-database.mjs} +0 -0
- /package/{esm2015/compat/database/interfaces.js → esm2022/compat/database/interfaces.mjs} +0 -0
- /package/{esm2015/compat/database/list/audit-trail.js → esm2022/compat/database/list/audit-trail.mjs} +0 -0
- /package/{esm2015/compat/database/list/changes.js → esm2022/compat/database/list/changes.mjs} +0 -0
- /package/{esm2015/compat/database/list/data-operation.js → esm2022/compat/database/list/data-operation.mjs} +0 -0
- /package/{esm2015/compat/database/list/remove.js → esm2022/compat/database/list/remove.mjs} +0 -0
- /package/{esm2015/compat/database/list/snapshot-changes.js → esm2022/compat/database/list/snapshot-changes.mjs} +0 -0
- /package/{esm2015/compat/database/list/state-changes.js → esm2022/compat/database/list/state-changes.mjs} +0 -0
- /package/{esm2015/compat/database/list/utils.js → esm2022/compat/database/list/utils.mjs} +0 -0
- /package/{esm2015/compat/database/object/create-reference.js → esm2022/compat/database/object/create-reference.mjs} +0 -0
- /package/{esm2015/compat/database/object/snapshot-changes.js → esm2022/compat/database/object/snapshot-changes.mjs} +0 -0
- /package/{esm2015/compat/database/observable/fromRef.js → esm2022/compat/database/observable/fromRef.mjs} +0 -0
- /package/{esm2015/compat/database/public_api.js → esm2022/compat/database/public_api.mjs} +0 -0
- /package/{esm2015/compat/database/utils.js → esm2022/compat/database/utils.mjs} +0 -0
- /package/{esm2015/compat/firebase.app.js → esm2022/compat/firebase.app.mjs} +0 -0
- /package/{esm2015/compat/firestore/angular-fire-compat-firestore.js → esm2022/compat/firestore/angular-fire-compat-firestore.mjs} +0 -0
- /package/{esm2015/compat/firestore/public_api.js → esm2022/compat/firestore/public_api.mjs} +0 -0
- /package/{esm2015/compat/functions/angular-fire-compat-functions.js → esm2022/compat/functions/angular-fire-compat-functions.mjs} +0 -0
- /package/{esm2015/compat/functions/base.js → esm2022/compat/functions/base.mjs} +0 -0
- /package/{esm2015/compat/messaging/angular-fire-compat-messaging.js → esm2022/compat/messaging/angular-fire-compat-messaging.mjs} +0 -0
- /package/{esm2015/compat/messaging/base.js → esm2022/compat/messaging/base.mjs} +0 -0
- /package/{esm2015/compat/messaging/public_api.js → esm2022/compat/messaging/public_api.mjs} +0 -0
- /package/{esm2015/compat/performance/angular-fire-compat-performance.js → esm2022/compat/performance/angular-fire-compat-performance.mjs} +0 -0
- /package/{esm2015/compat/performance/base.js → esm2022/compat/performance/base.mjs} +0 -0
- /package/{esm2015/compat/performance/public_api.js → esm2022/compat/performance/public_api.mjs} +0 -0
- /package/{esm2015/compat/public_api.js → esm2022/compat/public_api.mjs} +0 -0
- /package/{esm2015/compat/remote-config/angular-fire-compat-remote-config.js → esm2022/compat/remote-config/angular-fire-compat-remote-config.mjs} +0 -0
- /package/{esm2015/compat/remote-config/base.js → esm2022/compat/remote-config/base.mjs} +0 -0
- /package/{esm2015/compat/remote-config/interfaces.js → esm2022/compat/remote-config/interfaces.mjs} +0 -0
- /package/{esm2015/compat/remote-config/public_api.js → esm2022/compat/remote-config/public_api.mjs} +0 -0
- /package/{esm2015/compat/storage/angular-fire-compat-storage.js → esm2022/compat/storage/angular-fire-compat-storage.mjs} +0 -0
- /package/{esm2015/compat/storage/interfaces.js → esm2022/compat/storage/interfaces.mjs} +0 -0
- /package/{esm2015/compat/storage/observable/fromTask.js → esm2022/compat/storage/observable/fromTask.mjs} +0 -0
- /package/{esm2015/compat/storage/public_api.js → esm2022/compat/storage/public_api.mjs} +0 -0
- /package/{esm2015/compat/storage/ref.js → esm2022/compat/storage/ref.mjs} +0 -0
- /package/{esm2015/compat/storage/task.js → esm2022/compat/storage/task.mjs} +0 -0
- /package/{esm2015/database/angular-fire-database.js → esm2022/database/angular-fire-database.mjs} +0 -0
- /package/{esm2015/database/database.js → esm2022/database/database.mjs} +0 -0
- /package/{esm2015/database/firebase.js → esm2022/database/firebase.mjs} +0 -0
- /package/{esm2015/database/public_api.js → esm2022/database/public_api.mjs} +0 -0
- /package/{esm2015/database/rxfire.js → esm2022/database/rxfire.mjs} +0 -0
- /package/{esm2015/firestore/angular-fire-firestore.js → esm2022/firestore/angular-fire-firestore.mjs} +0 -0
- /package/{esm2015/firestore/firebase.js → esm2022/firestore/firebase.mjs} +0 -0
- /package/{esm2015/firestore/firestore.js → esm2022/firestore/firestore.mjs} +0 -0
- /package/{esm2015/firestore/lite/angular-fire-firestore-lite.js → esm2022/firestore/lite/angular-fire-firestore-lite.mjs} +0 -0
- /package/{esm2015/firestore/lite/firebase.js → esm2022/firestore/lite/firebase.mjs} +0 -0
- /package/{esm2015/firestore/lite/lite.js → esm2022/firestore/lite/lite.mjs} +0 -0
- /package/{esm2015/firestore/lite/public_api.js → esm2022/firestore/lite/public_api.mjs} +0 -0
- /package/{esm2015/firestore/lite/rxfire.js → esm2022/firestore/lite/rxfire.mjs} +0 -0
- /package/{esm2015/firestore/public_api.js → esm2022/firestore/public_api.mjs} +0 -0
- /package/{esm2015/functions/angular-fire-functions.js → esm2022/functions/angular-fire-functions.mjs} +0 -0
- /package/{esm2015/functions/firebase.js → esm2022/functions/firebase.mjs} +0 -0
- /package/{esm2015/functions/functions.js → esm2022/functions/functions.mjs} +0 -0
- /package/{esm2015/functions/public_api.js → esm2022/functions/public_api.mjs} +0 -0
- /package/{esm2015/functions/rxfire.js → esm2022/functions/rxfire.mjs} +0 -0
- /package/{esm2015/messaging/angular-fire-messaging.js → esm2022/messaging/angular-fire-messaging.mjs} +0 -0
- /package/{esm2015/messaging/firebase.js → esm2022/messaging/firebase.mjs} +0 -0
- /package/{esm2015/messaging/messaging.js → esm2022/messaging/messaging.mjs} +0 -0
- /package/{esm2015/messaging/public_api.js → esm2022/messaging/public_api.mjs} +0 -0
- /package/{esm2015/performance/angular-fire-performance.js → esm2022/performance/angular-fire-performance.mjs} +0 -0
- /package/{esm2015/performance/firebase.js → esm2022/performance/firebase.mjs} +0 -0
- /package/{esm2015/performance/performance.js → esm2022/performance/performance.mjs} +0 -0
- /package/{esm2015/performance/public_api.js → esm2022/performance/public_api.mjs} +0 -0
- /package/{esm2015/performance/rxfire.js → esm2022/performance/rxfire.mjs} +0 -0
- /package/{esm2015/public_api.js → esm2022/public_api.mjs} +0 -0
- /package/{esm2015/remote-config/angular-fire-remote-config.js → esm2022/remote-config/angular-fire-remote-config.mjs} +0 -0
- /package/{esm2015/remote-config/firebase.js → esm2022/remote-config/firebase.mjs} +0 -0
- /package/{esm2015/remote-config/public_api.js → esm2022/remote-config/public_api.mjs} +0 -0
- /package/{esm2015/remote-config/remote-config.js → esm2022/remote-config/remote-config.mjs} +0 -0
- /package/{esm2015/remote-config/rxfire.js → esm2022/remote-config/rxfire.mjs} +0 -0
- /package/{esm2015/storage/angular-fire-storage.js → esm2022/storage/angular-fire-storage.mjs} +0 -0
- /package/{esm2015/storage/firebase.js → esm2022/storage/firebase.mjs} +0 -0
- /package/{esm2015/storage/public_api.js → esm2022/storage/public_api.mjs} +0 -0
- /package/{esm2015/storage/rxfire.js → esm2022/storage/rxfire.mjs} +0 -0
- /package/{esm2015/storage/storage.js → esm2022/storage/storage.mjs} +0 -0
- /package/firestore/{angular-fire-firestore.d.ts → index.d.ts} +0 -0
- /package/firestore/lite/{angular-fire-firestore-lite.d.ts → index.d.ts} +0 -0
- /package/functions/{angular-fire-functions.d.ts → index.d.ts} +0 -0
- /package/{angular-fire.d.ts → index.d.ts} +0 -0
- /package/messaging/{angular-fire-messaging.d.ts → index.d.ts} +0 -0
- /package/performance/{angular-fire-performance.d.ts → index.d.ts} +0 -0
- /package/remote-config/{angular-fire-remote-config.d.ts → index.d.ts} +0 -0
- /package/storage/{angular-fire-storage.d.ts → index.d.ts} +0 -0
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
# Prerendering your Universal application
|
|
2
|
-
|
|
3
|
-
Prerendering a Universal application allows us to generate the HTML before the user requests it; increasing performance and decreasing cost. Let's configure your application to prerender and staticly serve it's most commonly accessed routes on Firebase Hosting.
|
|
4
|
-
|
|
5
|
-
First create a `static.paths.js` in your project root, which lists the URLs you'd want to prerender:
|
|
6
|
-
|
|
7
|
-
```js
|
|
8
|
-
export default [
|
|
9
|
-
'/',
|
|
10
|
-
'/another_path',
|
|
11
|
-
'/yet_another_path'
|
|
12
|
-
];
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
Let's install `mkdir-recursive` to make the next step a little easier:
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
npm i --save-dev mkdir-recursive
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
Now replace the listener in your `server.ts` with the following:
|
|
22
|
-
|
|
23
|
-
```ts
|
|
24
|
-
import { readFileSync, writeFileSync, existsSync } from 'fs';
|
|
25
|
-
import { renderModuleFactory } from '@angular/platform-server';
|
|
26
|
-
import { mkdirSync } from 'mkdir-recursive';
|
|
27
|
-
|
|
28
|
-
if (process.env.PRERENDER) {
|
|
29
|
-
|
|
30
|
-
const routes = require('./static.paths').default;
|
|
31
|
-
Promise.all(
|
|
32
|
-
routes.map(route =>
|
|
33
|
-
renderModuleFactory(AppServerModuleNgFactory, {
|
|
34
|
-
document: template,
|
|
35
|
-
url: route,
|
|
36
|
-
extraProviders: [
|
|
37
|
-
provideModuleMap(LAZY_MODULE_MAP)
|
|
38
|
-
]
|
|
39
|
-
}).then(html => [route, html])
|
|
40
|
-
)
|
|
41
|
-
).then(results => {
|
|
42
|
-
results.forEach(([route, html]) => {
|
|
43
|
-
const fullPath = join('./public', route);
|
|
44
|
-
if (!existsSync(fullPath)) { mkdirSync(fullPath); }
|
|
45
|
-
writeFileSync(join(fullPath, 'index.html'), html);
|
|
46
|
-
});
|
|
47
|
-
process.exit();
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
} else if (!process.env.FUNCTION_NAME) {
|
|
51
|
-
|
|
52
|
-
// If we're not in the Cloud Functions environment, spin up a Node server
|
|
53
|
-
const PORT = process.env.PORT || 4000;
|
|
54
|
-
app.listen(PORT, () => {
|
|
55
|
-
console.log(`Node server listening on http://localhost:${PORT}`);
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Now if the `PRERENDER` environment variable is passed any value, instead of serving your application it will iterate over the paths in `static.paths.js`, render them, and write them to your `public` directory. *You could always make this a seperate script.*
|
|
61
|
-
|
|
62
|
-
Finally make some modifications to your `package.json`, to prerender your content when you build:
|
|
63
|
-
|
|
64
|
-
```js
|
|
65
|
-
"scripts": {
|
|
66
|
-
// ... omitted
|
|
67
|
-
"build": "ng build && npm run copy:hosting && npm run build:functions && npm run prerender:ssr",
|
|
68
|
-
"prerender:ssr": "PRERENDER=1 node dist/YOUR_PROJECT_NAME-webpack/server.js",
|
|
69
|
-
},
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
Now when you run `npm run build` the prerendered content should be available in your `/public` directory, ready for deployment on Firebase Hosting.
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
# Upgrading to AngularFire2 4.0
|
|
2
|
-
|
|
3
|
-
AngularFire2 4.0 is a refactor of the AngularFire2 package which implements
|
|
4
|
-
@NgModule, simplifies authentication, and better supports Angular 4.
|
|
5
|
-
|
|
6
|
-
### Removing `AngularFire` for Modularity
|
|
7
|
-
|
|
8
|
-
Prior to 4.0, AngularFire2 did not take advantage of the Firebase SDK's modularity for tree shaking. The `AngularFire` service has now been removed and the library is broken up into smaller `@NgModule`s:
|
|
9
|
-
|
|
10
|
-
* `AngularFireModule`
|
|
11
|
-
* `AngularFireDatabaseModule`
|
|
12
|
-
* `AngularFireAuthModule`
|
|
13
|
-
|
|
14
|
-
When upgrading, replace calls to `AngularFire.database` and `AngularFire.auth` with `AngularFireDatabase` and `AngularFireAuth` respectively.
|
|
15
|
-
|
|
16
|
-
```typescript
|
|
17
|
-
constructor(af: AngularFire) {
|
|
18
|
-
af.database.list('foo');
|
|
19
|
-
af.auth;
|
|
20
|
-
}
|
|
21
|
-
```
|
|
22
|
-
Should now be:
|
|
23
|
-
|
|
24
|
-
```typescript
|
|
25
|
-
constructor(db: AngularFireDatabase, afAuth: AngularFireAuth) {
|
|
26
|
-
db.list('foo');
|
|
27
|
-
afAuth.authState;
|
|
28
|
-
}
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
### Simplified Authentication API
|
|
32
|
-
|
|
33
|
-
In 4.0 we've reduced the complexity of the auth module by providing only [`firebase.User`](https://firebase.google.com/docs/reference/js/firebase.User) observers (`AngularFireAuth.authState`, `AngularFireAuth.idToken`) and cutting the methods that were wrapping the Firebase SDK.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
```typescript
|
|
37
|
-
import { AngularFireAuth } from 'angularfire2/auth';
|
|
38
|
-
// Do not import from 'firebase' as you'd lose the tree shaking benefits
|
|
39
|
-
import firebase from 'firebase/app';
|
|
40
|
-
...
|
|
41
|
-
|
|
42
|
-
user: Observable<firebase.User>;
|
|
43
|
-
constructor(afAuth: AngularFireAuth) {
|
|
44
|
-
this.user = afAuth.authState; // only triggered on sign-in/out (for old behavior use .idToken)
|
|
45
|
-
}
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
AngularFire2 exposes the raw Firebase Auth object via `AngularFireAuth.auth`. For actions like login, logout, user creation, etc. you should use the [methods available to `firebase.auth.Auth`](https://firebase.google.com/docs/reference/js/firebase.auth.Auth).
|
|
49
|
-
|
|
50
|
-
While convenient, the pre-configured login feature added unneeded complexity. `AngularFireModule.initializeApp` no longer takes a default sign in method. Sign in should be done with the Firebase SDK via `firebase.auth.Auth`:
|
|
51
|
-
|
|
52
|
-
```typescript
|
|
53
|
-
login() {
|
|
54
|
-
this.afAuth.auth.signInWithPopup(new firebase.auth.GoogleAuthProvider());
|
|
55
|
-
}
|
|
56
|
-
logout() {
|
|
57
|
-
this.afAuth.auth.signOut();
|
|
58
|
-
}
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
### FirebaseListFactory and FirebaseObjectFactory API Changes
|
|
62
|
-
|
|
63
|
-
If you directly use `FirebaseListFactory` or `FirebaseObjectFactory` you will no longer be able to pass in a string, it will instead expect a Firebase database reference.
|
|
64
|
-
|
|
65
|
-
## Putting this all together
|
|
66
|
-
|
|
67
|
-
Here's an example of what AngularFire2 4.0 looks like:
|
|
68
|
-
|
|
69
|
-
```typescript
|
|
70
|
-
import { NgModule, Component } from '@angular/core';
|
|
71
|
-
import { Observable } from 'rxjs/Observable';
|
|
72
|
-
import { AngularFireModule } from 'angularfire2';
|
|
73
|
-
import { AngularFireDatabaseModule, AngularFireDatabase, FirebaseListObservable } from 'angularfire2/database';
|
|
74
|
-
import { AngularFireAuthModule, AngularFireAuth } from 'angularfire2/auth';
|
|
75
|
-
import { environment } from '../environments/environment';
|
|
76
|
-
|
|
77
|
-
// Do not import from 'firebase' as you'd lose the tree shaking benefits
|
|
78
|
-
import firebase from 'firebase/app';
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
@NgModule({
|
|
82
|
-
declarations: [ App ],
|
|
83
|
-
exports: [ App ],
|
|
84
|
-
imports: [
|
|
85
|
-
AngularFireModule.initializeApp(environment.firebase, 'my-app'),
|
|
86
|
-
AngularFireDatabaseModule,
|
|
87
|
-
AngularFireAuthModule
|
|
88
|
-
],
|
|
89
|
-
bootstrap: [ App ]
|
|
90
|
-
})
|
|
91
|
-
export class MyModule { }
|
|
92
|
-
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
```typescript
|
|
96
|
-
@Component({
|
|
97
|
-
selector: 'my-app',
|
|
98
|
-
template: `
|
|
99
|
-
<div> {{ (items | async)? | json }} </div>
|
|
100
|
-
<div> {{ (user | async)? | json }} </div>
|
|
101
|
-
<button (click)="login()">Login</button>
|
|
102
|
-
<button (click)="logout()">Logout</button>
|
|
103
|
-
`
|
|
104
|
-
})
|
|
105
|
-
export class App {
|
|
106
|
-
user: Observable<firebase.User>;
|
|
107
|
-
items: FirebaseListObservable<any[]>;
|
|
108
|
-
constructor(afAuth: AngularFireAuth, db: AngularFireDatabase) {
|
|
109
|
-
this.user = afAuth.authState;
|
|
110
|
-
this.items = db.list('items');
|
|
111
|
-
}
|
|
112
|
-
login() {
|
|
113
|
-
this.afAuth.auth.signInWithPopup(new firebase.auth.GoogleAuthProvider());
|
|
114
|
-
}
|
|
115
|
-
logout() {
|
|
116
|
-
this.afAuth.auth.signOut();
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
```
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
# Upgrading to AngularFire 5.0
|
|
2
|
-
|
|
3
|
-
AngularFire 5.0 is a refactor of the `AngularFireDatabase` module. It removes the `FirebaseListObservable` and `FirebaseObjectObservable` in favor of a generic based service API.
|
|
4
|
-
|
|
5
|
-
## Updating `FirebaseListObservable` to `AngularFireList<T>`
|
|
6
|
-
|
|
7
|
-
Rather than `.list()` returning a `FirebaseListObservable`, it now returns an `AngularFireList<T>`. This service contains methods that allow you to manipulate and stream data.
|
|
8
|
-
|
|
9
|
-
In the case of streaming back data, you now call one of the observable methods on `AngularFireList`.
|
|
10
|
-
|
|
11
|
-
### 4.0
|
|
12
|
-
|
|
13
|
-
```ts
|
|
14
|
-
constructor(afDb: AngularFireDatabase) {
|
|
15
|
-
afDb.list('items').subscribe(console.log);
|
|
16
|
-
}
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
### 5.0
|
|
20
|
-
|
|
21
|
-
```ts
|
|
22
|
-
constructor(afDb: AngularFireDatabase) {
|
|
23
|
-
afDb.list<Item>('items').valueChanges().subscribe(console.log);
|
|
24
|
-
}
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
The same concepts apply to `FirebaseObjectObservable` to `AngularFireObject`.
|
|
28
|
-
|
|
29
|
-
## Moving away from `$key` and `$value`
|
|
30
|
-
|
|
31
|
-
In AngularFireDatabase 4.0 the snapshot was automatically unwrapped for you and metadata was placed in `$` property. The Firebase Database rejects any keys with `$` in them so this mechanism allowed us to provide you with important metadata alongside your actual data. However, persisting the object could be a pain in some cases as the SDK would reject any `$` based properties. In 5.0 we have moved away from `$` properties and we provide multiple observable methods for receiving the data.
|
|
32
|
-
|
|
33
|
-
Calling `.valueChanges()` returns an Observable without any metadata. If you are already persisting the key as a property then you are fine. However, if you are relying on `$key`, then you need to use `.snapshotChanges()` and transform the data with an observable `.map()`.
|
|
34
|
-
|
|
35
|
-
### 4.0
|
|
36
|
-
|
|
37
|
-
```ts
|
|
38
|
-
constructor(afDb: AngularFireDatabase) {
|
|
39
|
-
afDb.list('items').subscribe(items => {
|
|
40
|
-
const allKeys = items.map(item => item.$key);
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
### 5.0
|
|
46
|
-
|
|
47
|
-
```ts
|
|
48
|
-
constructor(afDb: AngularFireDatabase) {
|
|
49
|
-
afDb.list('items').snapshotChanges().pipe(
|
|
50
|
-
map(actions =>
|
|
51
|
-
actions.map(a => ({ key: a.key, ...a.payload.val() }))
|
|
52
|
-
)
|
|
53
|
-
).subscribe(items => {
|
|
54
|
-
return items.map(item => item.key);
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
## Data manipulation methods
|
|
60
|
-
|
|
61
|
-
AngularFire 5.0 removes all custom observables which means their custom operators are gone as well. Instead of using custom operators on either a `FirebaseListObservable` or a `FirebaseObjectObservable`, use the methods on the service based APIs: `AngularFireList` and `AngularFireObject`. There is no resulting code change, but it worth pointing out.
|
|
62
|
-
|
|
63
|
-
### 4.0
|
|
64
|
-
|
|
65
|
-
```ts
|
|
66
|
-
constructor(afDb: AngularFireDatabase) {
|
|
67
|
-
const listObservable = afDb.list('items');
|
|
68
|
-
listObservable.push({ name: 'item' });
|
|
69
|
-
listObservable.subscribe();
|
|
70
|
-
}
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
### 5.0
|
|
74
|
-
|
|
75
|
-
```ts
|
|
76
|
-
constructor(afDb: AngularFireDatabase) {
|
|
77
|
-
const afList = afDb.list('items');
|
|
78
|
-
afList.push({ name: 'item' });
|
|
79
|
-
const listObservable = afList.snapshotChanges();
|
|
80
|
-
listObservable.subscribe();
|
|
81
|
-
}
|
|
82
|
-
```
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# Upgrading to AngularFire 6.0
|
|
2
|
-
|
|
3
|
-
Intended to be run with Angular 9; version 6 of AngularFire drops support for Angular version 8 and below, older versions of typescript, Firebase, drops `firebase-node`, `database-deprecated`, and more.
|
|
4
|
-
|
|
5
|
-
## Breaking changes:
|
|
6
|
-
|
|
7
|
-
* Support for Angular versions less than 9 has been dropped
|
|
8
|
-
* Support for Firebase JS SDK versions less than 7.13.1 has been dropped
|
|
9
|
-
* Support for `firebase-tools` less than 8.0 has been dropped
|
|
10
|
-
* The `angularfire2` NPM library will no longer be updated
|
|
11
|
-
* Dropped `@angular/fire/firebase-node` and `@angular/fire/database-depreciated`
|
|
12
|
-
* We make use of Proxy in more modules, you'll need to polyfill if you want to support IE 11
|
|
13
|
-
* We've standardized our DI Token naming conventions across all modules
|
|
14
|
-
* `AngularFireAuth` has dropped the `auth` property and instead Promise Proxies the underlying Firebase `auth.Auth` instance; allowing your development experience to more closely mirror the JS SDK. Similar changes have been made to `AngularFireFunctions`, `AngularFireMessaging`, and `AngularFirePerformance`.
|
|
15
|
-
* `AngularFireAuthGuard` and `canActivate` have dropped support for raw pipes, this was never working correctly in AOT
|
|
16
|
-
* `AngularFirePerformance` has been simplified, the RXJS pipes are now exported as pure-functions outside the class. Automatic tracking of `isStable` timing has now been moved into `PerformanceMonitoringService` and we've dropped the `AUTOMATICALLY_TRACE_CORE_NG_METRICS` DI token.
|
|
@@ -1,298 +0,0 @@
|
|
|
1
|
-
# Upgrading to AngularFire 7.0
|
|
2
|
-
|
|
3
|
-
Intended to be run with Angular 12, AngularFire 7.0 allows you to take full advantage of the new tree-shakable Firebase JS SDK (v9) while also providing a compatible experience with the prior API.
|
|
4
|
-
|
|
5
|
-
`ng update @angular/fire`
|
|
6
|
-
|
|
7
|
-
## Breaking changes
|
|
8
|
-
|
|
9
|
-
* Angular 12 is required
|
|
10
|
-
* AngularFire now only works in Ivy applications
|
|
11
|
-
* Firebase JS SDK v9 is required
|
|
12
|
-
* 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']`
|
|
14
|
-
|
|
15
|
-
## Compatibility mode
|
|
16
|
-
|
|
17
|
-
AngularFire v7.0 has a compatibility layer that supports the AngularFire v6.0 API. Just change your imports from `@angular/fire/*` to `@angular/fire/compat/*` and `firebase/*` to `firebase/compat/*`.
|
|
18
|
-
|
|
19
|
-
While not as tree-shakable as the new modular SDK, this allows you to upgrade and take advantage of the benefits of the new SDK ASAP.
|
|
20
|
-
|
|
21
|
-
**Most developers can stop here for now as the new API isn't feature complete.**
|
|
22
|
-
|
|
23
|
-
## **NEW** Modular SDK
|
|
24
|
-
|
|
25
|
-
### Initialization
|
|
26
|
-
|
|
27
|
-
In order to better support the tree-shakability introduced in Firebase v9 & to reduce the maintence required when the JS SDK adds new configuration flags, AngularFire providers now take a factory for a fully instantiated instance of the SDK you'd like to inject.
|
|
28
|
-
|
|
29
|
-
**Before:**
|
|
30
|
-
```ts
|
|
31
|
-
@NgModule({
|
|
32
|
-
imports: [
|
|
33
|
-
AngularFireModule.initializeApp(config),
|
|
34
|
-
AngularFirestoreModule.enablePersistence(),
|
|
35
|
-
AngularFireStorageModule,
|
|
36
|
-
],
|
|
37
|
-
providers: [
|
|
38
|
-
{ provide: USE_EMULATOR, useValue: ['localhost', 8080] },
|
|
39
|
-
],
|
|
40
|
-
})
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
**Modular SDK:**
|
|
44
|
-
```ts
|
|
45
|
-
@NgModule({
|
|
46
|
-
imports: [
|
|
47
|
-
provideFirebaseApp(() => initializeApp(config)),
|
|
48
|
-
provideFirestore(() => {
|
|
49
|
-
const firestore = getFirestore();
|
|
50
|
-
connectFirestoreEmulator(firestore, 'localhost', 8080);
|
|
51
|
-
enableIndexedDbPersistence(firestore);
|
|
52
|
-
return firestore;
|
|
53
|
-
}),
|
|
54
|
-
provideStorage(() => getStorage()),
|
|
55
|
-
],
|
|
56
|
-
})
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### Injecting services
|
|
60
|
-
|
|
61
|
-
Before when you injected Firebase JS SDK services into AngularFire they would be lazy-loaded and a promise-proxy would be returned to you. In AngularFire v7 you get the intiated service directly. We no longer lazy load for you.
|
|
62
|
-
|
|
63
|
-
```ts
|
|
64
|
-
import { Firestore, doc, onSnapshot, DocumentReference, docSnapshots } from '@angular/fire/firestore';
|
|
65
|
-
|
|
66
|
-
@Component({})
|
|
67
|
-
export class Foo {
|
|
68
|
-
doc: DocumentReference;
|
|
69
|
-
constructor(
|
|
70
|
-
firestore: Firestore, // Injects the instantiated Firestore instance
|
|
71
|
-
) {
|
|
72
|
-
// You can directly operate on the instance with JS SDK methods which we've
|
|
73
|
-
// reexported in AngularFire
|
|
74
|
-
this.doc = doc(firestore, 'foo/1');
|
|
75
|
-
onSnapshot(doc, snap => {
|
|
76
|
-
// ...
|
|
77
|
-
});
|
|
78
|
-
// or use the convenience observables
|
|
79
|
-
docSnapshots(doc).subscribe(...);
|
|
80
|
-
}
|
|
81
|
-
async update() {
|
|
82
|
-
await updateDoc(this.doc, { ... });
|
|
83
|
-
...
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
### Working with multiple apps / instances
|
|
89
|
-
|
|
90
|
-
In AngularFire v7 working with multiple instances was difficult, in the new SDK we have new DI tokens that make working with them much more straight forward.
|
|
91
|
-
|
|
92
|
-
```ts
|
|
93
|
-
@NgModule({
|
|
94
|
-
imports: [
|
|
95
|
-
provideFirebaseApp(() => initializeApp(config)),
|
|
96
|
-
provideFirebaseApp(() => initializeApp(config2, 'anotherApp')),
|
|
97
|
-
provideStorage(() => getStorage()),
|
|
98
|
-
provideStorage(() => getStorage(getApp(), 'anotherBucket')),
|
|
99
|
-
provideStorage(() => getStorage(getApp('anotherApp'))),
|
|
100
|
-
],
|
|
101
|
-
})
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
```ts
|
|
105
|
-
import { FirebaseApp, FirebaseApps } from '@angular/fire/app';
|
|
106
|
-
import { Storage, StorageInstances } from '@angular/fire/storage';
|
|
107
|
-
|
|
108
|
-
export class Foo {
|
|
109
|
-
constructor(
|
|
110
|
-
defaultApp: FirebaseApp, // Injects the default FirebaseApp
|
|
111
|
-
allFirebaseApps: FirebaseApps, // Injects an array of all initialized Firebase Apps
|
|
112
|
-
storage: Storage, // Injects the default storage instance
|
|
113
|
-
allStorageInstances: StorageInstances, // Injects an array of all the intialized storage instances
|
|
114
|
-
) { }
|
|
115
|
-
}
|
|
116
|
-
```
|
|
117
|
-
How the main injection tokens (i.e, `FirebaseApp`, `Storage`) function have changed from v7 but it should provide a much more powerful and intuitive API.
|
|
118
|
-
|
|
119
|
-
### API
|
|
120
|
-
|
|
121
|
-
Beyond Depdency Injection AngularFire is sporting an entirely new API:
|
|
122
|
-
|
|
123
|
-
1) We no longer handle lazy-loading the Firebase JS SDK modules for you
|
|
124
|
-
1) We no longer provide classes beyond Depedency Injection
|
|
125
|
-
1) No more Proxy / Promise-Proxy
|
|
126
|
-
1) We reexport and Zone-wrap all Firebase and RxFire APIs
|
|
127
|
-
|
|
128
|
-
So developing with the new AngularFire is easy, you can use it just like the vanilla Firebase JS SDK. Just change all your `firebase/app` imports to `@angular/fire/app`, `firebase/firestore` to `@angular/fire/firestore`, `firebase/database` to `@angular/fire/database`, etc. Then if you're feeling comfortable with RXJS and would like to use some of our convenience operators you can just dip into that toolbox.
|
|
129
|
-
|
|
130
|
-
#### Alternatives to v6 APIs
|
|
131
|
-
|
|
132
|
-
<table>
|
|
133
|
-
<thead>
|
|
134
|
-
<tr>
|
|
135
|
-
<th colspan="2">v6 / Compat</th>
|
|
136
|
-
<th>v7 Modular</th>
|
|
137
|
-
</tr>
|
|
138
|
-
</thead>
|
|
139
|
-
<tbody>
|
|
140
|
-
<tr>
|
|
141
|
-
<th rowspan="3">AngularFirestore</th>
|
|
142
|
-
<td>doc</td>
|
|
143
|
-
<td>
|
|
144
|
-
|
|
145
|
-
```ts
|
|
146
|
-
import { doc } from '@angular/fire/firestore';
|
|
147
|
-
doc<T>(firestore, 'foo/bar') // DocumentReference<T>
|
|
148
|
-
```
|
|
149
|
-
</td>
|
|
150
|
-
</tr>
|
|
151
|
-
<tr>
|
|
152
|
-
<td>collection</td>
|
|
153
|
-
<td>
|
|
154
|
-
|
|
155
|
-
```ts
|
|
156
|
-
import { collection } from '@angular/fire/firestore';
|
|
157
|
-
collection<T>(firestore, 'foo') // CollectionReference<T>
|
|
158
|
-
```
|
|
159
|
-
</td>
|
|
160
|
-
</tr>
|
|
161
|
-
<tr>
|
|
162
|
-
<td>collectionGroup</td>
|
|
163
|
-
<td>
|
|
164
|
-
|
|
165
|
-
```ts
|
|
166
|
-
import { collectionGroup } from '@angular/fire/firestore';
|
|
167
|
-
collectionGroup<T>(firestore, 'foo') // Query<T>
|
|
168
|
-
```
|
|
169
|
-
</td>
|
|
170
|
-
</tr>
|
|
171
|
-
<tr>
|
|
172
|
-
<th rowspan="7">AngularFirestoreDocument</th>
|
|
173
|
-
<td>set</td>
|
|
174
|
-
<td>
|
|
175
|
-
|
|
176
|
-
```ts
|
|
177
|
-
import { setDoc } from '@angular/fire/firestore';
|
|
178
|
-
setDoc(docRef, { ... }) // Promise<void>
|
|
179
|
-
```
|
|
180
|
-
</td>
|
|
181
|
-
|
|
182
|
-
</td>
|
|
183
|
-
</tr>
|
|
184
|
-
<tr>
|
|
185
|
-
<td>update</td>
|
|
186
|
-
<td>
|
|
187
|
-
|
|
188
|
-
```ts
|
|
189
|
-
import { updateDoc } from '@angular/fire/firestore';
|
|
190
|
-
updateDoc(docRef, { ... }) // Promise<void>
|
|
191
|
-
```
|
|
192
|
-
</td>
|
|
193
|
-
</tr>
|
|
194
|
-
<tr>
|
|
195
|
-
<td>delete</td>
|
|
196
|
-
<td>
|
|
197
|
-
|
|
198
|
-
```ts
|
|
199
|
-
import { deleteDoc } from '@angular/fire/firestore';
|
|
200
|
-
deleteDoc(docRef) // Promise<void>
|
|
201
|
-
```
|
|
202
|
-
</td>
|
|
203
|
-
</tr>
|
|
204
|
-
<tr>
|
|
205
|
-
<td>collection</td>
|
|
206
|
-
<td>
|
|
207
|
-
|
|
208
|
-
```ts
|
|
209
|
-
import { collection } from '@angular/fire/firestore';
|
|
210
|
-
collection<T>(docRef, 'bar') // CollectionReference<T>
|
|
211
|
-
```
|
|
212
|
-
</td>
|
|
213
|
-
</tr>
|
|
214
|
-
<tr>
|
|
215
|
-
<td>snapshotChanges</td>
|
|
216
|
-
<td>
|
|
217
|
-
|
|
218
|
-
```ts
|
|
219
|
-
import { docSnapshots } from '@angular/fire/firestore';
|
|
220
|
-
docSnapshots<T>(docRef) // Observable<DocumentSnapshot<T>>
|
|
221
|
-
```
|
|
222
|
-
</td>
|
|
223
|
-
|
|
224
|
-
</td>
|
|
225
|
-
</tr>
|
|
226
|
-
<tr>
|
|
227
|
-
<td>valueChanges</td>
|
|
228
|
-
<td>
|
|
229
|
-
|
|
230
|
-
```ts
|
|
231
|
-
import { docData } from '@angular/fire/firestore';
|
|
232
|
-
docData<T>(docRef) // Observable<T>
|
|
233
|
-
```
|
|
234
|
-
</td>
|
|
235
|
-
</tr>
|
|
236
|
-
<tr>
|
|
237
|
-
<td>get</td>
|
|
238
|
-
<td>
|
|
239
|
-
|
|
240
|
-
```ts
|
|
241
|
-
import { getDoc } from '@angular/fire/firestore';
|
|
242
|
-
getDoc<T>(docRef) // Promise<DocumentSnapshot<T>>
|
|
243
|
-
```
|
|
244
|
-
|
|
245
|
-
</td>
|
|
246
|
-
</tr>
|
|
247
|
-
</tbody>
|
|
248
|
-
</table>
|
|
249
|
-
|
|
250
|
-
### Code splitting and lazy-loading
|
|
251
|
-
|
|
252
|
-
AngularFire does not lazy-load services any longer. We have provided a helper observable for detecting when a new service instance is instantiated. In this example we'll code split out of all the Firestore related code and lazy-load
|
|
253
|
-
|
|
254
|
-
```ts
|
|
255
|
-
// firestore_operations.ts
|
|
256
|
-
import {
|
|
257
|
-
collectionData,
|
|
258
|
-
firestoreInstance$,
|
|
259
|
-
collection,
|
|
260
|
-
getFirestore
|
|
261
|
-
} from '@angular/fire/firestore';
|
|
262
|
-
import { first } from 'rxjs/operators';
|
|
263
|
-
import { IFoo } from '../interfaces';
|
|
264
|
-
|
|
265
|
-
export { getFirestore };
|
|
266
|
-
|
|
267
|
-
export const fooData = firestoreInstance$.pipe(
|
|
268
|
-
first(),
|
|
269
|
-
concatMap(firestore => collectionData<IFoo>(collection(firestore, 'foo'))),
|
|
270
|
-
);
|
|
271
|
-
```
|
|
272
|
-
|
|
273
|
-
```ts
|
|
274
|
-
export class AuthService {
|
|
275
|
-
constructor() {
|
|
276
|
-
getRedirectResult().then(result => {
|
|
277
|
-
// Initialize Firestore only after a user logs in
|
|
278
|
-
if (result.user) {
|
|
279
|
-
const { getFirestore } = await import('./firestore_operations');
|
|
280
|
-
getFirestore();
|
|
281
|
-
}
|
|
282
|
-
});
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
```
|
|
286
|
-
|
|
287
|
-
```ts
|
|
288
|
-
@Component({})
|
|
289
|
-
export class Foo {
|
|
290
|
-
data: Observable<IFoo[]>;
|
|
291
|
-
constructor() {
|
|
292
|
-
this.data = of(undefined).pipe(
|
|
293
|
-
concatMap(() => import('./firestore_operations')),
|
|
294
|
-
concatMap(it => it.fooData)
|
|
295
|
-
);
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
```
|