Skip to content

Add bundleSizeOptimizations for @sentry-internal/feedback #14079

Closed as not planned
Closed as not planned

Description

Problem Statement

It looks like there is no way to avoid internal @sentry-internal/feedback module that brings 80KB of rendered size in the app. It comes with @sentry/browser which in my setup (react/vite) is used by @sentry/react.

"node_modules/@sentry/browser": {
      "version": "8.35.0",
      "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-8.35.0.tgz",
      "integrity": "sha512-WHfI+NoZzpCsmIvtr6ChOe7yWPLQyMchPnVhY3Z4UeC70bkYNdKcoj/4XZbX3m0D8+71JAsm0mJ9s9OC3Ue6MQ==",
      "license": "MIT",
      "dependencies": {
        "@sentry-internal/browser-utils": "8.35.0",
        **"@sentry-internal/feedback": "8.35.0",**
        "@sentry-internal/replay": "8.35.0",
        "@sentry-internal/replay-canvas": "8.35.0",
        "@sentry/core": "8.35.0",
        "@sentry/types": "8.35.0",
        "@sentry/utils": "8.35.0"
      },
      "engines": {
        "node": ">=14.18"
      }
    },

Image

Solution Brainstorm

Two solutions:
1.) Add parameter to bundleSizeOptimizations, similar to excludeTracing and excludeReplayIframe, so I cam remove this dependency.
2.) Support automatic tree shaking, so I can load feedback later with:

                        const lazyLoadedSentry = await import("@sentry/react");
                        Sentry.addIntegration(lazyLoadedSentry.feedbackIntegration({
                            colorScheme: "system",
                            showBranding: false,
                            autoInject: false,
                        }));

                        const feedback = Sentry.getFeedback();
                        ...

Activity

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

Metadata

Assignees

No one assigned

    Labels

    Projects

    • Status

      Waiting for: Community

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions