Skip to content

The bundle size is too large 430KB #1733

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
TangShengda opened this issue Aug 17, 2021 · 7 comments
Closed

The bundle size is too large 430KB #1733

TangShengda opened this issue Aug 17, 2021 · 7 comments

Comments

@TangShengda
Copy link

The bundle package volume is too large 430KB

@ku8ar
Copy link

ku8ar commented Aug 17, 2021

@TangShengda Exactly. This is what it looks like in our project

Zrzut ekranu 2021-08-17 o 09 21 58

Modules marked in red seem completely unnecessary.

The problem seems to arise from importing entire modules:

// bad
import { addGlobalEventProcessor } from "@sentry/core";

//good
import addGlobalEventProcessor from "@sentry/core/src/addGlobalEventProcessor";

I tried to manually change these imports in @sentry/react-native package, but this applies to all @sentry/* packages.

For example, @sentry/browser is not directly imported into @sentry/react-native, but we import it all anyway.

As a result, the @sentry/react-native package is the second largest package in our app (because the largest is of course react-native). It even takes up more space than entire react-navigation package.

@jennmueng
Copy link
Member

Let's follow the discission over on the sentry-javascript repo: getsentry/sentry-javascript#2707

@jayshah-swiggy
Copy link

same as #1818

@marandaneto
Copy link
Contributor

related to #759

@philipphofmann philipphofmann moved this to Needs Discussion in Mobile SDKs Nov 9, 2021
@marandaneto marandaneto moved this from Needs Discussion to Backlog in Mobile SDKs Jan 21, 2022
@marandaneto
Copy link
Contributor

Ideally, we'd migrate to the Sentry JS SDK 7.x and get the bundle size improvements for free, which requires migration.
getsentry/sentry-javascript#4240

@marandaneto marandaneto moved this from Backlog to Blocked in Mobile SDKs Jan 21, 2022
@marandaneto marandaneto changed the title The bundle package volume is too large 430KB The bundle size is too large 430KB Jan 21, 2022
@marandaneto
Copy link
Contributor

The effort depends on who does the migration to Sentry JS SDK, maybe we do the migration for user feedback or attachments or client reports, if that's the case, then the effort is just Small.

@marandaneto
Copy link
Contributor

There were a few improvements related to bundle size on the JS SDK and Android SDK, the RN SDK got it for free, please upgrade to the latest version (4.x) and let us know if that helped, thanks.

Repository owner moved this from Blocked to Done in Mobile SDKs Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

6 participants