fix cargo check
This commit is contained in:
1 parent
4c22d5809e
commit
219af51526
10 files changed
+136
-142
No files matched your search
@@ -29,8 +29,9 @@ pub struct RouterProps<'a> {
|
||||
pub active_class: Option<&'a str>,
|
||||
|
||||
/// Set the initial url.
|
||||
#[props(!optional, into)]
|
||||
pub initial_url: Option<String>,
|
||||
// This is Option<Option<String>> because we want to be able to either omit the prop or pass in Option<String>
|
||||
#[props(into)]
|
||||
pub initial_url: Option<Option<String>>,
|
||||
}
|
||||
|
||||
/// A component that conditionally renders children based on the current location of the app.
|
||||
@@ -46,7 +47,7 @@ pub fn Router<'a>(cx: Scope<'a, RouterProps<'a>>) -> Element {
|
||||
RouterCfg {
|
||||
base_url: cx.props.base_url.map(|s| s.to_string()),
|
||||
active_class: cx.props.active_class.map(|s| s.to_string()),
|
||||
initial_url: cx.props.initial_url.clone(),
|
||||
initial_url: cx.props.initial_url.clone().flatten(),
|
||||
},
|
||||
))
|
||||
});
|
||||
|
||||
@@ -14,7 +14,7 @@ keywords = ["dom", "ui", "gui", "react", "ssr", "fullstack"]
|
||||
[dependencies]
|
||||
# server functions
|
||||
server_fn = { git = "https://github.com/leptos-rs/leptos", rev = "a9e6590b5e7f1c0b01da7db7b86719cb18a4aaa1", features = ["stable"] }
|
||||
server_macro = { path = "server-macro" }
|
||||
dioxus_server_macro = { path = "server-macro" }
|
||||
|
||||
# warp
|
||||
warp = { version = "0.3.3", optional = true }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "server_macro"
|
||||
name = "dioxus_server_macro"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
|
||||
@@ -24,11 +24,13 @@ pub mod prelude {
|
||||
#[cfg(feature = "warp")]
|
||||
pub use crate::adapters::warp_adapter::*;
|
||||
#[cfg(feature = "ssr")]
|
||||
pub use crate::render::SSRState;
|
||||
#[cfg(feature = "ssr")]
|
||||
pub use crate::serve_config::{ServeConfig, ServeConfigBuilder};
|
||||
pub use crate::server_context::DioxusServerContext;
|
||||
pub use crate::server_fn::ServerFn;
|
||||
#[cfg(feature = "ssr")]
|
||||
pub use crate::server_fn::ServerFnTraitObj;
|
||||
pub use dioxus_server_macro::*;
|
||||
pub use server_fn::{self, ServerFn as _, ServerFnError};
|
||||
pub use server_macro::*;
|
||||
}
|
||||
@@ -9,7 +9,7 @@ use crate::prelude::ServeConfig;
|
||||
|
||||
/// State used in server side rendering. This utilizes a pool of [`dioxus_ssr::Renderer`]s to cache static templates between renders.
|
||||
#[derive(Clone)]
|
||||
pub(crate) struct SSRState {
|
||||
pub struct SSRState {
|
||||
// We keep a pool of renderers to avoid re-creating them on every request. They are boxed to make them very cheap to move
|
||||
renderers: Arc<object_pool::Pool<Renderer>>,
|
||||
}
|
||||
@@ -23,6 +23,7 @@ impl Default for SSRState {
|
||||
}
|
||||
|
||||
impl SSRState {
|
||||
/// Render the application to HTML.
|
||||
pub fn render<P: 'static + Clone>(&self, cfg: &ServeConfig<P>) -> String {
|
||||
let ServeConfig {
|
||||
app, props, index, ..
|
||||
|
||||
Reference in new issue
Block a user