Skip to content

refactor: re-arrange peer deps#901

Merged
georgewrmarshall merged 3 commits into
MetaMask:mainfrom
kirillzyusko:refactor/re-arrange-peer-deps
Feb 12, 2026
Merged

refactor: re-arrange peer deps#901
georgewrmarshall merged 3 commits into
MetaMask:mainfrom
kirillzyusko:refactor/re-arrange-peer-deps

Conversation

@kirillzyusko

@kirillzyusko kirillzyusko commented Feb 11, 2026

Copy link
Copy Markdown
Collaborator

Description

Make package dependent on react-native-gesture-handler, react-native-safe-area-context and lodash. Before we were depending only on react-native-reanimated.

Related issues

Fixes:

Manual testing steps

  1. Open StoryBook app
  2. Make sure it works as before

Screenshots/Recordings

Before

After

image

Pre-merge author checklist

  • I've followed MetaMask Contributor Docs
  • I've completed the PR template to the best of my ability
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

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-handler and react-native-safe-area-context move to peerDependencies for the Storybook app, while @metamask/design-system-react-native tightens/pins RN support deps (adds lodash as a peer, pins react-native-gesture-handler to 2.12.0, and adds react-native-safe-area-context as both dev + peer). The lockfile is updated accordingly.

Written by Cursor Bugbot for commit 0a9b377. This will update automatically on new commits. Configure here.

@socket-security

socket-security Bot commented Feb 11, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedreact-native-gesture-handler@​2.12.1 ⏵ 2.12.0781009199 +2100

View full report

@kirillzyusko kirillzyusko mentioned this pull request Feb 12, 2026
7 tasks

@georgewrmarshall georgewrmarshall left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@georgewrmarshall georgewrmarshall marked this pull request as ready for review February 12, 2026 17:39
@georgewrmarshall georgewrmarshall requested a review from a team as a code owner February 12, 2026 17:39

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

"@metamask/design-system-twrnc-preset": "^0.3.0",
"@metamask/design-tokens": "^8.1.0",
"@metamask/utils": "^11.9.0",
"lodash": "^4.17.23",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

"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"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

@georgewrmarshall georgewrmarshall merged commit 5736053 into MetaMask:main Feb 12, 2026
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants