@angular/fire 7.6.0 → 16.0.0-canary.4172abd
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/analytics.module.d.ts +2 -2
- package/analytics/is-analytics-supported-factory.d.ts +4 -0
- package/analytics/screen-tracking.service.d.ts +3 -3
- package/app-check/app-check.d.ts +0 -6
- package/app-check/app-check.module.d.ts +3 -4
- package/app-check/public_api.d.ts +2 -1
- package/auth/auth.module.d.ts +2 -2
- package/auth-guard/auth-guard.d.ts +6 -6
- package/compat/analytics/analytics.d.ts +1 -3
- package/compat/analytics/analytics.module.d.ts +1 -1
- package/compat/analytics/screen-tracking.service.d.ts +1 -1
- package/compat/analytics/user-tracking.service.d.ts +1 -1
- package/compat/auth/auth.d.ts +4 -4
- package/compat/auth-guard/auth-guard.d.ts +8 -6
- package/compat/database/database.d.ts +4 -4
- package/compat/database/interfaces.d.ts +14 -14
- package/compat/database/list/audit-trail.d.ts +1 -1
- package/compat/database/list/create-reference.d.ts +1 -1
- package/compat/database/list/data-operation.d.ts +1 -1
- package/compat/database/list/state-changes.d.ts +1 -1
- package/compat/database/object/create-reference.d.ts +1 -1
- package/compat/database/observable/fromRef.d.ts +1 -1
- package/compat/database/utils.d.ts +1 -1
- package/compat/firebase.app.module.d.ts +1 -1
- package/compat/firestore/collection/collection.d.ts +2 -2
- package/compat/firestore/collection-group/collection-group.d.ts +2 -2
- package/compat/firestore/document/document.d.ts +4 -4
- package/compat/firestore/firestore.d.ts +7 -7
- package/compat/firestore/interfaces.d.ts +19 -19
- package/compat/functions/functions.d.ts +3 -3
- package/compat/messaging/messaging.d.ts +2 -2
- package/compat/performance/performance.d.ts +2 -2
- package/compat/proxy.d.ts +8 -8
- package/compat/remote-config/interfaces.d.ts +1 -1
- package/compat/remote-config/remote-config.d.ts +15 -49
- package/compat/storage/interfaces.d.ts +8 -8
- package/compat/storage/observable/fromTask.d.ts +1 -2
- package/compat/storage/pipes/storageUrl.pipe.d.ts +1 -1
- package/compat/storage/ref.d.ts +1 -1
- package/compat/storage/storage.d.ts +3 -3
- package/compat/storage/task.d.ts +1 -1
- package/core.d.ts +8 -12
- package/database/database.module.d.ts +2 -2
- package/{esm2015/analytics/analytics.js → esm2022/analytics/analytics.mjs} +1 -1
- 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 +148 -0
- package/esm2022/analytics/user-tracking.service.mjs +44 -0
- package/{esm2015/app/app.js → esm2022/app/app.mjs} +1 -1
- package/esm2022/app/app.module.mjs +85 -0
- package/esm2022/app-check/app-check.mjs +10 -0
- package/esm2022/app-check/app-check.module.mjs +78 -0
- package/esm2022/app-check/public_api.mjs +5 -0
- package/{esm2015/auth/auth.js → esm2022/auth/auth.mjs} +1 -1
- package/esm2022/auth/auth.module.mjs +71 -0
- package/esm2022/auth-guard/auth-guard.mjs +53 -0
- package/{esm2015/auth-guard/auth-guard.module.js → esm2022/auth-guard/auth-guard.module.mjs} +7 -7
- package/esm2022/compat/analytics/analytics.mjs +160 -0
- package/esm2022/compat/analytics/analytics.module.mjs +35 -0
- 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} +7 -7
- package/{esm2015/compat/auth/public_api.js → esm2022/compat/auth/public_api.mjs} +1 -1
- package/esm2022/compat/auth-guard/auth-guard.mjs +53 -0
- package/{esm2015/compat/auth-guard/auth-guard.module.js → esm2022/compat/auth-guard/auth-guard.module.mjs} +7 -7
- package/{esm2015/compat/cache.js → esm2022/compat/cache.mjs} +4 -3
- package/esm2022/compat/database/database.mjs +119 -0
- package/{esm2015/compat/database/database.module.js → esm2022/compat/database/database.module.mjs} +7 -7
- package/esm2022/compat/database/interfaces.mjs +2 -0
- package/{esm2015/compat/database/list/audit-trail.js → esm2022/compat/database/list/audit-trail.mjs} +3 -3
- package/esm2022/compat/database/list/changes.mjs +85 -0
- package/esm2022/compat/database/list/create-reference.mjs +44 -0
- package/{esm2015/compat/database/list/data-operation.js → esm2022/compat/database/list/data-operation.mjs} +1 -1
- package/{esm2015/compat/database/list/snapshot-changes.js → esm2022/compat/database/list/snapshot-changes.mjs} +1 -1
- package/{esm2015/compat/database/list/state-changes.js → esm2022/compat/database/list/state-changes.mjs} +2 -2
- package/{esm2015/compat/database/object/create-reference.js → esm2022/compat/database/object/create-reference.mjs} +2 -2
- package/{esm2015/compat/database/object/snapshot-changes.js → esm2022/compat/database/object/snapshot-changes.mjs} +1 -1
- package/esm2022/compat/database/observable/fromRef.mjs +48 -0
- package/{esm2015/compat/database/utils.js → esm2022/compat/database/utils.mjs} +1 -1
- package/{esm2015/compat/firebase.app.js → esm2022/compat/firebase.app.mjs} +1 -1
- package/esm2022/compat/firebase.app.module.mjs +71 -0
- 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} +7 -7
- 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} +7 -7
- package/{esm2015/compat/functions/public_api.js → esm2022/compat/functions/public_api.mjs} +1 -1
- package/esm2022/compat/messaging/messaging.mjs +81 -0
- package/{esm2015/compat/messaging/messaging.module.js → esm2022/compat/messaging/messaging.module.mjs} +7 -7
- package/esm2022/compat/performance/performance.mjs +105 -0
- package/esm2022/compat/performance/performance.module.mjs +27 -0
- package/esm2022/compat/performance/performance.service.mjs +28 -0
- package/esm2022/compat/proxy.mjs +58 -0
- package/esm2022/compat/remote-config/remote-config.mjs +206 -0
- package/{esm2015/compat/remote-config/remote-config.module.js → esm2022/compat/remote-config/remote-config.module.mjs} +7 -7
- package/esm2022/compat/storage/observable/fromTask.mjs +36 -0
- package/esm2022/compat/storage/pipes/storageUrl.pipe.mjs +58 -0
- package/{esm2015/compat/storage/ref.js → esm2022/compat/storage/ref.mjs} +3 -3
- package/esm2022/compat/storage/storage.mjs +95 -0
- package/esm2022/compat/storage/storage.module.mjs +22 -0
- package/{esm2015/compat/storage/task.js → esm2022/compat/storage/task.mjs} +2 -2
- package/esm2022/core.mjs +43 -0
- package/{esm2015/database/database.js → esm2022/database/database.mjs} +1 -1
- package/esm2022/database/database.module.mjs +74 -0
- package/{esm2015/firestore/firestore.js → esm2022/firestore/firestore.mjs} +1 -1
- package/esm2022/firestore/firestore.module.mjs +74 -0
- package/{esm2015/firestore/lite/lite.js → esm2022/firestore/lite/lite.mjs} +1 -1
- package/esm2022/firestore/lite/lite.module.mjs +73 -0
- package/esm2022/firestore/rxfire.mjs +15 -0
- package/{esm2015/functions/functions.js → esm2022/functions/functions.mjs} +1 -1
- package/esm2022/functions/functions.module.mjs +74 -0
- package/esm2022/messaging/is-messaging-supported-factory.mjs +16 -0
- package/{esm2015/messaging/messaging.js → esm2022/messaging/messaging.mjs} +1 -1
- package/esm2022/messaging/messaging.module.mjs +86 -0
- package/esm2022/messaging/overrides.mjs +3 -0
- package/{esm2015/performance/performance.js → esm2022/performance/performance.mjs} +1 -1
- package/esm2022/performance/performance.module.mjs +81 -0
- package/esm2022/remote-config/is-remote-config-supported-factory.mjs +16 -0
- package/esm2022/remote-config/overrides.mjs +3 -0
- package/{esm2015/remote-config/remote-config.js → esm2022/remote-config/remote-config.mjs} +1 -1
- package/esm2022/remote-config/remote-config.module.mjs +86 -0
- package/{esm2015/storage/storage.js → esm2022/storage/storage.mjs} +1 -1
- package/esm2022/storage/storage.module.mjs +74 -0
- package/esm2022/zones.mjs +194 -0
- package/{fesm2015/angular-fire-analytics.js → fesm2022/angular-fire-analytics.mjs} +64 -40
- package/fesm2022/angular-fire-analytics.mjs.map +1 -0
- package/{fesm2015/angular-fire-app-check.js → fesm2022/angular-fire-app-check.mjs} +16 -24
- package/fesm2022/angular-fire-app-check.mjs.map +1 -0
- package/{fesm2015/angular-fire-app.js → fesm2022/angular-fire-app.mjs} +10 -9
- package/fesm2022/angular-fire-app.mjs.map +1 -0
- package/{fesm2015/angular-fire-auth-guard.js → fesm2022/angular-fire-auth-guard.mjs} +31 -27
- package/fesm2022/angular-fire-auth-guard.mjs.map +1 -0
- package/{fesm2015/angular-fire-auth.js → fesm2022/angular-fire-auth.mjs} +10 -11
- package/fesm2022/angular-fire-auth.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat-analytics.js → fesm2022/angular-fire-compat-analytics.mjs} +43 -41
- 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} +30 -26
- package/fesm2022/angular-fire-compat-auth-guard.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat-auth.js → fesm2022/angular-fire-compat-auth.mjs} +38 -16
- package/fesm2022/angular-fire-compat-auth.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat-database.js → fesm2022/angular-fire-compat-database.mjs} +138 -132
- package/fesm2022/angular-fire-compat-database.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat-firestore.js → fesm2022/angular-fire-compat-firestore.mjs} +119 -98
- package/fesm2022/angular-fire-compat-firestore.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat-functions.js → fesm2022/angular-fire-compat-functions.mjs} +13 -12
- package/fesm2022/angular-fire-compat-functions.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat-messaging.js → fesm2022/angular-fire-compat-messaging.mjs} +25 -19
- package/fesm2022/angular-fire-compat-messaging.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat-performance.js → fesm2022/angular-fire-compat-performance.mjs} +29 -34
- 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} +35 -22
- package/fesm2022/angular-fire-compat-remote-config.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat-storage.js → fesm2022/angular-fire-compat-storage.mjs} +30 -23
- package/fesm2022/angular-fire-compat-storage.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat.js → fesm2022/angular-fire-compat.mjs} +25 -25
- package/fesm2022/angular-fire-compat.mjs.map +1 -0
- package/{fesm2015/angular-fire-database.js → fesm2022/angular-fire-database.mjs} +11 -12
- package/fesm2022/angular-fire-database.mjs.map +1 -0
- package/{fesm2015/angular-fire-firestore-lite.js → fesm2022/angular-fire-firestore-lite.mjs} +11 -12
- package/fesm2022/angular-fire-firestore-lite.mjs.map +1 -0
- package/{fesm2015/angular-fire-firestore.js → fesm2022/angular-fire-firestore.mjs} +15 -14
- package/fesm2022/angular-fire-firestore.mjs.map +1 -0
- package/{fesm2015/angular-fire-functions.js → fesm2022/angular-fire-functions.mjs} +12 -13
- 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} +11 -11
- 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} +10 -11
- package/fesm2022/angular-fire-storage.mjs.map +1 -0
- package/{fesm2015/angular-fire.js → fesm2022/angular-fire.mjs} +33 -58
- package/fesm2022/angular-fire.mjs.map +1 -0
- package/firestore/firestore.module.d.ts +2 -2
- package/firestore/lite/lite.module.d.ts +2 -2
- package/firestore/rxfire.d.ts +3 -1
- package/functions/functions.module.d.ts +2 -2
- package/messaging/is-messaging-supported-factory.d.ts +4 -0
- package/messaging/messaging.module.d.ts +2 -2
- package/package.json +159 -9
- package/performance/performance.module.d.ts +2 -2
- package/publish.sh +1 -0
- package/remote-config/is-remote-config-supported-factory.d.ts +4 -0
- package/remote-config/remote-config.module.d.ts +2 -2
- package/schematics/add/index.js +2 -2
- package/schematics/common.js +9 -5
- package/schematics/deploy/actions.js +69 -69
- package/schematics/deploy/builder.js +7 -7
- package/schematics/firebaseTools.js +9 -5
- package/schematics/setup/index.js +27 -27
- package/schematics/setup/prompts.js +22 -18
- package/schematics/update/index.js +1 -1
- package/schematics/update/v7/index.js +7 -7
- package/schematics/utils.js +34 -34
- package/storage/storage.module.d.ts +2 -2
- 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.js +0 -16
- package/esm2015/app-check/app-check.module.js +0 -81
- package/esm2015/app-check/public_api.js +0 -4
- package/esm2015/auth/auth.module.js +0 -71
- package/esm2015/auth-guard/auth-guard.js +0 -49
- package/esm2015/compat/analytics/analytics.js +0 -163
- package/esm2015/compat/analytics/analytics.module.js +0 -32
- 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/interfaces.js +0 -2
- package/esm2015/compat/database/list/changes.js +0 -85
- package/esm2015/compat/database/list/create-reference.js +0 -41
- package/esm2015/compat/database/observable/fromRef.js +0 -47
- package/esm2015/compat/firebase.app.module.js +0 -69
- 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.js +0 -110
- package/esm2015/compat/performance/performance.module.js +0 -28
- 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/observable/fromTask.js +0 -34
- package/esm2015/compat/storage/pipes/storageUrl.pipe.js +0 -54
- package/esm2015/compat/storage/storage.js +0 -94
- package/esm2015/compat/storage/storage.module.js +0 -22
- package/esm2015/core.js +0 -79
- package/esm2015/database/database.module.js +0 -74
- package/esm2015/firestore/firestore.module.js +0 -74
- package/esm2015/firestore/lite/lite.module.js +0 -74
- package/esm2015/firestore/rxfire.js +0 -13
- package/esm2015/functions/functions.module.js +0 -74
- package/esm2015/messaging/messaging.module.js +0 -85
- package/esm2015/messaging/overrides.js +0 -3
- package/esm2015/performance/performance.module.js +0 -81
- package/esm2015/remote-config/overrides.js +0 -3
- package/esm2015/remote-config/remote-config.module.js +0 -85
- package/esm2015/storage/storage.module.js +0 -74
- 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/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/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/firebase.js → esm2022/app-check/firebase.mjs} +0 -0
- /package/{esm2015/auth/angular-fire-auth.js → esm2022/auth/angular-fire-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/list/remove.js → esm2022/compat/database/list/remove.mjs} +0 -0
- /package/{esm2015/compat/database/list/utils.js → esm2022/compat/database/list/utils.mjs} +0 -0
- /package/{esm2015/compat/database/public_api.js → esm2022/compat/database/public_api.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/public_api.js → esm2022/compat/storage/public_api.mjs} +0 -0
- /package/{esm2015/database/angular-fire-database.js → esm2022/database/angular-fire-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/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/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/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/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/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/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/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,132 +0,0 @@
|
|
|
1
|
-
# Getting started with Performance Monitoring
|
|
2
|
-
|
|
3
|
-
> **NOTE**: [AngularFire has a new tree-shakable API](../../../README.md#developer-guide), you're looking at the documentation for the compatability version of the library. [See the v7 upgrade guide for more information on this change.](../../version-7-upgrade.md).
|
|
4
|
-
|
|
5
|
-
## Automatic page load tracing
|
|
6
|
-
|
|
7
|
-
Understand your Angular application's real-world performance with [Firebase Performance Monitoring](https://firebase.google.com/docs/perf-mon). Performance Monitoring automatically provides a trace for **page load** when you add `AngularFirePerformanceModule` into your App Module's imports.
|
|
8
|
-
|
|
9
|
-
```ts
|
|
10
|
-
import { AngularFireModule } from '@angular/fire/compat';
|
|
11
|
-
import { AngularFirePerformanceModule, PerformanceMonitoringService } from '@angular/fire/compat/performance';
|
|
12
|
-
import { environment } from '../environments/environment';
|
|
13
|
-
|
|
14
|
-
@NgModule({
|
|
15
|
-
imports: [
|
|
16
|
-
BrowserModule,
|
|
17
|
-
AngularFireModule.initializeApp(environment.firebase),
|
|
18
|
-
AngularFirePerformanceModule,
|
|
19
|
-
...
|
|
20
|
-
],
|
|
21
|
-
providers: [
|
|
22
|
-
PerformanceMonitoringService
|
|
23
|
-
],
|
|
24
|
-
declarations: [ AppComponent ],
|
|
25
|
-
bootstrap: [ AppComponent ]
|
|
26
|
-
})
|
|
27
|
-
export class AppModule {}
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
The page load trace breaks down into the following default metrics:
|
|
31
|
-
|
|
32
|
-
* [first paint traces](https://firebase.google.com/docs/perf-mon/automatic-web#first-paint) — measure the time between when the user navigates to a page and when any visual change happens
|
|
33
|
-
* [first contentful paint traces](https://firebase.google.com/docs/perf-mon/automatic-web#contentful-paint) — measure the time between when a user navigates to a page and when meaningful content displays, like an image or text
|
|
34
|
-
* [domInteractive traces](https://firebase.google.com/docs/perf-mon/automatic-web#domInteractive) — measure the time between when the user navigates to a page and when the page is considered interactive for the user
|
|
35
|
-
* [domContentLoadedEventEnd traces](https://firebase.google.com/docs/perf-mon/automatic-web#domContentLoaded) — measure the time between when the user navigates to a page and when the initial HTML document is completely loaded and parsed
|
|
36
|
-
* [loadEventEnd traces](https://firebase.google.com/docs/perf-mon/automatic-web#loadEventEnd) — measure the time between when the user navigates to the page and when the current document's load event completes
|
|
37
|
-
* [first input delay traces](https://firebase.google.com/docs/perf-mon/automatic-web#input-delay) — measure the time between when the user interacts with a page and when the browser is able to respond to that input
|
|
38
|
-
* **Angular specific traces** - `PerformanceMonitoringService` will measure the time needed for `ApplicationRef.isStable` to be true, an important metric to track if you're concerned about solving Zone.js issues for proper functionality of NGSW and Server Side Rendering
|
|
39
|
-
|
|
40
|
-
### Measuring First Input Delay
|
|
41
|
-
|
|
42
|
-
> First Input Delay (FID) measures the time from when a user first interacts with your site (i.e. when they click a link, tap on a button, or use a custom, JavaScript-powered control) to the time when the browser is actually able to respond to that interaction. [See the article on the Google Developer's Blog for more information on FID.](https://developers.google.com/web/updates/2018/05/first-input-delay)
|
|
43
|
-
|
|
44
|
-
In order to track first input delay, you'll want to [polyfill the browser performance API](https://github.com/GoogleChromeLabs/first-input-delay):
|
|
45
|
-
|
|
46
|
-
`npm install --save-dev first-input-delay`
|
|
47
|
-
|
|
48
|
-
Then add `import 'first-input-delay';` to your `src/polyfills.ts`.
|
|
49
|
-
|
|
50
|
-
## Manual traces
|
|
51
|
-
|
|
52
|
-
You can inject `AngularFirePerformance` to perform manual traces.
|
|
53
|
-
|
|
54
|
-
```ts
|
|
55
|
-
constructor(private performance: AngularFirePerformance) {}
|
|
56
|
-
|
|
57
|
-
...
|
|
58
|
-
|
|
59
|
-
const trace = await this.performance.trace('some-trace');
|
|
60
|
-
trace.start();
|
|
61
|
-
...
|
|
62
|
-
trace.stop();
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
## RXJS operators
|
|
66
|
-
|
|
67
|
-
AngularFire provides a number of RXJS operators which wrap the User Timing API. These are picked up by performance monitoring tools such as Chrome Inspector and Firebase Performance Monitoring.
|
|
68
|
-
|
|
69
|
-
```ts
|
|
70
|
-
import { trace } from '@angular/fire/compat/performance';
|
|
71
|
-
|
|
72
|
-
...
|
|
73
|
-
|
|
74
|
-
constructor(private performance: AngularFirePerformance, private afs: AngularFirestore) {}
|
|
75
|
-
|
|
76
|
-
ngOnInit() {
|
|
77
|
-
this.articles = afs.collection('articles')
|
|
78
|
-
.collection('articles', ref => ref.orderBy('publishedAt', 'desc'))
|
|
79
|
-
.snapshotChanges()
|
|
80
|
-
.pipe(
|
|
81
|
-
// measure the amount of time between the Observable being subscribed to and first emission (or completion)
|
|
82
|
-
trace('getArticles'),
|
|
83
|
-
map(articles => ...)
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
### `trace(name: string)`
|
|
89
|
-
|
|
90
|
-
The most basic operator, `trace` will measure the amount of time it takes for your observable to either complete or emit its first value. Beyond the basic trace there are several other operators:
|
|
91
|
-
|
|
92
|
-
<h3>
|
|
93
|
-
<pre>
|
|
94
|
-
traceUntil(
|
|
95
|
-
name: string,
|
|
96
|
-
test: (T) => Boolean,
|
|
97
|
-
options?: { orComplete?: true }
|
|
98
|
-
)
|
|
99
|
-
</pre>
|
|
100
|
-
</h3>
|
|
101
|
-
|
|
102
|
-
Trace the observable until the first emission that passes the provided test.
|
|
103
|
-
|
|
104
|
-
If the `orComplete` option is passed it will complete the trace when the observable completes, even if an emission never passed the provided test.
|
|
105
|
-
|
|
106
|
-
<h3>
|
|
107
|
-
<pre>
|
|
108
|
-
traceWhile(
|
|
109
|
-
name: string,
|
|
110
|
-
test: (T) => Boolean,
|
|
111
|
-
options?: { orComplete?: true }
|
|
112
|
-
)
|
|
113
|
-
</pre>
|
|
114
|
-
</h3>
|
|
115
|
-
|
|
116
|
-
Starting with an emission that passes the provided test, trace until an emission fails the test.
|
|
117
|
-
|
|
118
|
-
If the `orComplete` option is passed it will complete any existing trace when the observable completes.
|
|
119
|
-
|
|
120
|
-
### `traceUntilLast(name: string)`
|
|
121
|
-
|
|
122
|
-
Trace the observable until completion.
|
|
123
|
-
|
|
124
|
-
### `traceUntilFirst(name: string)`
|
|
125
|
-
|
|
126
|
-
Traces the observable until the first emission.
|
|
127
|
-
|
|
128
|
-
## Advanced usage
|
|
129
|
-
|
|
130
|
-
### Configuration via Dependency Injection
|
|
131
|
-
|
|
132
|
-
Set `INSTRUMENTATION_ENABLED` or `DATA_COLLECTION_ENABLED` to false disable all automatic and custom traces respectively.
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
<h1>Getting started with Remote Config <em><abbr title="beta">β<abbr></em></h1>
|
|
2
|
-
|
|
3
|
-
`AngularFireRemoteConfig` dynamically imports the `firebase/remote-config` library on demand, provides convenience observables, pipes, and a promisified version of the [Firebase Remote Config SDK (`firebase.remoteConfig.RemoteConfig`)](https://firebase.google.com/docs/reference/js/firebase.remoteconfig.RemoteConfig).
|
|
4
|
-
|
|
5
|
-
> **NOTE**: [AngularFire has a new tree-shakable API](../../../README.md#developer-guide), you're looking at the documentation for the compatability version of the library. [See the v7 upgrade guide for more information on this change.](../../version-7-upgrade.md).
|
|
6
|
-
|
|
7
|
-
### API:
|
|
8
|
-
|
|
9
|
-
```ts
|
|
10
|
-
class AngularFireRemoteConfigModule { }
|
|
11
|
-
|
|
12
|
-
interface ConfigTemplate {[key:string]: string|number|boolean}
|
|
13
|
-
|
|
14
|
-
type Parameter extends remoteConfig.Value {
|
|
15
|
-
key: string,
|
|
16
|
-
fetchTimeMillis: number
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
class AngularFireRemoteConfig {
|
|
20
|
-
changes: Observable<Parameter>;
|
|
21
|
-
parameters: Observable<Parameter[]>;
|
|
22
|
-
numbers: Observable<{[key:string]: number|undefined}> & {[key:string]: Observable<number>};
|
|
23
|
-
booleans: Observable<{[key:string]: boolean|undefined}> & {[key:string]: Observable<boolean>};
|
|
24
|
-
strings: Observable<{[key:string]: string|undefined}> & {[key:string]: Observable<string|undefined>};
|
|
25
|
-
|
|
26
|
-
// from firebase.remoteConfig() proxy:
|
|
27
|
-
activate: () => Promise<boolean>;
|
|
28
|
-
ensureInitialized: () => Promise<void>;
|
|
29
|
-
fetch: () => Promise<void>;
|
|
30
|
-
fetchAndActivate: () => Promise<boolean>;
|
|
31
|
-
getAll: () => Promise<{[key:string]: remoteConfig.Value}>;
|
|
32
|
-
getBoolean: (key:string) => Promise<boolean>;
|
|
33
|
-
getNumber: (key:string) => Promise<number>;
|
|
34
|
-
getString: (key:string) => Promise<string>;
|
|
35
|
-
getValue: (key:string) => Promise<remoteConfig.Value>;
|
|
36
|
-
setLogLevel: (logLevel: remoteConfig.LogLevel) => Promise<void>;
|
|
37
|
-
settings: Promise<remoteConfig.Settings>;
|
|
38
|
-
defaultConfig: Promise<{[key: string]: string | number | boolean}>;
|
|
39
|
-
fetchTimeMillis: Promise<number>;
|
|
40
|
-
lastFetchStatus: Promise<remoteConfig.FetchStatus>;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// Pipes for working with .changes and .parameters
|
|
44
|
-
filterRemote: () => MonoTypeOperatorFunction<Parameter | Parameter[]>
|
|
45
|
-
filterFresh: (interval: number) => MonoTypeOperatorFunction<Parameter | Parameter[]>
|
|
46
|
-
budget: <T>(interval: number) => MonoTypeOperatorFunction<T>
|
|
47
|
-
|
|
48
|
-
// scanToObject is for use with .changes
|
|
49
|
-
scanToObject: () => OperatorFunction<Parameter, {[key: string]: string|undefined}>
|
|
50
|
-
|
|
51
|
-
// mapToObject is the same behavior as scanToObject but for use with .parameters
|
|
52
|
-
mapToObject: () => OperatorFunction<Parameter[], {[key: string]: string|undefined}>
|
|
53
|
-
|
|
54
|
-
SETTINGS = InjectionToken<remoteConfig.Settings>;
|
|
55
|
-
DEFAULTS = InjectionToken<ConfigTemplate>;
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
## Configuration with Dependency Injection
|
|
59
|
-
|
|
60
|
-
### Configure Remote Config with `SETTINGS`
|
|
61
|
-
|
|
62
|
-
Using the `SETTINGS` DI Token (*default: {}*) will allow you to [configure Firebase Remote Config](https://firebase.google.com/docs/reference/js/firebase.remoteconfig.Settings.html).
|
|
63
|
-
|
|
64
|
-
### Configure default values with `DEFAULTS`
|
|
65
|
-
|
|
66
|
-
Providing `DEFAULTS ({[key: string]: string | number | boolean})` tells `AngularFireRemoteConfig` to emit the provided defaults first. This allows you to count on Remote Config when the user is offline or in environments that the Remote Config service does not handle (i.e. Server Side Rendering).
|
|
67
|
-
|
|
68
|
-
## Putting it all together
|
|
69
|
-
|
|
70
|
-
```ts
|
|
71
|
-
import { AngularFireRemoteConfigModule, DEFAULTS, SETTINGS } from '@angular/fire/compat/remote-config';
|
|
72
|
-
|
|
73
|
-
@NgModule({
|
|
74
|
-
imports: [
|
|
75
|
-
AngularFireModule.initializeApp(environment.firebase),
|
|
76
|
-
AngularFireRemoteConfigModule
|
|
77
|
-
],
|
|
78
|
-
providers: [
|
|
79
|
-
{ provide: DEFAULTS, useValue: { enableAwesome: true } },
|
|
80
|
-
{
|
|
81
|
-
provide: SETTINGS,
|
|
82
|
-
useFactory: () => isDevMode() ? { minimumFetchIntervalMillis: 10_000 } : {}
|
|
83
|
-
}
|
|
84
|
-
]
|
|
85
|
-
})
|
|
86
|
-
export class AppModule { }
|
|
87
|
-
|
|
88
|
-
...
|
|
89
|
-
|
|
90
|
-
constructor(remoteConfig: AngularFireRemoteConfig) {
|
|
91
|
-
remoteConfig.changes.pipe(
|
|
92
|
-
filterFresh(172_800_000), // ensure we have values from at least 48 hours ago
|
|
93
|
-
first(),
|
|
94
|
-
// scanToObject when used this way is similar to defaults
|
|
95
|
-
// but most importantly smart-casts remote config values and adds type safety
|
|
96
|
-
scanToObject({
|
|
97
|
-
enableAwesome: true,
|
|
98
|
-
titleBackgroundColor: 'blue',
|
|
99
|
-
titleFontSize: 12
|
|
100
|
-
})
|
|
101
|
-
).subscribe(…);
|
|
102
|
-
|
|
103
|
-
// all remote config values cast as strings
|
|
104
|
-
remoteConfig.strings.subscribe(...)
|
|
105
|
-
remoteConfig.booleans.subscribe(...); // as booleans
|
|
106
|
-
remoteConfig.numbers.subscribe(...); // as numbers
|
|
107
|
-
|
|
108
|
-
// convenience for observing a single string
|
|
109
|
-
remoteConfig.strings.titleBackgroundColor.subscribe(...);
|
|
110
|
-
remoteConfig.booleans.enableAwesome.subscribe(...); // boolean
|
|
111
|
-
remoteConfig.numbers.titleBackgroundColor.subscribe(...); // number
|
|
112
|
-
|
|
113
|
-
// however those may emit more than once as the remote config cache fires and gets fresh values
|
|
114
|
-
// from the server. You can filter it out of .changes for more control:
|
|
115
|
-
remoteConfig.changes.pipe(
|
|
116
|
-
filter(param => param.key === 'titleBackgroundColor'),
|
|
117
|
-
map(param => param.asString())
|
|
118
|
-
// budget at most 800ms and return the freshest value possible in that time
|
|
119
|
-
// our budget pipe is similar to timeout but won't error or abort the pending server fetch
|
|
120
|
-
// (it won't emit it, if the deadline is exceeded, but it will have been fetched so can use the
|
|
121
|
-
// freshest values on next subscription)
|
|
122
|
-
budget(800),
|
|
123
|
-
last()
|
|
124
|
-
).subscribe(...)
|
|
125
|
-
|
|
126
|
-
// just like .changes, but scanned into an array
|
|
127
|
-
remoteConfig.parameters.subscribe(all => ...);
|
|
128
|
-
|
|
129
|
-
// or make promisified firebase().remoteConfig() calls direct off AngularFireRemoteConfig
|
|
130
|
-
// using our proxy
|
|
131
|
-
remoteConfig.getAll().then(all => ...);
|
|
132
|
-
remoteConfig.lastFetchStatus.then(status => ...);
|
|
133
|
-
}
|
|
134
|
-
```
|
|
@@ -1,257 +0,0 @@
|
|
|
1
|
-
# 3. Retrieving data as lists
|
|
2
|
-
|
|
3
|
-
> **NOTE**: [AngularFire has a new tree-shakable API](../../../README.md#developer-guide), you're looking at the documentation for the compatability version of the library. [See the v7 upgrade guide for more information on this change.](../../version-7-upgrade.md).
|
|
4
|
-
|
|
5
|
-
> AngularFire synchronizes data as lists using the `AngularFireList` service.
|
|
6
|
-
|
|
7
|
-
The `AngularFireList` service is not created by itself, but through the `AngularFireDatabase` service.
|
|
8
|
-
|
|
9
|
-
The guide below demonstrates how to retrieve, save, and remove data as lists.
|
|
10
|
-
|
|
11
|
-
## Injecting the `AngularFireDatabase` service
|
|
12
|
-
|
|
13
|
-
**Make sure you have bootstrapped your application for AngularFire. See the Installation guide for bootstrap setup.**
|
|
14
|
-
|
|
15
|
-
AngularFireDatabase is a service which can be injected through the constructor of your Angular component or `@Injectable()` service.
|
|
16
|
-
In the previous step, we modified the `/src/app/app.component.ts` to retrieve data as an object. In this step, let's start with a clean slate.
|
|
17
|
-
|
|
18
|
-
Replace your `/src/app/app.component.ts` from previous step to look like below.
|
|
19
|
-
|
|
20
|
-
```ts
|
|
21
|
-
import { Component } from '@angular/core';
|
|
22
|
-
import { AngularFireDatabase } from '@angular/fire/compat/database';
|
|
23
|
-
|
|
24
|
-
@Component({
|
|
25
|
-
selector: 'app-root',
|
|
26
|
-
templateUrl: 'app.component.html',
|
|
27
|
-
styleUrls: ['app.component.css']
|
|
28
|
-
})
|
|
29
|
-
export class AppComponent {
|
|
30
|
-
constructor(db: AngularFireDatabase) { }
|
|
31
|
-
}
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
In this section, we're going to modify the `/src/app/app.component.ts` to retrieve data as list, but before that let's look at ways around how to bind to a list.
|
|
35
|
-
|
|
36
|
-
## Create a list binding
|
|
37
|
-
|
|
38
|
-
Data is retrieved through the `AngularFireDatabase` service. The service is also generic. Provide the singular type and not the array type.
|
|
39
|
-
|
|
40
|
-
```ts
|
|
41
|
-
const listRef = db.list('items');
|
|
42
|
-
const shirtsRef = db.list<Shirt>('shirts');
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
### Retrieve data
|
|
46
|
-
|
|
47
|
-
To get the list in realtime, create a list binding as a property of your component or service.
|
|
48
|
-
|
|
49
|
-
Then in your template, you can use the `async` pipe to unwrap the binding.
|
|
50
|
-
|
|
51
|
-
Update `/src/app/app.component.ts` to import `AngularFireList` from `@angular/fire` and iterate through the list once data is retrieved. Also note the change in attribute `templateUrl` to inline `template` below.
|
|
52
|
-
|
|
53
|
-
```ts
|
|
54
|
-
import { Component } from '@angular/core';
|
|
55
|
-
import { AngularFireDatabase } from '@angular/fire/compat/database';
|
|
56
|
-
import { Observable } from 'rxjs';
|
|
57
|
-
|
|
58
|
-
@Component({
|
|
59
|
-
selector: 'app-root',
|
|
60
|
-
template: `
|
|
61
|
-
<ul>
|
|
62
|
-
<li *ngFor="let item of items | async">
|
|
63
|
-
{{ item | json }}
|
|
64
|
-
</li>
|
|
65
|
-
</ul>
|
|
66
|
-
`,
|
|
67
|
-
})
|
|
68
|
-
export class AppComponent {
|
|
69
|
-
items: Observable<any[]>;
|
|
70
|
-
constructor(db: AngularFireDatabase) {
|
|
71
|
-
this.items = db.list('items').valueChanges();
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
## `AngularFireAction` - Action based API
|
|
77
|
-
|
|
78
|
-
AngularFire provides methods that stream data back as redux compatible actions. This gives you extra horsepower when using libraries like Animations, ngrx, and ReactiveForms.
|
|
79
|
-
|
|
80
|
-
### `valueChanges()`
|
|
81
|
-
|
|
82
|
-
**What is it?** - Returns an Observable of data as a synchronized array of JSON objects. All Snapshot metadata is stripped and just the method provides only the data.
|
|
83
|
-
|
|
84
|
-
**Why would you use it?** - When you just need a list of data. No snapshot metadata is attached to the resulting array which makes it simple to render to a view.
|
|
85
|
-
|
|
86
|
-
**When would you not use it?** - When you need a more complex data structure than an array or you need the `key` of each snapshot for data manipulation methods. This method assumes you either are saving the `key` for the snapshot data or using a "readonly" approach.
|
|
87
|
-
|
|
88
|
-
### `snapshotChanges()`
|
|
89
|
-
|
|
90
|
-
**What is it?** - Returns an Observable of data as a synchronized array of `AngularFireAction<DatabaseSnapshot>[]`.
|
|
91
|
-
|
|
92
|
-
**Why would you use it?** - When you need a list of data but also want to keep around metadata. Metadata provides you the underyling `DatabaseReference` and snapshot key. Having the snapshot's `key` around makes it easier to use data manipulation methods. This method gives you more horsepower with other Angular integrations such as ngrx, forms, and animations due to the `type` property. The `type` property on each `AngularFireAction` is useful for ngrx reducers, form states, and animation states.
|
|
93
|
-
|
|
94
|
-
**When would you not use it?** - When you need a more complex data structure than an array or if you need to process changes as they occur. This array is synchronized with the remote and local changes in the Firebase Database.
|
|
95
|
-
|
|
96
|
-
### `stateChanges()`
|
|
97
|
-
|
|
98
|
-
**What is it?** - Returns an Observable of the most recent change as an `AngularFireAction`.
|
|
99
|
-
|
|
100
|
-
**Why would you use it?** - The above methods return a singular `AngularFireAction` from each child event that occurs. `stateChanges()` emits changes as they occur rather than syncing the query order. This works well for ngrx integrations as you can build your own data structure in your reducer methods.
|
|
101
|
-
|
|
102
|
-
**When would you not use it?** - When you just need a list of data. This is a more advanced usage of `AngularFireDatabase`.
|
|
103
|
-
|
|
104
|
-
### `auditTrail()`
|
|
105
|
-
|
|
106
|
-
**What is it?** - Returns an Observable of `AngularFireAction[]` as they occur. Similar to `stateChanges()`, but instead it keeps around the trail of events as an array.
|
|
107
|
-
|
|
108
|
-
**Why would you use it?** - This method is like `stateChanges()` except it is not ephemeral. It collects each change in an array as they occur. This is useful for ngrx integrations where you need to replay the entire state of an application. This also works as a great debugging tool for all applications. You can simple write `db.list('items').auditTrail().subscribe(console.log)` and check the events in the console as they occur.
|
|
109
|
-
|
|
110
|
-
**When would you not use it?** - When you just need a list of data. This is a more advanced usage of AngularFireDatabase.
|
|
111
|
-
|
|
112
|
-
### Limiting events
|
|
113
|
-
|
|
114
|
-
There are four child events: `"child_added"`, `"child_changed"`, `"child_removed"`, and `"child_moved"`. Each streaming method listens to all four by default. However, your site may only be intrested in one of these events. You can specify which events you'd like to use through the first parameter of each method:
|
|
115
|
-
|
|
116
|
-
```ts
|
|
117
|
-
this.itemsRef = db.list('items');
|
|
118
|
-
this.itemsRef.snapshotChanges(['child_added'])
|
|
119
|
-
.subscribe(actions => {
|
|
120
|
-
actions.forEach(action => {
|
|
121
|
-
console.log(action.type);
|
|
122
|
-
console.log(action.key);
|
|
123
|
-
console.log(action.payload.val());
|
|
124
|
-
});
|
|
125
|
-
});
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
## Saving data
|
|
129
|
-
|
|
130
|
-
### API Summary
|
|
131
|
-
|
|
132
|
-
The table below highlights some of the common methods on the `AngularFireList`.
|
|
133
|
-
|
|
134
|
-
| method | |
|
|
135
|
-
| ---------|--------------------|
|
|
136
|
-
| `push(value: T)` | Creates a new record on the list, using the Realtime Database's push-ids. |
|
|
137
|
-
| `update(keyRefOrSnap: string, value: T)` | Firebase | AFUnwrappedSnapshot, value: Object) | Updates an existing item in the array. Accepts a key, database reference, or an unwrapped snapshot. |
|
|
138
|
-
| `remove(key: string?)` | Deletes the item by key. If no parameter is provided, the entire list will be deleted. |
|
|
139
|
-
|
|
140
|
-
## Returning promises
|
|
141
|
-
|
|
142
|
-
Each data operation method in the table above returns a promise. However,
|
|
143
|
-
you should rarely need to use the completion promise to indicate success,
|
|
144
|
-
because the realtime database keeps the list in sync.
|
|
145
|
-
|
|
146
|
-
The promise can be useful to chain multiple operations, catching possible errors
|
|
147
|
-
from security rules denials, or for debugging.
|
|
148
|
-
|
|
149
|
-
```ts
|
|
150
|
-
const promise = db.list('items').remove();
|
|
151
|
-
promise
|
|
152
|
-
.then(_ => console.log('success'))
|
|
153
|
-
.catch(err => console.log(err, 'You do not have access!'));
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
### Adding new items
|
|
157
|
-
|
|
158
|
-
Use the `push()` method to add new items on the list.
|
|
159
|
-
|
|
160
|
-
```ts
|
|
161
|
-
const itemsRef = db.list('items');
|
|
162
|
-
itemsRef.push({ name: newName });
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
### Replacing items in the list using `set`
|
|
166
|
-
|
|
167
|
-
Use the `set()` method to update existing items.
|
|
168
|
-
|
|
169
|
-
```ts
|
|
170
|
-
const itemsRef = db.list('items');
|
|
171
|
-
// to get a key, check the Example app below
|
|
172
|
-
itemsRef.set('key-of-some-data', { size: newSize });
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
Replaces the current value in the database with the new value specified as the parameter. This is called a destructive update, because it deletes everything currently in place and saves the new value.
|
|
176
|
-
|
|
177
|
-
### Updating items in the list using `update`
|
|
178
|
-
|
|
179
|
-
Use the `update()` method to update existing items.
|
|
180
|
-
|
|
181
|
-
```ts
|
|
182
|
-
const itemsRef = db.list('items');
|
|
183
|
-
// to get a key, check the Example app below
|
|
184
|
-
itemsRef.update('key-of-some-data', { size: newSize });
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
Note that this updates the current value with in the database with the new value specified as the parameter. This is called a non-destructive update, because it only updates the values specified.
|
|
188
|
-
|
|
189
|
-
### Removing items from the list
|
|
190
|
-
Use the `remove()` method to remove data at the list item's location.
|
|
191
|
-
|
|
192
|
-
```ts
|
|
193
|
-
const itemsRef = db.list('items');
|
|
194
|
-
// to get a key, check the Example app below
|
|
195
|
-
itemsRef.remove('key-of-some-data');
|
|
196
|
-
```
|
|
197
|
-
|
|
198
|
-
## Deleting the entire list
|
|
199
|
-
|
|
200
|
-
If you omit the `key` parameter from `.remove()` it deletes the entire list.
|
|
201
|
-
|
|
202
|
-
```ts
|
|
203
|
-
const itemsRef = db.list('items');
|
|
204
|
-
itemsRef.remove();
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
### Example
|
|
208
|
-
|
|
209
|
-
```ts
|
|
210
|
-
import { Component } from '@angular/core';
|
|
211
|
-
import { AngularFireDatabase, AngularFireList } from '@angular/fire/compat/database';
|
|
212
|
-
import { Observable } from 'rxjs';
|
|
213
|
-
import { map } from 'rxjs/operators';
|
|
214
|
-
|
|
215
|
-
@Component({
|
|
216
|
-
selector: 'app-root',
|
|
217
|
-
template: `
|
|
218
|
-
<ul>
|
|
219
|
-
<li *ngFor="let item of items | async">
|
|
220
|
-
<input type="text" #updatetext [value]="item.text" />
|
|
221
|
-
<button (click)="updateItem(item.key, updatetext.value)">Update</button>
|
|
222
|
-
<button (click)="deleteItem(item.key)">Delete</button>
|
|
223
|
-
</li>
|
|
224
|
-
</ul>
|
|
225
|
-
<input type="text" #newitem />
|
|
226
|
-
<button (click)="addItem(newitem.value)">Add</button>
|
|
227
|
-
<button (click)="deleteEverything()">Delete All</button>
|
|
228
|
-
`,
|
|
229
|
-
})
|
|
230
|
-
export class AppComponent {
|
|
231
|
-
itemsRef: AngularFireList<any>;
|
|
232
|
-
items: Observable<any[]>;
|
|
233
|
-
constructor(db: AngularFireDatabase) {
|
|
234
|
-
this.itemsRef = db.list('messages');
|
|
235
|
-
// Use snapshotChanges().map() to store the key
|
|
236
|
-
this.items = this.itemsRef.snapshotChanges().pipe(
|
|
237
|
-
map(changes =>
|
|
238
|
-
changes.map(c => ({ key: c.payload.key, ...c.payload.val() }))
|
|
239
|
-
)
|
|
240
|
-
);
|
|
241
|
-
}
|
|
242
|
-
addItem(newName: string) {
|
|
243
|
-
this.itemsRef.push({ text: newName });
|
|
244
|
-
}
|
|
245
|
-
updateItem(key: string, newText: string) {
|
|
246
|
-
this.itemsRef.update(key, { text: newText });
|
|
247
|
-
}
|
|
248
|
-
deleteItem(key: string) {
|
|
249
|
-
this.itemsRef.remove(key);
|
|
250
|
-
}
|
|
251
|
-
deleteEverything() {
|
|
252
|
-
this.itemsRef.remove();
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
### [Next Step: Querying lists](querying-lists.md)
|