From 7287e6e896683c8a2f21e497d45aa432353e54cc Mon Sep 17 00:00:00 2001 From: Luke Chu <37006668+lukechu10@users.noreply.github.com> Date: Tue, 8 Jun 2021 21:20:59 -0700 Subject: [PATCH 1/2] Fix docs for SsrNode --- packages/sycamore/src/generic_node/ssr_node.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/sycamore/src/generic_node/ssr_node.rs b/packages/sycamore/src/generic_node/ssr_node.rs index d73ddaf2f..ccc5c8533 100644 --- a/packages/sycamore/src/generic_node/ssr_node.rs +++ b/packages/sycamore/src/generic_node/ssr_node.rs @@ -17,9 +17,7 @@ static VOID_ELEMENTS: &[&str] = &[ "track", "wbr", "command", "keygen", "menuitem", ]; -/// Rendering backend for Server Side Rendering, aka. SSR. -/// -/// _This API requires the following crate features to be activated: `ssr`_ +/// Inner representation for [`SsrNode`]. #[derive(Debug)] enum SsrNodeType { Element(RefCell), @@ -34,6 +32,9 @@ struct SsrNodeInner { parent: RefCell>, } +/// Rendering backend for Server Side Rendering, aka. SSR. +/// +/// _This API requires the following crate features to be activated: `ssr`_ #[derive(Debug, Clone)] pub struct SsrNode(Rc); From 305f492db263599487e7210ad44916ff5489812e Mon Sep 17 00:00:00 2001 From: Luke Chu Date: Fri, 25 Jun 2021 17:36:01 +0000 Subject: [PATCH 2/2] Add comments about hydrate --- packages/sycamore/src/easing.rs | 1 - packages/sycamore/src/generic_node/dom_node.rs | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/sycamore/src/easing.rs b/packages/sycamore/src/easing.rs index b6affac81..f0ddde2b5 100644 --- a/packages/sycamore/src/easing.rs +++ b/packages/sycamore/src/easing.rs @@ -1,6 +1,5 @@ //! Easing functions. -use core::f32; use std::f32::consts::PI; const EXP_BASE: f32 = 2.0; diff --git a/packages/sycamore/src/generic_node/dom_node.rs b/packages/sycamore/src/generic_node/dom_node.rs index 0c8b58a95..89552613f 100644 --- a/packages/sycamore/src/generic_node/dom_node.rs +++ b/packages/sycamore/src/generic_node/dom_node.rs @@ -252,6 +252,9 @@ pub fn render_to(template: impl FnOnce() -> Template, parent: &Node) { /// /// For rendering without hydration, use [`render`] instead. /// +/// **TODO**: This method currently deletes existing nodes from DOM and reinserts new +/// created nodes. This will be fixed in a later release. +/// /// _This API requires the following crate features to be activated: `dom`_ pub fn hydrate(template: impl FnOnce() -> Template) { let window = web_sys::window().unwrap(); @@ -281,6 +284,9 @@ fn get_children(parent: &Element) -> Vec { /// /// For rendering without hydration, use [`render`] instead. /// +/// **TODO**: This method currently deletes existing nodes from DOM and reinserts new +/// created nodes. This will be fixed in a later release. +/// /// _This API requires the following crate features to be activated: `dom`_ pub fn hydrate_to(template: impl FnOnce() -> Template, parent: &Node) { for child in get_children(parent.unchecked_ref()) {