From 7ae45272d1e7ee642501d574ecb32f9a7b6d9345 Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Mon, 3 Apr 2023 13:20:38 -0500 Subject: [PATCH] fix some doc links in dioxus-server --- packages/server/server-macro/src/lib.rs | 6 +++--- packages/server/src/adapters/axum_adapter.rs | 4 +++- packages/server/src/adapters/mod.rs | 4 ++-- packages/server/src/lib.rs | 6 ++++-- packages/server/src/server_fn.rs | 2 +- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/packages/server/server-macro/src/lib.rs b/packages/server/server-macro/src/lib.rs index f6b4f92a2..e34a440d4 100644 --- a/packages/server/server-macro/src/lib.rs +++ b/packages/server/server-macro/src/lib.rs @@ -19,7 +19,7 @@ use server_fn_macro::*; /// work without WebAssembly, the encoding must be `"Url"`. /// /// The server function itself can take any number of arguments, each of which should be serializable -/// and deserializable with `serde`. Optionally, its first argument can be a [DioxusServerContext](dioxus_server::prelude::DioxusServerContext), +/// and deserializable with `serde`. Optionally, its first argument can be a [DioxusServerContext](https::/docs.rs/dioxus_server/latest/dixous_server/prelude/struct.DioxusServerContext.html), /// which will be injected *on the server side.* This can be used to inject the raw HTTP request or other /// server-side context into the server function. /// @@ -50,8 +50,8 @@ use server_fn_macro::*; /// They are serialized as an `application/x-www-form-urlencoded` /// form data using [`serde_urlencoded`](https://docs.rs/serde_urlencoded/latest/serde_urlencoded/) or as `application/cbor` /// using [`cbor`](https://docs.rs/cbor/latest/cbor/). -/// - **The [DioxusServerContext](dioxus_server::prelude::DioxusServerContext) comes from the server.** Optionally, the first argument of a server function -/// can be a [DioxusServerContext](dioxus_server::prelude::DioxusServerContext). This scope can be used to inject dependencies like the HTTP request +/// - **The [DioxusServerContext](https::/docs.rs/dioxus_server/latest/dixous_server/prelude/struct.DioxusServerContext.html) comes from the server.** Optionally, the first argument of a server function +/// can be a [DioxusServerContext](https::/docs.rs/dioxus_server/latest/dixous_server/prelude/struct.DioxusServerContext.html). This scope can be used to inject dependencies like the HTTP request /// or response or other server-only dependencies, but it does *not* have access to reactive state that exists in the client. #[proc_macro_attribute] pub fn server(args: proc_macro::TokenStream, s: TokenStream) -> TokenStream { diff --git a/packages/server/src/adapters/axum_adapter.rs b/packages/server/src/adapters/axum_adapter.rs index c9bf9ba77..f4bdd8a96 100644 --- a/packages/server/src/adapters/axum_adapter.rs +++ b/packages/server/src/adapters/axum_adapter.rs @@ -182,7 +182,9 @@ pub trait DioxusRouterExt { /// .unwrap(); /// } /// - /// fn app(cx: Scope) -> Element {todo!()} + /// fn app(cx: Scope) -> Element { + /// todo!() + /// } /// ``` fn serve_dioxus_application( self, diff --git a/packages/server/src/adapters/mod.rs b/packages/server/src/adapters/mod.rs index 148062db0..5809132b8 100644 --- a/packages/server/src/adapters/mod.rs +++ b/packages/server/src/adapters/mod.rs @@ -6,8 +6,8 @@ //! Each framework has utilies for some or all of the following: //! - Server functions //! - A generic way to register server functions -//! - A way to register server functions with a custom handler that allows users to pass in a custom [`DioxusServerContext`] based on the state of the server framework. -//! - A way to register static WASM files that is accepts [`ServeConfig`] +//! - A way to register server functions with a custom handler that allows users to pass in a custom [`crate::server_context::DioxusServerContext`] based on the state of the server framework. +//! - A way to register static WASM files that is accepts [`crate::serve_config::ServeConfig`] //! - A hot reloading web socket that intigrates with [`dioxus-hot-reload`](https://crates.io/crates/dioxus-hot-reload) #[cfg(feature = "axum")] diff --git a/packages/server/src/lib.rs b/packages/server/src/lib.rs index 7ef232c23..4738ef00f 100644 --- a/packages/server/src/lib.rs +++ b/packages/server/src/lib.rs @@ -1,8 +1,8 @@ //! Fullstack utilities for the [`dioxus`](https://dioxuslabs.com) framework. //! //! # Features -//! - Intigrations with the [axum](crate::adapters::axum_adapter), [salvo](crate::adapters::salvo_adapters), and [warp](crate::adapters::warp_adapters) server frameworks with utilities for serving and rendering Dioxus applications. -//! - Server functions that allow you to call code on the server from the client as if it were a normal function. +//! - Intigrations with the [axum](crate::adapters::axum_adapter), [salvo](crate::adapters::salvo_adapter), and [warp](crate::adapters::warp_adapter) server frameworks with utilities for serving and rendering Dioxus applications. +//! - [Server functions](crate::prelude::server) that allow you to call code on the server from the client as if it were a normal function. //! - Instant RSX Hot reloading with [`dioxus-hot-reload`](https://crates.io/crates/dioxus-hot-reload). //! //! # Example @@ -60,6 +60,8 @@ #[allow(unused)] use dioxus_core::prelude::*; +pub use adapters::*; + mod adapters; #[cfg(all(debug_assertions, feature = "hot-reload", feature = "ssr"))] mod hot_reload; diff --git a/packages/server/src/server_fn.rs b/packages/server/src/server_fn.rs index 6f985a39a..643f25c9f 100644 --- a/packages/server/src/server_fn.rs +++ b/packages/server/src/server_fn.rs @@ -82,7 +82,7 @@ pub enum ServerRegistrationFnError { /// Server functions are created using the `server` macro. /// /// The function should be registered by calling `ServerFn::register()`. The set of server functions -/// can be queried on the server for routing purposes by calling [ServerFunctionRegistry::get]. +/// can be queried on the server for routing purposes by calling [server_fn::ServerFunctionRegistry::get]. /// /// Technically, the trait is implemented on a type that describes the server function's arguments, not the function itself. pub trait ServerFn: server_fn::ServerFn {