-
-
Notifications
You must be signed in to change notification settings - Fork 537
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
Support for Deno? #850
Comments
Looking at deno's list of differences/behaviors at https://deno.land/manual/introduction this doesn't look like "a few tweaks". For example KafkaJS uses Secondly KafkaJS does use NodeJS functionalities for handling the network communication with Kafka, and it seems that deno does have a completely different standard library for providing that. This then would mean minimally some conditional coding, or some code switching depending on whether you run with deno or with NodeJS. Not impossible, but definitely requires a strong use case. So, what exactly is your use case here? :) |
I think it's an interesting idea, and I'm not necessarily 100% opposed to it in principle. What would motivate it would be the extremely large amount of unnecessary work that writing a Kafka client from scratch for Deno would be, when in reality 99% of the code is portable. Let's investigate the cost:
Some issues that I'm not sure how to deal with:
In addition to the above, there are also the additional running costs that we would incur:
Looking at it in total, I think the chance that we can afford to do this is effectively 0%. Converting KafkaJS from a CommonJS module to an ES Module will probably have to happen at some point, as it seems ES Modules are kind of becoming the standard, but just doing that won't give us Deno compatibility. However, KafkaJS is open-source, so what seems more realistic to me is to create a fork like I'm going to close this issue for now, as this is not something we are going to do at this moment. However, note that I am not saying we would never do it. The cost of doing it just has to come down.
I don't think this is actually possible. ES Module imports are static, and I don't believe you can import anywhere other than at the top-level. If we want to import different modules, I believe we have to make a change at build-time. Something similar to how you in React-Native can have platform-specific files ( |
Is your feature request related to a problem? Please describe.
Trying to run KafkaJS with Deno.
Describe the solution you'd like
Given KafkaJS is a pure javascript solution, it would be amazing if we could make a few tweaks to have it compatable with Deno. Tried to load it via pika but getting the error below:
The text was updated successfully, but these errors were encountered: