network icon indicating copy to clipboard operation
network copied to clipboard

Use latest node-datachannel with help of EsmLoader

Open ptesavol opened this issue 1 year ago • 4 comments

  • Add EsmLoader for loading esm modules into our CommonJS project
  • Use EsmLoader to load the latest node-datachannel library
  • Remove externals definitions from browser tests to make them work with the node-datachannel esm library
  • Add --experimental-vm-modules env variable to jest invocations to make them work with esm modules

ptesavol avatar Apr 03 '24 10:04 ptesavol

Does this change affect the end-users of say @streamr/sdk? Do they need to use the --experimental-vm-modules flag when running their code?

harbu avatar Apr 04 '24 11:04 harbu

@harbu The --experimental-vm-modules flag is only needed by jest. jest uses some exotic virtual machine api to load esm:s https://stackoverflow.com/questions/74069138/node-js-experimental-vm-modules-command-line-option-vs-type-module-in-pac

ptesavol avatar Apr 04 '24 11:04 ptesavol

probably a good idea to do an experimental release of this change just in case something goes wrong with the npm packaging @harbu

Good idea. Let's discuss on Monday call how we want to roll this out. (e.g. Keep branch or merge to main)

harbu avatar Apr 05 '24 14:04 harbu

Can close now after node-datachannel v0.7.0? https://github.com/streamr-dev/network/pull/2505

juslesan avatar Apr 18 '24 12:04 juslesan

No longer needed as CJS is supported bu node-datachannel since v0.8.0

juslesan avatar Apr 26 '24 08:04 juslesan