From 751e054da6e0ecbafc68f52f468088ff0232d6e5 Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Thu, 2 Dec 2021 11:51:04 -0500 Subject: [PATCH] ref(integrations): Make ReportTypes a const enum (#4209) `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. --- packages/integrations/src/reportingobserver.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/integrations/src/reportingobserver.ts b/packages/integrations/src/reportingobserver.ts index 2e4a457e04bf..4ae8f0f2d5c1 100644 --- a/packages/integrations/src/reportingobserver.ts +++ b/packages/integrations/src/reportingobserver.ts @@ -11,7 +11,7 @@ interface Report { } /** JSDoc */ -enum ReportTypes { +const enum ReportTypes { /** JSDoc */ Crash = 'crash', /** JSDoc */