Feature gate bevy_remote http transport. (#16019)

## Objective
Be able to depend on the crate for the types without bringing in
`smol-hyper` and other http dependencies.

## Solution

Create a new `HTTP` feature that is enabled by default.
This commit is contained in:
Liam Gallagher 2024-10-21 02:49:55 +13:00 committed by GitHub
parent 80e5d27e17
commit 26a5f7f9ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View file

@ -9,6 +9,10 @@ license = "MIT OR Apache-2.0"
keywords = ["bevy"]
readme = "README.md"
[features]
default = ["http"]
http = ["dep:async-io", "dep:smol-hyper"]
[dependencies]
# bevy
bevy_app = { path = "../bevy_app", version = "0.15.0-dev" }
@ -31,8 +35,8 @@ async-channel = "2"
# dependencies that will not compile on wasm
[target.'cfg(not(target_family = "wasm"))'.dependencies]
async-io = "2"
smol-hyper = "0.1"
async-io = { version = "2", optional = true }
smol-hyper = { version = "0.1", optional = true }
[lints]
workspace = true

View file

@ -315,6 +315,7 @@ use serde_json::Value;
use std::sync::RwLock;
pub mod builtin_methods;
#[cfg(feature = "http")]
pub mod http;
const CHANNEL_SIZE: usize = 16;