Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Implement and type auth.emulatorConfig. #4481

Merged
merged 3 commits into from
Feb 17, 2021
Merged

Conversation

yuchenshi
Copy link
Member

This PR implements the approved auth.emulatorConfig API in auth-exp, in parity with existing auth SDK.

Somehow auth.emulatorConfig and also useEmulator were never added to the existing auth-types. This PR also fixes that (and replaces #4354).

@changeset-bot
Copy link

changeset-bot bot commented Feb 17, 2021

🦋 Changeset detected

Latest commit: e8f2b37

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

This PR includes changesets to release 10 packages
Name Type
@firebase/auth-types Patch
@firebase/auth Patch
firebase Patch
@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

@github-actions
Copy link
Contributor

Changeset File Check ⚠️

  • Warning: This PR modifies files in the following packages but they have not been included in the changeset file:

    • @firebase/auth-compat
    • @firebase/auth-exp
    • @firebase/auth-types-exp

    Make sure this was intentional.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Feb 17, 2021

Binary Size Report

Affected SDKs

No changes between base commit (5538349) and head commit (b61ff41).

Test Logs

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Feb 17, 2021

Size Analysis Report

Affected Products

  • @firebase/auth-exp

    • ActionCodeURL

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      29.0 kB
      29.0 kB
      -5 B (-0.0%)
      size-with-ext-deps
      39.7 kB
      39.7 kB
      -5 B (-0.0%)
    • AuthCredential

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      28.2 kB
      28.2 kB
      -5 B (-0.0%)
      size-with-ext-deps
      38.9 kB
      38.9 kB
      -5 B (-0.0%)
    • EmailAuthCredential

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      29.9 kB
      29.9 kB
      -5 B (-0.0%)
      size-with-ext-deps
      40.7 kB
      40.7 kB
      -5 B (-0.0%)
    • EmailAuthProvider

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      31.3 kB
      31.3 kB
      -5 B (-0.0%)
      size-with-ext-deps
      42.0 kB
      42.0 kB
      -5 B (-0.0%)
    • FacebookAuthProvider

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      31.8 kB
      31.8 kB
      -5 B (-0.0%)
      size-with-ext-deps
      42.5 kB
      42.5 kB
      -5 B (-0.0%)
    • GithubAuthProvider

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      31.8 kB
      31.8 kB
      -5 B (-0.0%)
      size-with-ext-deps
      42.5 kB
      42.5 kB
      -5 B (-0.0%)
    • GoogleAuthProvider

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      31.8 kB
      31.8 kB
      -5 B (-0.0%)
      size-with-ext-deps
      42.5 kB
      42.5 kB
      -5 B (-0.0%)
    • OAuthCredential

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      30.0 kB
      30.0 kB
      -5 B (-0.0%)
      size-with-ext-deps
      40.7 kB
      40.7 kB
      -5 B (-0.0%)
    • OAuthProvider

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      31.2 kB
      31.2 kB
      -5 B (-0.0%)
      size-with-ext-deps
      41.9 kB
      41.9 kB
      -5 B (-0.0%)
    • PhoneAuthCredential

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      30.0 kB
      30.0 kB
      -5 B (-0.0%)
      size-with-ext-deps
      40.7 kB
      40.7 kB
      -5 B (-0.0%)
    • PhoneAuthProvider

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      31.6 kB
      31.6 kB
      -5 B (-0.0%)
      size-with-ext-deps
      42.3 kB
      42.3 kB
      -5 B (-0.0%)
    • PhoneMultiFactorGenerator

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      28.9 kB
      28.8 kB
      -5 B (-0.0%)
      size-with-ext-deps
      39.6 kB
      39.6 kB
      -5 B (-0.0%)
    • RecaptchaVerifier

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      34.2 kB
      34.2 kB
      -5 B (-0.0%)
      size-with-ext-deps
      44.9 kB
      44.9 kB
      -5 B (-0.0%)
    • TwitterAuthProvider

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      31.8 kB
      31.8 kB
      -5 B (-0.0%)
      size-with-ext-deps
      42.5 kB
      42.5 kB
      -5 B (-0.0%)
    • applyActionCode

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      28.1 kB
      28.0 kB
      -5 B (-0.0%)
      size-with-ext-deps
      38.8 kB
      38.8 kB
      -5 B (-0.0%)
    • checkActionCode

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      29.0 kB
      29.0 kB
      -5 B (-0.0%)
      size-with-ext-deps
      39.7 kB
      39.7 kB
      -5 B (-0.0%)
    • confirmPasswordReset

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      28.1 kB
      28.1 kB
      -5 B (-0.0%)
      size-with-ext-deps
      38.8 kB
      38.8 kB
      -5 B (-0.0%)
    • createUserWithEmailAndPassword

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      29.0 kB
      29.0 kB
      -5 B (-0.0%)
      size-with-ext-deps
      39.7 kB
      39.7 kB
      -5 B (-0.0%)
    • deleteUser

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      28.0 kB
      28.0 kB
      -5 B (-0.0%)
      size-with-ext-deps
      38.7 kB
      38.7 kB
      -5 B (-0.0%)
    • fetchSignInMethodsForEmail

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      28.3 kB
      28.3 kB
      -5 B (-0.0%)
      size-with-ext-deps
      39.0 kB
      39.0 kB
      -5 B (-0.0%)
    • getAdditionalUserInfo

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      29.3 kB
      29.3 kB
      -5 B (-0.0%)
      size-with-ext-deps
      40.0 kB
      40.0 kB
      -5 B (-0.0%)
    • getAuth

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      55.7 kB
      55.6 kB
      -5 B (-0.0%)
      size-with-ext-deps
      66.6 kB
      66.6 kB
      -5 B (-0.0%)
    • getIdToken

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      28.0 kB
      28.0 kB
      -5 B (-0.0%)
      size-with-ext-deps
      38.7 kB
      38.7 kB
      -5 B (-0.0%)
    • getIdTokenResult

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      27.9 kB
      27.9 kB
      -5 B (-0.0%)
      size-with-ext-deps
      38.6 kB
      38.6 kB
      -5 B (-0.0%)
    • getMultiFactorResolver

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      30.7 kB
      30.7 kB
      -5 B (-0.0%)
      size-with-ext-deps
      41.4 kB
      41.4 kB
      -5 B (-0.0%)
    • getRedirectResult

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      33.6 kB
      33.6 kB
      -5 B (-0.0%)
      size-with-ext-deps
      44.3 kB
      44.3 kB
      -5 B (-0.0%)
    • initializeAuth

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      28.4 kB
      28.4 kB
      -5 B (-0.0%)
      size-with-ext-deps
      39.1 kB
      39.1 kB
      -5 B (-0.0%)
    • isSignInWithEmailLink

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      29.1 kB
      29.1 kB
      -5 B (-0.0%)
      size-with-ext-deps
      39.8 kB
      39.8 kB
      -5 B (-0.0%)
    • linkWithCredential

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      29.0 kB
      29.0 kB
      -5 B (-0.0%)
      size-with-ext-deps
      39.7 kB
      39.7 kB
      -5 B (-0.0%)
    • linkWithPhoneNumber

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      32.5 kB
      32.5 kB
      -5 B (-0.0%)
      size-with-ext-deps
      43.2 kB
      43.2 kB
      -5 B (-0.0%)
    • linkWithPopup

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      36.9 kB
      36.9 kB
      -5 B (-0.0%)
      size-with-ext-deps
      47.6 kB
      47.6 kB
      -5 B (-0.0%)
    • linkWithRedirect

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      31.9 kB
      31.9 kB
      -5 B (-0.0%)
      size-with-ext-deps
      42.6 kB
      42.6 kB
      -5 B (-0.0%)
    • multiFactor

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      30.0 kB
      30.0 kB
      -5 B (-0.0%)
      size-with-ext-deps
      40.8 kB
      40.7 kB
      -5 B (-0.0%)
    • onAuthStateChanged

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      28.0 kB
      28.0 kB
      -5 B (-0.0%)
      size-with-ext-deps
      38.7 kB
      38.7 kB
      -5 B (-0.0%)
    • onIdTokenChanged

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      28.0 kB
      28.0 kB
      -5 B (-0.0%)
      size-with-ext-deps
      38.7 kB
      38.7 kB
      -5 B (-0.0%)
    • parseActionCodeURL

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      29.0 kB
      29.0 kB
      -5 B (-0.0%)
      size-with-ext-deps
      39.7 kB
      39.7 kB
      -5 B (-0.0%)
    • reauthenticateWithCredential

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      29.6 kB
      29.6 kB
      -5 B (-0.0%)
      size-with-ext-deps
      40.3 kB
      40.3 kB
      -5 B (-0.0%)
    • reauthenticateWithPhoneNumber

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      33.0 kB
      33.0 kB
      -5 B (-0.0%)
      size-with-ext-deps
      43.8 kB
      43.8 kB
      -5 B (-0.0%)
    • reauthenticateWithPopup

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      36.9 kB
      36.9 kB
      -5 B (-0.0%)
      size-with-ext-deps
      47.7 kB
      47.6 kB
      -5 B (-0.0%)
    • reauthenticateWithRedirect

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      31.7 kB
      31.7 kB
      -5 B (-0.0%)
      size-with-ext-deps
      42.4 kB
      42.4 kB
      -5 B (-0.0%)
    • reload

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      27.9 kB
      27.9 kB
      -5 B (-0.0%)
      size-with-ext-deps
      38.6 kB
      38.6 kB
      -5 B (-0.0%)
    • sendEmailVerification

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      28.9 kB
      28.9 kB
      -5 B (-0.0%)
      size-with-ext-deps
      39.6 kB
      39.6 kB
      -5 B (-0.0%)
    • sendPasswordResetEmail

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      28.8 kB
      28.8 kB
      -5 B (-0.0%)
      size-with-ext-deps
      39.5 kB
      39.5 kB
      -5 B (-0.0%)
    • sendSignInLinkToEmail

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      28.8 kB
      28.8 kB
      -5 B (-0.0%)
      size-with-ext-deps
      39.6 kB
      39.5 kB
      -5 B (-0.0%)
    • setPersistence

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      28.0 kB
      28.0 kB
      -5 B (-0.0%)
      size-with-ext-deps
      38.7 kB
      38.7 kB
      -5 B (-0.0%)
    • signInAnonymously

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      29.1 kB
      29.1 kB
      -5 B (-0.0%)
      size-with-ext-deps
      39.8 kB
      39.8 kB
      -5 B (-0.0%)
    • signInWithCredential

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      29.4 kB
      29.3 kB
      -5 B (-0.0%)
      size-with-ext-deps
      40.1 kB
      40.1 kB
      -5 B (-0.0%)
    • signInWithCustomToken

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      29.0 kB
      29.0 kB
      -5 B (-0.0%)
      size-with-ext-deps
      39.7 kB
      39.7 kB
      -5 B (-0.0%)
    • signInWithEmailAndPassword

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      32.8 kB
      32.8 kB
      -5 B (-0.0%)
      size-with-ext-deps
      43.5 kB
      43.5 kB
      -5 B (-0.0%)
    • signInWithEmailLink

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      33.0 kB
      33.0 kB
      -5 B (-0.0%)
      size-with-ext-deps
      43.7 kB
      43.7 kB
      -5 B (-0.0%)
    • signInWithPhoneNumber

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      32.8 kB
      32.8 kB
      -5 B (-0.0%)
      size-with-ext-deps
      43.5 kB
      43.5 kB
      -5 B (-0.0%)
    • signInWithPopup

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      36.9 kB
      36.9 kB
      -5 B (-0.0%)
      size-with-ext-deps
      47.6 kB
      47.6 kB
      -5 B (-0.0%)
    • signInWithRedirect

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      31.4 kB
      31.4 kB
      -5 B (-0.0%)
      size-with-ext-deps
      42.1 kB
      42.1 kB
      -5 B (-0.0%)
    • signOut

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      28.0 kB
      28.0 kB
      -5 B (-0.0%)
      size-with-ext-deps
      38.7 kB
      38.7 kB
      -5 B (-0.0%)
    • unlink

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      28.5 kB
      28.5 kB
      -5 B (-0.0%)
      size-with-ext-deps
      39.2 kB
      39.2 kB
      -5 B (-0.0%)
    • updateCurrentUser

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      28.0 kB
      28.0 kB
      -5 B (-0.0%)
      size-with-ext-deps
      38.7 kB
      38.7 kB
      -5 B (-0.0%)
    • updateEmail

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      28.3 kB
      28.2 kB
      -5 B (-0.0%)
      size-with-ext-deps
      39.0 kB
      39.0 kB
      -5 B (-0.0%)
    • updatePassword

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      28.3 kB
      28.3 kB
      -5 B (-0.0%)
      size-with-ext-deps
      39.0 kB
      39.0 kB
      -5 B (-0.0%)
    • updatePhoneNumber

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      28.7 kB
      28.7 kB
      -5 B (-0.0%)
      size-with-ext-deps
      39.4 kB
      39.4 kB
      -5 B (-0.0%)
    • updateProfile

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      28.4 kB
      28.4 kB
      -5 B (-0.0%)
      size-with-ext-deps
      39.2 kB
      39.2 kB
      -5 B (-0.0%)
    • useAuthEmulator

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      29.0 kB
      29.2 kB
      +196 B (+0.7%)
      size-with-ext-deps
      39.7 kB
      39.9 kB
      +196 B (+0.5%)
    • useDeviceLanguage

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      28.0 kB
      28.0 kB
      -5 B (-0.0%)
      size-with-ext-deps
      38.7 kB
      38.7 kB
      -5 B (-0.0%)
    • verifyBeforeUpdateEmail

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      28.9 kB
      28.9 kB
      -5 B (-0.0%)
      size-with-ext-deps
      39.6 kB
      39.6 kB
      -5 B (-0.0%)
    • verifyPasswordResetCode

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      29.1 kB
      29.1 kB
      -5 B (-0.0%)
      size-with-ext-deps
      39.8 kB
      39.8 kB
      -5 B (-0.0%)
    • browserLocalPersistence

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      30.9 kB
      30.9 kB
      -5 B (-0.0%)
      size-with-ext-deps
      41.7 kB
      41.7 kB
      -5 B (-0.0%)
    • browserPopupRedirectResolver

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      45.3 kB
      45.3 kB
      -5 B (-0.0%)
      size-with-ext-deps
      56.2 kB
      56.2 kB
      -5 B (-0.0%)
    • browserSessionPersistence

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      28.6 kB
      28.6 kB
      -5 B (-0.0%)
      size-with-ext-deps
      39.3 kB
      39.3 kB
      -5 B (-0.0%)
    • debugErrorMap

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      38.8 kB
      38.8 kB
      -5 B (-0.0%)
      size-with-ext-deps
      49.5 kB
      49.5 kB
      -5 B (-0.0%)
    • inMemoryPersistence

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      27.9 kB
      27.9 kB
      -5 B (-0.0%)
      size-with-ext-deps
      38.7 kB
      38.6 kB
      -5 B (-0.0%)
    • indexedDBLocalPersistence

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      35.3 kB
      35.3 kB
      -5 B (-0.0%)
      size-with-ext-deps
      46.0 kB
      46.0 kB
      -5 B (-0.0%)
    • prodErrorMap

      Size Table

      TypeBase (5538349)Head (b61ff41)Diff
      size
      27.9 kB
      27.9 kB
      -5 B (-0.0%)
      size-with-ext-deps
      38.7 kB
      38.7 kB
      -5 B (-0.0%)

authInternal.settings.appVerificationDisabledForTesting = true;
emitEmulatorWarning(!!options?.disableWarnings);
authInternal.emulatorConfig = Object.freeze({
Copy link
Contributor

Choose a reason for hiding this comment

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

Object.freeze() 🤯 amazing.

@yuchenshi yuchenshi merged commit 4ab5a9c into master Feb 17, 2021
@yuchenshi yuchenshi deleted the ys/auth-emulator-config branch February 17, 2021 17:58
@google-oss-bot google-oss-bot mentioned this pull request Feb 17, 2021
@firebase firebase locked and limited conversation to collaborators Mar 20, 2021
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants