Skip to content

Use interfaces for IndexedDB #6029

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 28, 2022
Merged

Use interfaces for IndexedDB #6029

merged 2 commits into from
Feb 28, 2022

Conversation

schmidt-sebastian
Copy link
Contributor

@schmidt-sebastian schmidt-sebastian commented Feb 24, 2022

We use classes for IndexedDB, but really our entries are just plain JSON. This PR changes the code to treat them as JSON, which reduces the overhead of JS classes. This PR is merely meant to reduce SDK size, as we are adding a lot of bytes for indexing.

@changeset-bot
Copy link

changeset-bot bot commented Feb 24, 2022

⚠️ No Changeset found

Latest commit: 42bbc24

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, 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

@github-actions
Copy link
Contributor

github-actions bot commented Feb 24, 2022

Changeset File Check ✅

  • No modified packages are missing from the changeset file.
  • No changeset formatting errors detected.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Feb 24, 2022

Size Report 1

Affected Products

  • @firebase/app

    TypeBase (091e867)Merge (7e4068d)Diff
    browser7.74 kB13.9 kB+6.16 kB (+79.6%)
    esm59.37 kB18.8 kB+9.40 kB (+100.3%)
    main10.2 kB19.7 kB+9.54 kB (+93.4%)
    module7.74 kB13.9 kB+6.16 kB (+79.6%)
  • @firebase/firestore

    TypeBase (091e867)Merge (7e4068d)Diff
    browser251 kB248 kB-2.47 kB (-1.0%)
    esm5311 kB309 kB-2.43 kB (-0.8%)
    main500 kB497 kB-2.92 kB (-0.6%)
    module251 kB248 kB-2.47 kB (-1.0%)
    react-native251 kB248 kB-2.47 kB (-1.0%)
  • bundle

    43 size changes

    TypeBase (091e867)Merge (7e4068d)Diff
    analytics (logEvent)34.7 kB41.8 kB+7.10 kB (+20.5%)
    app-check (CustomProvider)27.4 kB35.7 kB+8.26 kB (+30.2%)
    app-check (ReCaptchaEnterpriseProvider)29.6 kB37.9 kB+8.26 kB (+27.9%)
    app-check (ReCaptchaV3Provider)29.6 kB37.8 kB+8.26 kB (+27.9%)
    auth (Anonymous)56.9 kB65.3 kB+8.32 kB (+14.6%)
    auth (EmailAndPassword)61.0 kB69.3 kB+8.32 kB (+13.6%)
    auth (GoogleFBTwitterGitHubPopup)80.8 kB89.1 kB+8.32 kB (+10.3%)
    auth (GooglePopup)80.5 kB88.9 kB+8.32 kB (+10.3%)
    auth (GoogleRedirect)80.7 kB89.1 kB+8.32 kB (+10.3%)
    auth (Phone)67.0 kB75.3 kB+8.32 kB (+12.4%)
    database (Append to a list of data)137 kB146 kB+8.29 kB (+6.0%)
    database (Filtering data)136 kB144 kB+8.29 kB (+6.1%)
    database (Listen for child events)152 kB160 kB+8.29 kB (+5.4%)
    database (Listen for value events + Detach listeners)152 kB160 kB+8.29 kB (+5.4%)
    database (Listen for value events)152 kB160 kB+8.29 kB (+5.5%)
    database (Read data once)144 kB152 kB+8.29 kB (+5.8%)
    database (Save data as transactions)154 kB162 kB+8.29 kB (+5.4%)
    database (Sort data)138 kB146 kB+8.29 kB (+6.0%)
    database (Write data)136 kB145 kB+8.29 kB (+6.1%)
    firestore (Persistence)252 kB261 kB+8.80 kB (+3.5%)
    firestore (Query Cursors)192 kB203 kB+11.3 kB (+5.9%)
    firestore (Query)193 kB204 kB+11.3 kB (+5.9%)
    firestore (Read data once)181 kB193 kB+11.3 kB (+6.2%)
    firestore (Realtime updates)184 kB195 kB+11.3 kB (+6.2%)
    firestore (Transaction)166 kB177 kB+11.3 kB (+6.8%)
    firestore (Write data)165 kB177 kB+11.3 kB (+6.8%)
    firestore-lite (Query Cursors)56.9 kB68.3 kB+11.3 kB (+19.9%)
    firestore-lite (Query)60.0 kB71.3 kB+11.3 kB (+18.9%)
    firestore-lite (Read data once)44.5 kB55.8 kB+11.3 kB (+25.4%)
    firestore-lite (Transaction)61.8 kB73.1 kB+11.3 kB (+18.3%)
    firestore-lite (Write data)47.3 kB58.6 kB+11.3 kB (+23.9%)
    functions (call)18.3 kB29.6 kB+11.3 kB (+62.0%)
    messaging (send + receive)37.8 kB44.9 kB+7.10 kB (+18.8%)
    performance (trace)42.3 kB49.4 kB+7.10 kB (+16.8%)
    remote-config (getAndFetch)36.7 kB44.1 kB+7.47 kB (+20.4%)
    storage (getBytes)26.6 kB37.9 kB+11.3 kB (+42.5%)
    storage (getDownloadURL)28.7 kB40.0 kB+11.3 kB (+39.5%)
    storage (getMetadata)28.1 kB39.4 kB+11.3 kB (+40.2%)
    storage (list + listAll)27.5 kB38.9 kB+11.3 kB (+41.1%)
    storage (updateMetadata)28.4 kB39.7 kB+11.3 kB (+39.9%)
    storage (uploadBytes)32.9 kB44.3 kB+11.3 kB (+34.4%)
    storage (uploadBytesResumable)42.4 kB53.7 kB+11.3 kB (+26.7%)
    storage (uploadString)33.1 kB44.5 kB+11.3 kB (+34.1%)

  • firebase

    TypeBase (091e867)Merge (7e4068d)Diff
    firebase-app-compat.js17.9 kB28.2 kB+10.3 kB (+57.6%)
    firebase-app.js51.4 kB84.2 kB+32.7 kB (+63.6%)
    firebase-compat.js775 kB776 kB+1.23 kB (+0.2%)
    firebase-firestore-compat.js302 kB300 kB-2.49 kB (-0.8%)
    firebase-firestore.js835 kB817 kB-18.3 kB (-2.2%)
    firebase-performance-standalone-compat.es2017.js78.9 kB87.5 kB+8.60 kB (+10.9%)
    firebase-performance-standalone-compat.js57.0 kB65.7 kB+8.66 kB (+15.2%)

Test Logs

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

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Feb 24, 2022

Size Analysis Report 1

This report is too large (688,016 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/msYsYgjN2f.html

@schmidt-sebastian schmidt-sebastian marked this pull request as ready for review February 24, 2022 18:31
@wu-hui wu-hui assigned schmidt-sebastian and unassigned wu-hui Feb 25, 2022
@schmidt-sebastian schmidt-sebastian merged commit 27ed845 into master Feb 28, 2022
@schmidt-sebastian schmidt-sebastian deleted the mrschmidt/interfaces branch February 28, 2022 16:34
@firebase firebase locked and limited conversation to collaborators Mar 31, 2022
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