add WASM support
The goal is to add WASM support without changing much of the functionality.
I don't have much to explain.. comments to improve the description or edition of the issue would be appreciated.
About Bounty claim: I request @06chaynes to setup something like algora to officially put bounty or we can settle it with Paypal or Github Sponsors (one time) or UPI(for Indians).
Edit: this is quite urgent, I am sorry but I would have to put a deadline as 31st Dec 2023, 12am IST(+5:30).
I ran into issues trying to get this to work with the reqwest client implementation, I have some of that detailed here in this PR https://github.com/seanmonstar/reqwest/pull/1920. Basically I was unable to build a response. I also wasn't able to get Surf to build for wasm on my Mac at all and wasn't interested in troubleshooting that at the time.
Best of luck if you wish to tackle this, I'll help where I can. That said I do not plan on working during the holidays so I may not be as responsive till after the new year.
@06chaynes I don't think we need to convert that to web_sys::Response (our current implementation is solely based on reqwest and hyper) but I think the problem lies in caching
I think you may be missing my point. I have to create a reqwest response to return, I was unable to do that using the wasm::response::Response type in reqwest
ye I got your point, I tried that myself but failed..
understanding the implementation would take me some time but why do we require conversion from wasm::response::Response to reqwest::Response?
this is the normal implementation, and here I am trying to make client for WASM.
and they are executed here
I am confused why is the response conversion required here.. and can you give some possible solution (may be custom implementation) to cache responses
reqwest::wasm::response::Response is reqwest::Reponse when targeting wasm
On Sat, Dec 23, 2023 at 10:34 AM Sandipsinh Rathod @.***> wrote:
ye I got your point, I tried that myself but failed..
understanding the implementation would take me some time but why do we require conversion from wasm::response::Response to reqwest::Response?
this https://github.com/ssddOnTop/tailcall/blob/e7bf2682723e9936c4b3fc9a93107a60fb6b4bc6/src/http/client.rs#L82 is the normal implementation, and here https://github.com/ssddOnTop/tailcall/blob/e7bf2682723e9936c4b3fc9a93107a60fb6b4bc6/src/http/client.rs#L96 I am trying to make client for WASM.
and they are executed here https://github.com/ssddOnTop/tailcall/blob/e7bf2682723e9936c4b3fc9a93107a60fb6b4bc6/src/http/client.rs#L46
I am confused why is the response conversion required here.. and can you give some possible solution (may be custom implementation) to cache responses
— Reply to this email directly, view it on GitHub https://github.com/06chaynes/http-cache/issues/63#issuecomment-1868316618, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEVQGSGJCYYKCL6IMFGLBDYK32YHAVCNFSM6AAAAABBAZUKFCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRYGMYTMNRRHA . You are receiving this because you were mentioned.Message ID: @.***>
Just a note that I removed the bounty from the issue title as I do not want to confuse others into thinking that I am offering that bounty or that I can enforce that in some way.
@06chaynes apart from the conversion from reqwest::wasm::Response to http::Response I think we will need to use some other way to cache that works with wasm right? Do you have any idea for that?
Once the response can be created there's really only the backend cache manager implementation left to add, as the changes to the core library are fairly straightforward.
I had started on some of the core library changes in a branch here though now it's out of date https://github.com/06chaynes/http-cache/tree/wasm32.
As for the backed cache manager I was thinking of testing out some of the crates made for working with IndexedDB but didn't get that far after running into to the client side issues.