Skip to content

Tree-shake RepoInfo #4515

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 2 commits into from
Feb 24, 2021
Merged

Tree-shake RepoInfo #4515

merged 2 commits into from
Feb 24, 2021

Conversation

hsubox76
Copy link
Contributor

It seems like most of the methods should stay on the class, I only extracted connectionURL and its helper method needsQueryParam but let me know if that's incorrect.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Feb 23, 2021

Binary Size Report

Affected SDKs

  • @firebase/analytics

    Type Base (08e2aa3) Head (d98006b) Diff
    main 24.5 kB 24.2 kB -294 B (-1.2%)
  • @firebase/app

    Type Base (08e2aa3) Head (d98006b) Diff
    main 10.6 kB 9.93 kB -647 B (-6.1%)
    react-native 10.3 kB 9.64 kB -639 B (-6.2%)
  • @firebase/component

    Type Base (08e2aa3) Head (d98006b) Diff
    main 6.05 kB 5.63 kB -412 B (-6.8%)
  • @firebase/database

    Type Base (08e2aa3) Head (d98006b) Diff
    browser 276 kB 276 kB +59 B (+0.0%)
    esm2017 246 kB 246 kB +79 B (+0.0%)
    main 279 kB 278 kB -188 B (-0.1%)
    module 276 kB 276 kB +59 B (+0.0%)
  • @firebase/database-exp

    Type Base (08e2aa3) Head (d98006b) Diff
    browser 276 kB 276 kB +59 B (+0.0%)
    esm2017 243 kB 243 kB +79 B (+0.0%)
    main 278 kB 277 kB -363 B (-0.1%)
    module 276 kB 276 kB +59 B (+0.0%)
  • @firebase/firestore

    Type Base (08e2aa3) Head (d98006b) Diff
    main 531 kB 530 kB -474 B (-0.1%)
  • @firebase/firestore-exp

    Type Base (08e2aa3) Head (d98006b) Diff
    main 505 kB 505 kB -247 B (-0.0%)
  • @firebase/firestore-lite

    Type Base (08e2aa3) Head (d98006b) Diff
    main 144 kB 143 kB -247 B (-0.2%)
  • @firebase/firestore/bundle

    Type Base (08e2aa3) Head (d98006b) Diff
    main 527 kB 526 kB -500 B (-0.1%)
  • @firebase/firestore/memory

    Type Base (08e2aa3) Head (d98006b) Diff
    main 324 kB 324 kB -462 B (-0.1%)
  • @firebase/firestore/memory-bundle

    Type Base (08e2aa3) Head (d98006b) Diff
    main 321 kB 321 kB -500 B (-0.2%)
  • @firebase/installations

    Type Base (08e2aa3) Head (d98006b) Diff
    main 22.7 kB 22.2 kB -486 B (-2.1%)
  • @firebase/logger

    Type Base (08e2aa3) Head (d98006b) Diff
    main 5.75 kB 5.50 kB -247 B (-4.3%)
  • @firebase/performance

    Type Base (08e2aa3) Head (d98006b) Diff
    main 28.5 kB 28.0 kB -494 B (-1.7%)
  • @firebase/remote-config

    Type Base (08e2aa3) Head (d98006b) Diff
    main 23.4 kB 22.9 kB -490 B (-2.1%)
  • @firebase/rules-unit-testing

    Type Base (08e2aa3) Head (d98006b) Diff
    main 12.2 kB 12.5 kB +302 B (+2.5%)
  • @firebase/storage

    Type Base (08e2aa3) Head (d98006b) Diff
    main 61.2 kB 60.7 kB -510 B (-0.8%)
  • @firebase/storage/exp

    Type Base (08e2aa3) Head (d98006b) Diff
    main 49.9 kB 50.0 kB +33 B (+0.1%)
  • @firebase/util

    Type Base (08e2aa3) Head (d98006b) Diff
    main 22.1 kB 24.4 kB +2.24 kB (+10.1%)
  • @firebase/webchannel-wrapper

    Type Base (08e2aa3) Head (d98006b) Diff
    main 47.2 kB 46.9 kB -247 B (-0.5%)
  • firebase

    Type Base (08e2aa3) Head (d98006b) Diff
    firebase-database.js 186 kB 186 kB -132 B (-0.1%)
    firebase.js 847 kB 847 kB -287 B (-0.0%)

Test Logs

@google-oss-bot
Copy link
Contributor

Size Analysis Report

Affected Products

No changes between base commit (08e2aa3) and head commit (4ae293a).

Copy link
Contributor

@schmidt-sebastian schmidt-sebastian left a comment

Choose a reason for hiding this comment

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

I think it is pretty hard to determine which methods actually make a difference in terms of bundle size until we have the API implemented. I think your change makes sense. If there is anything that stands out once we have a tree-shakeable API we can always change it.

@@ -133,3 +91,51 @@ export class RepoInfo {
return `${protocol}${this.host}/${query}`;
}
}

function needsQueryParam(repoInfo: RepoInfo): boolean {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: I would also prefix this with "repoInfo" for consistency.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@hsubox76 hsubox76 merged commit 97f7e38 into master Feb 24, 2021
@hsubox76 hsubox76 deleted the ch-repoinfo branch February 24, 2021 00:59
@firebase firebase locked and limited conversation to collaborators Mar 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants