From 9e5bfd000925b9152daa4c9b1d167305af356950 Mon Sep 17 00:00:00 2001 From: Greg Johnston Date: Wed, 20 Nov 2024 20:48:04 -0500 Subject: [PATCH] chore: fix broken links, etc. in docs --- hydration_context/src/lib.rs | 9 ++--- integrations/actix/src/lib.rs | 28 ++------------ integrations/axum/src/lib.rs | 52 +++++++------------------- leptos/src/callback.rs | 6 +-- leptos/src/children.rs | 2 +- leptos/src/form.rs | 8 +--- leptos/src/lib.rs | 4 +- leptos_macro/src/lib.rs | 8 ++-- leptos_server/src/lib.rs | 2 +- leptos_server/src/once_resource.rs | 3 +- meta/src/lib.rs | 3 +- reactive_graph/src/computed.rs | 2 +- reactive_graph/src/lib.rs | 12 +++--- reactive_graph/src/owner/storage.rs | 2 +- reactive_graph/src/trait_options.rs | 2 +- reactive_graph/src/traits.rs | 4 +- router/src/components.rs | 32 +++++++++------- router/src/lib.rs | 3 +- router/src/matching/horizontal/mod.rs | 3 +- router/src/navigate.rs | 2 +- router/src/params.rs | 2 +- tachys/src/html/element/element_ext.rs | 4 +- tachys/src/html/style.rs | 4 +- tachys/src/renderer/dom.rs | 4 +- tachys/src/renderer/mod.rs | 3 +- tachys/src/view/mod.rs | 3 -- 26 files changed, 80 insertions(+), 127 deletions(-) diff --git a/hydration_context/src/lib.rs b/hydration_context/src/lib.rs index b1d2213b4a..0b4b8c9bf4 100644 --- a/hydration_context/src/lib.rs +++ b/hydration_context/src/lib.rs @@ -83,15 +83,14 @@ pub trait SharedContext: Debug { /// Reads the current value of some data from the shared context, if it has been /// sent from the server. This returns the serialized data as a `String` that should - /// be deserialized using [`Serializable::de`]. + /// be deserialized. /// /// On the server and in client-side rendered implementations, this should /// always return [`None`]. fn read_data(&self, id: &SerializedDataId) -> Option; /// Returns a [`Future`] that resolves with a `String` that should - /// be deserialized using [`Serializable::de`] once the given piece of server - /// data has resolved. + /// be deserialized once the given piece of server data has resolved. /// /// On the server and in client-side rendered implementations, this should /// return a [`Future`] that is immediately ready with [`None`]. @@ -148,8 +147,8 @@ pub trait SharedContext: Debug { /// Adds a `Future` to the set of “blocking resources” that should prevent the server’s /// response stream from beginning until all are resolved. The `Future` returned by - /// [`blocking_resources`](Self::blocking_resources) will not resolve until every `Future` - /// added by this method has resolved. + /// blocking resources will not resolve until every `Future` added by this method + /// has resolved. /// /// In browser implementations, this should be a no-op. fn defer_stream(&self, wait_for: PinnedFuture<()>); diff --git a/integrations/actix/src/lib.rs b/integrations/actix/src/lib.rs index d4ca97514e..ee0d112c90 100644 --- a/integrations/actix/src/lib.rs +++ b/integrations/actix/src/lib.rs @@ -82,7 +82,7 @@ impl ResponseParts { } } -/// A wrapper for an Actix [`HttpRequest`](actix_web::HttpRequest) that allows it to be used in an +/// A wrapper for an Actix [`HttpRequest`] that allows it to be used in an /// `Send`/`Sync` setting like Leptos's Context API. #[derive(Debug, Clone)] pub struct Request(SendWrapper); @@ -419,12 +419,6 @@ pub fn handle_server_fns_with_context( /// will include fallback content for any `` nodes, and be immediately interactive, /// but requires some client-side JavaScript. /// -/// The provides a [MetaContext] and a [RouterIntegrationContext] to app’s context before -/// rendering it, and includes any meta tags injected using [leptos_meta]. -/// -/// The HTML stream is rendered using [render_to_stream](leptos::ssr::render_to_stream), and -/// includes everything described in the documentation for that function. -/// /// This can then be set up at an appropriate route in your application: /// ``` /// use actix_web::{App, HttpServer}; @@ -465,7 +459,6 @@ pub fn handle_server_fns_with_context( /// - [ResponseOptions] /// - [Request] /// - [MetaContext](leptos_meta::MetaContext) -/// - [RouterIntegrationContext](leptos_router::RouterIntegrationContext) #[cfg_attr( feature = "tracing", tracing::instrument(level = "trace", fields(error), skip_all) @@ -485,13 +478,6 @@ where /// This stream will pause at each `` node and wait for it to resolve before /// sending down its HTML. The app will become interactive once it has fully loaded. /// -/// The provides a [MetaContext] and a [RouterIntegrationContext] to app’s context before -/// rendering it, and includes any meta tags injected using [leptos_meta]. -/// -/// The HTML stream is rendered using -/// [render_to_stream_in_order](leptos::ssr::render_to_stream_in_order), -/// and includes everything described in the documentation for that function. -/// /// This can then be set up at an appropriate route in your application: /// ``` /// use actix_web::{App, HttpServer}; @@ -534,7 +520,6 @@ where /// This function always provides context values including the following types: /// - [ResponseOptions] /// - [Request] -/// - [RouterIntegrationContext](leptos_router::RouterIntegrationContext) #[cfg_attr( feature = "tracing", tracing::instrument(level = "trace", fields(error), skip_all) @@ -551,13 +536,7 @@ where /// Returns an Actix [struct@Route](actix_web::Route) that listens for a `GET` request and tries /// to route it using [leptos_router], asynchronously rendering an HTML page after all -/// `async` [Resource](leptos::Resource)s have loaded. -/// -/// The provides a [MetaContext] and a [RouterIntegrationContext] to the app’s context before -/// rendering it, and includes any meta tags injected using [leptos_meta]. -/// -/// The HTML stream is rendered using [render_to_string_async](leptos::ssr::render_to_string_async), and -/// includes everything described in the documentation for that function. +/// `async` resources have loaded. /// /// This can then be set up at an appropriate route in your application: /// ``` @@ -690,7 +669,6 @@ where /// - [ResponseOptions] /// - [Request] /// - [MetaContext](leptos_meta::MetaContext) -/// - [RouterIntegrationContext](leptos_router::RouterIntegrationContext) #[cfg_attr( feature = "tracing", tracing::instrument(level = "trace", fields(error), skip_all) @@ -713,7 +691,7 @@ where /// Returns an Actix [struct@Route](actix_web::Route) that listens for a `GET` request and tries /// to route it using [leptos_router], asynchronously serving the page once all `async` -/// [Resource](leptos::Resource)s have loaded. +/// resources have loaded. /// /// This function allows you to provide additional information to Leptos for your route. /// It could be used to pass in Path Info, Connection Info, or anything your heart desires. diff --git a/integrations/axum/src/lib.rs b/integrations/axum/src/lib.rs index ffde4c2bd3..b3c52d8bc8 100644 --- a/integrations/axum/src/lib.rs +++ b/integrations/axum/src/lib.rs @@ -197,9 +197,9 @@ impl ExtendResponse for AxumResponse { /// 2. A server function that is called from WASM running in the client (e.g., a dispatched action /// or a spawned `Future`). /// 3. A `
` submitted to the server function endpoint using default browser APIs (often due -/// to using [`ActionForm`](leptos::form::ActionForm) without JS/WASM present.) +/// to using [`ActionForm`] without JS/WASM present.) /// -/// Using it with a non-blocking [`Resource`](leptos::server::Resource) will not work if you are using streaming rendering, +/// Using it with a non-blocking [`Resource`] will not work if you are using streaming rendering, /// as the response's headers will already have been sent by the time the server function calls `redirect()`. /// /// ### Implementation @@ -442,12 +442,6 @@ pub type PinnedHtmlStream = /// Returns an Axum [Handler](axum::handler::Handler) that listens for a `GET` request and tries /// to route it using [leptos_router], serving an HTML stream of your application. /// -/// The provides a [MetaContext] and a [RouterIntegrationContext] to app’s context before -/// rendering it, and includes any meta tags injected using [leptos_meta]. -/// -/// The HTML stream is rendered using [render_to_stream](leptos::ssr::render_to_stream), and -/// includes everything described in the documentation for that function. -/// /// This can then be set up at an appropriate route in your application: /// ``` /// use axum::{handler::Handler, Router}; @@ -485,8 +479,7 @@ pub type PinnedHtmlStream = /// This function always provides context values including the following types: /// - [`Parts`] /// - [`ResponseOptions`] -/// - [`ServerMetaContext`](leptos_meta::ServerMetaContext) -/// - [`RouterIntegrationContext`](leptos_router::RouterIntegrationContext) +/// - [`ServerMetaContext`] #[cfg_attr( feature = "tracing", tracing::instrument(level = "trace", fields(error), skip_all) @@ -537,12 +530,6 @@ where /// This stream will pause at each `` node and wait for it to resolve before /// sending down its HTML. The app will become interactive once it has fully loaded. /// -/// The provides a [MetaContext] and a [RouterIntegrationContext] to app’s context before -/// rendering it, and includes any meta tags injected using [leptos_meta]. -/// -/// The HTML stream is rendered using [render_to_stream_in_order], and includes everything described in -/// the documentation for that function. -/// /// This can then be set up at an appropriate route in your application: /// ``` /// use axum::{handler::Handler, Router}; @@ -580,8 +567,7 @@ where /// This function always provides context values including the following types: /// - [`Parts`] /// - [`ResponseOptions`] -/// - [`ServerMetaContext`](leptos_meta::ServerMetaContext) -/// - [`RouterIntegrationContext`](leptos_router::RouterIntegrationContext) +/// - [`ServerMetaContext`] #[cfg_attr( feature = "tracing", tracing::instrument(level = "trace", fields(error), skip_all) @@ -634,8 +620,7 @@ where /// This function always provides context values including the following types: /// - [`Parts`] /// - [`ResponseOptions`] -/// - [`ServerMetaContext`](leptos_meta::ServerMetaContext) -/// - [`RouterIntegrationContext`](leptos_router::RouterIntegrationContext) +/// - [`ServerMetaContext`] #[cfg_attr( feature = "tracing", tracing::instrument(level = "trace", fields(error), skip_all) @@ -766,8 +751,7 @@ where /// This function always provides context values including the following types: /// - [`Parts`] /// - [`ResponseOptions`] -/// - [`ServerMetaContext`](leptos_meta::ServerMetaContext) -/// - [`RouterIntegrationContext`](leptos_router::RouterIntegrationContext) +/// - [`ServerMetaContext`] #[cfg_attr( feature = "tracing", tracing::instrument(level = "trace", fields(error), skip_all) @@ -834,8 +818,7 @@ where /// This function always provides context values including the following types: /// - [`Parts`] /// - [`ResponseOptions`] -/// - [`ServerMetaContext`](leptos_meta::ServerMetaContext) -/// - [`RouterIntegrationContext`](leptos_router::RouterIntegrationContext) +/// - [`ServerMetaContext`] #[cfg_attr( feature = "tracing", tracing::instrument(level = "trace", fields(error), skip_all) @@ -952,13 +935,7 @@ fn provide_contexts( /// Returns an Axum [Handler](axum::handler::Handler) that listens for a `GET` request and tries /// to route it using [leptos_router], asynchronously rendering an HTML page after all -/// `async` [Resource](leptos::Resource)s have loaded. -/// -/// The provides a [MetaContext] and a [RouterIntegrationContext] to app’s context before -/// rendering it, and includes any meta tags injected using [leptos_meta]. -/// -/// The HTML stream is rendered using [render_to_string_async], and includes everything described in -/// the documentation for that function. +/// `async` resources have loaded. /// /// This can then be set up at an appropriate route in your application: /// ``` @@ -998,8 +975,7 @@ fn provide_contexts( /// This function always provides context values including the following types: /// - [`Parts`] /// - [`ResponseOptions`] -/// - [`ServerMetaContext`](leptos_meta::ServerMetaContext) -/// - [`RouterIntegrationContext`](leptos_router::RouterIntegrationContext) +/// - [`ServerMetaContext`] #[cfg_attr( feature = "tracing", tracing::instrument(level = "trace", fields(error), skip_all) @@ -1020,7 +996,7 @@ where /// Returns an Axum [Handler](axum::handler::Handler) that listens for a `GET` request and tries /// to route it using [leptos_router], asynchronously rendering an HTML page after all -/// `async` [Resource](leptos::Resource)s have loaded. +/// `async` resources have loaded. /// /// This version allows us to pass Axum State/Extension/Extractor or other infro from Axum or network /// layers above Leptos itself. To use it, you'll need to write your own handler function that provides @@ -1053,8 +1029,7 @@ where /// This function always provides context values including the following types: /// - [`Parts`] /// - [`ResponseOptions`] -/// - [`ServerMetaContext`](leptos_meta::ServerMetaContext) -/// - [`RouterIntegrationContext`](leptos_router::RouterIntegrationContext) +/// - [`ServerMetaContext`] #[cfg_attr( feature = "tracing", tracing::instrument(level = "trace", fields(error), skip_all) @@ -1088,7 +1063,7 @@ where /// Returns an Axum [Handler](axum::handler::Handler) that listens for a `GET` request and tries /// to route it using [leptos_router], asynchronously rendering an HTML page after all -/// `async` [Resource](leptos::Resource)s have loaded. +/// `async` resources have loaded. /// /// This version allows us to pass Axum State/Extension/Extractor or other infro from Axum or network /// layers above Leptos itself. To use it, you'll need to write your own handler function that provides @@ -1121,8 +1096,7 @@ where /// This function always provides context values including the following types: /// - [`Parts`] /// - [`ResponseOptions`] -/// - [`ServerMetaContext`](leptos_meta::ServerMetaContext) -/// - [`RouterIntegrationContext`](leptos_router::RouterIntegrationContext) +/// - [`ServerMetaContext`] #[cfg_attr( feature = "tracing", tracing::instrument(level = "trace", fields(error), skip_all) diff --git a/leptos/src/callback.rs b/leptos/src/callback.rs index 8444c71558..f4e43bc943 100644 --- a/leptos/src/callback.rs +++ b/leptos/src/callback.rs @@ -31,13 +31,13 @@ //! *Notes*: //! - The `render_number` prop can receive any type that implements `Fn(i32) -> String`. //! - Callbacks are most useful when you want optional generic props. -//! - All callbacks implement the [`Callable`] trait, and can be invoked with `my_callback.run(input)`. +//! - All callbacks implement the [`Callable`](leptos::callback::Callable) trait, and can be invoked with `my_callback.run(input)`. //! - The callback types implement [`Copy`], so they can easily be moved into and out of other closures, just like signals. //! //! # Types //! This modules implements 2 callback types: -//! - [`Callback`] -//! - [`UnsyncCallback`] +//! - [`Callback`](leptos::callback::Callback) +//! - [`UnsyncCallback`](leptos::callback::UnsyncCallback) //! //! Use `SyncCallback` if the function is not `Sync` and `Send`. diff --git a/leptos/src/children.rs b/leptos/src/children.rs index 7d69757a10..4721404996 100644 --- a/leptos/src/children.rs +++ b/leptos/src/children.rs @@ -246,7 +246,7 @@ where } } -/// A typed equivalent to [`ChildrenMut`], which takes a generic but preserves type information to +/// A typed equivalent to [`ChildrenFnMut`], which takes a generic but preserves type information to /// allow the compiler to optimize the view more effectively. pub struct TypedChildrenMut(Box View + Send>); diff --git a/leptos/src/form.rs b/leptos/src/form.rs index 648b9c9013..37c483aba4 100644 --- a/leptos/src/form.rs +++ b/leptos/src/form.rs @@ -72,9 +72,7 @@ use web_sys::{ #[cfg_attr(feature = "tracing", tracing::instrument(level = "trace", skip_all))] #[component] pub fn ActionForm( - /// The action from which to build the form. This should include a URL, which can be generated - /// by default using [`create_server_action`](leptos_server::create_server_action) or added - /// manually using [`using_server_fn`](leptos_server::Action::using_server_fn). + /// The action from which to build the form. action: ServerAction, /// A [`NodeRef`] in which the `` element should be stored. #[prop(optional)] @@ -149,9 +147,7 @@ where /// progressively enhanced to use client-side routing. #[component] pub fn MultiActionForm( - /// The action from which to build the form. This should include a URL, which can be generated - /// by default using [create_server_action](leptos_server::create_server_action) or added - /// manually using [leptos_server::Action::using_server_fn]. + /// The action from which to build the form. action: ServerMultiAction, /// A [`NodeRef`] in which the `` element should be stored. #[prop(optional)] diff --git a/leptos/src/lib.rs b/leptos/src/lib.rs index 0e40893d1f..2fb44e5bd9 100644 --- a/leptos/src/lib.rs +++ b/leptos/src/lib.rs @@ -39,7 +39,7 @@ //! server actions, forms, and server-sent events (SSE). //! - **[`todomvc`]** shows the basics of building an isomorphic web app. Both the server and the client import the same app code. //! The server renders the app directly to an HTML string, and the client hydrates that HTML to make it interactive. -//! You might also want to see how we use [`Effect::new`](leptos::prelude::Effect::new) to +//! You might also want to see how we use [`Effect::new`](leptos::prelude::Effect) to //! [serialize JSON to `localStorage`](https://github.com/leptos-rs/leptos/blob/20af4928b2fffe017408d3f4e7330db22cf68277/examples/todomvc/src/lib.rs#L191-L209) //! and [reactively call DOM methods](https://github.com/leptos-rs/leptos/blob/16f084a71268ac325fbc4a5e50c260df185eadb6/examples/todomvc/src/lib.rs#L292-L296) //! on [references to elements](https://github.com/leptos-rs/leptos/blob/20af4928b2fffe017408d3f4e7330db22cf68277/examples/todomvc/src/lib.rs#L228). @@ -78,7 +78,7 @@ //! + `async` interop: [`Resource`](leptos::prelude::Resource) for loading data using `async` functions //! and [`Action`](leptos::prelude::Action) to mutate data or imperatively call `async` functions. //! + reactions: [`Effect`](leptos::prelude::Effect) and [`RenderEffect`](leptos::prelude::RenderEffect). -//! - **Templating/Views**: the [`view`] macro and [`IntoView`](leptos::IntoView) trait. +//! - **Templating/Views**: the [`view`] macro and [`IntoView`] trait. //! - **Routing**: the [`leptos_router`](https://docs.rs/leptos_router/latest/leptos_router/) crate //! - **Server Functions**: the [`server`](macro@leptos::prelude::server) macro and [`ServerAction`](leptos::prelude::ServerAction). //! diff --git a/leptos_macro/src/lib.rs b/leptos_macro/src/lib.rs index e1669a958f..b92d6953c9 100644 --- a/leptos_macro/src/lib.rs +++ b/leptos_macro/src/lib.rs @@ -1,4 +1,4 @@ -//! Macros for use with the [`leptos`] framework. +//! Macros for use with the Leptos framework. #![cfg_attr(feature = "nightly", feature(proc_macro_span))] #![forbid(unsafe_code)] @@ -272,8 +272,8 @@ pub fn view(tokens: TokenStream) -> TokenStream { view_macro_impl(tokens, false) } -/// The `template` macro behaves like [`view`], except that it wraps the entire tree in a -/// [`ViewTemplate`](leptos::prelude::ViewTemplate). This optimizes creation speed by rendering +/// The `template` macro behaves like [`view`](view!), except that it wraps the entire tree in a +/// [`ViewTemplate`](https://docs.rs/leptos/0.7.0-gamma3/leptos/prelude/struct.ViewTemplate.html). This optimizes creation speed by rendering /// most of the view into a `