fix: remove unused date-fns dependency from sdk-communication-layer - #1395
Open
ZayanKhan-12 wants to merge 2 commits into
Open
fix: remove unused date-fns dependency from sdk-communication-layer#1395ZayanKhan-12 wants to merge 2 commits into
ZayanKhan-12 wants to merge 2 commits into
Conversation
date-fns is not imported anywhere in the package (or the monorepo) — it is only declared in package.json and listed as a UMD global in the rollup config. Consumers were pulling in the full date-fns v2 tree (~25MB) for nothing, and the v2 pin also failed to dedupe against date-fns v3/v4 in downstream apps. Fixes MetaMask#1352 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
@metamask/sdk-communication-layerdeclaresdate-fns: ^2.29.3as a dependency, but nothing in the package (or anywhere in the monorepo) imports it — the only references are thepackage.jsonentry and a stale'date-fns': 'dateFns'UMD-globals entry inrollup.config.js.As reported in #1352, this forces consumers to install the full date-fns v2 tree (~25MB unpacked) for nothing, and the v2 pin can't dedupe against date-fns v3/v4 used by downstream apps.
This removes the dependency and the stale rollup global instead of bumping it, since it's dead weight.
Fixes #1352
Testing
yarn install— lockfile updated, no other packages affectedyarn workspace @metamask/sdk-communication-layer build— all four targets (browser ES/UMD, RN, node) build cleanyarn workspace @metamask/sdk-communication-layer test— 66 suites / 313 tests pass🤖 Generated with Claude Code
Note
Low Risk
Dependency-only cleanup with no runtime code changes; lowers install footprint and avoids unnecessary v2 date-fns in the tree.
Overview
Removes the unused
date-fnsdependency from@metamask/sdk-communication-layer, so consumers no longer pull in a large v2 tree that the package never used.The change drops
date-fnsfrompackage.json, removes the stale'date-fns': 'dateFns'UMD global fromrollup.config.js, updatesyarn.lock, and records the removal under [Unreleased] inCHANGELOG.md.Reviewed by Cursor Bugbot for commit e2bb17b. Bugbot is set up for automated code reviews on this repo. Configure here.