Switch to bun, clean up web implementation
This commit is contained in:
23 files changed
+240
-173
No files matched your search
@@ -3,7 +3,6 @@ use dioxus_core::prelude::*;
|
||||
use dioxus_core::AttributeValue;
|
||||
use dioxus_core::WriteMutations;
|
||||
use dioxus_core::{DynamicNode, ElementId, ScopeState, TemplateNode, VNode, VirtualDom};
|
||||
use dioxus_interpreter_js::save_template;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum RehydrationError {
|
||||
@@ -23,7 +22,7 @@ impl WebsysDom {
|
||||
// Recursively rehydrate the dom from the VirtualDom
|
||||
self.rehydrate_scope(root_scope, dom, &mut ids, &mut to_mount)?;
|
||||
|
||||
dioxus_interpreter_js::hydrate(self.interpreter.js_channel(), ids);
|
||||
self.interpreter.as_web().hydrate(ids);
|
||||
|
||||
#[cfg(feature = "mounted")]
|
||||
for id in to_mount {
|
||||
@@ -40,8 +39,7 @@ impl WebsysDom {
|
||||
ids: &mut Vec<u32>,
|
||||
to_mount: &mut Vec<ElementId>,
|
||||
) -> Result<(), RehydrationError> {
|
||||
let vnode = scope.root_node();
|
||||
self.rehydrate_vnode(dom, vnode, ids, to_mount)
|
||||
self.rehydrate_vnode(dom, scope.root_node(), ids, to_mount)
|
||||
}
|
||||
|
||||
fn rehydrate_vnode(
|
||||
@@ -168,11 +166,10 @@ impl WriteMutations for OnlyWriteTemplates<'_> {
|
||||
self.0
|
||||
.templates
|
||||
.insert(template.name.to_owned(), self.0.max_template_id);
|
||||
save_template(
|
||||
self.0.interpreter.js_channel(),
|
||||
roots,
|
||||
self.0.max_template_id,
|
||||
);
|
||||
self.0
|
||||
.interpreter
|
||||
.as_web()
|
||||
.save_template(roots, self.0.max_template_id);
|
||||
self.0.max_template_id += 1
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user