-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
ref(integrations): Make ReportTypes a const enum #4209
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.
ReportTypes
is an interally used enum, so we do not need the runtime support. TheReportTypes
enum lives inpackages/integrations/src/reportingobserver.ts
and is used by theReportingObserver
integration to manage report types.According to the TS docs: https://www.typescriptlang.org/docs/handbook/enums.html
This helps save on bundle size.