Skip to content

fix: remove unused date-fns dependency from sdk-communication-layer - #1395

Open
ZayanKhan-12 wants to merge 2 commits into
MetaMask:mainfrom
ZayanKhan-12:fix/1352-date-fns-v4
Open

fix: remove unused date-fns dependency from sdk-communication-layer#1395
ZayanKhan-12 wants to merge 2 commits into
MetaMask:mainfrom
ZayanKhan-12:fix/1352-date-fns-v4

Conversation

@ZayanKhan-12

@ZayanKhan-12 ZayanKhan-12 commented Aug 4, 2026

Copy link
Copy Markdown

Description

@metamask/sdk-communication-layer declares date-fns: ^2.29.3 as a dependency, but nothing in the package (or anywhere in the monorepo) imports it — the only references are the package.json entry and a stale 'date-fns': 'dateFns' UMD-globals entry in rollup.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 affected
  • yarn workspace @metamask/sdk-communication-layer build — all four targets (browser ES/UMD, RN, node) build clean
  • yarn 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-fns dependency from @metamask/sdk-communication-layer, so consumers no longer pull in a large v2 tree that the package never used.

The change drops date-fns from package.json, removes the stale 'date-fns': 'dateFns' UMD global from rollup.config.js, updates yarn.lock, and records the removal under [Unreleased] in CHANGELOG.md.

Reviewed by Cursor Bugbot for commit e2bb17b. Bugbot is set up for automated code reviews on this repo. Configure here.

ZayanKhan-12 and others added 2 commits August 3, 2026 20:15
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>
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.

@metamask/sdk-communication-layer pulls in old date-fns v2

1 participant