confluentinc / confluent-kafka-javascript

Confluent's Apache Kafka JavaScript client
https://www.npmjs.com/package/@confluentinc/kafka-javascript
MIT License
92 stars 5 forks source link

[Question] Why not use cmake-js instead of node-gyp to remove python dep #43

Closed dermasmid closed 1 month ago

dermasmid commented 1 month ago

https://github.com/cmake-js/cmake-js seems like it could replace node-gyp, this is important since python is a big dependency and can slow down build times and can increase image sizes.

if project maintainers agree that its worth doing, i'd be happy to create a pr for it

milindl commented 1 month ago

Hi @dermasmid , thanks for the suggestion. I'll take a look at the tool - I understand it'd require cmake as a dependency instead of python, right?

Before that, though, one question, does the tool play nicely with node-pre-gyp (or offer something similar)? I searched for something like that online, but without much success. We're using node-pre-gyp to pre-build our addon (including a static build of librdkafka, librdkafka.a). This build is very painful (with lots of dependencies) and time consuming, so we would definitely want to pre-build it rather than building it at "npm install" time.

dermasmid commented 1 month ago

i see now that theres no runtime dep on node-gyp, just node-pre-gyp which means the user does not need to have python installed when installing this.

you might want to update the docs that python is not needed

milindl commented 1 month ago

I'll update the documentation to reflect that python is conditionally required in case we have to fallback to building the addon (it occurs when npm-installing this on a system where we haven't prepared the pre-compiled binaries, for example, node < 18, or x64 Mac OSX.

Thanks!

milindl commented 1 month ago

I updated the README. Closing this issue.