sentry-react-native
sentry-react-native copied to clipboard
Optimization problem with @sentry/react-native within a react-native-web app - lodash gots fully imported
OS:
- [x] Windows
- [x] MacOS
- [x] Linux
Platform:
- [x] iOS
- [x] Android
SDK:
- [x]
@sentry/react-native
(>= 1.0.0) - [ ]
react-native-sentry
(<= 0.43.2)
SDK version: 4.2.2
react-native
version: 0.68.2
Are you using Expo?
- [ ] Yes
- [x] No
Are you using sentry.io or on-premise?
- [ ] sentry.io (SaaS)
- [x] on-premise 22.5.0
Configuration:
I have following issue:
We use lodash.*
do target exactly which module we need from lodash
, but after buildeing our react-native-web app (which is also a react-native app), it appears looking at webpack-bundle-analyzer that one of our dependency
(which is sentry-react-native) import the whole lodash. Is this necessary ?
see in red the multiple lodash we have now
Steps to reproduce:
- yarn add @sentry/react-native
- npm ls lodash
Actual result:
├─┬ @sentry/[email protected]
│ └─┬ @sentry/[email protected]
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ └── [email protected] deduped
Expected result:
├─┬ @sentry/[email protected]
│ └─┬ @sentry/[email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ └── [email protected]
Related issues
- https://stackoverflow.com/questions/73222347/why-webpack-bundle-analyzer-show-lodash-bundled-more-than-once
- https://github.com/getsentry/sentry-wizard/issues/182
Also, I do see that https://www.npmjs.com/package/inquirer is a cli tool, what's the point of shipping it into our iOS/Android app ? Could this dependence be removed?
It was removed but it's back because of https://github.com/getsentry/sentry-react-native/pull/2015 We can remove it again for the 5.x release since we don't need to support older RN versions in that major bump.
Hi @marandaneto , it's great, do you have an ETA for the 5.x release ? Meanwhile I presume we must switch to lodash the whole instead of picking everything.
This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog
or Status: In Progress
, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀
Keep open
https://github.com/getsentry/sentry-react-native/blob/e96259b6ed55622619015e580ed9ca98f29ef8d5/package.json#L57
On the next major version v5, the wizard was moved to the dev deps, so please upgrade your SDK when you feel comfortable with, since its not GA yet.