mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-14 00:27:12 +00:00
Doc tweaks
This commit is contained in:
parent
0a9da8d55e
commit
3200068ab3
1 changed files with 10 additions and 10 deletions
|
@ -2,27 +2,27 @@ use std::{env::VarError, net::SocketAddr, str::FromStr};
|
||||||
use typed_builder::TypedBuilder;
|
use typed_builder::TypedBuilder;
|
||||||
|
|
||||||
/// This struct serves as a convenient place to store details used for rendering.
|
/// This struct serves as a convenient place to store details used for rendering.
|
||||||
/// It's serialized into a file in the root called .leptos.kdl for cargo-leptos
|
/// It's serialized into a file in the root called `.leptos.kdl` for cargo-leptos
|
||||||
/// to watch. It's also used in our actix and axum integrations to generate the
|
/// to watch. It's also used in our actix and axum integrations to generate the
|
||||||
/// correct path for WASM, JS, and Websockets. It's goal is to be the single source
|
/// correct path for WASM, JS, and Websockets. Its goal is to be the single source
|
||||||
/// of truth for render options
|
/// of truth for render options
|
||||||
#[derive(TypedBuilder, Clone)]
|
#[derive(TypedBuilder, Clone)]
|
||||||
pub struct RenderOptions {
|
pub struct RenderOptions {
|
||||||
/// The path and name of the WASM and JS files generated by wasm-bindgen
|
/// The path and name of the WASM and JS files generated by wasm-bindgen
|
||||||
/// For example `/pkg/app` might be a valid input
|
/// For example, `/pkg/app` might be a valid input if your crate name was `app`.
|
||||||
#[builder(setter(into))]
|
#[builder(setter(into))]
|
||||||
pub pkg_path: String,
|
pub pkg_path: String,
|
||||||
/// Used to control whether the Websocket code for code watching is incuded
|
/// Used to control whether the Websocket code for code watching is included.
|
||||||
/// I recommend passing in the result of `env::var("RUST_ENV")`
|
/// I recommend passing in the result of `env::var("RUST_ENV")`
|
||||||
#[builder(setter(into), default)]
|
#[builder(setter(into), default)]
|
||||||
pub environment: RustEnv,
|
pub environment: RustEnv,
|
||||||
/// Provides a way to control the address leptos is served from
|
/// Provides a way to control the address leptos is served from.
|
||||||
/// Using an env variable here would allow you to run the same code in dev and prod
|
/// Using an env variable here would allow you to run the same code in dev and prod
|
||||||
/// Defaults to `127.0.0.1:3000`
|
/// Defaults to `127.0.0.1:3000`
|
||||||
#[builder(setter(into), default=SocketAddr::from(([127,0,0,1], 3000)))]
|
#[builder(setter(into), default=SocketAddr::from(([127,0,0,1], 3000)))]
|
||||||
pub socket_address: SocketAddr,
|
pub socket_address: SocketAddr,
|
||||||
/// The port the Websocket watcher listens on. Should match the `reload_port` in cargo-leptos
|
/// The port the Websocket watcher listens on. Should match the `reload_port` in cargo-leptos(if using).
|
||||||
/// Defaults to 3001
|
/// Defaults to `3001`
|
||||||
#[builder(default = 3001)]
|
#[builder(default = 3001)]
|
||||||
pub reload_port: u32,
|
pub reload_port: u32,
|
||||||
}
|
}
|
||||||
|
@ -46,9 +46,9 @@ RenderOptions {{
|
||||||
fs::write("./.leptos.kdl", options).expect("Unable to write file");
|
fs::write("./.leptos.kdl", options).expect("Unable to write file");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/// An enum that can be used to define the environment Leptos is running in. Can be passed to RenderOptions
|
/// An enum that can be used to define the environment Leptos is running in. Can be passed to RenderOptions.
|
||||||
/// Setting this to PROD will not include the websockets code for cargo-leptos' watch.
|
/// Setting this to the PROD variant will not include the websockets code for cargo-leptos' watch.
|
||||||
/// Defaults to prod
|
/// Defaults to PROD
|
||||||
#[derive(Default, Debug, Clone)]
|
#[derive(Default, Debug, Clone)]
|
||||||
pub enum RustEnv {
|
pub enum RustEnv {
|
||||||
#[default]
|
#[default]
|
||||||
|
|
Loading…
Reference in a new issue