Skip to content
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

add WASM support #63

Open
ssddOnTop opened this issue Dec 23, 2023 · 8 comments
Open

add WASM support #63

ssddOnTop opened this issue Dec 23, 2023 · 8 comments

Comments

@ssddOnTop
Copy link

ssddOnTop commented Dec 23, 2023

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).

@06chaynes
Copy link
Owner

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 seanmonstar/reqwest#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.

@ssddOnTop
Copy link
Author

@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

@06chaynes
Copy link
Owner

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

@ssddOnTop
Copy link
Author

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

@06chaynes
Copy link
Owner

06chaynes commented Dec 23, 2023 via email

@06chaynes 06chaynes changed the title Bounty($50): add WASM support add WASM support Dec 23, 2023
@06chaynes
Copy link
Owner

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.

@ssddOnTop
Copy link
Author

ssddOnTop commented Dec 24, 2023

@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?

@06chaynes
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants