Files
dioxus/packages/liveview/Cargo.toml
T
Gabi dfc359cdfb adds feature server_fn_axum that compiles for wasm target (#3840)
The current `axum` feature and `server` feature are incompatible with wasm32-unknown-unknown target
due to:
1. depends on axum features not compatible with wasm
2. SSR requires reading the filesystem for index.html

With this patch I add the `server_fn_axum` feature which disables SSR and enables targeting
wasm32-unknown-unknown with server functions enabled.

Note that for this to work, `server_fn` depends on `inventory` and as stated in this docs depending on
the context you might need to expose and call [`__wasm_call_ctors`](https://docs.rs/inventory/latest/inventory/#webassembly-and-constructors)
(I needed that specifically for cloudflare workers)

change axum_server_fn feature for axum_wasm and include SSR tools there

This change additionaly make axum_server_fn feature additive by exposing a different
`DioxusRouterWasmExt` with only the wasm-compatible parts instead of exposing the
`DioxusRouter` trait under the same name.

Docs are updated to reflect this change.

rename axum_wasm to axum_core and update docs

fix typo

re-enable default-features for axum in dioxus-cli

re-enable axum default-features for liveview

re-enable default-features for axum for playwright-tests
2025-03-27 00:51:53 -06:00

59 lines
1.9 KiB
TOML

[package]
name = "dioxus-liveview"
version = { workspace = true }
edition = "2021"
repository = "https://github.com/DioxusLabs/dioxus/"
homepage = "https://dioxuslabs.com/learn/0.6/getting_started"
keywords = ["dom", "ui", "gui", "react", "liveview"]
description = "Build server-side apps with Dioxus"
authors = ["Jonathan Kelley", "Evan Almloff"]
license = "MIT OR Apache-2.0"
[dependencies]
thiserror = { workspace = true }
tracing = { workspace = true }
slab = { workspace = true }
futures-util = { workspace = true, default-features = false, features = [
"sink",
] }
futures-channel = { workspace = true }
tokio = { workspace = true, features = ["time", "macros"] }
tokio-stream = { version = "0.1.11", features = ["net"] }
tokio-util = { version = "0.7.4", features = ["rt"] }
serde = { version = "1.0.151", features = ["derive"] }
serde_json = "1.0.91"
dioxus-html = { workspace = true, features = ["serialize"] }
dioxus-document = { workspace = true }
dioxus-history = { workspace = true }
rustc-hash = { workspace = true }
dioxus-core = { workspace = true, features = ["serialize"] }
dioxus-interpreter-js = { workspace = true, features = ["binary-protocol"] }
dioxus-devtools = { workspace = true, optional = true }
dioxus-cli-config = { workspace = true }
generational-box = { workspace = true }
# axum
axum = { workspace = true, optional = true, default-features = true, features = ["ws"] }
[dev-dependencies]
tokio = { workspace = true, features = ["full"] }
axum = { workspace = true, features = ["ws"] }
tower = { workspace = true }
dioxus = { workspace = true }
[features]
default = ["devtools", "multi-thread"]
axum = ["dep:axum"]
multi-thread = ["tokio/rt-multi-thread"]
devtools = ["dep:dioxus-devtools"]
[[example]]
name = "axum"
required-features = ["axum"]
doc-scrape-examples = true
[[example]]
name = "axum_stress"
required-features = ["axum"]
doc-scrape-examples = true