Skip to content

Refactor Stack Parsing #4543

Description

@timfish

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:

This quick PoC shows that the stack line parsers can be moved into individual functions that will allow features to be configurable.

Rough Plan

Make incremental improvements, starting with non-breaking changes:

Then breaking changes for next major version:

A stack parser that can handle both Chrome and Node.js frames might be constructed like:

import{createStackParser}from'@sentry/utils';import{chrome}from'@sentry/browser';import{node}from'@sentry/node';import{Exception}from'@sentry.types';conststackParser=createStackParser(chrome,node);try{thrownewError('bad things');}catch(e){constex: Exception=stackParser(e);}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions