mockrtc icon indicating copy to clipboard operation
mockrtc copied to clipboard

Update node-datachannel to 0.5.x

Open ptrcnull opened this issue 1 year ago • 5 comments

0.5.0 fixes an issue when building from source on modern Linux systems: https://github.com/murat-dogan/node-datachannel/pull/183

ptrcnull avatar Dec 09 '23 15:12 ptrcnull

I am looking into this, but it's a little tricky, due to a) newly flaky tests in this repo (I think due to Chrome changes?) and b) node-datachannel 0.5.0+ moving to pure ESM, so it can't easily be used in CommonJS modules like this one.

Nothing insurmountable, but it might take a little while. Any PRs or testing to help work through those issues is very welcome :smile:

pimterry avatar Dec 12 '23 19:12 pimterry

so it can't easily be used in CommonJS modules like this one.

when setting up http toolkit server, hotpatching require to import in pre-compiled TS code:

const NodeDataChannel = import("node-datachannel");

worked for me just fine :p however, i'm not sure if that wouldn't require modernising the tsconfig to the new import method to work properly

ptrcnull avatar Dec 12 '23 21:12 ptrcnull

:laughing: very neat. Probably not the solution I want to ship into production though I'm afraid! I'll let you know once I've got something working here.

pimterry avatar Dec 13 '23 08:12 pimterry

Oh, to be clear: it's probably going to require converting this module to ESM too, as a new breaking release, so you might want to be prepared for that downstream.

pimterry avatar Dec 13 '23 08:12 pimterry

I've just released v0.3.2, which uses the latest node-datachannel (without migrating to ESM, by using https://github.com/nktnet1/import-sync internally). @ptrcnull Can you test it out and let me know if that works for you now?

pimterry avatar Dec 18 '23 16:12 pimterry