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

feat: deprecate webrtc and quic features in libp2p crate #3580

Merged
merged 12 commits into from
Mar 21, 2023
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion interop-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
6 changes: 4 additions & 2 deletions interop-tests/src/bin/ping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
6 changes: 6 additions & 0 deletions libp2p/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
16 changes: 12 additions & 4 deletions libp2p/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)]
Expand Down