-
Notifications
You must be signed in to change notification settings - Fork 928
Remove all public const enums; export maps instead (with typings to strings) #5022
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
Conversation
|
Binary Size ReportAffected SDKs
Test Logs |
Size Analysis ReportAffected Products
|
common/api-review/auth-exp.api.md
Outdated
@@ -20,18 +20,18 @@ export interface ActionCodeInfo { | |||
multiFactorInfo?: MultiFactorInfo | null; | |||
previousEmail?: string | null; | |||
}; | |||
operation: ActionCodeOperation; | |||
operation: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use string literal unions to make it more type safe, using something like
typeof ActionCodeOperation[keyof typeof ActionCodeOperation]
We can apply the same to other places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done (where appropriate)
ProviderId
and SignInMethod
should remain string
. Updated the others.
This PR removes public
const enum
s (which are inaccessible to JS anyway) and moves any (public) reference to those types to simplystring
. Instead, we export maps that can be used to reference acceptable values (but these are not used internally to aid tree shaking)Fixes #5012