Make the package ESM-only?
Closed this issue · 4 comments
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.
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) 🙏🏽
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: libsql/isomorphic-ts#6
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:
- improving CI workflows (including automatic releasing to NPM via github releases)
- migrating to pnpm workspaces
- setting up Typescript project references to make working with the multiple packages easier during development
- improving linting/formatting
- stricter type-safety
Let's keep CommonJS support in and switch to Node 18.