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

Firestore: simple_db.ts: move getAndroidVersion() to a free function #8178

Merged
merged 3 commits into from
Apr 18, 2024

Conversation

dconeybe
Copy link
Contributor

@dconeybe dconeybe commented Apr 18, 2024

#7929 accidentally pulled in the IndexedDB persistence code even in Firestore applications that did not used IndexedDB, unnecessarily increasing the code size by 6.5 kB starting in v10.7.2. This PR fixes this code size increase by moving the getAndroidVersion() function from a static member of the SimpleDB class to a free function to avoid pulling in all of the IndexedDB code.

… a static function of SimpleDb) so it can be used without pulling in the entire indexeddb persistence layer
@dconeybe dconeybe self-assigned this Apr 18, 2024
Copy link

changeset-bot bot commented Apr 18, 2024

🦋 Changeset detected

Latest commit: 8e6bd38

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@firebase/firestore Patch
firebase Patch
@firebase/firestore-compat Patch

Not sure what this means? Click here to learn what changesets are.

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

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Apr 18, 2024

Size Report 1

Affected Products

  • @firebase/firestore

    TypeBase (55fef6d)Merge (6394a2e)Diff
    browser377 kB377 kB+39 B (+0.0%)
    esm5362 kB362 kB-4 B (-0.0%)
    main580 kB580 kB-16 B (-0.0%)
    module377 kB377 kB+39 B (+0.0%)
    react-native377 kB377 kB+39 B (+0.0%)
  • bundle

    TypeBase (55fef6d)Merge (6394a2e)Diff
    firestore (CSI Auto Indexing Disable and Delete)268 kB268 kB-4 B (-0.0%)
    firestore (CSI Auto Indexing Enable)268 kB268 kB-4 B (-0.0%)
    firestore (Persistence)303 kB303 kB-4 B (-0.0%)
    firestore (Query Cursors)247 kB240 kB-6.51 kB (-2.6%)
    firestore (Query)245 kB238 kB-6.51 kB (-2.7%)
    firestore (Read data once)233 kB226 kB-6.51 kB (-2.8%)
    firestore (Read Write w Persistence)323 kB323 kB-4 B (-0.0%)
    firestore (Realtime updates)235 kB229 kB-6.51 kB (-2.8%)
    firestore (Transaction)212 kB205 kB-6.51 kB (-3.1%)
    firestore (Write data)212 kB205 kB-6.51 kB (-3.1%)
  • firebase

    TypeBase (55fef6d)Merge (6394a2e)Diff
    firebase-compat.js786 kB786 kB-4 B (-0.0%)
    firebase-firestore-compat.js342 kB342 kB-4 B (-0.0%)
    firebase-firestore.js436 kB436 kB+39 B (+0.0%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/TJ4D8EWrCq.html

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Apr 18, 2024

Size Analysis Report 1

This report is too large (567,773 characters) to be displayed here in a GitHub comment. Please use the below link to see the full report on Google Cloud Storage.

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/Nrz7ZHSK3P.html

@dconeybe dconeybe changed the title Firestore: Reduce code size that accidentally regressed in 10.7.2 for applications that do _not_ use IndexedDB persistence Firestore: simple_db.ts: move getAndroidVersion() to a free function Apr 18, 2024
@dconeybe dconeybe marked this pull request as ready for review April 18, 2024 14:59
@dconeybe dconeybe requested review from a team as code owners April 18, 2024 14:59
@dconeybe dconeybe requested a review from wu-hui April 18, 2024 15:04
Copy link
Contributor

@MarkDuckworth MarkDuckworth left a comment

Choose a reason for hiding this comment

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

LGTM

@dconeybe dconeybe merged commit 84f9ff0 into master Apr 18, 2024
44 checks passed
@dconeybe dconeybe deleted the dconeybe/BundleSizeSimpleDbFix branch April 18, 2024 16:21
@google-oss-bot google-oss-bot mentioned this pull request Apr 24, 2024
@firebase firebase locked and limited conversation to collaborators May 19, 2024
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.

4 participants