Skip to content

Tree-shakeable FirestoreClient #3492

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 9 commits into from
Jul 29, 2020
Merged

Conversation

schmidt-sebastian
Copy link
Contributor

This extracts all logic from FirestoreClient into free standing functions. The goal of this is to no longer use firestore-exp in the tree-shakeable client.

@changeset-bot
Copy link

changeset-bot bot commented Jul 28, 2020

💥 No Changeset

Latest commit: 9890082

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 28, 2020

Binary Size Report

Affected SDKs

  • @firebase/firestore

    Type Base (b1090a2) Head (ba80165) Diff
    browser 246 kB 246 kB +411 B (+0.2%)
    esm2017 193 kB 193 kB +142 B (+0.1%)
    main 470 kB 470 kB +667 B (+0.1%)
    module 243 kB 244 kB +367 B (+0.2%)
    react-native 193 kB 193 kB +142 B (+0.1%)
  • @firebase/firestore/exp

    Type Base (b1090a2) Head (ba80165) Diff
    browser 187 kB 187 kB +142 B (+0.1%)
    main 466 kB 466 kB +667 B (+0.1%)
    module 187 kB 187 kB +142 B (+0.1%)
    react-native 187 kB 187 kB +142 B (+0.1%)
  • @firebase/firestore/memory

    Type Base (b1090a2) Head (ba80165) Diff
    browser 184 kB 185 kB +411 B (+0.2%)
    esm2017 144 kB 145 kB +142 B (+0.1%)
    main 345 kB 345 kB +667 B (+0.2%)
    module 182 kB 183 kB +367 B (+0.2%)
    react-native 145 kB 145 kB +142 B (+0.1%)
  • firebase

    Type Base (b1090a2) Head (ba80165) Diff
    firebase-firestore.js 284 kB 285 kB +359 B (+0.1%)
    firebase-firestore.memory.js 225 kB 225 kB +359 B (+0.2%)
    firebase.js 818 kB 818 kB +363 B (+0.0%)

Test Logs

Copy link
Contributor

@dconeybe dconeybe left a comment

Choose a reason for hiding this comment

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

LGTM, pending one comment that I left.

enabled: boolean
): Promise<void> {
return asyncQueue.enqueue(() => {
persistence.setNetworkEnabled(true);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should persistence.setNetworkEnabled(true) be invoked with enabled instead of hardcodingtrue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It should not. It must! Thanks for catching.

@schmidt-sebastian schmidt-sebastian force-pushed the mrschmidt/asyncobservercleanup branch from 4a93ee3 to 3e4c610 Compare July 28, 2020 18:58
Base automatically changed from mrschmidt/asyncobservercleanup to master July 28, 2020 22:13
@schmidt-sebastian schmidt-sebastian merged commit 6f283d5 into master Jul 29, 2020
@firebase firebase locked and limited conversation to collaborators Aug 29, 2020
@schmidt-sebastian schmidt-sebastian deleted the mrschmidt/treeshakeablefc branch November 9, 2020 22:38
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