Skip to content

Commit a741002

Browse files
authored
Clarify the usage of const enums and enum maps in auth. (#7249)
Formatting changes generated with `yarn format`
1 parent 623dba3 commit a741002

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/auth/src/model/public_types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,9 @@ export interface AuthProvider {
541541
/**
542542
* An enum of factors that may be used for multifactor authentication.
543543
*
544+
* Internally we use an enum type for FactorId, ActionCodeOperation, but there is a copy in https://github.com/firebase/firebase-js-sdk/blob/48a2096aec53a7eaa9ffcc2625016ecb9f90d113/packages/auth/src/model/enum_maps.ts#L23 that uses maps.
545+
* const enums are better for tree-shaking, however can cause runtime errors if exposed in public APIs, example - https://github.com/microsoft/rushstack/issues/3058
546+
* So, we expose enum maps publicly, but use const enums internally to get some tree-shaking benefit.
544547
* @internal
545548
*/
546549
export const enum FactorId {

0 commit comments

Comments
 (0)