diff --git a/Cargo.lock b/Cargo.lock index 49c9cb5e8f7..a786d0dbf71 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1998,6 +1998,8 @@ dependencies = [ "env_logger 0.10.0", "futures", "libp2p", + "libp2p-quic", + "libp2p-webrtc", "log", "rand 0.8.5", "redis", diff --git a/interop-tests/Cargo.toml b/interop-tests/Cargo.toml index cdd8cdac00b..dfaf93fd9df 100644 --- a/interop-tests/Cargo.toml +++ b/interop-tests/Cargo.toml @@ -10,7 +10,9 @@ anyhow = "1" either = "1.8.0" env_logger = "0.10.0" futures = "0.3.27" -libp2p = { path = "../libp2p", features = ["websocket", "quic", "mplex", "yamux", "tcp", "tokio", "ping", "noise", "tls", "dns", "rsa", "macros", "webrtc"] } +libp2p = { path = "../libp2p", features = ["websocket", "mplex", "yamux", "tcp", "tokio", "ping", "noise", "tls", "dns", "rsa", "macros"] } +libp2p-quic = { path = "../transports/quic", features = ["tokio"] } +libp2p-webrtc = { path = "../transports/webrtc", features = ["tokio"] } log = "0.4" rand = "0.8.5" redis = { version = "0.22.1", default-features = false, features = ["tokio-comp"] } diff --git a/interop-tests/src/bin/ping.rs b/interop-tests/src/bin/ping.rs index 71cdf6e833e..25d4459d0fa 100644 --- a/interop-tests/src/bin/ping.rs +++ b/interop-tests/src/bin/ping.rs @@ -13,9 +13,11 @@ use libp2p::swarm::{keep_alive, NetworkBehaviour, SwarmEvent}; use libp2p::tls::TlsStream; use libp2p::websocket::WsConfig; use libp2p::{ - identity, mplex, noise, ping, quic, swarm::SwarmBuilder, tcp, tls, webrtc, yamux, - InboundUpgradeExt, Multiaddr, OutboundUpgradeExt, PeerId, Transport as _, + identity, mplex, noise, ping, swarm::SwarmBuilder, tcp, tls, yamux, InboundUpgradeExt, + Multiaddr, OutboundUpgradeExt, PeerId, Transport as _, }; +use libp2p_quic as quic; +use libp2p_webrtc as webrtc; use redis::AsyncCommands; #[tokio::main] diff --git a/libp2p/CHANGELOG.md b/libp2p/CHANGELOG.md index 36e4204ca88..946b0dfdd0e 100644 --- a/libp2p/CHANGELOG.md +++ b/libp2p/CHANGELOG.md @@ -3,7 +3,13 @@ - Introduce `libp2p::connection_limits` module. See [PR 3386]. +- Deprecate the `quic` and `webrtc` feature. + These two crates are only in alpha state. + To properly communicate this to users, we want them to add the dependency directly which makes the `alpha` version visible. + See [PR 3580]. + [PR 3386]: https://github.com/libp2p/rust-libp2p/pull/3386 +[PR 3580]: https://github.com/libp2p/rust-libp2p/pull/3580 # 0.51.1 diff --git a/libp2p/src/lib.rs b/libp2p/src/lib.rs index 0fe8ee9c0fd..322decc1fb4 100644 --- a/libp2p/src/lib.rs +++ b/libp2p/src/lib.rs @@ -97,8 +97,12 @@ pub use libp2p_plaintext as plaintext; pub use libp2p_pnet as pnet; #[cfg(feature = "quic")] #[cfg(not(target_arch = "wasm32"))] -#[doc(inline)] -pub use libp2p_quic as quic; +#[deprecated( + note = "`quic` is only in alpha status. Please depend on `libp2p-quic` directly and don't ues the `quic` feature of `libp2p`." +)] +pub mod quic { + pub use libp2p_quic::*; +} #[cfg(feature = "relay")] #[doc(inline)] pub use libp2p_relay as relay; @@ -131,8 +135,12 @@ pub use libp2p_wasm_ext as wasm_ext; #[cfg(feature = "webrtc")] #[cfg_attr(docsrs, doc(cfg(feature = "webrtc")))] #[cfg(not(target_arch = "wasm32"))] -#[doc(inline)] -pub use libp2p_webrtc as webrtc; +#[deprecated( + note = "`webrtc` is only in alpha status. Please depend on `libp2p-webrtc` directly and don't ues the `webrtc` feature of `libp2p`." +)] +pub mod webrtc { + pub use libp2p_webrtc::*; +} #[cfg(feature = "websocket")] #[cfg(not(target_arch = "wasm32"))] #[doc(inline)]