Skip to content

Commit 344bd88

Browse files
Remove experimentalTabSynchronization (#3943)
1 parent 2c1764d commit 344bd88

File tree

3 files changed

+19
-33
lines changed

3 files changed

+19
-33
lines changed

.changeset/shy-trees-divide.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"firebase": major
3+
"@firebase/firestore": major
4+
---
5+
6+
Removed depreacted `experimentalTabSynchronization` settings. To enable multi-tab sychronization, use `synchronizeTabs` instead.

packages/firebase/index.d.ts

+3-14
Original file line numberDiff line numberDiff line change
@@ -1813,7 +1813,7 @@ declare namespace firebase.functions {
18131813
/**
18141814
* Changes this instance to point to a Cloud Functions emulator running
18151815
* locally. See https://firebase.google.com/docs/functions/local-emulator
1816-
*
1816+
*
18171817
* @deprecated Prefer the useEmulator(host, port) method.
18181818
* @param origin The origin of the local emulator, such as
18191819
* "http://localhost:5005".
@@ -3132,10 +3132,10 @@ declare namespace firebase.auth {
31323132
*/
31333133
useDeviceLanguage(): void;
31343134
/**
3135-
* Modify this Auth instance to communicate with the Firebase Auth emulator. This must be
3135+
* Modify this Auth instance to communicate with the Firebase Auth emulator. This must be
31363136
* called synchronously immediately following the first call to `firebase.auth()`. Do not use
31373137
* with production credentials as emulator traffic is not encrypted.
3138-
*
3138+
*
31393139
* @param url The URL at which the emulator is running (eg, 'http://localhost:9099')
31403140
*/
31413141
useEmulator(url: string): void;
@@ -7954,17 +7954,6 @@ declare namespace firebase.firestore {
79547954
*/
79557955
synchronizeTabs?: boolean;
79567956

7957-
/**
7958-
* Whether to synchronize the in-memory state of multiple tabs. Setting this
7959-
* to `true` in all open tabs enables shared access to local persistence,
7960-
* shared execution of queries and latency-compensated local document updates
7961-
* across all connected instances.
7962-
*
7963-
* @deprecated This setting is deprecated. To enable synchronization between
7964-
* multiple tabs, please use `synchronizeTabs: true` instead.
7965-
*/
7966-
experimentalTabSynchronization?: boolean;
7967-
79687957
/**
79697958
* Whether to force enable persistence for the client. This cannot be used
79707959
* with `synchronizeTabs:true` and is primarily intended for use with Web

packages/firestore/src/api/database.ts

+10-19
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ export const CACHE_SIZE_UNLIMITED = LruParams.COLLECTION_DISABLED;
159159

160160
// enablePersistence() defaults:
161161
const DEFAULT_SYNCHRONIZE_TABS = false;
162+
const DEFAULT_FORCE_OWNING_TAB = false;
162163

163164
/** Undocumented, private additional settings not exposed in our public API. */
164165
interface PrivateSettings extends PublicSettings {
@@ -461,26 +462,16 @@ export class Firestore implements PublicFirestore, FirebaseService {
461462
let experimentalForceOwningTab = false;
462463

463464
if (settings) {
464-
if (settings.experimentalTabSynchronization !== undefined) {
465-
logError(
466-
"The 'experimentalTabSynchronization' setting will be removed. Use 'synchronizeTabs' instead."
467-
);
468-
}
469-
synchronizeTabs =
470-
settings.synchronizeTabs ??
471-
settings.experimentalTabSynchronization ??
472-
DEFAULT_SYNCHRONIZE_TABS;
473-
474-
experimentalForceOwningTab = settings.experimentalForceOwningTab
475-
? settings.experimentalForceOwningTab
476-
: false;
465+
synchronizeTabs = settings.synchronizeTabs ?? DEFAULT_SYNCHRONIZE_TABS;
466+
experimentalForceOwningTab =
467+
settings.experimentalForceOwningTab ?? DEFAULT_FORCE_OWNING_TAB;
477468

478-
if (synchronizeTabs && experimentalForceOwningTab) {
479-
throw new FirestoreError(
480-
Code.INVALID_ARGUMENT,
481-
"The 'experimentalForceOwningTab' setting cannot be used with 'synchronizeTabs'."
482-
);
483-
}
469+
validateIsNotUsedTogether(
470+
'synchronizeTabs',
471+
synchronizeTabs,
472+
'experimentalForceOwningTab',
473+
experimentalForceOwningTab
474+
);
484475
}
485476

486477
return this.configureClient(

0 commit comments

Comments
 (0)