cellml / libcellml

Repository for libCellML development.
https://libcellml.org
Apache License 2.0
16 stars 21 forks source link

Do we really need both the ESM and CommonJS versions of our JavaScript bindings? #1168

Open agarny opened 1 year ago

agarny commented 1 year ago

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.

hsorby commented 1 year ago

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.