Skip to content

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

Closed
kflansburg wants to merge 1 commit intomainfrom
kflansburg/global-fetch
Closed

[WIP] Convert global fetcher to use http crate#480
kflansburg wants to merge 1 commit intomainfrom
kflansburg/global-fetch

Conversation

@kflansburg
Copy link
Contributor

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

mod test;
mod utils;

#[cfg(feature = "http")]
Copy link
Contributor 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...
wasm-bindgen/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.

2 participants