[package]
name = "server_fn"
authors = ["Greg Johnston", "Ben Wishovich"]
license = "MIT"
repository = "https://github.com/leptos-rs/leptos"
description = "RPC for any web framework."
readme = "../README.md"
version = "0.8.8"
rust-version.workspace = true
edition.workspace = true

[dependencies]
throw_error = { workspace = true }
server_fn_macro_default = { workspace = true }
# used for hashing paths in #[server] macro
const_format = { workspace = true, default-features = true }
const-str = { workspace = true, default-features = true }
rustversion = { workspace = true, default-features = true }
xxhash-rust = { features = [
  "const_xxh64",
], workspace = true, default-features = true }
# used across multiple features
serde = { features = ["derive"], workspace = true, default-features = true }
send_wrapper = { features = [
  "futures",
], optional = true, workspace = true, default-features = true }
thiserror = { workspace = true, default-features = true }

# registration system
inventory = { optional = true, workspace = true, default-features = true }
dashmap = { workspace = true, default-features = true }

## servers
# actix
actix-web = { optional = true, workspace = true, default-features = false }
actix-ws = { optional = true, workspace = true, default-features = true }

# axum
axum = { optional = true, default-features = false, features = [
  "multipart",
], workspace = true }
tower = { optional = true, workspace = true, default-features = true }
tower-layer = { optional = true, workspace = true, default-features = true }

## input encodings
serde_qs = { workspace = true, default-features = true }
multer = { optional = true, workspace = true, default-features = true }

## output encodings
# serde
serde_json = { workspace = true, default-features = true }
serde-lite = { features = [
  "derive",
], optional = true, workspace = true, default-features = true }
futures = { workspace = true, default-features = true }
http = { workspace = true, default-features = true }
ciborium = { optional = true, workspace = true, default-features = true }
postcard = { features = [
  "alloc",
], optional = true, workspace = true, default-features = true }
hyper = { optional = true, workspace = true, default-features = true }
bytes = { workspace = true, default-features = true }
http-body-util = { optional = true, workspace = true, default-features = true }
rkyv = { optional = true, workspace = true, default-features = true }
rmp-serde = { optional = true, workspace = true, default-features = true }
base64 = { workspace = true, default-features = true }
bitcode = { optional = true, workspace = true, default-features = true }

# client
gloo-net = { optional = true, workspace = true, default-features = true }
js-sys = { optional = true, workspace = true, default-features = true }
wasm-bindgen = { workspace = true, optional = true, default-features = true }
wasm-bindgen-futures = { optional = true, workspace = true, default-features = true }
wasm-streams = { optional = true, workspace = true, default-features = true }
web-sys = { optional = true, features = [
  "console",
  "ReadableStream",
  "ReadableStreamDefaultReader",
  "AbortController",
  "AbortSignal",
], workspace = true, default-features = true }

# reqwest client
reqwest = { default-features = false, optional = true, features = [
  "multipart",
  "stream",
], workspace = true }
tokio-tungstenite = { optional = true, workspace = true, default-features = true }
url = { workspace = true, default-features = true }
pin-project-lite = { workspace = true, default-features = true }
tokio = { features = [
  "rt",
], optional = true, workspace = true, default-features = true }

[build-dependencies]
rustc_version = { workspace = true, default-features = true }

[dev-dependencies]
trybuild = { workspace = true, default-features = true }

[features]
axum-no-default = [
  "ssr",
  "generic",
  "dep:axum",
  "dep:hyper",
  "dep:http-body-util",
  "dep:tower",
  "dep:tower-layer",
]
form-redirects = []
actix-no-default = ["ssr", "dep:actix-web", "dep:actix-ws", "dep:send_wrapper"]
actix = ["actix-web/default", "actix-no-default"]
axum = ["axum/default", "axum-no-default", "axum/ws", "dep:tokio"]
browser = [
  "dep:gloo-net",
  "dep:js-sys",
  "dep:send_wrapper",
  "dep:wasm-bindgen",
  "dep:web-sys",
  "dep:wasm-streams",
  "dep:wasm-bindgen-futures",
]
serde-lite = ["dep:serde-lite"]
multipart = ["browser", "dep:multer"]
cbor = ["dep:ciborium"]
rkyv = ["dep:rkyv"]
msgpack = ["dep:rmp-serde"]
postcard = ["dep:postcard"]
bitcode = ["dep:bitcode"]
default-tls = ["reqwest?/default-tls"]
rustls = ["reqwest?/rustls-tls", "tokio-tungstenite?/rustls"]
reqwest = ["dep:reqwest", "dep:tokio-tungstenite", "dep:tokio"]
ssr = ["inventory"]
generic = []

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--generate-link-to-definition"]

# disables some feature combos for testing in CI
[package.metadata.cargo-all-features]
denylist = [
  "rustls",
  "default-tls",
  "form-redirects",
  "gloo-net",
  "js-sys",
  "wasm-bindgen",
  "web-sys",
  "tower",
  "tower-layer",
  "send_wrapper",
  "ciborium",
  "hyper",
  "inventory",
  "rkyv",
]
skip_feature_sets = [
  [
    "actix",
    "axum",
  ],
  [
    "actix",
    "generic",
  ],
  [
    "browser",
    "actix",
  ],
  [
    "browser",
    "axum",
  ],
  [
    "browser",
    "reqwest",
  ],
  [
    "browser",
    "generic",
  ],
  [
    "default-tls",
    "rustls",
  ],
  [
    "browser",
    "ssr",
  ],
  [
    "axum-no-default",
    "actix",
  ],
  [
    "axum-no-default",
    "browser",
  ],
  [
    "axum-no-default",
    "generic",
  ],
  [
    "rkyv",
    "json",
  ],
  [
    "rkyv",
    "cbor",
  ],
  [
    "rkyv",
    "url",
  ],
  [
    "rkyv",
    "serde-lite",
  ],
  [
    "url",
    "json",
  ],
  [
    "url",
    "cbor",
  ],
  [
    "url",
    "serde-lite",
  ],
  [
    "postcard",
    "json",
  ],
  [
    "postcard",
    "cbor",
  ],
  [
    "postcard",
    "url",
  ],
  [
    "postcard",
    "serde-lite",
  ],
  [
    "postcard",
    "rkyv",
  ],
]
max_combination_size = 2

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = [
  'cfg(leptos_debuginfo)',
  'cfg(rustc_nightly)',
] }
