Skip to content

fix: replace deprecated @paulmillr/qr with qr - #1396

Open
ZayanKhan-12 wants to merge 2 commits into
MetaMask:mainfrom
ZayanKhan-12:fix/1297-replace-deprecated-qr-package
Open

fix: replace deprecated @paulmillr/qr with qr#1396
ZayanKhan-12 wants to merge 2 commits into
MetaMask:mainfrom
ZayanKhan-12:fix/1297-replace-deprecated-qr-package

Conversation

@ZayanKhan-12

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

Copy link
Copy Markdown

Description

@paulmillr/qr is deprecated on npm: "Switch to qr (new package name) for security updates". qr is the same library by the same author with an identical API (default-export encodeQR, same Output union and QrOpts), so this is a rename-only swap.

Changes:

  • packages/sdk, packages/sdk-install-modal-web, packages/sdk-multichain, packages/sdk-multichain-ui: dependency @paulmillr/qr@^0.2.1qr@^0.6.0
  • All import encodeQR from '@paulmillr/qr' sites, declare module shims, and test mocks updated to 'qr'

Both packages are ESM-only, so module-format behavior for consumers is unchanged (qr's engines: node >=20.19 reflects its require(esm) support).

Fixes #1297

Testing

  • yarn workspace @metamask/sdk-install-modal-web build
  • yarn workspace @metamask/sdk build + test — QR-related suites pass (the two failing suites, isOldIOS/PlatfformManager, fail identically on unmodified main under Node ≥21 — Cannot redefine property: navigator — unrelated to this change)
  • yarn workspace @metamask/sdk-multichain test — 256 tests pass (includes the qr mock suites)
  • yarn workspace @metamask/sdk-multichain-ui build

🤖 Generated with Claude Code


Note

Low Risk
Dependency rename with the same encodeQR API and updated tests/mocks; no auth or connection logic changes, only QR encoding for install modals.

Overview
Swaps the deprecated @paulmillr/qr dependency for qr@^0.6.0 across @metamask/sdk, sdk-install-modal-web, sdk-multichain, and sdk-multichain-ui, with matching yarn.lock updates.

All encodeQR import sites, declare module shims, and test mocks now target 'qr' instead of '@paulmillr/qr' (Stencil install/select modals, Node install modals, and related tests). Changelogs record the change under [Unreleased]; call patterns such as encodeQR(link, 'ascii') and encodeQR(link, 'svg', { ecc, scale }) are unchanged.

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

ZayanKhan-12 and others added 2 commits August 3, 2026 20:19
@paulmillr/qr is deprecated on npm with the notice 'Switch to qr (new
package name) for security updates'. The qr package is the same library
by the same author with an identical API (default-export encodeQR, same
Output types and QrOpts), so this is a rename-only swap across the four
packages that declared it.

Fixes MetaMask#1297

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@socket-security

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
Addednpm/​qr@​0.6.010010010083100

View full report

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.

Replace deprecated @paulmillr/qr with qr

1 participant