Skip to content

Export Integrations (and other potential things) individually for proper treeshaking support #2738

Closed
@mortargrind

Description

@mortargrind

Package + Version

  • @sentry/browser
  • @sentry/node

Version:

15.19.1 and below

Description

Integrations (actually not just them, everything) should be exported individually using named exports, instead of using namespace objects like Integrations so unused integrations (or any other thing) won't be included in the bundle. Right now If I include any integrations (like LinkedErrors integration) I am forced to include every possible integration, which unnecessarily increases the bundle size. Also, in the case of this issue: #2688 it results in loading a server-side module on browser-side (and vice-versa), which is a much bigger problem that not just affects performance but also functionality.

I think this can be done in a minor update via keeping the old Integrations style exports but directing people to using the new individual exports. I can try to add this with a PR if you want.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions