Optimization problem with @sentry/react-native within a react-native-web app - lodash gots fully imported
See original GitHub issueOS:
- Windows
- MacOS
- Linux
Platform:
- iOS
- Android
SDK:
-
@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
- No
Are you using sentry.io or on-premise?
- sentry.io (SaaS)
- 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/react-native@4.2.2
│ └─┬ @sentry/wizard@1.2.17
│ ├─┬ inquirer@6.5.2
│ │ └── lodash@4.17.21 deduped
│ └── lodash@4.17.21 deduped
Expected result:
├─┬ @sentry/react-native@4.2.2
│ └─┬ @sentry/wizard@1.2.17
│ ├─┬ inquirer@6.5.2
│ │ └── lodash.something@4.17.21
│ └── lodash.something@4.17.21
Related issues
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How to shrink (tree-shake) lodash in bundle file for React ...
By implementing tree shaking practices, the performance of your React Native applications will be improved and the bundle size reduced. The idea ...
Read more >The Correct Way to Import Lodash Libraries: A Benchmark
In this article, we'll talk about ways and methods to optimize imports of the Lodash library both with and without external plugins. We...
Read more >Correct way of importing and using lodash in Angular
I now get the following error when using that statement: '"{...}/node_modules/@types/lodash/index"' has no exported member 'debounce'.
Read more >Optimization of Lodash styling and bundle size
In big projects dealing with the styling of Lodash imports alone may quickly become a mess, and a single “whole library” import will...
Read more >JavaScript Lodash Tutorial - YouTube
A few weeks ago, I explored Lodash https:// lodash.com/ an Essential JavaScript Utility library. Other fellow programmers used this library ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
Keep open