Skip to content

Stop using const enums in the public API #5012

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
Feiyang1 opened this issue Jun 10, 2021 · 1 comment · Fixed by #5022
Closed

Stop using const enums in the public API #5012

Feiyang1 opened this issue Jun 10, 2021 · 1 comment · Fixed by #5022
Assignees
Milestone

Comments

@Feiyang1
Copy link
Member

Some build tools (e.g. esbuild, vite) don't work with const enums because they compile Typescript in the isolatedModules mode. They compile files individually without type information, so they can't inline const enums, which eventually cause runtime errors.

Plus Javascript users can't use const enums.

Auth exports some const enums, e.g. ProviderId, SignInMethod. We should probably replace them with just plain object maps.

@BayanBennett
Copy link

Also, NextJS requires isolatedModules due to the way that they have babel configured.

Thank you for this change.

@firebase firebase locked and limited conversation to collaborators Jul 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants