make more of core private

This commit is contained in:
Evan Almloff committed 2023-07-26 16:17:48 -07:00
1 parent 6e80f15d6a
commit 2d51a1c4f2
5 files changed
+80 -30

No files matched your search

+8 -8
View File
@@ -1,7 +1,6 @@
use crate::dom::WebsysDom;
use dioxus_core::{
AttributeValue, DynamicNode, ElementId, ScopeState, TemplateNode, VNode, VPlaceholder, VText,
VirtualDom,
AttributeValue, DynamicNode, ElementId, ScopeState, TemplateNode, VNode, VirtualDom,
};
use dioxus_html::event_bubbles;
use wasm_bindgen::JsCast;
@@ -130,7 +129,7 @@ impl WebsysDom {
if let dioxus_core::TemplateAttribute::Dynamic { id } = attr {
let attribute = &vnode.dynamic_attrs[*id];
let value = &attribute.value;
let id = attribute.mounted_element.get();
let id = attribute.mounted_element();
mounted_id = Some(id);
let name = attribute.name;
if let AttributeValue::Listener(_) = value {
@@ -211,7 +210,8 @@ impl WebsysDom {
}
}
match dynamic {
dioxus_core::DynamicNode::Text(VText { id, .. }) => {
dioxus_core::DynamicNode::Text(text) => {
let id = text.mounted_element();
// skip comment separator before node
if cfg!(debug_assertions) {
assert!(current_child
@@ -227,7 +227,7 @@ impl WebsysDom {
set_node(
hydrated,
id.get().ok_or(VNodeNotInitialized)?,
id.ok_or(VNodeNotInitialized)?,
current_child.clone()?,
);
*current_child = current_child
@@ -251,10 +251,10 @@ impl WebsysDom {
*last_node_was_static_text = false;
}
dioxus_core::DynamicNode::Placeholder(VPlaceholder { id, .. }) => {
dioxus_core::DynamicNode::Placeholder(placeholder) => {
set_node(
hydrated,
id.get().ok_or(VNodeNotInitialized)?,
placeholder.mounted_element().ok_or(VNodeNotInitialized)?,
current_child.clone()?,
);
*current_child = current_child
@@ -265,7 +265,7 @@ impl WebsysDom {
*last_node_was_static_text = false;
}
dioxus_core::DynamicNode::Component(comp) => {
let scope = comp.scope.get().ok_or(VNodeNotInitialized)?;
let scope = comp.mounted_scope().ok_or(VNodeNotInitialized)?;
self.rehydrate_scope(
dom.get_scope(scope).unwrap(),
current_child,