Skip to content

Avoid inlining TypeScript helpers (__rest, __awaiter) in every file of dist/js #6955

Closed

Description

@retyui

Problem Statement

@sentry/react-native@8.26.0 ships TypeScript helpers inlined into its compiled output, so the same helper code is duplicated in every file that uses it. This adds ~7.0 KB of repeated code to the JS bundle of every app using the SDK.

Inlined helpers: __rest, __awaiter

Affected files (26):

  • dist/js/feedback/integration.js
  • dist/js/wrapper.js
  • dist/js/feedback/FeedbackForm.js
  • dist/js/feedback/ScreenshotButton.js
  • dist/js/GlobalErrorBoundary.js
  • dist/js/NavigationContainer.js
  • dist/js/integrations/debugsymbolicatorutils.js
  • dist/js/tracing/timeToDisplayFallback.js
  • dist/js/integrations/sdkinfo.js
  • dist/js/replay/mobilereplay.js
  • dist/js/replay/xhrUtils.js
  • dist/js/tracing/integrations/appStart.js
  • dist/js/tracing/timetodisplay.js
  • dist/js/sdk.js
  • dist/js/tracing/integrations/nativeFrames.js
  • dist/js/integrations/debugsymbolicator.js
  • dist/js/integrations/devicecontext.js
  • dist/js/profiling/integration.js
  • dist/js/profiling/utils.js
  • dist/js/integrations/logEnricherIntegration.js
  • dist/js/integrations/modulesloader.js
  • dist/js/integrations/release.js
  • dist/js/integrations/reactnativeerrorhandlers.js
  • dist/js/integrations/screenshot.js
  • dist/js/tracing/integrations/timeToDisplayIntegration.js
  • dist/js/integrations/viewhierarchy.js

Solution Brainstorm

Enable "importHelpers": true in tsconfig.json and add tslib as a dependency. The compiler will then import the helpers from tslib instead of emitting a copy in each file, so they're included only once in the app bundle (and deduplicated with other packages that already use tslib).

Alternatively, raising the compile target (e.g. ES2018+) would let TypeScript emit native object rest / async-await and drop these helpers entirely, leaving down-levelling to the app's Babel/Metro setup.

Are you willing to submit a PR?

None

Activity

  1. linear-code commented on Oct 27, 2026

    @linear-code
  2. antonis commented on Oct 28, 2026

    @antonis
    Contributor

    Thank you for reporting 🙇 We will investigate it and iterate back.

  3. self-assigned this
    on Oct 28, 2026
  4. added a commit that references this issue on Oct 29, 2026
    f167c0d
  5. github-actions commented on Oct 29, 2026

    @github-actions
    Contributor

    A PR closing this issue has just been released 🚀

    This issue was referenced by PR #6957, which was included in the 8.33.0 release.

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

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions