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

Use idb 7 for products using shared idb library #6154

Merged
merged 7 commits into from
May 4, 2022
Merged

Use idb 7 for products using shared idb library #6154

merged 7 commits into from
May 4, 2022

Conversation

hsubox76
Copy link
Contributor

@hsubox76 hsubox76 commented Apr 14, 2022

Context: Until recently, we were using the external idb dependency for app, installations, and messaging. (This also effectively made it a dependency of analytics, performance, and remote-config, as they depend on the installations package.) However, because we were required to support IE, we had to pin the idb version to 3.0.2, as subsequent versions of idb no longer supported IE. Since idb is currently on version 7+, this has caused a number of issues, most recently with lack of named exports causing problems with Angular.

We made a temporary fix to replace idb entirely with our own stopgap code in #6061

Since we are planning to drop IE support at I/O, we can now put the idb dependency back and bump it to 7+, which should have named exports and the Node exports field and support ESM.

@changeset-bot
Copy link

changeset-bot bot commented Apr 14, 2022

🦋 Changeset detected

Latest commit: 61bfd0e

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

This PR includes changesets to release 28 packages
Name Type
@firebase/util Minor
@firebase/app Patch
@firebase/installations Patch
@firebase/messaging Patch
@firebase/analytics-compat Patch
@firebase/analytics Patch
@firebase/app-check-compat Patch
@firebase/app-check Patch
@firebase/app-compat Patch
@firebase/auth-compat Patch
@firebase/auth Patch
@firebase/component Patch
@firebase/database-compat Patch
@firebase/database-types Patch
@firebase/database Patch
firebase Patch
@firebase/firestore-compat Patch
@firebase/firestore Patch
@firebase/functions-compat Patch
@firebase/functions Patch
@firebase/installations-compat Patch
@firebase/messaging-compat Patch
@firebase/performance-compat Patch
@firebase/performance Patch
@firebase/remote-config-compat Patch
@firebase/remote-config Patch
@firebase/storage-compat Patch
@firebase/storage 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 14, 2022

Size Report 1

Affected Products

  • @firebase/app

    TypeBase (5249483)Merge (c9e3ec3)Diff
    browser13.8 kB13.8 kB+21 B (+0.2%)
    esm518.0 kB18.0 kB+21 B (+0.1%)
    main18.9 kB19.0 kB+50 B (+0.3%)
    module13.8 kB13.8 kB+21 B (+0.2%)
  • @firebase/app-check

    TypeBase (5249483)Merge (c9e3ec3)Diff
    browser25.2 kB25.2 kB-10 B (-0.0%)
    esm529.8 kB29.8 kB-10 B (-0.0%)
    main31.0 kB31.0 kB-10 B (-0.0%)
    module25.2 kB25.2 kB-10 B (-0.0%)
  • @firebase/firestore

    TypeBase (5249483)Merge (c9e3ec3)Diff
    browser252 kB253 kB+787 B (+0.3%)
    esm5313 kB314 kB+1.03 kB (+0.3%)
    main504 kB505 kB+1.25 kB (+0.2%)
    module252 kB253 kB+787 B (+0.3%)
    react-native252 kB253 kB+787 B (+0.3%)
  • @firebase/firestore-lite

    TypeBase (5249483)Merge (c9e3ec3)Diff
    browser73.2 kB73.3 kB+101 B (+0.1%)
    esm586.6 kB86.7 kB+99 B (+0.1%)
    main126 kB126 kB+153 B (+0.1%)
    module73.2 kB73.3 kB+101 B (+0.1%)
    react-native73.4 kB73.5 kB+101 B (+0.1%)
  • @firebase/functions

    TypeBase (5249483)Merge (c9e3ec3)Diff
    browser8.99 kB9.39 kB+397 B (+4.4%)
    esm511.1 kB11.5 kB+414 B (+3.7%)
    main11.8 kB12.4 kB+529 B (+4.5%)
    module8.99 kB9.39 kB+397 B (+4.4%)
  • @firebase/functions-compat

    TypeBase (5249483)Merge (c9e3ec3)Diff
    browser1.68 kB1.79 kB+111 B (+6.6%)
    esm51.83 kB1.98 kB+148 B (+8.1%)
    main2.20 kB2.34 kB+137 B (+6.2%)
    module1.68 kB1.79 kB+111 B (+6.6%)
  • @firebase/installations

    TypeBase (5249483)Merge (c9e3ec3)Diff
    browser17.8 kB17.8 kB+13 B (+0.1%)
    esm522.9 kB22.9 kB+13 B (+0.1%)
    main23.7 kB23.8 kB+42 B (+0.2%)
    module17.8 kB17.8 kB+13 B (+0.1%)
  • @firebase/messaging

    TypeBase (5249483)Merge (c9e3ec3)Diff
    browser20.8 kB20.8 kB+25 B (+0.1%)
    esm526.2 kB26.2 kB+25 B (+0.1%)
    main26.8 kB26.9 kB+50 B (+0.2%)
    module20.8 kB20.8 kB+25 B (+0.1%)
  • @firebase/messaging-sw

    TypeBase (5249483)Merge (c9e3ec3)Diff
    main29.6 kB29.6 kB+50 B (+0.2%)
    module22.8 kB22.9 kB+25 B (+0.1%)
  • @firebase/util

    TypeBase (5249483)Merge (c9e3ec3)Diff
    browser23.4 kB20.5 kB-2.87 kB (-12.3%)
    esm525.5 kB21.9 kB-3.68 kB (-14.4%)
    main30.6 kB26.7 kB-3.86 kB (-12.6%)
    module23.4 kB20.5 kB-2.87 kB (-12.3%)
  • bundle

    43 size changes

    TypeBase (5249483)Merge (c9e3ec3)Diff
    analytics (logEvent)40.0 kB41.5 kB+1.50 kB (+3.8%)
    app-check (CustomProvider)33.7 kB35.2 kB+1.49 kB (+4.4%)
    app-check (ReCaptchaEnterpriseProvider)35.9 kB37.4 kB+1.49 kB (+4.2%)
    app-check (ReCaptchaV3Provider)35.9 kB37.4 kB+1.50 kB (+4.2%)
    auth (Anonymous)63.5 kB65.0 kB+1.52 kB (+2.4%)
    auth (EmailAndPassword)67.6 kB69.1 kB+1.52 kB (+2.2%)
    auth (GoogleFBTwitterGitHubPopup)87.4 kB88.9 kB+1.52 kB (+1.7%)
    auth (GooglePopup)87.1 kB88.6 kB+1.52 kB (+1.7%)
    auth (GoogleRedirect)87.3 kB88.8 kB+1.52 kB (+1.7%)
    auth (Phone)73.6 kB75.1 kB+1.52 kB (+2.1%)
    database (Append to a list of data)144 kB145 kB+1.52 kB (+1.1%)
    database (Filtering data)142 kB144 kB+1.52 kB (+1.1%)
    database (Listen for child events)158 kB160 kB+1.52 kB (+1.0%)
    database (Listen for value events + Detach listeners)158 kB160 kB+1.52 kB (+1.0%)
    database (Listen for value events)158 kB160 kB+1.52 kB (+1.0%)
    database (Read data once)150 kB151 kB+1.52 kB (+1.0%)
    database (Save data as transactions)160 kB162 kB+1.52 kB (+0.9%)
    database (Sort data)144 kB146 kB+1.52 kB (+1.1%)
    database (Write data)143 kB144 kB+1.52 kB (+1.1%)
    firestore (Persistence)262 kB265 kB+2.28 kB (+0.9%)
    firestore (Query Cursors)202 kB204 kB+1.98 kB (+1.0%)
    firestore (Query)203 kB205 kB+1.98 kB (+1.0%)
    firestore (Read data once)192 kB194 kB+1.97 kB (+1.0%)
    firestore (Realtime updates)194 kB196 kB+1.98 kB (+1.0%)
    firestore (Transaction)176 kB178 kB+1.94 kB (+1.1%)
    firestore (Write data)176 kB177 kB+1.94 kB (+1.1%)
    firestore-lite (Query Cursors)66.3 kB67.8 kB+1.48 kB (+2.2%)
    firestore-lite (Query)69.4 kB71.0 kB+1.60 kB (+2.3%)
    firestore-lite (Read data once)53.9 kB55.4 kB+1.52 kB (+2.8%)
    firestore-lite (Transaction)71.2 kB72.7 kB+1.52 kB (+2.1%)
    firestore-lite (Write data)56.6 kB58.1 kB+1.52 kB (+2.7%)
    functions (call)27.6 kB29.1 kB+1.54 kB (+5.6%)
    messaging (send + receive)43.3 kB44.7 kB+1.34 kB (+3.1%)
    performance (trace)47.7 kB49.2 kB+1.50 kB (+3.1%)
    remote-config (getAndFetch)42.4 kB43.9 kB+1.50 kB (+3.5%)
    storage (getBytes)35.9 kB37.4 kB+1.50 kB (+4.2%)
    storage (getDownloadURL)38.0 kB39.5 kB+1.50 kB (+3.9%)
    storage (getMetadata)37.5 kB39.0 kB+1.50 kB (+4.0%)
    storage (list + listAll)36.9 kB38.4 kB+1.50 kB (+4.1%)
    storage (updateMetadata)37.7 kB39.2 kB+1.50 kB (+4.0%)
    storage (uploadBytes)42.3 kB43.8 kB+1.50 kB (+3.6%)
    storage (uploadBytesResumable)51.7 kB53.2 kB+1.50 kB (+2.9%)
    storage (uploadString)42.5 kB44.0 kB+1.50 kB (+3.5%)

  • firebase

    22 size changes

    TypeBase (5249483)Merge (c9e3ec3)Diff
    firebase-analytics-compat.js24.3 kB25.6 kB+1.26 kB (+5.2%)
    firebase-analytics.js105 kB111 kB+5.89 kB (+5.6%)
    firebase-app-check-compat.js22.7 kB22.7 kB-10 B (-0.0%)
    firebase-app-check.js90.1 kB90.0 kB-10 B (-0.0%)
    firebase-app-compat.js26.4 kB27.6 kB+1.26 kB (+4.8%)
    firebase-app.js81.5 kB87.4 kB+5.90 kB (+7.2%)
    firebase-auth-react-native.js492 kB487 kB-4.98 kB (-1.0%)
    firebase-compat.js779 kB781 kB+2.07 kB (+0.3%)
    firebase-firestore-compat.js304 kB305 kB+795 B (+0.3%)
    firebase-firestore-lite.js250 kB250 kB+205 B (+0.1%)
    firebase-firestore.js822 kB824 kB+2.48 kB (+0.3%)
    firebase-functions-compat.js7.95 kB8.12 kB+169 B (+2.1%)
    firebase-functions.js31.1 kB32.0 kB+947 B (+3.0%)
    firebase-messaging-compat.js36.4 kB37.5 kB+1.11 kB (+3.0%)
    firebase-messaging-sw.js101 kB107 kB+5.89 kB (+5.8%)
    firebase-messaging.js99.4 kB105 kB+5.89 kB (+5.9%)
    firebase-performance-compat.js29.1 kB30.4 kB+1.25 kB (+4.3%)
    firebase-performance-standalone-compat.es2017.js86.5 kB87.1 kB+626 B (+0.7%)
    firebase-performance-standalone-compat.js64.0 kB64.9 kB+925 B (+1.4%)
    firebase-performance.js117 kB123 kB+5.89 kB (+5.0%)
    firebase-remote-config-compat.js25.8 kB27.1 kB+1.26 kB (+4.9%)
    firebase-remote-config.js106 kB112 kB+5.89 kB (+5.5%)

Test Logs

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

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Apr 14, 2022

Size Analysis Report 1

This report is too large (608,208 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/sOxpotHDE3.html

@github-actions
Copy link
Contributor

github-actions bot commented Apr 15, 2022

Changeset File Check ✅

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

@hsubox76 hsubox76 marked this pull request as ready for review April 26, 2022 18:07
interface InstallationsDB extends DBSchema {
'firebase-installations-store': {
key: string;
value: InstallationEntry | undefined;
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we prefer this style of optionals instead of value?: InstallationEntry;?

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 would be better to do value?: InstallationEntry but unfortunately we're extending a type from the external idb library and that type doesn't allow value to be an optional property (but does allow | undefined):

https://github.com/jakearchibald/idb/blob/231942c8a6b425e799e22885afb88751df4432ca/src/entry.ts#L124

Copy link
Contributor

@dwyfrequency dwyfrequency left a comment

Choose a reason for hiding this comment

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

LGTM

@hsubox76 hsubox76 merged commit 9c5c9c3 into master May 4, 2022
@hsubox76 hsubox76 deleted the ch-idb7 branch May 4, 2022 17:51
@google-oss-bot google-oss-bot mentioned this pull request May 5, 2022
@edi
Copy link

edi commented May 8, 2022

image

9.8.0 also introduces this issue (not present in 9.7.0) in React Native builds.

Regards

@kristof-kovacs
Copy link

I am finding the same error as @edi

@edi
Copy link

edi commented May 11, 2022

Someone opened the same issue here.

#6253

@firebase firebase locked and limited conversation to collaborators Jun 4, 2022
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.

5 participants