refactor: re-arrange peer deps#901
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
| "@metamask/design-system-twrnc-preset": "^0.3.0", | ||
| "@metamask/design-tokens": "^8.1.0", | ||
| "@metamask/utils": "^11.9.0", | ||
| "lodash": "^4.17.23", |
There was a problem hiding this comment.
Unused lodash peer dependency burdens consumers unnecessarily
Medium Severity
lodash is added as a peerDependency of @metamask/design-system-react-native, but it is not imported or used anywhere in the package's source code. A thorough search of the entire src/ directory confirms zero references. Additionally, lodash is already a direct dependency of react-native-gesture-handler, so it gets installed transitively without needing to be a peer dependency here. This forces every consumer to explicitly install lodash for no reason.
| "react-native-gesture-handler": ">=1.10.3", | ||
| "react-native-reanimated": ">=3.3.0" | ||
| "react-native-reanimated": ">=3.3.0", | ||
| "react-native-safe-area-context": ">=4.0.0" |
There was a problem hiding this comment.
Unused react-native-safe-area-context peer dependency added
Medium Severity
react-native-safe-area-context is newly added as a peerDependency, but it is not imported or used anywhere in the package's source code. A search of the entire src/ directory shows zero references to this library. This forces every consumer to install react-native-safe-area-context without any actual need from the package's code.


Description
Make package dependent on
react-native-gesture-handler,react-native-safe-area-contextandlodash. Before we were depending only onreact-native-reanimated.Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Primarily dependency metadata changes plus a simple Storybook wrapper; risk is limited to potential install/peer-resolution issues or runtime gesture-handler initialization in Storybook.
Overview
Storybook RN is updated to wrap all stories in
GestureHandlerRootView, ensuring gesture-handler-dependent components render correctly.Dependency declarations are reshuffled:
react-native-gesture-handlerandreact-native-safe-area-contextmove topeerDependenciesfor the Storybook app, while@metamask/design-system-react-nativetightens/pins RN support deps (addslodashas a peer, pinsreact-native-gesture-handlerto2.12.0, and addsreact-native-safe-area-contextas both dev + peer). The lockfile is updated accordingly.Written by Cursor Bugbot for commit 0a9b377. This will update automatically on new commits. Configure here.