diff --git a/Cargo.lock b/Cargo.lock index 072db81f51..bbb45f8177 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2299,18 +2299,23 @@ dependencies = [ "dioxus-hot-reload", "dioxus-html", "dioxus-interpreter-js", + "dioxus-ssr", "dunce", "exitcode", "futures-channel", "futures-util", "generational-box 0.5.2", "global-hotkey", + "http-range", "infer 0.11.0", "muda", "objc", "objc_id", + "rand 0.8.5", + "reqwest", "rfd", "rustc-hash", + "separator", "serde", "serde_json", "signal-hook", @@ -2577,6 +2582,8 @@ name = "dioxus-router" version = "0.5.2" dependencies = [ "axum", + "base64 0.21.7", + "ciborium", "console_error_panic_hook", "criterion 0.5.1", "dioxus", diff --git a/Cargo.toml b/Cargo.toml index fd153d125a..74f39c4d8f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -118,9 +118,6 @@ axum-extra = "0.9.2" reqwest = "0.11.24" owo-colors = "4.0.0" -[workspace.dev-dependencies] -isnta = "1.36.1" - # speed up some macros by optimizing them [profile.dev.package.insta] opt-level = 3 @@ -199,27 +196,139 @@ http = ["reqwest", "http-range"] [[example]] name = "login_form" required-features = ["http"] +doc-scrape-examples = true [[example]] name = "dog_app" required-features = ["http"] +doc-scrape-examples = true [[example]] name = "video_stream" -required-features = ["http"] +required-features = ["http", "desktop"] +doc-scrape-examples = true [[example]] name = "suspense" -required-features = ["http"] +required-features = ["http", "desktop"] +doc-scrape-examples = true [[example]] name = "weather_app" required-features = ["http"] +doc-scrape-examples = true [[example]] name = "image_generator_openai" required-features = ["http"] +doc-scrape-examples = true [[example]] name = "hash_fragment_state" required-features = ["ciborium", "base64"] +doc-scrape-examples = true + +[[example]] +name = "backgrounded_futures" +required-features = ["desktop"] +doc-scrape-examples = true + +[[example]] +name = "calculator_mutable" +required-features = ["desktop"] +doc-scrape-examples = true + +[[example]] +name = "calculator" +required-features = ["desktop"] +doc-scrape-examples = true + +[[example]] +name = "clock" +required-features = ["desktop"] +doc-scrape-examples = true + +[[example]] +name = "crm" +required-features = ["desktop"] +doc-scrape-examples = true + +[[example]] +name = "custom_html" +required-features = ["desktop"] +doc-scrape-examples = true + +[[example]] +name = "custom_menu" +required-features = ["desktop"] +doc-scrape-examples = true + +[[example]] +name = "dynamic_asset" +required-features = ["desktop"] +doc-scrape-examples = true + +[[example]] +name = "error_handle" +required-features = ["desktop"] +doc-scrape-examples = true + +[[example]] +name = "file_explorer" +required-features = ["desktop"] +doc-scrape-examples = true + +[[example]] +name = "future" +required-features = ["desktop"] +doc-scrape-examples = true + +[[example]] +name = "hydration" +required-features = ["desktop"] +doc-scrape-examples = true + +[[example]] +name = "multiwindow" +required-features = ["desktop"] +doc-scrape-examples = true + +[[example]] +name = "overlay" +required-features = ["desktop"] +doc-scrape-examples = true + +[[example]] +name = "popup" +required-features = ["desktop"] +doc-scrape-examples = true + +[[example]] +name = "read_size" +required-features = ["desktop"] +doc-scrape-examples = true + +[[example]] +name = "shortcut" +required-features = ["desktop"] +doc-scrape-examples = true + +[[example]] +name = "streams" +required-features = ["desktop"] +doc-scrape-examples = true + +[[example]] +name = "window_event" +required-features = ["desktop"] +doc-scrape-examples = true + +[[example]] +name = "window_focus" +required-features = ["desktop"] +doc-scrape-examples = true + +[[example]] +name = "window_zoom" +required-features = ["desktop"] +doc-scrape-examples = true diff --git a/examples/generic_component.rs b/examples/generic_component.rs index 3261ea13bc..6af34e542b 100644 --- a/examples/generic_component.rs +++ b/examples/generic_component.rs @@ -7,7 +7,7 @@ use dioxus::prelude::*; use std::fmt::Display; fn main() { - launch_desktop(app); + launch(app); } fn app() -> Element { diff --git a/examples/link.rs b/examples/link.rs index ac853b3f6c..caaca67216 100644 --- a/examples/link.rs +++ b/examples/link.rs @@ -9,7 +9,7 @@ use dioxus::prelude::*; fn main() { - launch_desktop(app); + launch(app); } fn app() -> Element { diff --git a/examples/login_form.rs b/examples/login_form.rs index c813e1434f..39e874cc99 100644 --- a/examples/login_form.rs +++ b/examples/login_form.rs @@ -9,7 +9,7 @@ use dioxus::prelude::*; fn main() { - launch_desktop(app); + launch(app); } fn app() -> Element { diff --git a/examples/memo_chain.rs b/examples/memo_chain.rs index 2be2b88fb6..205fe87693 100644 --- a/examples/memo_chain.rs +++ b/examples/memo_chain.rs @@ -6,7 +6,7 @@ use dioxus::prelude::*; fn main() { - launch_desktop(app); + launch(app); } fn app() -> Element { diff --git a/examples/scroll_to_top.rs b/examples/scroll_to_top.rs index b69a86c510..9f4f85955e 100644 --- a/examples/scroll_to_top.rs +++ b/examples/scroll_to_top.rs @@ -8,7 +8,7 @@ use dioxus::prelude::*; fn main() { - launch_desktop(app); + launch(app); } fn app() -> Element { diff --git a/examples/shorthand.rs b/examples/shorthand.rs index 5b016ab930..f726c8a21f 100644 --- a/examples/shorthand.rs +++ b/examples/shorthand.rs @@ -3,7 +3,7 @@ use dioxus::prelude::*; fn main() { - launch_desktop(app); + launch(app); } fn app() -> Element { diff --git a/examples/signals.rs b/examples/signals.rs index 0accddc564..a5d739a89b 100644 --- a/examples/signals.rs +++ b/examples/signals.rs @@ -10,7 +10,7 @@ use dioxus::prelude::*; use std::time::Duration; fn main() { - launch_desktop(app); + launch(app); } fn app() -> Element { diff --git a/examples/simple_list.rs b/examples/simple_list.rs index 1d33d4f0cf..4bbbd2188a 100644 --- a/examples/simple_list.rs +++ b/examples/simple_list.rs @@ -5,7 +5,7 @@ use dioxus::prelude::*; fn main() { - launch_desktop(app); + launch(app); } fn app() -> Element { diff --git a/packages/autofmt/Cargo.toml b/packages/autofmt/Cargo.toml index f3c8e5a9e5..1e6d6e6d3d 100644 --- a/packages/autofmt/Cargo.toml +++ b/packages/autofmt/Cargo.toml @@ -25,3 +25,6 @@ prettyplease = { workspace = true } [dev-dependencies] pretty_assertions = "1.2.1" + +[package.metadata.docs.rs] +cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] diff --git a/packages/check/src/issues.rs b/packages/check/src/issues.rs index eec3b750a4..a76c8e6780 100644 --- a/packages/check/src/issues.rs +++ b/packages/check/src/issues.rs @@ -159,11 +159,11 @@ impl Display for IssueReport { #[allow(clippy::enum_variant_names)] // we'll add non-hook ones in the future /// Issues that might be found via static analysis of a Dioxus file. pub enum Issue { - /// https://dioxuslabs.com/learn/0.5/reference/hooks#no-hooks-in-conditionals + /// HookInsideConditional(HookInfo, ConditionalInfo), - /// https://dioxuslabs.com/learn/0.5/reference/hooks#no-hooks-in-loops + /// HookInsideLoop(HookInfo, AnyLoopInfo), - /// https://dioxuslabs.com/learn/0.5/reference/hooks#no-hooks-in-closures + /// HookInsideClosure(HookInfo, ClosureInfo), HookOutsideComponent(HookInfo), } diff --git a/packages/cli-config/Cargo.toml b/packages/cli-config/Cargo.toml index 8e31b21b9a..0cee779a77 100644 --- a/packages/cli-config/Cargo.toml +++ b/packages/cli-config/Cargo.toml @@ -25,3 +25,6 @@ tauri-utils = { version = "=1.5.*", optional = true } default = ["read-config"] cli = ["tauri-bundler", "tauri-utils", "clap", "toml", "cargo_toml"] read-config = [] + +[package.metadata.docs.rs] +cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] diff --git a/packages/config-macro/Cargo.toml b/packages/config-macro/Cargo.toml index 95e70de726..d30487745b 100644 --- a/packages/config-macro/Cargo.toml +++ b/packages/config-macro/Cargo.toml @@ -25,3 +25,6 @@ mobile = [] web = [] ssr = [] liveview = [] + +[package.metadata.docs.rs] +cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] diff --git a/packages/core-macro/Cargo.toml b/packages/core-macro/Cargo.toml index cbc1699285..4e121e042b 100644 --- a/packages/core-macro/Cargo.toml +++ b/packages/core-macro/Cargo.toml @@ -29,3 +29,6 @@ trybuild = "1.0" [features] default = [] + +[package.metadata.docs.rs] +cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] diff --git a/packages/core/Cargo.toml b/packages/core/Cargo.toml index 98b6ed0a4c..39c5d7371f 100644 --- a/packages/core/Cargo.toml +++ b/packages/core/Cargo.toml @@ -35,3 +35,6 @@ reqwest = { workspace = true} [features] default = [] serialize = ["serde"] + +[package.metadata.docs.rs] +cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] diff --git a/packages/desktop/Cargo.toml b/packages/desktop/Cargo.toml index a8de851512..f70bb3e52e 100644 --- a/packages/desktop/Cargo.toml +++ b/packages/desktop/Cargo.toml @@ -81,10 +81,16 @@ gnu = [] [package.metadata.docs.rs] default-features = false features = ["tokio_runtime", "hot-reload"] +cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] [dev-dependencies] dioxus = { workspace = true, features = ["desktop"] } exitcode = "1.1.2" +reqwest = { version = "0.11.9", features = ["json"] } +http-range = { version = "0.1.5" } +dioxus-ssr = { workspace = true, version = "0.5.0", default-features = false } +separator = "0.4.1" +rand = { version = "0.8.4", features = ["small_rng"] } # These tests need to be run on the main thread, so they cannot use rust's test harness. [[test]] @@ -101,3 +107,114 @@ harness = false name = "check_eval" path = "headless_tests/eval.rs" harness = false + +# Most of the examples live in the workspace. We include some here so that docs.rs can scrape our examples for better inline docs +[[example]] +name = "video_stream" +path = "../../examples/video_stream.rs" +doc-scrape-examples = true + +[[example]] +name = "suspense" +path = "../../examples/suspense.rs" +doc-scrape-examples = true + +[[example]] +name = "calculator_mutable" +path = "../../examples/calculator_mutable.rs" +doc-scrape-examples = true + +[[example]] +name = "calculator" +path = "../../examples/calculator.rs" +doc-scrape-examples = true + +[[example]] +name = "clock" +path = "../../examples/clock.rs" +doc-scrape-examples = true + +[[example]] +name = "crm" +path = "../../examples/crm.rs" +doc-scrape-examples = true + +[[example]] +name = "custom_html" +path = "../../examples/custom_html.rs" +doc-scrape-examples = true + +[[example]] +name = "custom_menu" +path = "../../examples/custom_menu.rs" +doc-scrape-examples = true + +[[example]] +name = "dynamic_asset" +path = "../../examples/dynamic_asset.rs" +doc-scrape-examples = true + +[[example]] +name = "error_handle" +path = "../../examples/error_handle.rs" +doc-scrape-examples = true + +[[example]] +name = "file_explorer" +path = "../../examples/file_explorer.rs" +doc-scrape-examples = true + +[[example]] +name = "future" +path = "../../examples/future.rs" +doc-scrape-examples = true + +[[example]] +name = "hydration" +path = "../../examples/hydration.rs" +doc-scrape-examples = true + +[[example]] +name = "multiwindow" +path = "../../examples/multiwindow.rs" +doc-scrape-examples = true + +[[example]] +name = "overlay" +path = "../../examples/overlay.rs" +doc-scrape-examples = true + +[[example]] +name = "popup" +path = "../../examples/popup.rs" +doc-scrape-examples = true + +[[example]] +name = "read_size" +path = "../../examples/read_size.rs" +doc-scrape-examples = true + +[[example]] +name = "shortcut" +path = "../../examples/shortcut.rs" +doc-scrape-examples = true + +[[example]] +name = "streams" +path = "../../examples/streams.rs" +doc-scrape-examples = true + +[[example]] +name = "window_event" +path = "../../examples/window_event.rs" +doc-scrape-examples = true + +[[example]] +name = "window_focus" +path = "../../examples/window_focus.rs" +doc-scrape-examples = true + +[[example]] +name = "window_zoom" +path = "../../examples/window_zoom.rs" +doc-scrape-examples = true diff --git a/packages/dioxus-lib/Cargo.toml b/packages/dioxus-lib/Cargo.toml index d0ffab03c0..5b8909f3f9 100644 --- a/packages/dioxus-lib/Cargo.toml +++ b/packages/dioxus-lib/Cargo.toml @@ -25,6 +25,9 @@ dioxus = { workspace = true } [features] default = ["macro", "html", "signals", "hooks"] signals = ["dioxus-signals"] -macro = ["dioxus-core-macro", "dioxus-rsx"] +macro = ["dioxus-core-macro", "dioxus-rsx", "dioxus-config-macro"] html = ["dioxus-html"] hooks = ["dioxus-hooks"] + +[package.metadata.docs.rs] +cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] diff --git a/packages/dioxus-lib/src/lib.rs b/packages/dioxus-lib/src/lib.rs index 6748d472fa..e04423de7b 100644 --- a/packages/dioxus-lib/src/lib.rs +++ b/packages/dioxus-lib/src/lib.rs @@ -35,7 +35,7 @@ pub mod prelude { #[allow(deprecated)] pub use dioxus_core_macro::{component, format_args_f, inline_props, render, rsx, Props}; - #[cfg(feature = "launch")] + #[cfg(feature = "macro")] pub use dioxus_config_macro::*; #[cfg(feature = "html")] diff --git a/packages/dioxus/Cargo.toml b/packages/dioxus/Cargo.toml index 96edcdd400..91852c994b 100644 --- a/packages/dioxus/Cargo.toml +++ b/packages/dioxus/Cargo.toml @@ -67,3 +67,6 @@ tokio = { workspace = true, features = ["full"] } [[bench]] name = "jsframework" harness = false + +[package.metadata.docs.rs] +cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] diff --git a/packages/fullstack/Cargo.toml b/packages/fullstack/Cargo.toml index 6d567fca93..7a9ad0926e 100644 --- a/packages/fullstack/Cargo.toml +++ b/packages/fullstack/Cargo.toml @@ -96,3 +96,7 @@ server = [ "thiserror", "dioxus-cli-config" ] + +[package.metadata.docs.rs] +cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] +features = ["axum", "web"] diff --git a/packages/generational-box/Cargo.toml b/packages/generational-box/Cargo.toml index 9f4e08105a..5d77b95046 100644 --- a/packages/generational-box/Cargo.toml +++ b/packages/generational-box/Cargo.toml @@ -25,3 +25,6 @@ debug_ownership = [] [[bench]] name = "lock" harness = false + +[package.metadata.docs.rs] +cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] diff --git a/packages/hooks/Cargo.toml b/packages/hooks/Cargo.toml index c12eba9eb0..2ed4ef276f 100644 --- a/packages/hooks/Cargo.toml +++ b/packages/hooks/Cargo.toml @@ -30,3 +30,6 @@ dioxus-core = { workspace = true } dioxus = { workspace = true } web-sys = { version = "0.3.64", features = ["Document", "Window", "Element"] } tokio = { version = "1.0", features = ["full"] } + +[package.metadata.docs.rs] +cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] diff --git a/packages/hot-reload/Cargo.toml b/packages/hot-reload/Cargo.toml index 33ab5b21b4..fb59736368 100644 --- a/packages/hot-reload/Cargo.toml +++ b/packages/hot-reload/Cargo.toml @@ -38,3 +38,6 @@ default = ["dioxus-html"] custom_file_watcher = ["ignore", "chrono", "notify", "execute", "once_cell", "ignore"] file_watcher = ["custom_file_watcher", "dioxus-html/hot-reload-context"] serve = ["axum", "tokio-stream", "futures-util", "tokio", "file_watcher"] + +[package.metadata.docs.rs] +cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] diff --git a/packages/html/Cargo.toml b/packages/html/Cargo.toml index fc3ee0e8fc..72c93b8b85 100644 --- a/packages/html/Cargo.toml +++ b/packages/html/Cargo.toml @@ -78,3 +78,7 @@ wasm-bind = ["web-sys", "wasm-bindgen"] native-bind = ["tokio"] hot-reload-context = ["dioxus-rsx"] html-to-rsx = [] + +[package.metadata.docs.rs] +cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] +feature = ["html-to-rsx", "hot-reload-context", "html-to-rsx", "native-bind", "wasm-bind"] diff --git a/packages/liveview/Cargo.toml b/packages/liveview/Cargo.toml index 8f27128984..a1c8621c3f 100644 --- a/packages/liveview/Cargo.toml +++ b/packages/liveview/Cargo.toml @@ -49,7 +49,9 @@ hot-reload = ["dioxus-hot-reload"] [[example]] name = "axum" required-features = ["axum"] +doc-scrape-examples = true [[example]] name = "axum_stress" required-features = ["axum"] +doc-scrape-examples = true diff --git a/packages/mobile/Cargo.toml b/packages/mobile/Cargo.toml index ff8ee67123..6e8f6cb121 100644 --- a/packages/mobile/Cargo.toml +++ b/packages/mobile/Cargo.toml @@ -16,3 +16,6 @@ dioxus-desktop = { workspace = true, features = ["tokio_runtime"] } doctest = false # tests suspended until package ready test = false + +[package.metadata.docs.rs] +cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] diff --git a/packages/router-macro/Cargo.toml b/packages/router-macro/Cargo.toml index 96cd636462..a35a4850b0 100644 --- a/packages/router-macro/Cargo.toml +++ b/packages/router-macro/Cargo.toml @@ -26,3 +26,6 @@ dioxus = { workspace = true, features = ["router"] } [features] default = [] web = [] + +[package.metadata.docs.rs] +cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] diff --git a/packages/router/Cargo.toml b/packages/router/Cargo.toml index 74efc58b35..8cd44d583e 100644 --- a/packages/router/Cargo.toml +++ b/packages/router/Cargo.toml @@ -31,6 +31,15 @@ dioxus-fullstack = { workspace = true, optional = true } tokio = { workspace = true, features = ["full"], optional = true } dioxus-cli-config = { workspace = true, features = ["read-config"] } +# you need to comment this out when publishing since cargo workspaces is not smart enough to wipe this when dropping +# dev-dependncey crates +[target.'cfg(target_family = "wasm")'.dev-dependencies] +console_error_panic_hook = "0.1.7" +dioxus-router = { workspace = true, features = ["web"] } +# dioxus-web = { workspace = true } +gloo = "0.8.0" +wasm-bindgen-test = "0.3.33" + [features] default = [] ssr = ["dioxus-ssr/incremental", "tokio", "dioxus-fullstack?/server", "http"] @@ -44,21 +53,55 @@ axum = { workspace = true, features = ["ws"] } dioxus = { workspace = true, features = ["router"] } dioxus-ssr = { workspace = true } criterion = { version = "0.5", features = ["async_tokio", "html_reports"] } +ciborium = { version = "0.2.1" } +base64 = { version = "0.21.0" } +serde = { version = "1", features = ["derive"] } -[[example]] -name = "static_generation" -required-features = ["ssr"] +[package.metadata.docs.rs] +cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] [[bench]] name = "incremental" required-features = ["ssr"] harness = false -# you need to comment this out when publishing since cargo workspaces is not smart enough to wipe this when dropping -# dev-dependncey crates -[target.'cfg(target_family = "wasm")'.dev-dependencies] -console_error_panic_hook = "0.1.7" -dioxus-router = { workspace = true, features = ["web"] } -# dioxus-web = { workspace = true } -gloo = "0.8.0" -wasm-bindgen-test = "0.3.33" +# Most of the examples live in the workspace. We include some here so that docs.rs can scrape our examples for better inline docs +[[example]] +name = "crm" +path = "../../examples/crm.rs" +doc-scrape-examples = true + +[[example]] +name = "flat_router" +path = "../../examples/flat_router.rs" +doc-scrape-examples = true + +[[example]] +name = "hash_fragment_state" +path = "../../examples/hash_fragment_state.rs" +doc-scrape-examples = true + +[[example]] +name = "link" +path = "../../examples/link.rs" +doc-scrape-examples = true + +[[example]] +name = "query_segment_search" +path = "../../examples/query_segment_search.rs" +doc-scrape-examples = true + +[[example]] +name = "router" +path = "../../examples/router.rs" +doc-scrape-examples = true + +[[example]] +name = "simple_router" +path = "../../examples/simple_router.rs" +doc-scrape-examples = true + +[[example]] +name = "static_generation" +required-features = ["ssr"] +doc-scrape-examples = true diff --git a/packages/rsx-rosetta/Cargo.toml b/packages/rsx-rosetta/Cargo.toml index 6ca165ad68..27911a930d 100644 --- a/packages/rsx-rosetta/Cargo.toml +++ b/packages/rsx-rosetta/Cargo.toml @@ -29,3 +29,6 @@ convert_case = "0.5.0" [dev-dependencies] pretty_assertions = "1.2.1" + +[package.metadata.docs.rs] +cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] diff --git a/packages/rsx/Cargo.toml b/packages/rsx/Cargo.toml index 5a5cbf1ac8..c3848eaf82 100644 --- a/packages/rsx/Cargo.toml +++ b/packages/rsx/Cargo.toml @@ -31,3 +31,6 @@ html = [] [dev-dependencies] insta = "1.36.1" + +[package.metadata.docs.rs] +cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] diff --git a/packages/server-macro/Cargo.toml b/packages/server-macro/Cargo.toml index a29f854168..9f2684c3dd 100644 --- a/packages/server-macro/Cargo.toml +++ b/packages/server-macro/Cargo.toml @@ -26,3 +26,6 @@ proc-macro = true axum = ["server_fn_macro/axum"] server = ["server_fn_macro/ssr"] reqwest = ["server_fn_macro/reqwest"] + +[package.metadata.docs.rs] +cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] diff --git a/packages/signals/Cargo.toml b/packages/signals/Cargo.toml index a4a94393fc..14d9de916e 100644 --- a/packages/signals/Cargo.toml +++ b/packages/signals/Cargo.toml @@ -32,3 +32,6 @@ simple_logger = "4.2.0" [features] default = [] serialize = ["serde"] + +[package.metadata.docs.rs] +cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] diff --git a/packages/ssr/Cargo.toml b/packages/ssr/Cargo.toml index 87f165bd5e..947bf1b780 100644 --- a/packages/ssr/Cargo.toml +++ b/packages/ssr/Cargo.toml @@ -44,3 +44,6 @@ fs_extra = "1.2.0" [features] default = [] incremental = ["dep:tokio", "chrono", "dioxus-cli-config"] + +[package.metadata.docs.rs] +cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] diff --git a/packages/static-generation/Cargo.toml b/packages/static-generation/Cargo.toml index 0655319303..ace352e2d4 100644 --- a/packages/static-generation/Cargo.toml +++ b/packages/static-generation/Cargo.toml @@ -32,3 +32,6 @@ dioxus = { workspace = true } default = [] server = ["dioxus-fullstack/server", "dioxus-router/ssr", "dioxus-ssr", "tokio", "http", "dep:axum", "tower-http", "dioxus-hot-reload", "dioxus-cli-config", "tower"] web = ["dioxus-fullstack/web", "dioxus-router/web", "dioxus-web"] + +[package.metadata.docs.rs] +cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] diff --git a/packages/web/Cargo.toml b/packages/web/Cargo.toml index 7e80a76e8f..53fe302231 100644 --- a/packages/web/Cargo.toml +++ b/packages/web/Cargo.toml @@ -73,3 +73,6 @@ gloo-timers = "0.2.3" gloo-dialogs = "0.1.1" dioxus-web = { path = ".", features = ["hydrate"] } tracing-wasm = "0.2.1" + +[package.metadata.docs.rs] +cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]