Skip to content
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

Tree-shakeable Target #3248

Merged
merged 3 commits into from
Jun 22, 2020
Merged

Conversation

schmidt-sebastian
Copy link
Contributor

@schmidt-sebastian schmidt-sebastian commented Jun 22, 2020

This is the first step in making Query tree-shakeable (but has not side impact on its own, since the non tree-shakeable Query relies on all functionality).

This PR:

  • Makes all Target methods tree-shakeable.
  • Split up Target into Target/TargetImpl, which adds a lot of code and indirection, but hides the memoizedCanonicalId from the public API
  • Updated ObjectMap to use the new equals functions instead of Equatable, which allows Targets to still be stored in Objects.
  • Adds the ability to use the new equals methods in our custom test equals helper.

The diff is easier to review in IntelliJ (it correlates more of the existing code). In general, this PR only contains moved code and no logic modifications.

@schmidt-sebastian schmidt-sebastian force-pushed the mrschmdit/treeshakeabletarget branch 2 times, most recently from 0853a38 to 013f665 Compare June 22, 2020 06:30
@schmidt-sebastian schmidt-sebastian force-pushed the mrschmdit/treeshakeabletarget branch from 013f665 to 8f536a0 Compare June 22, 2020 06:31
@schmidt-sebastian schmidt-sebastian changed the title Tree-shakeable target Tree-shakeable Target Jun 22, 2020
@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jun 22, 2020

Binary Size Report

Affected SDKs

  • @firebase/firestore

    Type Base (e733228) Head (c18b3ec) Diff
    browser 249 kB 249 kB +140 B (+0.1%)
    esm2017 194 kB 194 kB +61 B (+0.0%)
    main 491 kB 492 kB +989 B (+0.2%)
    module 246 kB 247 kB +164 B (+0.1%)
  • @firebase/firestore/lite

    Type Base (e733228) Head (c18b3ec) Diff
    main 139 kB 140 kB +570 B (+0.4%)
  • @firebase/firestore/memory

    Type Base (e733228) Head (c18b3ec) Diff
    browser 186 kB 186 kB +174 B (+0.1%)
    esm2017 145 kB 145 kB +66 B (+0.0%)
    main 361 kB 362 kB +943 B (+0.3%)
    module 184 kB 184 kB +150 B (+0.1%)
  • firebase

    Type Base (e733228) Head (c18b3ec) Diff
    firebase-firestore.js 287 kB 287 kB +143 B (+0.0%)
    firebase-firestore.memory.js 226 kB 226 kB +152 B (+0.1%)
    firebase.js 820 kB 820 kB +144 B (+0.0%)

Test Logs

@schmidt-sebastian schmidt-sebastian merged commit 23e8971 into master Jun 22, 2020
@schmidt-sebastian schmidt-sebastian deleted the mrschmdit/treeshakeabletarget branch July 9, 2020 17:45
@firebase firebase locked and limited conversation to collaborators Jul 23, 2020
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