Skip to content

ref(integrations): Simplify calling original method in CaptureConsole #4505

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

Merged

Conversation

lobsterkatie
Copy link
Member

In responding to #4504, I noticed two things which could be improved about the code in question:

  1. The author of that PR was misled by the admittedly confusing name of the original method we're wrapping.

  2. We've been calling that method in a more complex way than necessary.

This PR fixes both of those problems.

Note: There are no tests for this integration. We should definitely add some, but that is fodder for a separate PR.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2022

size-limit report

Path Base Size (1a6c26e) Current Size Change
@sentry/browser - CDN Bundle (gzipped) 19.68 KB 19.68 KB +0.02% 🔺
@sentry/browser - CDN Bundle (minified) 62.89 KB 62.9 KB +0.01% 🔺
@sentry/browser - Webpack 22.21 KB 22.21 KB 0%
@sentry/browser - Webpack - gzip = false 76.02 KB 76.02 KB 0%
@sentry/react - Webpack 22.24 KB 22.24 KB 0%
@sentry/nextjs Client - Webpack 46.24 KB 46.24 KB 0%
@sentry/browser + @sentry/tracing - CDN Bundle (gzipped) 28.22 KB 28.23 KB +0.02% 🔺

Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added #4506

@lobsterkatie lobsterkatie merged commit d898730 into master Feb 4, 2022
@lobsterkatie lobsterkatie deleted the kmclb-integrations-simplify-capture-console-wrapper branch February 4, 2022 22:04
AbhiPrasad added a commit that referenced this pull request Feb 9, 2022
Apply changes from #4505
that applied to `CaptureConsole` integration to the `instrumentConsole`
func in `@sentry/utils`.

It's important to note that the logic in utils, in `CaptureConsole` and
the node `Console` integration is very similar, perhaps we can refactor
to combine them.
AbhiPrasad added a commit that referenced this pull request Feb 9, 2022
Apply changes from #4505
that applied to `CaptureConsole` integration to the `instrumentConsole`
func in `@sentry/utils`.

It's important to note that the logic in utils, in `CaptureConsole` and
the node `Console` integration is very similar, perhaps we can refactor
to combine them.
AbhiPrasad added a commit that referenced this pull request Feb 10, 2022
Apply changes from #4505
that applied to `CaptureConsole` integration to the `instrumentConsole`
func in `@sentry/utils`.

It's important to note that the logic in utils, in `CaptureConsole` and
the node `Console` integration is very similar, perhaps we can refactor
to combine them.
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.

2 participants