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

[WIP] Convert global fetcher to use http crate #480

Closed
wants to merge 1 commit into from

Conversation

kflansburg
Copy link
Member

@kflansburg kflansburg commented Mar 15, 2024

This was identified as an inconsistency in the original PR (#477). This is one option for fixing it (converting the existing API), but another that I will try is to improve interoperability so that we can just recommend that people use reqwest directly and remove this API entirely. Will open another PR with that option.

Note that there is one breaking change: the request object supplied to fetch_with_request is no longer a reference.

@@ -21,6 +23,34 @@ mod r2;
mod test;
mod utils;

#[cfg(feature = "http")]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These just convert the types between what fetch expects (depends on feature flag) and what the test harness router expects (worker::Request). I think pretty soon we should have the http version of the test harness use axum and remove this.

Copy link
Contributor

@spigaz spigaz Mar 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the only reason you see for that API is to be used by the tests as is, then I think, they should be dropped.

Regarding tests, I believe we should move to wasm-bindgen-test and move unit tests closer to the source.

As MrBBot no longer told me to wait, so I started getting my feet wet...
rustwasm/wasm-bindgen#3891

That would allow tests to be direct, instead of the current model.

@kflansburg kflansburg closed this Mar 26, 2024
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

Successfully merging this pull request may close these issues.

None yet

2 participants