Title: Deprecate or Change type of exported `wrap` function · Issue #8897 · getsentry/sentry-javascript · GitHub
Open Graph Title: Deprecate or Change type of exported `wrap` function · Issue #8897 · getsentry/sentry-javascript
X Title: Deprecate or Change type of exported `wrap` function · Issue #8897 · getsentry/sentry-javascript
Description: Problem Statement TIL: In the browser SDK, we export a wrap function that people can wrap around any function call. It'll try/catch whatever happens inside and report an error to Sentry (using our internal wrap function). This function i...
Open Graph Description: Problem Statement TIL: In the browser SDK, we export a wrap function that people can wrap around any function call. It'll try/catch whatever happens inside and report an error to Sentry (using our ...
X Description: Problem Statement TIL: In the browser SDK, we export a wrap function that people can wrap around any function call. It'll try/catch whatever happens inside and report an error to Sentry (using ...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/8897
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Deprecate or Change type of exported `wrap` function","articleBody":"### Problem Statement\n\nTIL: In the browser SDK, we export a `wrap` function that people can wrap around any function call. \r\n\r\nIt'll try/catch whatever happens inside and report an error to Sentry (using our internal `wrap` function). This function is typed with `any`.\r\n\r\nhttps://github.com/getsentry/sentry-javascript/blob/b618a52a37d1520bfa4dd4596ea6278fe5fffa18/packages/browser/src/sdk.ts#L200-L203\r\n\r\n\n\n### Solution Brainstorm\n\nWe should rewrite the type here to use generics:\r\n\r\n```js\r\nexport function wrap\u003cF>(fn: () => F): F\r\n```\r\n\r\nWe can now add the newly typed function and deprecate the `any`-typed one to remove in v8\r\n\r\n### Alternative\r\n\r\nDeprecate the function and remove it? I never saw this before and afaict it's not documented anywhere.","author":{"url":"https://github.com/Lms24","@type":"Person","name":"Lms24"},"datePublished":"2023-08-29T14:02:48Z","url":"https://github.com/getsentry/sentry-javascript/issues/8897"}
| 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:cbe3895a-dd88-8a3b-e9f9-02bb1bb04096 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8664:1827E:2592AD6:319E018:6B036EA9 |
| html-safe-nonce | 8b001d712a33a627cf633e6a504bba064bfad3c811b0e2a95908a5f59adbb753 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NjY0OjE4MjdFOjI1OTJBRDY6MzE5RTAxODo2QjAzNkVBOSIsInZpc2l0b3JfaWQiOiIxNTU2MDk2MTk4MjE2MjE2MjMzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 9fb14c39e1a6cee3562b549d4cc2415ebed782f710913c8aff032e7f599b7c22 |
| hovercard-subject-tag | issue:1871746818 |
| 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/8897/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5521690e51b40f6bea4a92905c29c40a2e84bf76f51b77f912983c42c0ea71b2/getsentry/sentry-javascript/issues/8897 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5521690e51b40f6bea4a92905c29c40a2e84bf76f51b77f912983c42c0ea71b2/getsentry/sentry-javascript/issues/8897 |
| og:image:alt | Problem Statement TIL: In the browser SDK, we export a wrap function that people can wrap around any function call. It'll try/catch whatever happens inside and report an error to Sentry (using our ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Lms24 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| 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 | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| 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