tursodatabase / libsql-client-ts

TypeScript/JavaScript client API for libSQL
https://docs.turso.tech/sdk/ts/quickstart
MIT License
226 stars 32 forks source link

Make the package ESM-only? #164

Closed penberg closed 7 months ago

penberg commented 8 months ago

We currently support both ESM and CommonJS, but some of our dependencies, like node-fetch, has become ESM-only. Let's think about making the libSQL client ESM-only.

netroy commented 8 months ago

I'm currently trying to migrate a large nodejs application to libSQL, and if this package wasn't available as CommonJS, I would have to abandon those efforts. I know that we should all be slowly migrating our projects to ESM, but unfortunately it's quite a chore to move large projects to ESM. If it's not a hassle, I'd request to keep including CJS in the builds for another year (if possible) 🙏🏽

penberg commented 8 months ago

Thanks for the feedback, @netroy, very helpful! I definitely prefer to keep CommonJS support around. The problem we're starting to face is that the rest of the ecosystem is moving to ESM. Specifically, the latest node-fetch is ESM-only. However, I think we can solve this by just requiring Node 18 as discussed in: https://github.com/libsql/isomorphic-ts/issues/6

netroy commented 8 months ago

Node 16 went EOL last year. So, you folks should migrate to Node 18 anyways.

btw, Let me know if you need any help with the tooling on the repo. I can help with:

penberg commented 7 months ago

Let's keep CommonJS support in and switch to Node 18.