@angular/fire 7.2.0 → 7.3.0-canary.8d5bc12

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.
Files changed (56) hide show
  1. package/README.md +1 -2
  2. package/app/app.module.d.ts +1 -1
  3. package/auth/auth.module.d.ts +1 -1
  4. package/bundles/angular-fire-app.umd.js.map +1 -1
  5. package/bundles/angular-fire-auth.umd.js.map +1 -1
  6. package/bundles/angular-fire-compat.umd.js.map +1 -1
  7. package/bundles/angular-fire-database.umd.js.map +1 -1
  8. package/bundles/angular-fire-functions.umd.js.map +1 -1
  9. package/bundles/angular-fire-messaging.umd.js.map +1 -1
  10. package/bundles/angular-fire-performance.umd.js.map +1 -1
  11. package/bundles/angular-fire-remote-config.umd.js.map +1 -1
  12. package/bundles/angular-fire-storage.umd.js +6 -0
  13. package/bundles/angular-fire-storage.umd.js.map +1 -1
  14. package/bundles/angular-fire.umd.js +10 -8
  15. package/bundles/angular-fire.umd.js.map +1 -1
  16. package/compat/proxy.d.ts +9 -6
  17. package/database/database.module.d.ts +1 -1
  18. package/docs/auth/getting-started.md +6 -6
  19. package/esm2015/app/app.module.js +1 -1
  20. package/esm2015/auth/auth.module.js +1 -1
  21. package/esm2015/compat/proxy.js +1 -1
  22. package/esm2015/core.js +5 -5
  23. package/esm2015/database/database.module.js +1 -1
  24. package/esm2015/functions/functions.module.js +1 -1
  25. package/esm2015/messaging/messaging.module.js +1 -1
  26. package/esm2015/performance/performance.module.js +1 -1
  27. package/esm2015/remote-config/remote-config.module.js +1 -1
  28. package/esm2015/storage/firebase.js +5 -2
  29. package/esm2015/storage/storage.module.js +1 -1
  30. package/esm2015/zones.js +7 -5
  31. package/fesm2015/angular-fire-app.js.map +1 -1
  32. package/fesm2015/angular-fire-auth.js.map +1 -1
  33. package/fesm2015/angular-fire-compat.js.map +1 -1
  34. package/fesm2015/angular-fire-database.js.map +1 -1
  35. package/fesm2015/angular-fire-functions.js.map +1 -1
  36. package/fesm2015/angular-fire-messaging.js.map +1 -1
  37. package/fesm2015/angular-fire-performance.js.map +1 -1
  38. package/fesm2015/angular-fire-remote-config.js.map +1 -1
  39. package/fesm2015/angular-fire-storage.js +5 -2
  40. package/fesm2015/angular-fire-storage.js.map +1 -1
  41. package/fesm2015/angular-fire.js +10 -8
  42. package/fesm2015/angular-fire.js.map +1 -1
  43. package/firestore-protos.js +4 -16
  44. package/functions/functions.module.d.ts +1 -1
  45. package/messaging/messaging.module.d.ts +1 -1
  46. package/package.json +4 -4
  47. package/performance/performance.module.d.ts +1 -1
  48. package/remote-config/remote-config.module.d.ts +1 -1
  49. package/schematics/deploy/actions.js +6 -1
  50. package/schematics/deploy/functions-templates.js +11 -1
  51. package/schematics/deploy/schema.json +9 -5
  52. package/schematics/setup/prompts.js +7 -7
  53. package/schematics/utils.js +2 -5
  54. package/schematics/versions.json +1 -10
  55. package/storage/firebase.d.ts +4 -1
  56. package/storage/storage.module.d.ts +1 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "../node_modules/ng-packagr/package.schema.json",
3
3
  "name": "@angular/fire",
4
- "version": "7.2.0",
4
+ "version": "7.3.0-canary.8d5bc12",
5
5
  "description": "The official Angular library for Firebase.",
6
6
  "schematics": "./schematics/collection.json",
7
7
  "builders": "./schematics/builders.json",
@@ -27,10 +27,8 @@
27
27
  "@angular/core": "^12.0.0 || ^13.0.0",
28
28
  "@angular/platform-browser": "^12.0.0 || ^13.0.0",
29
29
  "@angular/platform-browser-dynamic": "^12.0.0 || ^13.0.0",
30
- "firebase": "^9.4.0",
31
- "rxfire": "^6.0.0",
32
30
  "rxjs": "~6.6.0 || ^7.0.0",
33
- "firebase-tools": "^9.9.0"
31
+ "firebase-tools": "^9.9.0 || ^10.0.0"
34
32
  },
35
33
  "peerDependenciesMeta": {
36
34
  "firebase-tools": {
@@ -38,6 +36,8 @@
38
36
  }
39
37
  },
40
38
  "dependencies": {
39
+ "firebase": "^9.5.0",
40
+ "rxfire": "^6.0.0",
41
41
  "@angular-devkit/schematics": "^12.0.0 || ^13.0.0",
42
42
  "@schematics/angular": "^12.0.0 || ^13.0.0",
43
43
  "tslib": "^2.0.0",
@@ -12,4 +12,4 @@ export declare class PerformanceModule {
12
12
  static ɵmod: i0.ɵɵNgModuleDeclaration<PerformanceModule, never, never, never>;
13
13
  static ɵinj: i0.ɵɵInjectorDeclaration<PerformanceModule>;
14
14
  }
15
- export declare function providePerformance(fn: () => FirebasePerformance, ...deps: any[]): ModuleWithProviders<PerformanceModule>;
15
+ export declare function providePerformance(fn: (injector: Injector) => FirebasePerformance, ...deps: any[]): ModuleWithProviders<PerformanceModule>;
@@ -12,4 +12,4 @@ export declare class RemoteConfigModule {
12
12
  static ɵmod: i0.ɵɵNgModuleDeclaration<RemoteConfigModule, never, never, never>;
13
13
  static ɵinj: i0.ɵɵInjectorDeclaration<RemoteConfigModule>;
14
14
  }
15
- export declare function provideRemoteConfig(fn: () => FirebaseRemoteConfig, ...deps: any[]): ModuleWithProviders<RemoteConfigModule>;
15
+ export declare function provideRemoteConfig(fn: (injector: Injector) => FirebaseRemoteConfig, ...deps: any[]): ModuleWithProviders<RemoteConfigModule>;
@@ -193,7 +193,12 @@ const deployToFunction = (firebaseTools, context, workspaceRoot, staticBuildTarg
193
193
  }
194
194
  const functionsPackageJsonPath = path_1.join(functionsOut, 'package.json');
195
195
  fsHost.writeFileSync(functionsPackageJsonPath, JSON.stringify(packageJson, null, 2));
196
- fsHost.writeFileSync(path_1.join(functionsOut, 'index.js'), functions_templates_1.defaultFunction(serverBuildOptions.outputPath, options, functionName));
196
+ if (options.CF3v2) {
197
+ fsHost.writeFileSync(path_1.join(functionsOut, 'index.js'), functions_templates_1.functionGen2(serverBuildOptions.outputPath, options, functionName));
198
+ }
199
+ else {
200
+ fsHost.writeFileSync(path_1.join(functionsOut, 'index.js'), functions_templates_1.defaultFunction(serverBuildOptions.outputPath, options, functionName));
201
+ }
197
202
  if (!options.prerender) {
198
203
  try {
199
204
  fsHost.renameSync(path_1.join(newStaticOut, 'index.html'), path_1.join(newStaticOut, 'index.original.html'));
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dockerfile = exports.defaultFunction = exports.defaultPackage = exports.DEFAULT_FUNCTION_NAME = exports.DEFAULT_NODE_VERSION = void 0;
3
+ exports.dockerfile = exports.functionGen2 = exports.defaultFunction = exports.defaultPackage = exports.DEFAULT_FUNCTION_NAME = exports.DEFAULT_NODE_VERSION = void 0;
4
4
  exports.DEFAULT_NODE_VERSION = 14;
5
5
  exports.DEFAULT_FUNCTION_NAME = 'ssr';
6
6
  const DEFAULT_FUNCTION_REGION = 'us-central1';
@@ -37,6 +37,16 @@ exports.${functionName || exports.DEFAULT_FUNCTION_NAME} = functions
37
37
  .onRequest(expressApp);
38
38
  `;
39
39
  exports.defaultFunction = defaultFunction;
40
+ const functionGen2 = (path, options, functionName) => `const { onRequest } = require('firebase-functions/v2/https');
41
+
42
+ // Increase readability in Cloud Logging
43
+ require("firebase-functions/lib/logger/compat");
44
+
45
+ const expressApp = require('./${path}/main').app();
46
+
47
+ exports.${functionName || exports.DEFAULT_FUNCTION_NAME} = onRequest(${JSON.stringify(Object.assign({ region: options.region || DEFAULT_FUNCTION_REGION }, (options.functionsRuntimeOptions || DEFAULT_RUNTIME_OPTIONS)))}, expressApp);
48
+ `;
49
+ exports.functionGen2 = functionGen2;
40
50
  const dockerfile = (options) => `FROM node:${options.functionsNodeVersion || exports.DEFAULT_NODE_VERSION}-slim
41
51
  WORKDIR /usr/src/app
42
52
  COPY package*.json ./
@@ -30,7 +30,7 @@
30
30
  "pattern": "^[^:\\s]+:[^:\\s]+(:[^\\s]+)?$"
31
31
  },
32
32
  "ssr": {
33
- "type": ["boolean", "string"],
33
+ "oneOf": [{ "type": "boolean" }, { "type": "string" }],
34
34
  "description": "Should we attempt to deploy the function to Cloud Functions (true or 'cloud-functions') / Cloud Run ('cloud-run') or just Hosting (false)"
35
35
  },
36
36
  "prerender": {
@@ -54,9 +54,13 @@
54
54
  "description": "The name of the Cloud Function or Cloud Run serviceId to deploy SSR to"
55
55
  },
56
56
  "functionsNodeVersion": {
57
- "type": ["number", "string"],
57
+ "oneOf": [{ "type": "number" }, { "type": "string" }],
58
58
  "description": "Version of Node.js to run Cloud Functions / Run on"
59
59
  },
60
+ "CF3v2": {
61
+ "type": "boolean",
62
+ "description": "Generation of the Functions product to run on"
63
+ },
60
64
  "region": {
61
65
  "type": "string",
62
66
  "description": "The region to deploy Cloud Functions or Cloud Run to"
@@ -82,12 +86,12 @@
82
86
  "description": "Set a CPU limit in Kubernetes cpu units."
83
87
  },
84
88
  "maxConcurrency": {
85
- "type": ["number", "string"],
89
+ "oneOf": [{ "type": "number" }, { "type": "string" }],
86
90
  "pattern": "^(\\d+|default)$",
87
91
  "description": "Set the maximum number of concurrent requests allowed per container instance. If concurrency is unspecified, any number of concurrent requests are allowed. To unset this field, provide the special value default."
88
92
  },
89
93
  "maxInstances": {
90
- "type": ["number", "string"],
94
+ "oneOf": [{ "type": "number" }, { "type": "string" }],
91
95
  "pattern": "^(\\d+|default)$",
92
96
  "description": "The maximum number of container instances of the Service to run. Use 'default' to unset the limit and use the platform default."
93
97
  },
@@ -97,7 +101,7 @@
97
101
  "description": "Set a memory limit. Ex: 1Gi, 512Mi."
98
102
  },
99
103
  "minInstances": {
100
- "type": ["number", "string"],
104
+ "oneOf": [{ "type": "number" }, { "type": "string" }],
101
105
  "pattern": "^(\\d+|default)$",
102
106
  "description": "The minimum number of container instances of the Service to run or 'default' to remove any minimum."
103
107
  },
@@ -47,7 +47,7 @@ const isApp = (elem) => {
47
47
  const isSite = (elem) => {
48
48
  return elem.original === undefined;
49
49
  };
50
- const searchProjects = (promise) => (_, input) => promise.then(projects => {
50
+ const searchProjects = (projects) => (_, input) => __awaiter(void 0, void 0, void 0, function* () {
51
51
  projects.unshift({
52
52
  projectId: NEW_OPTION,
53
53
  displayName: '[CREATE NEW PROJECT]'
@@ -72,7 +72,7 @@ const searchProjects = (promise) => (_, input) => promise.then(projects => {
72
72
  });
73
73
  });
74
74
  exports.searchProjects = searchProjects;
75
- const searchApps = (promise) => (_, input) => promise.then(apps => {
75
+ const searchApps = (apps) => (_, input) => __awaiter(void 0, void 0, void 0, function* () {
76
76
  apps.unshift({
77
77
  appId: NEW_OPTION,
78
78
  displayName: '[CREATE NEW APP]',
@@ -97,7 +97,7 @@ const searchApps = (promise) => (_, input) => promise.then(apps => {
97
97
  });
98
98
  });
99
99
  exports.searchApps = searchApps;
100
- const searchSites = (promise) => (_, input) => promise.then(sites => {
100
+ const searchSites = (sites) => (_, input) => __awaiter(void 0, void 0, void 0, function* () {
101
101
  sites.unshift({
102
102
  name: NEW_OPTION,
103
103
  defaultUrl: '[CREATE NEW SITE]',
@@ -164,7 +164,7 @@ const userPrompt = (options) => __awaiter(void 0, void 0, void 0, function* () {
164
164
  exports.userPrompt = userPrompt;
165
165
  const projectPrompt = (defaultProject, options) => __awaiter(void 0, void 0, void 0, function* () {
166
166
  const firebaseTools = yield firebaseTools_1.getFirebaseTools();
167
- const projects = firebaseTools.projects.list(options);
167
+ const projects = yield firebaseTools.projects.list(options);
168
168
  const { projectId } = yield autocomplete({
169
169
  type: 'autocomplete',
170
170
  name: 'projectId',
@@ -191,7 +191,7 @@ const projectPrompt = (defaultProject, options) => __awaiter(void 0, void 0, voi
191
191
  exports.projectPrompt = projectPrompt;
192
192
  const appPrompt = ({ projectId: project }, defaultAppId, options) => __awaiter(void 0, void 0, void 0, function* () {
193
193
  const firebaseTools = yield firebaseTools_1.getFirebaseTools();
194
- const apps = firebaseTools.apps.list('web', Object.assign(Object.assign({}, options), { project }));
194
+ const apps = yield firebaseTools.apps.list('web', Object.assign(Object.assign({}, options), { project }));
195
195
  const { appId } = yield autocomplete({
196
196
  type: 'autocomplete',
197
197
  name: 'appId',
@@ -212,7 +212,7 @@ const appPrompt = ({ projectId: project }, defaultAppId, options) => __awaiter(v
212
212
  exports.appPrompt = appPrompt;
213
213
  const sitePrompt = ({ projectId: project }, options) => __awaiter(void 0, void 0, void 0, function* () {
214
214
  const firebaseTools = yield firebaseTools_1.getFirebaseTools();
215
- const sites = firebaseTools.hosting.sites.list(Object.assign(Object.assign({}, options), { project })).then(it => {
215
+ const sites = yield firebaseTools.hosting.sites.list(Object.assign(Object.assign({}, options), { project })).then(it => {
216
216
  if (it.sites.length === 0) {
217
217
  return [{
218
218
  name: project,
@@ -230,7 +230,7 @@ const sitePrompt = ({ projectId: project }, options) => __awaiter(void 0, void 0
230
230
  name: 'siteName',
231
231
  source: exports.searchSites(sites),
232
232
  message: 'Please select a hosting site:',
233
- default: _ => sites.then(it => common_1.shortSiteName(it.find(it => it.type === DEFAULT_SITE_TYPE))),
233
+ default: _ => common_1.shortSiteName(sites.find(site => site.type === DEFAULT_SITE_TYPE)),
234
234
  });
235
235
  if (siteName === NEW_OPTION) {
236
236
  const { subdomain } = yield inquirer.prompt({
@@ -127,12 +127,9 @@ function addFixesToServer(host, options) {
127
127
  }
128
128
  const sourceText = text.toString('utf-8');
129
129
  const addZonePatch = !sourceText.includes('import \'zone.js/dist/zone-patch-rxjs\';');
130
- const addFirestorePatch = options.features.includes(7) &&
131
- !sourceText.includes('import \'@angular/fire/firestore-protos\';');
132
- if (addZonePatch || addFirestorePatch) {
130
+ if (addZonePatch) {
133
131
  common_1.overwriteIfExists(host, serverPath, sourceText.replace('import \'zone.js/dist/zone-node\';', `import 'zone.js/dist/zone-node';
134
- ${addZonePatch ? 'import \'zone.js/dist/zone-patch-rxjs\';' : ''}
135
- ${addFirestorePatch ? 'import \'@angular/fire/firestore-protos\';' : ''}`));
132
+ ${addZonePatch ? 'import \'zone.js/dist/zone-patch-rxjs\';' : ''}`));
136
133
  }
137
134
  return host;
138
135
  }
@@ -1,14 +1,5 @@
1
1
  {
2
- "peerDependencies": {
3
- "firebase": {
4
- "dev": false,
5
- "version": "^9.4.0"
6
- },
7
- "rxfire": {
8
- "dev": false,
9
- "version": "^6.0.0"
10
- }
11
- },
2
+ "peerDependencies": {},
12
3
  "firebaseFunctionsDependencies": {
13
4
  "firebase-admin": {
14
5
  "dev": false,
@@ -1,10 +1,13 @@
1
1
  export * from 'firebase/storage';
2
- import { connectStorageEmulator as _connectStorageEmulator, deleteObject as _deleteObject, getDownloadURL as _getDownloadURL, getMetadata as _getMetadata, getStorage as _getStorage, list as _list, listAll as _listAll, ref as _ref, updateMetadata as _updateMetadata, uploadBytes as _uploadBytes, uploadBytesResumable as _uploadBytesResumable, uploadString as _uploadString } from 'firebase/storage';
2
+ import { connectStorageEmulator as _connectStorageEmulator, deleteObject as _deleteObject, getBlob as _getBlob, getBytes as _getBytes, getDownloadURL as _getDownloadURL, getMetadata as _getMetadata, getStorage as _getStorage, getStream as _getStream, list as _list, listAll as _listAll, ref as _ref, updateMetadata as _updateMetadata, uploadBytes as _uploadBytes, uploadBytesResumable as _uploadBytesResumable, uploadString as _uploadString } from 'firebase/storage';
3
3
  export declare const connectStorageEmulator: typeof _connectStorageEmulator;
4
4
  export declare const deleteObject: typeof _deleteObject;
5
+ export declare const getBlob: typeof _getBlob;
6
+ export declare const getBytes: typeof _getBytes;
5
7
  export declare const getDownloadURL: typeof _getDownloadURL;
6
8
  export declare const getMetadata: typeof _getMetadata;
7
9
  export declare const getStorage: typeof _getStorage;
10
+ export declare const getStream: typeof _getStream;
8
11
  export declare const list: typeof _list;
9
12
  export declare const listAll: typeof _listAll;
10
13
  export declare const ref: typeof _ref;
@@ -12,4 +12,4 @@ export declare class StorageModule {
12
12
  static ɵmod: i0.ɵɵNgModuleDeclaration<StorageModule, never, never, never>;
13
13
  static ɵinj: i0.ɵɵInjectorDeclaration<StorageModule>;
14
14
  }
15
- export declare function provideStorage(fn: () => FirebaseStorage, ...deps: any[]): ModuleWithProviders<StorageModule>;
15
+ export declare function provideStorage(fn: (injector: Injector) => FirebaseStorage, ...deps: any[]): ModuleWithProviders<StorageModule>;