Skip to content
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(types): deprecate severity enum #4280

Merged
merged 7 commits into from
Dec 16, 2021
Merged

ref(types): deprecate severity enum #4280

merged 7 commits into from
Dec 16, 2021

Conversation

JonasBa
Copy link
Member

@JonasBa JonasBa commented Dec 14, 2021

Drops Deprecate severity enum. I kept the implementation of fromString because it guards from arbitrary severity types

@JonasBa JonasBa force-pushed the jb/bundle/drop-severity branch from 4edc753 to 29bb6ad Compare December 14, 2021 13:47
@AbhiPrasad AbhiPrasad added this to the Treeshaking / Bundle Size milestone Dec 14, 2021
@JonasBa JonasBa force-pushed the jb/bundle/drop-severity branch from 29bb6ad to 4ca00aa Compare December 14, 2021 15:38
@github-actions
Copy link
Contributor

github-actions bot commented Dec 14, 2021

size-limit report

Path Base Size (b8dc945) Current Size Change
@sentry/browser - CDN Bundle (gzipped) 21.01 KB 20.61 KB -1.92% 🔽
@sentry/browser - CDN Bundle (minified) 66.97 KB 65.87 KB -1.64% 🔽
@sentry/browser - Webpack 22.79 KB 22.59 KB -0.9% 🔽
@sentry/browser - Webpack - gzip = false 78.2 KB 77.45 KB -0.97% 🔽
@sentry/react - Webpack 22.82 KB 22.62 KB -0.9% 🔽
@sentry/nextjs Client - Webpack 47.34 KB 46.72 KB -1.32% 🔽
@sentry/browser + @sentry/tracing - CDN Bundle (gzipped) 29.35 KB 28.75 KB -2.04% 🔽

@JonasBa
Copy link
Member Author

JonasBa commented Dec 14, 2021

Slow and steady

@JonasBa
Copy link
Member Author

JonasBa commented Dec 14, 2021

@AbhiPrasad One problem with above code changes is that Severity.fromString is now marked as deprecated too 🤮 This is actually unexpected and I'm not quite sure why TS does this. We can remove the namespace and just export a severityFromString function, but it may be better to move this function to the utils package. Wdyt?
CleanShot 2021-12-14 at 18 14 29@2x

@mitsuhiko
Copy link
Member

@JonasBa i would keep this function internally and hide it as good as possible. In the spirit of removing API surface there is no reason for this function to be public.

@AbhiPrasad
Copy link
Member

+1 on keeping it internal

@JonasBa JonasBa force-pushed the jb/bundle/drop-severity branch from 6d11492 to 291d0e1 Compare December 15, 2021 08:00
@JonasBa JonasBa changed the title refactor(types): drop severity enum ref(types): deprecate severity enum Dec 15, 2021
@JonasBa JonasBa changed the title ref(types): deprecate severity enum ref(types): deprecate Severity enum Dec 15, 2021
@mitsuhiko
Copy link
Member

@JonasBa it's conflicting now :(

@JonasBa JonasBa force-pushed the jb/bundle/drop-severity branch from a2642a1 to 2dc1d7a Compare December 15, 2021 14:59
@JonasBa JonasBa force-pushed the jb/bundle/drop-severity branch from edba6fb to 1dbeeda Compare December 16, 2021 10:57
@JonasBa JonasBa changed the title ref(types): deprecate Severity enum ref(types): deprecate severity enum Dec 16, 2021
* ref(types): deprecate enum and export type

* ref(types): fix fromHttpCode usage to statusFromHttpCode

* ref(types): remove enum usage

* fix(types): fix mistake on span

* fix: fmt

* ref(types): do not export the status enum

* ref(types): fix all imports

* ref(utils): consistent naming

* ref(types): deprecate span status enum (#4299)

* ref(span): deprecate span status enum

* ts(span): widen type

* ref(span): avoid reexporting the enum

* ref(types): fix all imports

* fix(test): remove extra space

* fix(test): import extension methods

* ref(types): deprecate transactionmethod enum (#4314)

* ref(types): deprecate transactionmethod enum

* fix(types): drop transactionsamplingmethod

* ref(types): deprecate outcome enum (#4315)

* ref(types): deprecate outcome enum

* fix(types): drop transportoutcome

* ref(types): deprecate request status enum (#4316)

* ref(types): deprecate request status

* ref(types): deprecate session status

* ref(types): remove unused logLevel (#4317) (#4320)

Co-authored-by: Armin Ronacher <[email protected]>
@JonasBa JonasBa merged commit caba96e into master Dec 16, 2021
@JonasBa JonasBa deleted the jb/bundle/drop-severity branch December 16, 2021 14:18
onurtemizkan pushed a commit that referenced this pull request Dec 19, 2021
* fix(types): use SeverityLevel

* fix(types): remove other references to the enum

* fix(types): disable deprecation warning

* fix(types): move fromString to utils

* packages(types): fix exports

* fix(rebase): fix conflicts

* ref(types): deprecate status enum (#4298)

* ref(types): deprecate enum and export type

* ref(types): fix fromHttpCode usage to statusFromHttpCode

* ref(types): remove enum usage

* fix(types): fix mistake on span

* fix: fmt

* ref(types): do not export the status enum

* ref(types): fix all imports

* ref(utils): consistent naming

* ref(types): deprecate span status enum (#4299)

* ref(span): deprecate span status enum

* ts(span): widen type

* ref(span): avoid reexporting the enum

* ref(types): fix all imports

* fix(test): remove extra space

* fix(test): import extension methods

* ref(types): deprecate transactionmethod enum (#4314)

* ref(types): deprecate transactionmethod enum

* fix(types): drop transactionsamplingmethod

* ref(types): deprecate outcome enum (#4315)

* ref(types): deprecate outcome enum

* fix(types): drop transportoutcome

* ref(types): deprecate request status enum (#4316)

* ref(types): deprecate request status

* ref(types): deprecate session status

* ref(types): remove unused logLevel (#4317) (#4320)

Co-authored-by: Armin Ronacher <[email protected]>

Co-authored-by: Armin Ronacher <[email protected]>
AbhiPrasad added a commit that referenced this pull request Jan 17, 2022
In #4280,
specifically in commit dd3aa70, we
deprecated the `Severity` enum in favour of using a string union type,
`SeverityLevel`. It's important to note that this change affected the
type signature of one of our public API methods, `captureMessage`.

The change to deprecate the `Severity` enum was done for bundle size
reasons.

After releasing the beta with these changes, it was found that
deprecating the `Severity` enum and replacing it with `SeverityLevel`
was quite the disruptive change, which would make upgrading to the minor
version a hassle for users. As a result, this patch undeprecates the
`Severity` enum. The `Severity` enum will be removed in the upcoming
major release instead, as a breaking change.
AbhiPrasad added a commit that referenced this pull request Jan 17, 2022
In #4280,
specifically in commit dd3aa70, we
deprecated the `Severity` enum in favour of using a string union type,
`SeverityLevel`. It's important to note that this change affected the
type signature of one of our public API methods, `captureMessage`.

The change to deprecate the `Severity` enum was done for bundle size
reasons.

After releasing the beta with these changes, it was found that
deprecating the `Severity` enum and replacing it with `SeverityLevel`
was quite the disruptive change, which would make upgrading to the minor
version a hassle for users. As a result, this patch undeprecates the
`Severity` enum. The `Severity` enum will be removed in the upcoming
major release instead, as a breaking change.
AbhiPrasad added a commit that referenced this pull request Jan 17, 2022
In #4280,
specifically in commit dd3aa70, we
deprecated the `Severity` enum in favour of using a string union type,
`SeverityLevel`. It's important to note that this change affected the
type signature of one of our public API methods, `captureMessage`.

The change to deprecate the `Severity` enum was done for bundle size
reasons.

After releasing the beta with these changes, it was found that
deprecating the `Severity` enum and replacing it with `SeverityLevel`
was quite the disruptive change, which would make upgrading to the minor
version a hassle for users. As a result, this patch undeprecates the
`Severity` enum. The `Severity` enum will be removed in the upcoming
major release instead, as a breaking change.
AbhiPrasad added a commit that referenced this pull request Jan 17, 2022
In #4280,
specifically in commit dd3aa70, we
deprecated the `Severity` enum in favour of using a string union type,
`SeverityLevel`. It's important to note that this change affected the
type signature of one of our public API methods, `captureMessage`.

The change to deprecate the `Severity` enum was done for bundle size
reasons.

After releasing the beta with these changes, it was found that
deprecating the `Severity` enum and replacing it with `SeverityLevel`
was quite the disruptive change, which would make upgrading to the minor
version a hassle for users. As a result, this patch undeprecates the
`Severity` enum. The `Severity` enum will be removed in the upcoming
major release instead, as a breaking change.
AbhiPrasad added a commit that referenced this pull request Jan 18, 2022
In #4280,
specifically in commit dd3aa70, we
deprecated the `Severity` enum in favour of using a string union type,
`SeverityLevel`. It's important to note that this change affected the
type signature of one of our public API methods, `captureMessage`.

The change to deprecate the `Severity` enum was done for bundle size
reasons.

After releasing the beta with these changes, it was found that
deprecating the `Severity` enum and replacing it with `SeverityLevel`
was quite the disruptive change, which would make upgrading to the minor
version a hassle for users. As a result, this patch undeprecates the
`Severity` enum. The `Severity` enum will be removed in the upcoming
major release instead, as a breaking change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants