Skip to content

ref(tracing): Split @sentry/tracing into runtime specific packages #5815

Description

@timfish

Problem Statement

After some discussions around supporting newer JavaScript runtimes (#5611) @lforst pointed out the first thing that needs tackling is @sentry/tracing!

This package currently contains:

  • Runtime agnostic code used to add transaction support to the hub
  • Browser specific instrumentation code
  • Node.js specific instrumentation code

Goal: Remove the tracing package, move stuff into core/browser/node

Solution Brainstorm

It looks like the runtime agnostic code can safely be moved to @sentry/core without affecting bundle sizes since if it goes unused it gets tree-shaken.

The runtime specific code could be moved into package exports under the specific runtime, ie. @sentry/browser/tracing and @sentry/node/tracing. We've been using this in the Electron SDK for a while to keep bundlers happy with the two different contexts we run in. We can't export the tracing code at the root of the packages since importing tracing has side-effects!

I haven't marked this issue as Breaking yet because I think it would be possible to move this code while keeping @sentry/tracing as a stub that would simply re-export the moved code. @sentry/tracing would have to depend on both @sentry/browser and @sentry/node so I'm not sure how viable this is yet or if it's worth that extra step 🤔

### Tasks
- [ ] https://github.com/getsentry/sentry-javascript/issues/7091
- [ ] https://github.com/getsentry/sentry-javascript/pull/7345
- [ ] https://github.com/getsentry/sentry-javascript/issues/7342
- [ ] https://github.com/getsentry/sentry-javascript/issues/7346
- [ ] https://github.com/getsentry/sentry-javascript/issues/7340
### Cleanup
- [ ] https://github.com/getsentry/sentry-docs/issues/6518
- [ ] https://github.com/getsentry/sentry-javascript/issues/7586

Activity

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

Metadata

Metadata

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions