Use latest node-datachannel with help of EsmLoader
- 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
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 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
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)
Can close now after node-datachannel v0.7.0? https://github.com/streamr-dev/network/pull/2505
No longer needed as CJS is supported bu node-datachannel since v0.8.0