Skip to content

Remove MultiTabSyncEngine #3442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 21, 2020
Merged

Remove MultiTabSyncEngine #3442

merged 4 commits into from
Jul 21, 2020

Conversation

schmidt-sebastian
Copy link
Contributor

@schmidt-sebastian schmidt-sebastian commented Jul 20, 2020

This is similar to #3436 and removes the explicit MultiTabSyncEngine class. Instead, the methods are now tree-shakeable and will only be included with multi-tab IndexedDb persistence.

Much smaller diff: https://github.com/firebase/firebase-js-sdk/pull/3442/files?w=1

This is the second commit in #3425. The next PR will then rewrite the component provider.

@changeset-bot
Copy link

changeset-bot bot commented Jul 20, 2020

💥 No Changeset

Latest commit: a70479b

Merging this PR will not cause any packages to be released. If these changes should not cause updates to packages in this repo, this is fine 🙂

If these changes should be published to npm, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jul 20, 2020

Binary Size Report

Affected SDKs

  • @firebase/firestore

    Type Base (7d5678b) Head (2a2eca4) Diff
    browser 246 kB 246 kB -502 B (-0.2%)
    esm2017 193 kB 193 kB -75 B (-0.0%)
    main 469 kB 469 kB +5 B (+0.0%)
    module 244 kB 244 kB -492 B (-0.2%)
    react-native 194 kB 193 kB -75 B (-0.0%)
  • @firebase/firestore/exp

    Type Base (7d5678b) Head (2a2eca4) Diff
    browser 187 kB 187 kB -75 B (-0.0%)
    main 508 kB 508 kB -10 B (-0.0%)
    react-native 187 kB 187 kB -75 B (-0.0%)
  • @firebase/firestore/lite

    Type Base (7d5678b) Head (2a2eca4) Diff
    main 494 kB 494 kB -10 B (-0.0%)
  • @firebase/firestore/memory

    Type Base (7d5678b) Head (2a2eca4) Diff
    browser 185 kB 185 kB +93 B (+0.1%)
    esm2017 145 kB 145 kB +103 B (+0.1%)
    main 344 kB 344 kB +279 B (+0.1%)
    module 183 kB 183 kB +93 B (+0.1%)
    react-native 145 kB 145 kB +103 B (+0.1%)
  • firebase

    Type Base (7d5678b) Head (2a2eca4) Diff
    firebase-firestore.js 285 kB 284 kB -525 B (-0.2%)
    firebase-firestore.memory.js 224 kB 224 kB +86 B (+0.0%)
    firebase.js 820 kB 819 kB -526 B (-0.1%)

Test Logs

@schmidt-sebastian schmidt-sebastian changed the title Remove MulitTabSyncEngine WIP Remove MulitTabSyncEngine Jul 20, 2020
@schmidt-sebastian schmidt-sebastian force-pushed the mrschmidt/onesyncengine branch from 7f24fca to e1cd35b Compare July 20, 2020 22:29
// online state (the local client may go offline, even though the primary
// tab remains online) and only apply the primary tab's online state from
// SharedClientState.
if (
Copy link
Contributor Author

@schmidt-sebastian schmidt-sebastian Jul 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: This combines the MultiTabSyncEngine's applyOnlineStateChange with the SyncEngine's applyOnlineStateChange. It is actually similar to what we had 6+ months ago.

@@ -75,7 +75,6 @@ export type ClientId = string;
* assigned before calling `start()`.
*/
export interface SharedClientState {
syncEngine: SharedClientStateSyncer | null;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This field is now only part of WebStorageSharedClientState. Removing it made the general test setup a lot easier, since it is not accessed in most tests but would still have to be assigned.

@var-const var-const changed the title WIP Remove MulitTabSyncEngine WIP Remove MultiTabSyncEngine Jul 20, 2020
@schmidt-sebastian schmidt-sebastian changed the title WIP Remove MultiTabSyncEngine Remove MultiTabSyncEngine Jul 20, 2020
@schmidt-sebastian schmidt-sebastian merged commit cf8696e into master Jul 21, 2020
@firebase firebase locked and limited conversation to collaborators Aug 21, 2020
@schmidt-sebastian schmidt-sebastian deleted the mrschmidt/onesyncengine branch November 9, 2020 22:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants