Skip to content

Commit 8e2c404

Browse files
committed
line size fixup
1 parent 03815f5 commit 8e2c404

File tree

5 files changed

+22
-17
lines changed

5 files changed

+22
-17
lines changed

packages/yew/src/dom_bundle/btext.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@ mod feat_hydration {
104104
previous_next_sibling: &mut Option<DynamicDomSlot>,
105105
) -> Self::Bundle {
106106
let create_at = |next_sibling: Option<Node>, text: AttrValue| {
107-
// If there are multiple text nodes placed back-to-back in SSR, it may be parsed as a
108-
// single text node by browser, hence we need to add extra text nodes here
109-
// if the next node is not a text node. Similarly, the value of the text
110-
// node may be a combination of multiple VText vnodes. So we always need to
111-
// override their values.
107+
// If there are multiple text nodes placed back-to-back in SSR, it may be parsed as
108+
// a single text node by browser, hence we need to add extra text
109+
// nodes here if the next node is not a text node. Similarly, the
110+
// value of the text node may be a combination of multiple VText
111+
// vnodes. So we always need to override their values.
112112
let text_node = document().create_text_node(text.as_ref());
113113
DomSlot::create(next_sibling).insert(parent, &text_node);
114114
BText { text, text_node }

packages/yew/src/dom_bundle/position.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ impl DynamicDomSlot {
173173
}
174174

175175
/// Move out of self, leaving behind a trapped slot. `self` should not be used afterwards.
176-
/// Used during the transition from a hydrating to a rendered component to move state between enum variants.
176+
/// Used during the transition from a hydrating to a rendered component to move state between
177+
/// enum variants.
177178
#[cfg(feature = "hydration")]
178179
pub fn take(&mut self) -> Self {
179180
std::mem::replace(self, Self::new(DomSlot::new_debug_trapped()))

packages/yew/src/dom_bundle/traits.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,11 @@ mod feat_hydration {
116116
parent_scope: &AnyScope,
117117
parent: &Element,
118118
fragment: &mut Fragment,
119-
// We hydrate in document order, but need to know the "next sibling" in each component to shift elements.
120-
// (blame Web API for having `Node.insertBefore` but no `Node.insertAfter`)
121-
// Hence, we pass an optional argument to inform of the new hydrated node's position.
122-
// This should end up assigning the same position that would have been returned from `Self::attach` on creation.
119+
// We hydrate in document order, but need to know the "next sibling" in each component
120+
// to shift elements. (blame Web API for having `Node.insertBefore` but no
121+
// `Node.insertAfter`) Hence, we pass an optional argument to inform of the
122+
// new hydrated node's position. This should end up assigning the same
123+
// position that would have been returned from `Self::attach` on creation.
123124
prev_next_sibling: &mut Option<DynamicDomSlot>,
124125
) -> Self::Bundle;
125126
}

packages/yew/src/html/component/lifecycle.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@ pub(crate) enum ComponentRenderState {
2626
root: BSubtree,
2727
parent: Element,
2828
/// The dom position in front of the next sibling.
29-
/// Gets updated when the bundle in which this component occurs gets re-rendered and is shared with the
30-
/// children of this component.
29+
/// Gets updated when the bundle in which this component occurs gets re-rendered and is
30+
/// shared with the children of this component.
3131
sibling_slot: DynamicDomSlot,
3232
/// The dom position in front of this component.
33-
/// Gets updated whenever this component re-renders and is shared with the bundle in which this component occurs.
33+
/// Gets updated whenever this component re-renders and is shared with the bundle in which
34+
/// this component occurs.
3435
own_slot: DynamicDomSlot,
3536
},
3637
#[cfg(feature = "hydration")]
@@ -229,8 +230,8 @@ pub(crate) struct ComponentState {
229230
#[cfg(feature = "csr")]
230231
has_rendered: bool,
231232
/// This deals with an edge case. Usually, we want to update props as fast as possible.
232-
/// But, when a component hydrates and suspends, we want to continue using the intially given props.
233-
/// This is prop updates are ignored during SSR, too.
233+
/// But, when a component hydrates and suspends, we want to continue using the intially given
234+
/// props. This is prop updates are ignored during SSR, too.
234235
#[cfg(feature = "hydration")]
235236
pending_props: Option<Rc<dyn Any>>,
236237

@@ -527,7 +528,8 @@ impl ComponentState {
527528
ref root,
528529
} => {
529530
// We schedule a "first" render to run immediately after hydration.
530-
// Most notably, only this render will trigger the "rendered" callback, hence we want to prioritize this.
531+
// Most notably, only this render will trigger the "rendered" callback, hence we
532+
// want to prioritize this.
531533
scheduler::push_component_priority_render(
532534
self.comp_id,
533535
Box::new(RenderRunner {

packages/yew/src/html/component/scope.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,8 @@ mod feat_hydration {
696696

697697
// These two references need to be fixed before the component is used.
698698
// Our own slot gets fixed on the first render.
699-
// The sibling slot gets shared with the caller to fix up when continuing through existing DOM.
699+
// The sibling slot gets shared with the caller to fix up when continuing through
700+
// existing DOM.
700701
let own_slot = DynamicDomSlot::new_debug_trapped();
701702
let shared_slot = own_slot.clone();
702703
let sibling_slot = DynamicDomSlot::new_debug_trapped();

0 commit comments

Comments
 (0)