getsentry / getsentry/sentry-javascript

Investigate tree shaking of transaction code when span streaming is used

Open
#22,580 1 comment 0 reactions 0 assignees View on GitHub
Core Feature javascript Traces
Dominant language
TypeScript
Stars
8.7k
Forks
1.8k
Avg merge
1d 17h
Merged PRs (30d)
515

Description

Span streaming adds a hefty bundle size increase (~5KB gzip, 2-3KB added via the `spanStreamingIntegration`, rest is in core code) to the SDK, when enabled. In v11, streaming becomes the default, so the size increase is always there. We should investigate if we can provide a tree shaking flag for bundle-size conscious users that takes care of removing transaction code paths that are "dead code" for streaming mode.

This is also a good exercise for us to determine which code paths we should remove once transactions are no longer supported by the SDK (v12?). Plus it will give us a projection of the since decrease this will yield.

Contributor guide

Open the contributing guide

Research direction

Start by examining the spanStreamingIntegration and the core transaction code paths responsible for the reported bundle-size increase. Measure the SDK bundle with streaming enabled, identify transaction paths that can be removed through tree shaking, and compare the resulting gzip size. Done means a documented projection of the reduction and a clear proposal for the tree-shaking flag and future transaction cleanup.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
performance, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.