Unverified Commit a229459e authored by Niklas Adolfsson's avatar Niklas Adolfsson Committed by GitHub
Browse files

fix(jsonrpsee): less deps when defining RPC API. (#849)

* fix(jsonrpsee): less deps when defining RPC API.

* address grumbles

* fix missing macros feature in full
parent 1fbaf45f
Pipeline #208117 passed with stages
in 4 minutes and 49 seconds
......@@ -26,17 +26,20 @@ tracing = { version = "0.1.34", optional = true }
[features]
client-ws-transport = ["jsonrpsee-client-transport/ws", "jsonrpsee-client-transport/tls"]
client-ws-transport-no-tls = ["jsonrpsee-client-transport/ws"]
client-web-transport = ["jsonrpsee-client-transport/web"]
async-client = ["jsonrpsee-core/async-client"]
http-client = ["jsonrpsee-http-client", "jsonrpsee-types", "jsonrpsee-core"]
http-server = ["jsonrpsee-http-server", "jsonrpsee-types", "jsonrpsee-core"]
wasm-client = ["jsonrpsee-wasm-client", "jsonrpsee-types", "jsonrpsee-core"]
ws-client = ["jsonrpsee-ws-client", "jsonrpsee-types", "jsonrpsee-core"]
ws-server = ["jsonrpsee-ws-server", "jsonrpsee-types", "jsonrpsee-core"]
macros = ["jsonrpsee-proc-macros", "jsonrpsee-types", "jsonrpsee-core/client", "tracing"]
http-client = ["jsonrpsee-http-client", "jsonrpsee-types", "jsonrpsee-core/client"]
http-server = ["jsonrpsee-http-server", "jsonrpsee-types", "jsonrpsee-core/server"]
wasm-client = ["jsonrpsee-wasm-client", "jsonrpsee-types", "jsonrpsee-core/client"]
ws-client = ["jsonrpsee-ws-client", "jsonrpsee-types", "jsonrpsee-core/client"]
ws-server = ["jsonrpsee-ws-server", "jsonrpsee-types", "jsonrpsee-core/server"]
macros = ["jsonrpsee-proc-macros", "jsonrpsee-types", "tracing"]
client = ["http-client", "ws-client", "wasm-client"]
server = ["http-server", "ws-server"]
full = ["client", "server", "macros", "async-client", "client-ws-transport"]
client = ["http-client", "ws-client", "wasm-client", "client-ws-transport", "client-web-transport", "async-client", "client-core"]
client-core = ["jsonrpsee-core/client"]
server = ["http-server", "ws-server", "server-core"]
server-core = ["jsonrpsee-core/server"]
full = ["client", "server", "macros"]
[package.metadata.docs.rs]
all-features = true
......
......@@ -33,7 +33,7 @@
//! The `jsonrpsee` crate composes JSON-RPC functionality behind optional feature
//! flags to provide for client and server communication over specific protocols.
//! There are no default features, all functionality must be opted in to accordingly.
//! The following features are avaliable.
//! The following features are available.
//!
//! - **`http-client`** - JSON-RPC client functionality over HTTP protocol.
//! - **`http-server`** - JSON-RPC server functionality over HTTP protocol.
......@@ -41,12 +41,15 @@
//! - **`ws-client`** - JSON-RPC client functionality over WebSocket protocol.
//! - **`ws-server`** - JSON-RPC server functionality over WebSocket protocol.
//! - **`macros`** - JSON-RPC API generation convenience by derive macros.
//! - **`client`** - Enables `http-client` and `ws-client` features.
//! - **`server`** - Enables `http-server` and `ws-server` features.
//! - **`full`** - Enables `client`, `server` and `macros` features.
//! - **`client-core`** - Enables minimal client features to generate the RPC API without transports.
//! - **`client`** - Enables all client features including transports.
//! - **`server-core`** - Enables minimal server features to generate the RPC API without transports.
//! - **`server`** - Enables all server features including transports.
//! - **`full`** - Enables all features.
//! - **`async-client`** - Enables the async client without any transport.
//! - **`client-ws-transport`** - Enables `ws` transport with TLS.
//! - **`client-ws-transport-no-tls`** - Enables `ws` transport without TLS.
//! - **`client-web-transport`** - Enables `websys` transport.
#![cfg_attr(docsrs, feature(doc_cfg))]
......
......@@ -11,7 +11,7 @@ macro_rules! cfg_feature {
macro_rules! cfg_client {
($($item:item)*) => {
$(
#[cfg(any(feature = "jsonrpsee-http-client", feature = "jsonrpsee-wasm-client", feature = "jsonrpsee-ws-client", feature = "client", feature = "async-client"))]
#[cfg(any(feature = "jsonrpsee-http-client", feature = "jsonrpsee-wasm-client", feature = "jsonrpsee-ws-client", feature = "client", feature = "async-client", feature = "client-core"))]
$item
)*
}
......@@ -50,7 +50,7 @@ macro_rules! cfg_client_transport {
macro_rules! cfg_server {
($($item:item)*) => {
$(
#[cfg(any(feature = "jsonrpsee-http-server", feature = "jsonrpsee-ws-server"))]
#[cfg(any(feature = "server", feature = "server-core", feature = "ws-server", feature = "http-server"))]
$item
)*
}
......@@ -83,7 +83,7 @@ macro_rules! cfg_types {
macro_rules! cfg_client_or_server {
($($item:item)*) => {
$(
#[cfg(any(feature = "jsonrpsee-http-client", feature = "jsonrpsee-ws-client", feature = "jsonrpsee-wasm-client", feature = "client", feature = "async-client", feature = "jsonrpsee-ws-server", feature = "jsonrpsee-http-server"))]
#[cfg(any(feature = "jsonrpsee-http-client", feature = "jsonrpsee-wasm-client", feature = "jsonrpsee-ws-client", feature = "client", feature = "async-client", feature = "client-core", feature = "server", feature = "server-core", feature = "ws-server", feature = "http-server"))]
$item
)*
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment