Skip to content

Update error handling to account for TS v4.4 auto unknown variable in… #6320

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 1 commit into from
Jun 2, 2022

Conversation

dwyfrequency
Copy link
Contributor

Updating error handling in select packages to account for a future TypeScript package upgrade. For more information, see the below blog comment about TypeScript v4.4 errors.

"""
In JavaScript, any type of value can be thrown with throw and caught in a catch clause. Because of this, TypeScript historically typed catch clause variables as any, and would not allow any other type annotation:

Once TypeScript added the unknown type, it became clear that unknown was a better choice than any in catch clause variables for users who want the highest degree of correctness and type-safety, since it narrows better and forces us to test against arbitrary values. Eventually TypeScript 4.0 allowed users to specify an explicit type annotation of unknown (or any) on each catch clause variable so that we could opt into stricter types on a case-by-case basis; however, for some, manually specifying : unknown on every catch clause was a chore.
"""
per https://devblogs.microsoft.com/typescript/announcing-typescript-4-4/#use-unknown-catch-variables

@changeset-bot
Copy link

changeset-bot bot commented Jun 1, 2022

⚠️ No Changeset found

Latest commit: 70d6088

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 Jun 1, 2022

Changeset File Check ⚠️

  • Changeset formatting error in following file:
    Some packages have been changed but no changesets were found. Run `changeset add` to resolve this error.
    If this change doesn't need a release, run `changeset add --empty`.
    

@google-oss-bot
Copy link
Contributor

Size Report 1

Affected Products

  • @firebase/app

    TypeBase (9fddd5c)Merge (c81943a)Diff
    browser13.8 kB13.9 kB+84 B (+0.6%)
    esm518.0 kB18.1 kB+84 B (+0.5%)
    main19.0 kB19.1 kB+84 B (+0.4%)
    module13.8 kB13.9 kB+84 B (+0.6%)
  • @firebase/app-check

    TypeBase (9fddd5c)Merge (c81943a)Diff
    browser25.2 kB25.3 kB+122 B (+0.5%)
    esm529.8 kB29.9 kB+122 B (+0.4%)
    main31.0 kB31.1 kB+122 B (+0.4%)
    module25.2 kB25.3 kB+122 B (+0.5%)
  • @firebase/remote-config

    TypeBase (9fddd5c)Merge (c81943a)Diff
    browser18.8 kB19.2 kB+331 B (+1.8%)
    esm523.7 kB24.0 kB+331 B (+1.4%)
    main24.9 kB25.2 kB+331 B (+1.3%)
    module18.8 kB19.2 kB+331 B (+1.8%)
  • bundle

    43 size changes

    TypeBase (9fddd5c)Merge (c81943a)Diff
    analytics (logEvent)41.5 kB41.6 kB+76 B (+0.2%)
    app-check (CustomProvider)35.2 kB35.4 kB+186 B (+0.5%)
    app-check (ReCaptchaEnterpriseProvider)37.4 kB37.6 kB+186 B (+0.5%)
    app-check (ReCaptchaV3Provider)37.4 kB37.5 kB+186 B (+0.5%)
    auth (Anonymous)66.1 kB66.1 kB+76 B (+0.1%)
    auth (EmailAndPassword)70.2 kB70.2 kB+76 B (+0.1%)
    auth (GoogleFBTwitterGitHubPopup)90.0 kB90.1 kB+76 B (+0.1%)
    auth (GooglePopup)89.7 kB89.8 kB+76 B (+0.1%)
    auth (GoogleRedirect)89.9 kB90.0 kB+76 B (+0.1%)
    auth (Phone)76.1 kB76.2 kB+76 B (+0.1%)
    database (Append to a list of data)145 kB145 kB+76 B (+0.1%)
    database (Filtering data)144 kB144 kB+76 B (+0.1%)
    database (Listen for child events)160 kB160 kB+76 B (+0.0%)
    database (Listen for value events + Detach listeners)160 kB160 kB+76 B (+0.0%)
    database (Listen for value events)160 kB160 kB+76 B (+0.0%)
    database (Read data once)152 kB152 kB+76 B (+0.1%)
    database (Save data as transactions)162 kB162 kB+76 B (+0.0%)
    database (Sort data)146 kB146 kB+76 B (+0.1%)
    database (Write data)144 kB144 kB+76 B (+0.1%)
    firestore (Persistence)269 kB269 kB+76 B (+0.0%)
    firestore (Query Cursors)208 kB208 kB+76 B (+0.0%)
    firestore (Query)209 kB209 kB+76 B (+0.0%)
    firestore (Read data once)197 kB197 kB+76 B (+0.0%)
    firestore (Realtime updates)200 kB200 kB+76 B (+0.0%)
    firestore (Transaction)181 kB181 kB+76 B (+0.0%)
    firestore (Write data)181 kB181 kB+76 B (+0.0%)
    firestore-lite (Query Cursors)67.8 kB67.9 kB+76 B (+0.1%)
    firestore-lite (Query)71.0 kB71.1 kB+76 B (+0.1%)
    firestore-lite (Read data once)55.4 kB55.5 kB+76 B (+0.1%)
    firestore-lite (Transaction)80.0 kB80.0 kB+76 B (+0.1%)
    firestore-lite (Write data)65.2 kB65.2 kB+76 B (+0.1%)
    functions (call)29.1 kB29.2 kB+76 B (+0.3%)
    messaging (send + receive)44.7 kB44.7 kB+76 B (+0.2%)
    performance (trace)49.5 kB49.6 kB+76 B (+0.2%)
    remote-config (getAndFetch)43.9 kB44.2 kB+375 B (+0.9%)
    storage (getBytes)37.4 kB37.5 kB+76 B (+0.2%)
    storage (getDownloadURL)39.5 kB39.6 kB+76 B (+0.2%)
    storage (getMetadata)39.0 kB39.0 kB+76 B (+0.2%)
    storage (list + listAll)38.4 kB38.4 kB+76 B (+0.2%)
    storage (updateMetadata)39.2 kB39.3 kB+76 B (+0.2%)
    storage (uploadBytes)43.8 kB43.8 kB+76 B (+0.2%)
    storage (uploadBytesResumable)53.2 kB53.3 kB+76 B (+0.1%)
    storage (uploadString)44.0 kB44.0 kB+76 B (+0.2%)

  • firebase

    TypeBase (9fddd5c)Merge (c81943a)Diff
    firebase-app-check-compat.js22.7 kB22.8 kB+84 B (+0.4%)
    firebase-app-check.js90.0 kB90.2 kB+175 B (+0.2%)
    firebase-app-compat.js27.6 kB27.7 kB+56 B (+0.2%)
    firebase-app.js87.4 kB87.6 kB+120 B (+0.1%)
    firebase-compat.js787 kB788 kB+367 B (+0.0%)
    firebase-performance-standalone-compat.es2017.js87.4 kB87.5 kB+76 B (+0.1%)
    firebase-performance-standalone-compat.js65.3 kB65.3 kB+76 B (+0.1%)
    firebase-remote-config-compat.js27.1 kB27.3 kB+227 B (+0.8%)
    firebase-remote-config.js112 kB113 kB+491 B (+0.4%)

Test Logs

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

@google-oss-bot
Copy link
Contributor

Size Analysis Report 1

This report is too large (126,051 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/n9OwqDpYun.html

@dwyfrequency dwyfrequency marked this pull request as ready for review June 1, 2022 19:48
@dwyfrequency dwyfrequency merged commit f84cacd into master Jun 2, 2022
@dwyfrequency dwyfrequency deleted the tsUpdate branch June 2, 2022 17:23
@firebase firebase locked and limited conversation to collaborators Jul 3, 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.

3 participants