From c0362fcc31662e528975f92645261ba9e7d00512 Mon Sep 17 00:00:00 2001 From: Jeremiah Senkpiel Date: Mon, 7 Sep 2020 14:43:17 -0700 Subject: [PATCH 1/2] Crate: export with the async-h1 client by default This should be stable enough. Refs: https://github.com/http-rs/surf/issues/217 --- Cargo.toml | 2 +- src/lib.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 48ecbfda..06d53d77 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ edition = "2018" [features] # when the default feature set is updated, verify that the `--features` flags in # `.github/workflows/ci.yaml` are updated accordingly -default = ["native-client", "middleware-logger", "encoding"] +default = ["h1-client", "middleware-logger", "encoding"] h1-client = ["wasm-client", "http-client/h1_client"] native-client = ["curl-client", "wasm-client", "http-client/native_client"] curl-client = ["http-client/curl_client"] diff --git a/src/lib.rs b/src/lib.rs index 1e46c90c..a1f04dcd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -63,8 +63,8 @@ //! //! # Features //! The following features are available. -//! - __`h1-client`:__ use `async-h1` on the server and `window.fetch` in the browser. -//! - __`native-client` (default):__ use `curl` on the server and `window.fetch` in the browser. +//! - __`h1-client` (default):__ use `async-h1` on the server and `window.fetch` in the browser. +//! - __`native-client`:__ use `curl` on the server and `window.fetch` in the browser. //! - __`middleware-logger` (default):__ enables logging requests and responses using a middleware. //! - __`curl-client`:__ use `curl` (through `isahc`) as the HTTP backend. //! - __`wasm-client`:__ use `window.fetch` as the HTTP backend. From bc098cd7dd66369a742bc63139d1b06ccc6ba175 Mon Sep 17 00:00:00 2001 From: Jeremiah Senkpiel Date: Mon, 7 Sep 2020 14:44:29 -0700 Subject: [PATCH 2/2] Crate: feature flag the wasm client. This is a tad unfortunate but should get around cargo pulling in wasm dependencies when not building for wasm. --- Cargo.toml | 2 +- src/lib.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 06d53d77..4ff04e6a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ edition = "2018" # when the default feature set is updated, verify that the `--features` flags in # `.github/workflows/ci.yaml` are updated accordingly default = ["h1-client", "middleware-logger", "encoding"] -h1-client = ["wasm-client", "http-client/h1_client"] +h1-client = ["http-client/h1_client"] native-client = ["curl-client", "wasm-client", "http-client/native_client"] curl-client = ["http-client/curl_client"] wasm-client = ["http-client/wasm_client"] diff --git a/src/lib.rs b/src/lib.rs index a1f04dcd..9585ee34 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -63,8 +63,8 @@ //! //! # Features //! The following features are available. -//! - __`h1-client` (default):__ use `async-h1` on the server and `window.fetch` in the browser. -//! - __`native-client`:__ use `curl` on the server and `window.fetch` in the browser. +//! - __`h1-client` (default):__ use `async-h1` (non-wasm). +//! - __`native-client`:__ use `curl-client` on the server and `window.fetch` in the browser. //! - __`middleware-logger` (default):__ enables logging requests and responses using a middleware. //! - __`curl-client`:__ use `curl` (through `isahc`) as the HTTP backend. //! - __`wasm-client`:__ use `window.fetch` as the HTTP backend.