libcellml
libcellml copied to clipboard
Do we really need both the ESM and CommonJS versions of our JavaScript bindings?
Right now, we generate and provide both an ESM and CommonJS version of our JavaScript bindings, which means that it takes twice as much space as really needed. Yet, we know that CommonJS works in Node, but not in web browsers while ESM is supported by all modern web browsers and Node 13+. So, it ought to be sufficient to just support ESM?
Now, I know that we use the CommonJS version for our tests with jest
, but we can get jest
to work with ESM by using it with --experimental-vm-modules
. ESM seems to be the way forward, so I would just generate and provide an ESM version of our JavaScript bindings.
I know of at least one person who is using the CommonJS version with node, so I don't think it is a good idea to not supply this variant.