Web works with the js structure
This commit is contained in:
16 files changed
+470
-325
No files matched your search
@@ -8,7 +8,7 @@
|
||||
|
||||
use dioxus_core::ElementId;
|
||||
use dioxus_html::PlatformEventData;
|
||||
use dioxus_interpreter_js::{unified_bindings::Interpreter, WebInterpreter};
|
||||
use dioxus_interpreter_js::unified_bindings::Interpreter;
|
||||
use futures_channel::mpsc;
|
||||
use rustc_hash::FxHashMap;
|
||||
use wasm_bindgen::{closure::Closure, JsCast};
|
||||
@@ -112,7 +112,7 @@ impl WebsysDom {
|
||||
}
|
||||
}));
|
||||
|
||||
let _interpreter: &WebInterpreter = interpreter.as_web();
|
||||
let _interpreter = interpreter.base();
|
||||
_interpreter.initialize(
|
||||
root.clone().unchecked_into(),
|
||||
handler.as_ref().unchecked_ref(),
|
||||
|
||||
@@ -65,7 +65,7 @@ impl WebsysDom {
|
||||
#[cfg(feature = "mounted")]
|
||||
fn flush_queued_mounted_events(&mut self) {
|
||||
for id in self.queued_mounted_events.drain(..) {
|
||||
let node = self.interpreter.as_web().get_node(id.0 as u32);
|
||||
let node = self.interpreter.base().get_node(id.0 as u32);
|
||||
if let Some(element) = node.dyn_ref::<web_sys::Element>() {
|
||||
let _ = self.event_channel.unbounded_send(UiEvent {
|
||||
name: "mounted".to_string(),
|
||||
@@ -92,7 +92,7 @@ impl WriteMutations for WebsysDom {
|
||||
self.templates
|
||||
.insert(template.name.to_owned(), self.max_template_id);
|
||||
self.interpreter
|
||||
.as_web()
|
||||
.base()
|
||||
.save_template(roots, self.max_template_id);
|
||||
self.max_template_id += 1
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ impl WebsysDom {
|
||||
// Recursively rehydrate the dom from the VirtualDom
|
||||
self.rehydrate_scope(root_scope, dom, &mut ids, &mut to_mount)?;
|
||||
|
||||
self.interpreter.as_web().hydrate(ids);
|
||||
self.interpreter.base().hydrate(ids);
|
||||
|
||||
#[cfg(feature = "mounted")]
|
||||
for id in to_mount {
|
||||
@@ -168,7 +168,7 @@ impl WriteMutations for OnlyWriteTemplates<'_> {
|
||||
.insert(template.name.to_owned(), self.0.max_template_id);
|
||||
self.0
|
||||
.interpreter
|
||||
.as_web()
|
||||
.base()
|
||||
.save_template(roots, self.0.max_template_id);
|
||||
self.0.max_template_id += 1
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user