Title: [v7] Deprecated Enums Removal · Issue #4888 · getsentry/sentry-javascript · GitHub
Open Graph Title: [v7] Deprecated Enums Removal · Issue #4888 · getsentry/sentry-javascript
X Title: [v7] Deprecated Enums Removal · Issue #4888 · getsentry/sentry-javascript
Description: Problem Statement Last December, we made some efforts to deprecate enums as they add excess bundle size. We plan to remove these in v7. Here is a list of them, alongside things we must consider. Solution Brainstorm Will be deleted Status...
Open Graph Description: Problem Statement Last December, we made some efforts to deprecate enums as they add excess bundle size. We plan to remove these in v7. Here is a list of them, alongside things we must consider. So...
X Description: Problem Statement Last December, we made some efforts to deprecate enums as they add excess bundle size. We plan to remove these in v7. Here is a list of them, alongside things we must consider. So...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/4888
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[v7] Deprecated Enums Removal","articleBody":"### Problem Statement\r\n\r\nLast December, we made some efforts to deprecate enums as they add excess bundle size. We plan to remove these in v7.\r\n\r\nHere is a list of them, alongside things we must consider.\r\n\r\n### Solution Brainstorm\r\n\r\n## Will be deleted\r\n\r\n### `Status`\r\nhttps://github.com/getsentry/sentry-javascript/pull/4298/commits/b177690d89640aef2587039113c614672c07d2be\r\n\r\n```ts\r\nexport type EventStatus =\r\n /** The status could not be determined. */\r\n | 'unknown'\r\n /** The event was skipped due to configuration or callbacks. */\r\n | 'skipped'\r\n /** The event was sent to Sentry successfully. */\r\n | 'rate_limit'\r\n /** The client is currently rate limited and will try again later. */\r\n | 'invalid'\r\n /** The event could not be processed. */\r\n | 'failed'\r\n /** A server-side error occurred during submission. */\r\n | 'success';\r\n ```\r\n\r\nThis is an internally used enum, so we can delete this without much repercussions. \r\n\r\n### `SessionStatus`\r\nhttps://github.com/getsentry/sentry-javascript/blob/master/packages/types/src/sessionstatus.ts\r\n\r\n```ts\r\nexport enum SessionStatus {\r\n /** JSDoc */\r\n Ok = 'ok',\r\n /** JSDoc */\r\n Exited = 'exited',\r\n /** JSDoc */\r\n Crashed = 'crashed',\r\n /** JSDoc */\r\n Abnormal = 'abnormal',\r\n}\r\n```\r\n\r\nAn internal enum, we can delete!\r\n\r\n### `RequestSessionStatus`\r\n\r\nexport enum RequestSessionStatus {\r\n /** JSDoc */\r\n Ok = 'ok',\r\n /** JSDoc */\r\n Errored = 'errored',\r\n /** JSDoc */\r\n Crashed = 'crashed',\r\n}\r\n\r\nAn internal enum, we can delete!\r\n\r\n## Up for debate\r\n\r\n### `Severity`\r\n\r\n```ts\r\nexport enum Severity {\r\n /** JSDoc */\r\n Fatal = 'fatal',\r\n /** JSDoc */\r\n Error = 'error',\r\n /** JSDoc */\r\n Warning = 'warning',\r\n /** JSDoc */\r\n Log = 'log',\r\n /** JSDoc */\r\n Info = 'info',\r\n /** JSDoc */\r\n Debug = 'debug',\r\n /** JSDoc */\r\n Critical = 'critical',\r\n}\r\n```\r\n\r\nThe Severity enum was removed in https://github.com/getsentry/sentry-javascript/pull/4280/commits/dd3aa70e5edb8efc317cb1ced7cf87e614e3957e, but was later undeprecated in https://github.com/getsentry/sentry-javascript/pull/4412.\r\n\r\nThe Severity enum is part of the public API - `captureMessage` call, so possibly would require a lot of user facing changes (they have to go in and change a bunch of methods). Do we decide to still move on with removing the enum?\r\n\r\nhttps://github.com/getsentry/sentry-javascript/blob/4e722eb8778e27d7910e96ccb1aac108bcbea146/packages/hub/src/hub.ts#L227\r\n\r\n### `SpanStatus`\r\n\r\nhttps://github.com/getsentry/sentry-javascript/blob/master/packages/tracing/src/spanstatus.ts\r\n\r\n```ts\r\nexport enum SpanStatus {\r\n /** The operation completed successfully. */\r\n Ok = 'ok',\r\n /** Deadline expired before operation could complete. */\r\n DeadlineExceeded = 'deadline_exceeded',\r\n /** 401 Unauthorized (actually does mean unauthenticated according to RFC 7235) */\r\n Unauthenticated = 'unauthenticated',\r\n /** 403 Forbidden */\r\n PermissionDenied = 'permission_denied',\r\n /** 404 Not Found. Some requested entity (file or directory) was not found. */\r\n NotFound = 'not_found',\r\n /** 429 Too Many Requests */\r\n ResourceExhausted = 'resource_exhausted',\r\n /** Client specified an invalid argument. 4xx. */\r\n InvalidArgument = 'invalid_argument',\r\n /** 501 Not Implemented */\r\n Unimplemented = 'unimplemented',\r\n /** 503 Service Unavailable */\r\n Unavailable = 'unavailable',\r\n /** Other/generic 5xx. */\r\n InternalError = 'internal_error',\r\n /** Unknown. Any non-standard HTTP status code. */\r\n UnknownError = 'unknown_error',\r\n /** The operation was cancelled (typically by the user). */\r\n Cancelled = 'cancelled',\r\n /** Already exists (409) */\r\n AlreadyExists = 'already_exists',\r\n /** Operation was rejected because the system is not in a state required for the operation's */\r\n FailedPrecondition = 'failed_precondition',\r\n /** The operation was aborted, typically due to a concurrency issue. */\r\n Aborted = 'aborted',\r\n /** Operation was attempted past the valid range. */\r\n OutOfRange = 'out_of_range',\r\n /** Unrecoverable data loss or corruption */\r\n DataLoss = 'data_loss',\r\n}\r\n```\r\n\r\n`SpanStatus` is another that has big savings if deleted, but provides a high amount of UX because it allows user's to see what exactly to set status to. We use it all around the docs (see the first example in https://docs.sentry.io/platforms/javascript/performance/instrumentation/custom-instrumentation/). Should we delete this?\r\n\r\n","author":{"url":"https://github.com/AbhiPrasad","@type":"Person","name":"AbhiPrasad"},"datePublished":"2022-04-07T16:31:36Z","url":"https://github.com/getsentry/sentry-javascript/issues/4888"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5e1f0019-2cc2-a27e-99e7-5196328a914f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C776:C74C:EB02:13482:6B0429B3 |
| html-safe-nonce | 3afb8894714ec016a8f644cad2046cb92ce0550a6c9a56e725a235ff1d6d9ed5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNzc2OkM3NEM6RUIwMjoxMzQ4Mjo2QjA0MjlCMyIsInZpc2l0b3JfaWQiOiIxNjY0MDE5ODQwMDc3NDA4NjkxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 556e56c9afab64c32444f99f6743615caf42bc33f51605d4bd40af42d2612a1f |
| hovercard-subject-tag | issue:1196298123 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/4888/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4d24d675dce7fcbd45a118857dff2526191811fd5a7c02c3295c3511b2ee1bb3/getsentry/sentry-javascript/issues/4888 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4d24d675dce7fcbd45a118857dff2526191811fd5a7c02c3295c3511b2ee1bb3/getsentry/sentry-javascript/issues/4888 |
| og:image:alt | Problem Statement Last December, we made some efforts to deprecate enums as they add excess bundle size. We plan to remove these in v7. Here is a list of them, alongside things we must consider. So... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | AbhiPrasad |
| hostname | github.com |
| expected-hostname | github.com |
| None | b7a1d2b9101496921b08579fbee988d014345aef2f5bd660d1f8c7332d81560e |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c3dd496c3da6ea6b77e69c09279d2b81604654f1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width