[RUMF-1169] cleanup compute stack trace #1335
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Reduce bundles size by removing old browser support in tracekit imported code. Those browsers are not supported by our SDK in the first place (the code won't execute at all), so it won't have any impact.
Changes
Remove various strategies to compute the call stack. I made sure that removed code cannot be used in supported browsers:
old Opera (presto-based) browsers don't support WeakMaps, which is a requirement for our SDK
the IE11 errors may not have a
stack
(they need to be thrown to have a stack), but the fallback strategy to produce a stack by walking the caller stack wasn't working because our SDK is evaluated in strict mode. Also, this strategy would probably return something similar to the "handling stack" instead of the actual error stack.Before:
After
8.6% size reduction for logs bundle 🎉
Testing
I have gone over the contributing documentation.