Skip to content

Conversation

@manojVivek
Copy link

This PR implements the extraction of the debugId from the magic comment of the js file and passing that as part of the frame data, so that this can be used to source map the locations on the server.

pid := pr.PID()
symbolReporter reporter.SymbolReporter, pr process.Process, mappings []process.Mapping,
) error {
i.reporter = symbolReporter
Copy link
Author

Choose a reason for hiding this comment

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

I'm a bit skeptical about doing this, please let me know if there is a better way to get the symbolReporter in the appendFrames function.

Copy link
Collaborator

Choose a reason for hiding this comment

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

You could change the Symbolize function to accept it, and then pass it down in processmanager/manager.go. But that will require you to change every interpreter. IMO, if you don't want to do that, this way is probably fine.


// debugIDRegex matches the debug ID magic comment at the end of JS files
// Pattern: //# debugId=550e8400-e29b-41d4-a716-446655440000
var debugIDRegex = regexp.MustCompile(`//# debugId=([0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})`)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we verify this occupies an entire line by itself?

pid := pr.PID()
symbolReporter reporter.SymbolReporter, pr process.Process, mappings []process.Mapping,
) error {
i.reporter = symbolReporter
Copy link
Collaborator

Choose a reason for hiding this comment

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

You could change the Symbolize function to accept it, and then pass it down in processmanager/manager.go. But that will require you to change every interpreter. IMO, if you don't want to do that, this way is probably fine.

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