Replace wrtc and node-pre-gyp with node-datachannel/polyfill#8352
Replace wrtc and node-pre-gyp with node-datachannel/polyfill#8352
Conversation
Remove the problematic 'wrtc' npm package from devDependencies and update test files (replication-google-drive.test.ts, replication-microsoft-onedrive.test.ts) to use 'node-datachannel/polyfill' instead. Update documentation to remove references to the 'wrtc' package alternative. Agent-Logs-Url: https://github.com/pubkey/rxdb/sessions/7cd4ebe2-2f70-485d-8dda-45031c40d59e Co-authored-by: pubkey <8926560+pubkey@users.noreply.github.com>
|
@copilot peer error: TypeError: Cannot set property sdp of # which has only a getter |
Add createSimplePeerWrtc() wrapper that returns plain objects from createOffer/createAnswer to work around read-only RTCSessionDescription.sdp in node-datachannel/polyfill. Update all test files and docs. Agent-Logs-Url: https://github.com/pubkey/rxdb/sessions/8be19412-10ed-4561-ae1a-2e055060d6d2 Co-authored-by: pubkey <8926560+pubkey@users.noreply.github.com>
Agent-Logs-Url: https://github.com/pubkey/rxdb/sessions/8be19412-10ed-4561-ae1a-2e055060d6d2 Co-authored-by: pubkey <8926560+pubkey@users.noreply.github.com>
... Fixed in 472d523. The root cause was that Added a Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
const Orig = ndc.RTCPeerConnection;
|
|
@copilot ci fails |
Agent-Logs-Url: https://github.com/pubkey/rxdb/sessions/19e63b0a-6e9c-46a1-acb2-05d822de5fc0 Co-authored-by: pubkey <8926560+pubkey@users.noreply.github.com>
|
@copilot can we also remove the node-gyp depedency if we no longer use wrtc? |
Agent-Logs-Url: https://github.com/pubkey/rxdb/sessions/cd14244f-18e4-4c5c-8921-a3f527c70dae Co-authored-by: pubkey <8926560+pubkey@users.noreply.github.com>
Summary
The
wrtcnpm package (v0.4.7) is known to cause many problems (build failures, compatibility issues, unmaintained). This PR removes it entirely and replaces all its usages withnode-datachannel/polyfill, which was already a devDependency and is the recommended WebRTC polyfill for Node.js. Thenode-pre-gypdevDependency, which was only needed forwrtc's native compilation, is also removed.Because
node-datachannel/polyfill'sRTCSessionDescriptionhas a read-onlysdpproperty thatsimple-peertries to mutate, this PR also adds acreateSimplePeerWrtc()wrapper function that returns plain objects fromcreateOffer()/createAnswer()to ensure compatibility.Changes
wrtcandnode-pre-gypfromdevDependenciescreateSimplePeerWrtc()exported helper that wrapsRTCPeerConnectionto return plain{ type, sdp }objects fromcreateOffer()/createAnswer(), making them compatible withsimple-peerrequire('wrtc')withnode-datachannel/polyfillwrapped viacreateSimplePeerWrtc()createSimplePeerWrtc()createSimplePeerWrtc()createSimplePeerWrtc()import and usageValidation
npm run lintpassesnpm run check-typespasses (pre-existing errors only, unrelated to this change)npm run buildsucceedsnpm run test:fast:memorypasses (1324 tests)