-
-
Couldn't load subscription status.
- Fork 1.7k
ref(integrations): Make ReportTypes a const enum #4209
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
`ReportTypes` is an interally used enum, so we do not need the runtime support. This helps save on bundle size.
size-limit report
|
|
Same suggestion here as on #4210:
Suggestion: ...so we don't need its underlying values to be meaningful at runtime. Making it a You also might consider mentioning, in the title and/or the description, that |
|
Updated description |
`ReportTypes` is an interally used enum, so we do not need the runtime support. The `ReportTypes` enum lives in `packages/integrations/src/reportingobserver.ts` and is used by the `ReportingObserver` integration to manage report types. According to the TS docs: https://www.typescriptlang.org/docs/handbook/enums.html > Const enums can only use constant enum expressions and unlike regular enums they are completely removed during compilation. Const enum members are inlined at use sites. This is possible since const enums cannot have computed members. This helps save on bundle size.
`ReportTypes` is an interally used enum, so we do not need the runtime support. The `ReportTypes` enum lives in `packages/integrations/src/reportingobserver.ts` and is used by the `ReportingObserver` integration to manage report types. According to the TS docs: https://www.typescriptlang.org/docs/handbook/enums.html > Const enums can only use constant enum expressions and unlike regular enums they are completely removed during compilation. Const enum members are inlined at use sites. This is possible since const enums cannot have computed members. This helps save on bundle size.
ReportTypesis an interally used enum, so we do not need the runtime support. TheReportTypesenum lives inpackages/integrations/src/reportingobserver.tsand is used by theReportingObserverintegration to manage report types.According to the TS docs: https://www.typescriptlang.org/docs/handbook/enums.html
This helps save on bundle size.