Skip to content

Publicly export auth error codes #4579

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

Closed
wants to merge 4 commits into from
Closed

Publicly export auth error codes #4579

wants to merge 4 commits into from

Conversation

hsubox76
Copy link
Contributor

@hsubox76 hsubox76 commented Mar 3, 2021

This is for the current package only, we'll have to think of a different approach for exp.

@changeset-bot
Copy link

changeset-bot bot commented Mar 3, 2021

🦋 Changeset detected

Latest commit: 580dfce

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

This PR includes changesets to release 8 packages
Name Type
@firebase/auth Minor
firebase Minor
@firebase/rules-unit-testing 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 Mar 3, 2021

Size Analysis Report

Affected Products

Diffs between base commit (2301aee) and head commit (cd59692) are too large (198,650 characters) to display.

Please check below links to see details from the original test log.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Mar 3, 2021

Binary Size Report

Affected SDKs

  • @firebase/auth

    Type Base (2301aee) Head (cd59692) Diff
    browser 181 kB 185 kB +4.01 kB (+2.2%)
    main 181 kB 185 kB +4.01 kB (+2.2%)
    module 181 kB 185 kB +4.01 kB (+2.2%)
  • @firebase/component

    Type Base (2301aee) Head (cd59692) Diff
    browser 5.33 kB 6.18 kB +856 B (+16.1%)
    esm2017 4.08 kB 4.77 kB +695 B (+17.1%)
    main 5.63 kB 6.50 kB +869 B (+15.4%)
    module 5.33 kB 6.18 kB +856 B (+16.1%)
  • @firebase/database

    Type Base (2301aee) Head (cd59692) Diff
    browser 275 kB 275 kB -140 B (-0.1%)
    esm2017 246 kB 248 kB +1.64 kB (+0.7%)
    main 277 kB 277 kB -114 B (-0.0%)
    module 275 kB 275 kB -140 B (-0.1%)
  • @firebase/database-exp

    Type Base (2301aee) Head (cd59692) Diff
    browser 275 kB 272 kB -3.09 kB (-1.1%)
    esm2017 243 kB 245 kB +1.64 kB (+0.7%)
    main 276 kB 273 kB -2.93 kB (-1.1%)
    module 275 kB 272 kB -3.09 kB (-1.1%)
  • @firebase/firestore

    Type Base (2301aee) Head (cd59692) Diff
    browser 259 kB 259 kB +145 B (+0.1%)
    esm2017 201 kB 202 kB +90 B (+0.0%)
    main 530 kB 530 kB +254 B (+0.0%)
    module 259 kB 259 kB +145 B (+0.1%)
    react-native 201 kB 202 kB +90 B (+0.0%)
  • @firebase/firestore-exp

    Type Base (2301aee) Head (cd59692) Diff
    browser 199 kB 199 kB +64 B (+0.0%)
    main 505 kB 505 kB +166 B (+0.0%)
    module 199 kB 199 kB +64 B (+0.0%)
    react-native 200 kB 200 kB +64 B (+0.0%)
  • @firebase/firestore-lite

    Type Base (2301aee) Head (cd59692) Diff
    browser 64.9 kB 64.9 kB +25 B (+0.0%)
    main 143 kB 143 kB +37 B (+0.0%)
    module 64.9 kB 64.9 kB +25 B (+0.0%)
    react-native 65.1 kB 65.1 kB +25 B (+0.0%)
  • @firebase/firestore/bundle

    Type Base (2301aee) Head (cd59692) Diff
    browser 266 kB 266 kB +184 B (+0.1%)
    esm2017 155 kB 155 kB +129 B (+0.1%)
    main 526 kB 526 kB +255 B (+0.0%)
    module 266 kB 266 kB +184 B (+0.1%)
    react-native 155 kB 155 kB +129 B (+0.1%)
  • @firebase/firestore/memory

    Type Base (2301aee) Head (cd59692) Diff
    browser 196 kB 196 kB +77 B (+0.0%)
    esm2017 152 kB 152 kB +90 B (+0.1%)
    main 324 kB 324 kB +174 B (+0.1%)
    module 196 kB 196 kB +77 B (+0.0%)
    react-native 152 kB 152 kB +90 B (+0.1%)
  • @firebase/firestore/memory-bundle

    Type Base (2301aee) Head (cd59692) Diff
    browser 204 kB 205 kB +116 B (+0.1%)
    esm2017 155 kB 155 kB +129 B (+0.1%)
    main 321 kB 321 kB +174 B (+0.1%)
    module 204 kB 205 kB +116 B (+0.1%)
    react-native 155 kB 155 kB +129 B (+0.1%)
  • @firebase/functions

    Type Base (2301aee) Head (cd59692) Diff
    browser 9.87 kB 9.90 kB +29 B (+0.3%)
    esm2017 7.69 kB 7.71 kB +21 B (+0.3%)
    main 10.3 kB 10.3 kB +29 B (+0.3%)
    module 9.87 kB 9.90 kB +29 B (+0.3%)
  • @firebase/installations

    Type Base (2301aee) Head (cd59692) Diff
    main 22.2 kB 22.2 kB +22 B (+0.1%)
    module 21.6 kB 21.6 kB +28 B (+0.1%)
  • @firebase/logger

    Type Base (2301aee) Head (cd59692) Diff
    main 5.50 kB 5.38 kB -121 B (-2.2%)
    module 4.83 kB 4.65 kB -179 B (-3.7%)
  • @firebase/messaging

    Type Base (2301aee) Head (cd59692) Diff
    main 34.9 kB 34.9 kB +22 B (+0.1%)
    module 34.4 kB 34.4 kB +28 B (+0.1%)
  • @firebase/performance

    Type Base (2301aee) Head (cd59692) Diff
    browser 27.6 kB 27.7 kB +50 B (+0.2%)
    main 28.0 kB 28.0 kB +69 B (+0.2%)
    module 27.6 kB 27.7 kB +50 B (+0.2%)
  • @firebase/remote-config

    Type Base (2301aee) Head (cd59692) Diff
    browser 22.4 kB 22.4 kB +29 B (+0.1%)
    esm2017 17.4 kB 17.4 kB +21 B (+0.1%)
    main 22.9 kB 23.0 kB +29 B (+0.1%)
    module 22.4 kB 22.4 kB +29 B (+0.1%)
  • @firebase/storage

    Type Base (2301aee) Head (cd59692) Diff
    browser 60.2 kB 60.2 kB +26 B (+0.0%)
    esm2017 51.9 kB 51.9 kB +21 B (+0.0%)
    main 60.7 kB 60.7 kB +27 B (+0.0%)
    module 60.2 kB 60.2 kB +26 B (+0.0%)
  • @firebase/storage/exp

    Type Base (2301aee) Head (cd59692) Diff
    browser 49.2 kB 49.2 kB +21 B (+0.0%)
    main 50.0 kB 50.0 kB +21 B (+0.0%)
    module 49.2 kB 49.2 kB +21 B (+0.0%)
  • firebase

    Click to show 15 binary size changes.
    Type Base (2301aee) Head (cd59692) Diff
    firebase-analytics.js 35.8 kB 35.6 kB -187 B (-0.5%)
    firebase-app.js 20.0 kB 20.4 kB +404 B (+2.0%)
    firebase-auth.js 177 kB 181 kB +4.03 kB (+2.3%)
    firebase-database.js 183 kB 178 kB -4.96 kB (-2.7%)
    firebase-firestore.js 304 kB 303 kB -145 B (-0.0%)
    firebase-firestore.memory.js 243 kB 243 kB -169 B (-0.1%)
    firebase-functions.js 10.1 kB 10.2 kB +22 B (+0.2%)
    firebase-installations.js 19.1 kB 19.1 kB +8 B (+0.0%)
    firebase-messaging.js 40.8 kB 40.9 kB +112 B (+0.3%)
    firebase-performance-standalone.es2017.js 71.9 kB 72.3 kB +457 B (+0.6%)
    firebase-performance-standalone.js 48.2 kB 48.4 kB +243 B (+0.5%)
    firebase-performance.js 38.6 kB 38.2 kB -349 B (-0.9%)
    firebase-remote-config.js 36.9 kB 36.8 kB -162 B (-0.4%)
    firebase-storage.js 39.9 kB 39.9 kB -80 B (-0.2%)
    firebase.js 844 kB 843 kB -733 B (-0.1%)

Test Logs

* Developer-facing Firebase Auth error codes.
*/
declare namespace firebase.auth.ErrorCode {
var ADMIN_ONLY_OPERATION: string;
Copy link
Member

Choose a reason for hiding this comment

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

Shall we use the enum value as type instead of string?

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.

@sam-gc
Copy link
Contributor

sam-gc commented Mar 3, 2021

I'm a little concerned about the size increase, but this package is already fairly large as it is

@laurentpayot
Copy link

laurentpayot commented Mar 8, 2021

Maybe a simple const E = fireauth.authenum.Error or something like that to replace the 93 occurences of fireauth.authenum.Error in exports_auth.js could save us some bandwidth? 😉

@hsubox76
Copy link
Contributor Author

Going to abandon this due to the size increase, which users cannot opt out of in the current version of the SDK. However, we plan to provide an error code object map in the upcoming modularized version of auth, that users can choose to import or not, depending on size concerns.

@hsubox76 hsubox76 closed this Mar 15, 2021
@firebase firebase locked and limited conversation to collaborators Apr 15, 2021
@hsubox76 hsubox76 deleted the ch-autherrortypes branch July 8, 2021 18:47
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