diff --git a/.changeset/shy-trees-divide.md b/.changeset/shy-trees-divide.md new file mode 100644 index 00000000000..8bc7b66e887 --- /dev/null +++ b/.changeset/shy-trees-divide.md @@ -0,0 +1,6 @@ +--- +"firebase": major +"@firebase/firestore": major +--- + +Removed depreacted `experimentalTabSynchronization` settings. To enable multi-tab sychronization, use `synchronizeTabs` instead. diff --git a/packages/firebase/index.d.ts b/packages/firebase/index.d.ts index 01e76372722..3dbef9e2c19 100644 --- a/packages/firebase/index.d.ts +++ b/packages/firebase/index.d.ts @@ -1813,7 +1813,7 @@ declare namespace firebase.functions { /** * Changes this instance to point to a Cloud Functions emulator running * locally. See https://firebase.google.com/docs/functions/local-emulator - * + * * @deprecated Prefer the useEmulator(host, port) method. * @param origin The origin of the local emulator, such as * "http://localhost:5005". @@ -3132,10 +3132,10 @@ declare namespace firebase.auth { */ useDeviceLanguage(): void; /** - * Modify this Auth instance to communicate with the Firebase Auth emulator. This must be + * Modify this Auth instance to communicate with the Firebase Auth emulator. This must be * called synchronously immediately following the first call to `firebase.auth()`. Do not use * with production credentials as emulator traffic is not encrypted. - * + * * @param url The URL at which the emulator is running (eg, 'http://localhost:9099') */ useEmulator(url: string): void; @@ -7954,17 +7954,6 @@ declare namespace firebase.firestore { */ synchronizeTabs?: boolean; - /** - * Whether to synchronize the in-memory state of multiple tabs. Setting this - * to `true` in all open tabs enables shared access to local persistence, - * shared execution of queries and latency-compensated local document updates - * across all connected instances. - * - * @deprecated This setting is deprecated. To enable synchronization between - * multiple tabs, please use `synchronizeTabs: true` instead. - */ - experimentalTabSynchronization?: boolean; - /** * Whether to force enable persistence for the client. This cannot be used * with `synchronizeTabs:true` and is primarily intended for use with Web diff --git a/packages/firestore/src/api/database.ts b/packages/firestore/src/api/database.ts index c9912e81a9f..9ac0a2e27e3 100644 --- a/packages/firestore/src/api/database.ts +++ b/packages/firestore/src/api/database.ts @@ -159,6 +159,7 @@ export const CACHE_SIZE_UNLIMITED = LruParams.COLLECTION_DISABLED; // enablePersistence() defaults: const DEFAULT_SYNCHRONIZE_TABS = false; +const DEFAULT_FORCE_OWNING_TAB = false; /** Undocumented, private additional settings not exposed in our public API. */ interface PrivateSettings extends PublicSettings { @@ -461,26 +462,16 @@ export class Firestore implements PublicFirestore, FirebaseService { let experimentalForceOwningTab = false; if (settings) { - if (settings.experimentalTabSynchronization !== undefined) { - logError( - "The 'experimentalTabSynchronization' setting will be removed. Use 'synchronizeTabs' instead." - ); - } - synchronizeTabs = - settings.synchronizeTabs ?? - settings.experimentalTabSynchronization ?? - DEFAULT_SYNCHRONIZE_TABS; - - experimentalForceOwningTab = settings.experimentalForceOwningTab - ? settings.experimentalForceOwningTab - : false; + synchronizeTabs = settings.synchronizeTabs ?? DEFAULT_SYNCHRONIZE_TABS; + experimentalForceOwningTab = + settings.experimentalForceOwningTab ?? DEFAULT_FORCE_OWNING_TAB; - if (synchronizeTabs && experimentalForceOwningTab) { - throw new FirestoreError( - Code.INVALID_ARGUMENT, - "The 'experimentalForceOwningTab' setting cannot be used with 'synchronizeTabs'." - ); - } + validateIsNotUsedTogether( + 'synchronizeTabs', + synchronizeTabs, + 'experimentalForceOwningTab', + experimentalForceOwningTab + ); } return this.configureClient(