-
Notifications
You must be signed in to change notification settings - Fork 3
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
Consider implementing the API for non WASM targets #34
Comments
Hi @tomasol sorry for the delay. Wrapping an implementation for non-WASM targets isn't difficult, but I'm not sure if it makes sense. This is because the implementation for WASM is very different from a regular implementation. It's quite likely that something running correctly on a non-WASM implementation might not work on the WASM implementation, making debugging this way pointless. |
Do you think that the behavior of the HTTP client is going to be different all that often? Sure, the host could decide to do something else with the request, and in order to test that, one needs to write an integration test as suggested in #6, but for most cases I think it is safe to assume that the host will forward the request properly. The scenario I am thinking about is introducing WASM Components to new developers. Not being able to use one of the standard clients (yet) is a hassle, so we should not add more things that look like a barrier. |
This is reasonable, but I haven’t figured out the specific implementation yet. It might not be a high priority for me at the moment. However, if you're interested, feel free to submit a PR. |
I would second this feature request. First of all, great job to the author and maintainers to this repo, same as @tomasol , I came across this repo a few weeks ago, and surprisingly find that how much simpler it makes developing http clients and servers on WASM. In addition to the testing purpose mentioned in the ticket, If waki can be made to work across WASM and non-WASM targets, it'll be very useful in libraries like Dapr SDKs. Nowadays, WASM developers need to rebuild many wheels simply because libraries like Dapr SDK can't work out of the box in WASM. A generic cross-target http client would help to resolve these cases. I think the testing perspective is still valid - maybe it's inappropriate to unit test in native Rust because of the potential behavioural difference, but sometimes we want to write somewhat integration-level testing, taking Dapr client again as example, I'm hoping to use testcontainers to startup a datastore and Daprd container and validate that my client is sending the right headers to Dapr and it's able to CRUD the datastore. Mocking waki wouldn't make much sense in such test. |
Hi, First, thanks @iawia002 for this work. I don't really understand why another target(s) should be added, as the project is targeting WASM applications for servers / non-browser-applications. I understand that using one and only one library for every target in the world could be interesting, but as WASM seems specific and is still in proposal I don't think we should make this project more complex. |
I agree that this may not be the right time for this endeavor. It would be best to wait until WASI 0.3 is released. Regarding complexity, it has to exist somewhere. Centralizing it in one place is preferable to having multiple separate HTTP clients in every library that needs to support both native and WASI targets. |
I am aware of #6 and understand that testing the component requires using
wasmtime
. However, it would be highly beneficial ifwaki
could support running in non-WASM environments, wrapping one of existing HTTP clients.This enhancement would allow developers to test and debug components using familiar tools, streamlining the development process and making it more accessible.
The text was updated successfully, but these errors were encountered: