Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
agarny opened this issue May 22, 2023 · 1 comment

Comments

@agarny
Copy link
Contributor

agarny commented May 22, 2023

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
Copy link
Contributor

hsorby commented May 22, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants