Skip to content

chore(streams): remove unused JSON stream transforms - #38953

Merged
georgewrmarshall merged 2 commits into
mainfrom
cursor/remove-dead-code-streams-20261105
Nov 6, 2026
Merged

georgewrmarshall merged 2 commits into
mainfrom
cursor/remove-dead-code-streams-20261105

Conversation

@georgewrmarshall

@georgewrmarshall georgewrmarshall commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Description

Remove two unused JSON stream transforms from app/util/streams.js. Owner set: (none). No user-facing behavior change.

setupMultiplex stays. SnapBridge and BackgroundBridge still use it. The through2 require existed only for the deleted transforms.

path removed (file / symbol / style key) why dead
app/util/streams.js jsonParseStream unused export
app/util/streams.js jsonStringifyStream unused export
app/util/streams.js through2 require cascade from jsonParseStream and jsonStringifyStream

Docs/comments updated: none

Changelog

CHANGELOG entry: null

Related issues

Refs: proactive dead-code cleanup (see #34030)

Manual testing steps

N/A — deletes code with no inbound references; verified with yarn lint:tsc, eslint and jest on affected directories (no snapshot changes).

Screenshots/Recordings

N/A — no UI change

Before

N/A — no UI change

After

N/A — no UI change

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

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
Unused export removal with no inbound references; multiplex setup path is unchanged.

Overview
Removes dead code from app/util/streams.js: jsonParseStream, jsonStringifyStream, and the through2 dependency that existed only for those helpers.

The module now exports only setupMultiplex, which SnapBridge and BackgroundBridge still import. No call sites referenced the deleted transforms.

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

Description

Remove two unused JSON stream transforms from app/util/streams.js. Owner set: (none). No user-facing behavior change.

setupMultiplex stays. SnapBridge and BackgroundBridge still use it. The through2 require and the through2 package.json dependency existed only for the deleted transforms. yarn depcheck reports no unused dependencies after this change.

path removed (file / symbol / style key) why dead
app/util/streams.js jsonParseStream unused export
app/util/streams.js jsonStringifyStream unused export
app/util/streams.js through2 require cascade from jsonParseStream and jsonStringifyStream
package.json, yarn.lock through2 dependency cascade; no other workspace package depends on it

Docs/comments updated: none

Changelog

CHANGELOG entry: null

Related issues

Refs: proactive dead-code cleanup (see #34030)

Manual testing steps

N/A — deletes code with no inbound references; verified with yarn lint:tsc, eslint and jest on affected directories (no snapshot changes).

Screenshots/Recordings

N/A — no UI change

Before

N/A — no UI change

After

N/A — no UI change

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

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.
Open in Web Open in Cursor 

Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
@github-actions github-actions Bot added the size-S label Nov 5, 2026
@georgewrmarshall georgewrmarshall added team-design-system All issues relating to design system in Mobile and removed size-S labels Nov 5, 2026 — with Cursor
@georgewrmarshall georgewrmarshall self-assigned this Nov 5, 2026
@github-actions github-actions Bot added the size-S label Nov 5, 2026
@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Smart E2E Test Selection

Selected E2E tags: No E2E tests selected

AI Confidence: 90

E2E reasoning

Expand to read

This PR removes dead code from app/util/streams.js (jsonParseStream and jsonStringifyStream functions that used through2) and removes the through2 dependency from package.json/yarn.lock.

Key findings:

  1. The removed functions (jsonParseStream, jsonStringifyStream) were not imported anywhere in the codebase - they were unused exports.
  2. The only function remaining in streams.js (setupMultiplex) is unchanged and continues to be used by BackgroundBridge.js for dApp stream multiplexing.
  3. BackgroundBridge.js only imports setupMultiplex from streams.js - not the removed functions.
  4. The through2 package removal is clean - no other files reference it.
  5. No behavioral changes to any existing functionality - this is purely dead code removal.

Since no existing behavior is modified, no shared components are changed in a way that could break tests, and the critical setupMultiplex function is untouched, there is no need to run any E2E smoke tests for this change. The risk of breaking any existing E2E test is negligible.

View run

Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
@sonarqubecloud

sonarqubecloud Bot commented Nov 5, 2026

Copy link
Copy Markdown

@georgewrmarshall
georgewrmarshall added this pull request to the merge queue Nov 6, 2026
Merged via the queue into main with commit 96e5c97 Nov 6, 2026
94 checks passed
@georgewrmarshall
georgewrmarshall deleted the cursor/remove-dead-code-streams-20261105 branch November 6, 2026 07:09
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 6, 2026
@metamask-ci metamask-ci Bot added the release-8.21.0 Issue or pull request that will be included in release 8.21.0 label Nov 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-8.21.0 Issue or pull request that will be included in release 8.21.0 size-S team-design-system All issues relating to design system in Mobile

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants