@firebase/firestore 3.11.0 → 3.12.0-20230511201449

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 (61) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/firestore/src/api/long_polling_options.d.ts +55 -0
  3. package/dist/firestore/src/api/settings.d.ts +16 -2
  4. package/dist/firestore/src/api.d.ts +1 -0
  5. package/dist/firestore/src/core/database_info.d.ts +4 -1
  6. package/dist/firestore/src/lite-api/settings.d.ts +3 -0
  7. package/dist/firestore/src/platform/browser/webchannel_connection.d.ts +1 -0
  8. package/dist/firestore/test/unit/api/long_polling_options.test.d.ts +17 -0
  9. package/dist/index.cjs.js +1222 -1181
  10. package/dist/index.cjs.js.map +1 -1
  11. package/dist/index.d.ts +61 -2
  12. package/dist/index.esm2017.js +1137 -1096
  13. package/dist/index.esm2017.js.map +1 -1
  14. package/dist/index.esm5.js +1041 -1021
  15. package/dist/index.esm5.js.map +1 -1
  16. package/dist/index.node.cjs.js +71 -6
  17. package/dist/index.node.cjs.js.map +1 -1
  18. package/dist/index.node.mjs +71 -6
  19. package/dist/index.node.mjs.map +1 -1
  20. package/dist/index.rn.js +868 -827
  21. package/dist/index.rn.js.map +1 -1
  22. package/dist/internal.d.ts +67 -3
  23. package/dist/lite/firestore/src/api/long_polling_options.d.ts +55 -0
  24. package/dist/lite/firestore/src/api/settings.d.ts +16 -2
  25. package/dist/lite/firestore/src/api.d.ts +1 -0
  26. package/dist/lite/firestore/src/core/database_info.d.ts +4 -1
  27. package/dist/lite/firestore/src/lite-api/settings.d.ts +3 -0
  28. package/dist/lite/firestore/src/platform/browser/webchannel_connection.d.ts +1 -0
  29. package/dist/lite/firestore/test/unit/api/long_polling_options.test.d.ts +17 -0
  30. package/dist/lite/index.browser.esm2017.js +756 -716
  31. package/dist/lite/index.browser.esm2017.js.map +1 -1
  32. package/dist/lite/index.browser.esm5.js +764 -745
  33. package/dist/lite/index.browser.esm5.js.map +1 -1
  34. package/dist/lite/index.cjs.js +756 -716
  35. package/dist/lite/index.cjs.js.map +1 -1
  36. package/dist/lite/index.node.cjs.js +71 -6
  37. package/dist/lite/index.node.cjs.js.map +1 -1
  38. package/dist/lite/index.node.mjs +71 -6
  39. package/dist/lite/index.node.mjs.map +1 -1
  40. package/dist/lite/index.rn.esm2017.js +763 -723
  41. package/dist/lite/index.rn.esm2017.js.map +1 -1
  42. package/dist/lite/internal.d.ts +52 -1
  43. package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +127 -144
  44. package/dist/lite/packages/firestore/src/api/long_polling_options.d.ts +55 -0
  45. package/dist/lite/packages/firestore/src/api/settings.d.ts +16 -2
  46. package/dist/lite/packages/firestore/src/api.d.ts +1 -0
  47. package/dist/lite/packages/firestore/src/core/database_info.d.ts +4 -1
  48. package/dist/lite/packages/firestore/src/lite-api/settings.d.ts +3 -0
  49. package/dist/lite/packages/firestore/src/platform/browser/webchannel_connection.d.ts +1 -0
  50. package/dist/lite/packages/firestore/test/unit/api/long_polling_options.test.d.ts +17 -0
  51. package/dist/lite/private.d.ts +52 -1
  52. package/dist/packages/firestore/dist/index.esm2017.d.ts +275 -292
  53. package/dist/packages/firestore/src/api/long_polling_options.d.ts +55 -0
  54. package/dist/packages/firestore/src/api/settings.d.ts +16 -2
  55. package/dist/packages/firestore/src/api.d.ts +1 -0
  56. package/dist/packages/firestore/src/core/database_info.d.ts +4 -1
  57. package/dist/packages/firestore/src/lite-api/settings.d.ts +3 -0
  58. package/dist/packages/firestore/src/platform/browser/webchannel_connection.d.ts +1 -0
  59. package/dist/packages/firestore/test/unit/api/long_polling_options.test.d.ts +17 -0
  60. package/dist/private.d.ts +67 -3
  61. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @firebase/firestore
2
2
 
3
+ ## 3.12.0-20230511201449
4
+
5
+ ### Minor Changes
6
+
7
+ - [`e45fea9b8`](https://github.com/firebase/firebase-js-sdk/commit/e45fea9b8ce2c284c5e147fd3ac2174087fbba09) [#7236](https://github.com/firebase/firebase-js-sdk/pull/7236) - Enabled long-polling networking mode auto detection by default. It can be explicitly disabled by setting `FirestoreSettings.experimentalForceLongPolling` to `false`.
8
+
9
+ - [`8051e4a99`](https://github.com/firebase/firebase-js-sdk/commit/8051e4a99e199e5cc8e6ff51a1a1116e4a56337b) [#7176](https://github.com/firebase/firebase-js-sdk/pull/7176) - Added the ability to configure the long-polling hanging get request timeout using the new `experimentalLongPollingOptions.timeoutSeconds` setting
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [[`466d3670a`](https://github.com/firebase/firebase-js-sdk/commit/466d3670ae32b61e3e0319bb73407bcd7ac90290), [`e0551fa13`](https://github.com/firebase/firebase-js-sdk/commit/e0551fa13c9ae1556edf0ffb967f2f9e661f18a0)]:
14
+ - @firebase/app@0.9.10-20230511201449
15
+
3
16
  ## 3.11.0
4
17
 
5
18
  ### Minor Changes
@@ -0,0 +1,55 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ /**
18
+ * Options that configure the SDK’s underlying network transport (WebChannel)
19
+ * when long-polling is used.
20
+ *
21
+ * Note: This interface is "experimental" and is subject to change.
22
+ *
23
+ * See `FirestoreSettings.experimentalAutoDetectLongPolling`,
24
+ * `FirestoreSettings.experimentalForceLongPolling`, and
25
+ * `FirestoreSettings.experimentalLongPollingOptions`.
26
+ */
27
+ export interface ExperimentalLongPollingOptions {
28
+ /**
29
+ * The desired maximum timeout interval, in seconds, to complete a
30
+ * long-polling GET response. Valid values are between 5 and 30, inclusive.
31
+ * Floating point values are allowed and will be rounded to the nearest
32
+ * millisecond.
33
+ *
34
+ * By default, when long-polling is used the "hanging GET" request sent by
35
+ * the client times out after 30 seconds. To request a different timeout
36
+ * from the server, set this setting with the desired timeout.
37
+ *
38
+ * Changing the default timeout may be useful, for example, if the buffering
39
+ * proxy that necessitated enabling long-polling in the first place has a
40
+ * shorter timeout for hanging GET requests, in which case setting the
41
+ * long-polling timeout to a shorter value, such as 25 seconds, may fix
42
+ * prematurely-closed hanging GET requests.
43
+ * For example, see https://github.com/firebase/firebase-js-sdk/issues/6987.
44
+ */
45
+ timeoutSeconds?: number;
46
+ }
47
+ /**
48
+ * Compares two `ExperimentalLongPollingOptions` objects for equality.
49
+ */
50
+ export declare function longPollingOptionsEqual(options1: ExperimentalLongPollingOptions, options2: ExperimentalLongPollingOptions): boolean;
51
+ /**
52
+ * Creates and returns a new `ExperimentalLongPollingOptions` with the same
53
+ * option values as the given instance.
54
+ */
55
+ export declare function cloneLongPollingOptions(options: ExperimentalLongPollingOptions): ExperimentalLongPollingOptions;
@@ -16,6 +16,7 @@
16
16
  */
17
17
  import { FirestoreSettings as LiteSettings } from '../lite-api/settings';
18
18
  import { FirestoreLocalCache } from './cache_config';
19
+ import { ExperimentalLongPollingOptions } from './long_polling_options';
19
20
  export { DEFAULT_HOST } from '../lite-api/settings';
20
21
  /**
21
22
  * Settings that can be passed to `enableIndexedDbPersistence()` to configure
@@ -80,8 +81,21 @@ export interface FirestoreSettings extends LiteSettings {
80
81
  * detect if long-polling should be used. This is very similar to
81
82
  * `experimentalForceLongPolling`, but only uses long-polling if required.
82
83
  *
83
- * This setting will likely be enabled by default in future releases and
84
- * cannot be combined with `experimentalForceLongPolling`.
84
+ * After having had a default value of `false` since its inception in 2019,
85
+ * the default value of this setting was changed in mid-2023 to `true`. That
86
+ * is, auto-detection of long polling is now enabled by default. To disable
87
+ * it, set this setting to `false`, and please open a GitHub issue to share
88
+ * the problems that motivated you disabling long-polling auto-detection.
85
89
  */
86
90
  experimentalAutoDetectLongPolling?: boolean;
91
+ /**
92
+ * Options that configure the SDK’s underlying network transport (WebChannel)
93
+ * when long-polling is used.
94
+ *
95
+ * These options are only used if `experimentalForceLongPolling` is true or if
96
+ * `experimentalAutoDetectLongPolling` is true and the auto-detection
97
+ * determined that long-polling was needed. Otherwise, these options have no
98
+ * effect.
99
+ */
100
+ experimentalLongPollingOptions?: ExperimentalLongPollingOptions;
87
101
  }
@@ -21,6 +21,7 @@ export { documentId, FieldPath } from './api/field_path';
21
21
  export { clearIndexedDbPersistence, connectFirestoreEmulator, disableNetwork, EmulatorMockTokenOptions, enableIndexedDbPersistence, enableMultiTabIndexedDbPersistence, enableNetwork, ensureFirestoreConfigured, Firestore, getFirestore, initializeFirestore, loadBundle, namedQuery, terminate, waitForPendingWrites } from './api/database';
22
22
  export { LoadBundleTask, LoadBundleTaskProgress, TaskState } from './api/bundle';
23
23
  export { FirestoreSettings, PersistenceSettings } from './api/settings';
24
+ export { ExperimentalLongPollingOptions } from './api/long_polling_options';
24
25
  export { DocumentChange, DocumentChangeType, DocumentSnapshot, FirestoreDataConverter, QueryDocumentSnapshot, QuerySnapshot, snapshotEqual, SnapshotMetadata, SnapshotOptions } from './api/snapshot';
25
26
  export { collection, collectionGroup, CollectionReference, doc, DocumentData, DocumentReference, PartialWithFieldValue, Query, queryEqual, refEqual, SetOptions, UpdateData, WithFieldValue } from './api/reference';
26
27
  export { and, endAt, endBefore, limit, limitToLast, or, orderBy, OrderByDirection, query, QueryCompositeFilterConstraint, QueryConstraint, QueryConstraintType, QueryEndAtConstraint, QueryFieldFilterConstraint, QueryFilterConstraint, QueryLimitConstraint, QueryNonFilterConstraint, QueryOrderByConstraint, QueryStartAtConstraint, startAfter, startAt, where, WhereFilterOp } from './api/filter';
@@ -1,4 +1,5 @@
1
1
  import { FirebaseApp } from '@firebase/app';
2
+ import { ExperimentalLongPollingOptions } from '../api/long_polling_options';
2
3
  /**
3
4
  * @license
4
5
  * Copyright 2017 Google LLC
@@ -23,6 +24,7 @@ export declare class DatabaseInfo {
23
24
  readonly ssl: boolean;
24
25
  readonly forceLongPolling: boolean;
25
26
  readonly autoDetectLongPolling: boolean;
27
+ readonly longPollingOptions: ExperimentalLongPollingOptions;
26
28
  readonly useFetchStreams: boolean;
27
29
  /**
28
30
  * Constructs a DatabaseInfo using the provided host, databaseId and
@@ -38,10 +40,11 @@ export declare class DatabaseInfo {
38
40
  * when using WebChannel as the network transport.
39
41
  * @param autoDetectLongPolling - Whether to use the detectBufferingProxy
40
42
  * option when using WebChannel as the network transport.
43
+ * @param longPollingOptions Options that configure long-polling.
41
44
  * @param useFetchStreams Whether to use the Fetch API instead of
42
45
  * XMLHTTPRequest
43
46
  */
44
- constructor(databaseId: DatabaseId, appId: string, persistenceKey: string, host: string, ssl: boolean, forceLongPolling: boolean, autoDetectLongPolling: boolean, useFetchStreams: boolean);
47
+ constructor(databaseId: DatabaseId, appId: string, persistenceKey: string, host: string, ssl: boolean, forceLongPolling: boolean, autoDetectLongPolling: boolean, longPollingOptions: ExperimentalLongPollingOptions, useFetchStreams: boolean);
45
48
  }
46
49
  /** The default database name for a project. */
47
50
  export declare const DEFAULT_DATABASE_NAME = "(default)";
@@ -16,6 +16,7 @@
16
16
  */
17
17
  import { FirestoreLocalCache } from '../api/cache_config';
18
18
  import { CredentialsSettings } from '../api/credentials';
19
+ import { ExperimentalLongPollingOptions } from '../api/long_polling_options';
19
20
  export declare const DEFAULT_HOST = "firestore.googleapis.com";
20
21
  export declare const DEFAULT_SSL = true;
21
22
  /**
@@ -41,6 +42,7 @@ export interface PrivateSettings extends FirestoreSettings {
41
42
  cacheSizeBytes?: number;
42
43
  experimentalForceLongPolling?: boolean;
43
44
  experimentalAutoDetectLongPolling?: boolean;
45
+ experimentalLongPollingOptions?: ExperimentalLongPollingOptions;
44
46
  useFetchStreams?: boolean;
45
47
  localCache?: FirestoreLocalCache;
46
48
  }
@@ -57,6 +59,7 @@ export declare class FirestoreSettingsImpl {
57
59
  readonly cacheSizeBytes: number;
58
60
  readonly experimentalForceLongPolling: boolean;
59
61
  readonly experimentalAutoDetectLongPolling: boolean;
62
+ readonly experimentalLongPollingOptions: ExperimentalLongPollingOptions;
60
63
  readonly ignoreUndefinedProperties: boolean;
61
64
  readonly useFetchStreams: boolean;
62
65
  readonly cache?: FirestoreLocalCache;
@@ -23,6 +23,7 @@ export declare class WebChannelConnection extends RestConnection {
23
23
  private readonly forceLongPolling;
24
24
  private readonly autoDetectLongPolling;
25
25
  private readonly useFetchStreams;
26
+ private readonly longPollingOptions;
26
27
  constructor(info: DatabaseInfo);
27
28
  protected performRPCRequest<Req, Resp>(rpcName: string, url: string, headers: StringMap, body: Req): Promise<Resp>;
28
29
  openStream<Req, Resp>(rpcName: string, authToken: Token | null, appCheckToken: Token | null): Stream<Req, Resp>;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export {};