Skip to content

chore: remove @openpgp/web-stream-tools dependency - #476

Open
kentkwu wants to merge 1 commit into
apache:mainfrom
kentkwu:fix/remove-web-stream-tools-dependency
Open

chore: remove @openpgp/web-stream-tools dependency#476
kentkwu wants to merge 1 commit into
apache:mainfrom
kentkwu:fix/remove-web-stream-tools-dependency

Conversation

@kentkwu

@kentkwu kentkwu commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Removes @openpgp/web-stream-tools dependency and replaces it with a local concatStream() implementation.

  • The package changed from CommonJS-compatible (v0.0.13) to pure ESM-only (v0.3.1), breaking Jest's module resolution
  • Even with Jest 30, dynamic imports of pure ESM packages fail with "Cannot find module"
  • Only 3 tests use this package for concatenating ReadableStreams, a simple ~15-line function
  • Local implementation eliminates the external dependency and ESM compatibility issues

Verified all 696 tests in test/unit/ipc/reader/streams-dom-tests.ts pass with the local implementation.

Test Plan

  • npm run build
  • TEST_DOM_STREAMS=true npx jest test/unit/ipc/reader/streams-dom-tests.ts (all 696 tests pass)

Related

Closes dependabot PR #434 which attempted to upgrade this package but failed CI due to the ESM incompatibility.

Replace external dependency with local concatStream implementation.
The package changed to ESM-only between v0.0.13 and v0.3.1, breaking
Jest's module resolution even with Jest 30. Since only 3 tests use
this simple utility, implementing it locally (~15 lines) is more
maintainable than dealing with ESM compatibility issues.

- Remove @openpgp/web-stream-tools from package.json
- Add concatStream() helper in streams-dom-tests.ts
- Remove package from jest.config.js transformIgnorePatterns
- All 696 tests pass
@kentkwu
kentkwu force-pushed the fix/remove-web-stream-tools-dependency branch from 208edf4 to 6c1d8f7 Compare September 10, 2026 18:24

@kou kou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1

The concatStream implementation may be naive but I think that it's enough for test propose.

@trxcllnt @domoritz Do you want to review this we merge this?

@domoritz domoritz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you

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.

3 participants