-
Notifications
You must be signed in to change notification settings - Fork 730
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
Decouple elasticsearch-js from the Node.js core APIs #1742
Comments
Hey @adamyeats, thanks for the proposal! As was mentioned in #1680, Deno support is not at the top of our priority list right now, but it is encouraging to see adoption growing steadily. I'd like to explore this as time allows. My biggest concern is how this would work with Undici, our default HTTP client. At first glance it appears to depend on at least |
Pinging @srikanthmanvi, in case you wanted to look at Deno adoption numbers. The numbers from the State of JavaScript survey in 2021 vs. 2022 are a very rough indicator of adoption rate. |
Thank you for the info @JoshMock . |
This issue is stale because it has been open 90 days with no activity. Remove the |
Relevant. Deno/Bun support is on our longer-term roadmap for this library, just not an immediate priority. |
FYI: I'm able to use |
This issue is stale because it has been open 90 days with no activity. Remove the |
Just to give a little update here, I finally managed to actually use the code that I claimed "works just fine on Deno": it doesn't work. The client always throws a ConnectionError complaining about not having the right http protocol. I just used the information from my debug output to connect to the host using the native fetch API to POST my documents, which works like a charm. |
@karfau Can you provide some example code that did not work? Having some integration tests to run against Deno (and other runtimes) is going to be valuable when starting this work. |
Is there something like a public demo elastic cloud that I can use for the setup? Or some free tier option? |
If you have Docker, from the root of the repo you can run |
See #2341 |
Related to #1680.
🚀 Feature Proposal
I tried importing
elasticsearch-js
into a Deno project recently (imported via Skypack), but looks like it (or, more precisely,@elastic/transport
) currently depends on Node.js'zlib
library. I'm sure there are other Node.js APIs used across the codebase also. This makes usage of the library in Deno a no-go for the time being.Motivation
As the library is named
elasticsearch-js
, IMHO it sort of implies that we support the broader JavaScript ecosystem with this library (client-side usage being the exception to the rule), rather than just Node.js. Decouplingelasticsearch-js
from the core Node.js libraries would allow us to support not only Deno, but any other JavaScript runtimes that emerge.It might be more pragmatic on the first pass to look into optionally shimming the Node.js core libaries somehow, this might save a lot of implementation work. However, I'm not sure if such a thing would be possible in the case of
zlib
we might need a better solution in that case.The text was updated successfully, but these errors were encountered: