Title: Refactor Stack Parsing · Issue #4543 · getsentry/sentry-javascript · GitHub
Open Graph Title: Refactor Stack Parsing · Issue #4543 · getsentry/sentry-javascript
X Title: Refactor Stack Parsing · Issue #4543 · getsentry/sentry-javascript
Description: Currently the JavaScript stack parsing is made up of: Highly modified version of Tracekit for the browser Mildly modified version of node-stack-parse for node.js These are currently working well but there is scope for improvement: Multip...
Open Graph Description: Currently the JavaScript stack parsing is made up of: Highly modified version of Tracekit for the browser Mildly modified version of node-stack-parse for node.js These are currently working well bu...
X Description: Currently the JavaScript stack parsing is made up of: Highly modified version of Tracekit for the browser Mildly modified version of node-stack-parse for node.js These are currently working well bu...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/4543
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Refactor Stack Parsing","articleBody":"Currently the JavaScript stack parsing is made up of:\r\n - Highly modified version of Tracekit for the browser\r\n - Mildly modified version of `node-stack-parse` for node.js\r\n\r\nThese are currently working well but there is scope for improvement:\r\n- Multiple refactors have resulted in unused fields/code paths and unnecessary abstractions\r\n- Downstream SDKs cannot configure the parser\r\n - In Electron we need to use both Chrome and node.js line parsers in the renderer (https://github.com/getsentry/sentry-electron/issues/308)\r\n - SDK users might want to exclude certain parsers to reduce bundle size\r\n\r\nThis [quick PoC](https://github.com/timfish/sentry-javascript/blob/tracekit-seperater-parsers/packages/browser/src/tracekit.ts) shows that the stack line parsers can be moved into individual functions that will allow features to be configurable.\r\n\r\n## Rough Plan\r\nMake incremental improvements, starting with non-breaking changes:\r\n\r\n- [x] Refactor and improve tests and make some minor parser simplifications \r\n - #4514\r\n- [x] Remove unnecessary types and more simplifications \r\n - #4523 \r\n- [x] Split line parsers into individual functions\r\n - #4555\r\n- [x] Migrate `node-stack-parse` to the common parser\r\n - [x] Improve Node tests\r\n - #4564 \r\n - [x] Move context line fetching to an integration \r\n - #3729\r\n - [x] Update docs to deprecate `frameContextLines` \r\n - https://github.com/getsentry/sentry-docs/pull/4746 \r\n - [ ] Run node CI tests on Windows\r\n - https://github.com/getsentry/sentry-javascript/pull/4616\r\n - [x] Refactor node parser to be line orientated and use common parser\r\n - #4612\r\n- [x] More stack parse improvements and consolidation\r\n - #4669\r\n\r\nThen breaking changes for next major version:\r\n - [x] Add `stackParser` to `init` options so it can be overridden in downstream SDKs\r\n - This will require modifications to exports in eventbuilder\r\n - #4902\r\n - [x] Remove usages of deprecated `event.stacktrace`\r\n - #4885\r\n - [x] Drop default Opera support since its not in the list of supported browsers\r\n - #4923\r\n - [x] Remove `frameContextLines` from `NodeOptions` since this will now be passed to the integration\r\n - #4884\r\n - [x] Remove `eventbuilder` exports which were at some point used in `@sentry/electron`\r\n - #4887\r\n\r\n\r\nA stack parser that can handle both Chrome and Node.js frames might be constructed like:\r\n```ts\r\nimport { createStackParser } from '@sentry/utils';\r\nimport { chrome } from '@sentry/browser';\r\nimport { node} from '@sentry/node';\r\nimport { Exception } from '@sentry.types';\r\n\r\nconst stackParser = createStackParser(chrome, node);\r\n\r\ntry {\r\n throw new Error('bad things');\r\n} catch(e) {\r\n const ex: Exception = stackParser(e);\r\n}\r\n\r\n```\r\n ","author":{"url":"https://github.com/timfish","@type":"Person","name":"timfish"},"datePublished":"2022-02-10T18:22:12Z","url":"https://github.com/getsentry/sentry-javascript/issues/4543"}
| 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:3c08dea9-c624-e38c-38a2-a9eef8966162 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8366:27A224:CB16:10C5D:6B0429A6 |
| html-safe-nonce | 0481ce22c4baec6c72d2d6d1b145ea89a8a5acd302cfce9e9735a7fd0ab4aca7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MzY2OjI3QTIyNDpDQjE2OjEwQzVEOjZCMDQyOUE2IiwidmlzaXRvcl9pZCI6Ijc2MzUyNzc1MzI3MTUyOTcxOTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 5470096ec0983e5d5facf5c134d147c69307a68199a5b0f3a437e0f80f69f0a7 |
| hovercard-subject-tag | issue:1130617894 |
| 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/4543/issue_layout |
| twitter:image | https://opengraph.githubassets.com/62799465d76c3ab6806471b436a9e568a44039bfd55644331dd9c98780a9189f/getsentry/sentry-javascript/issues/4543 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/62799465d76c3ab6806471b436a9e568a44039bfd55644331dd9c98780a9189f/getsentry/sentry-javascript/issues/4543 |
| og:image:alt | Currently the JavaScript stack parsing is made up of: Highly modified version of Tracekit for the browser Mildly modified version of node-stack-parse for node.js These are currently working well bu... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | timfish |
| 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