diff --git a/docs/guide/examples/component_children_inspect.rs b/docs/guide/examples/component_children_inspect.rs
index 880c64358..a79b068a3 100644
--- a/docs/guide/examples/component_children_inspect.rs
+++ b/docs/guide/examples/component_children_inspect.rs
@@ -26,7 +26,7 @@ struct ClickableProps<'a> {
// ANCHOR: Clickable
fn Clickable<'a>(cx: Scope<'a, ClickableProps<'a>>) -> Element {
match cx.props.children {
- Ok(VNode { dynamic_nodes, .. }) => {
+ Some(VNode { dynamic_nodes, .. }) => {
todo!("render some stuff")
}
_ => {
diff --git a/packages/core/Cargo.toml b/packages/core/Cargo.toml
index af134b8ce..bca8bd031 100644
--- a/packages/core/Cargo.toml
+++ b/packages/core/Cargo.toml
@@ -31,13 +31,12 @@ futures-channel = "0.3.21"
indexmap = "1.7"
-# Serialize the Edits for use in Webview/Liveview instances
-serde = { version = "1", features = ["derive"], optional = true }
-anyhow = "1.0.66"
-
smallbox = "0.8.1"
log = "0.4.17"
+# Serialize the Edits for use in Webview/Liveview instances
+serde = { version = "1", features = ["derive"], optional = true }
+
[dev-dependencies]
tokio = { version = "*", features = ["full"] }
dioxus = { path = "../dioxus" }
diff --git a/packages/core/src/arena.rs b/packages/core/src/arena.rs
index 5702a9c9b..9d723d89c 100644
--- a/packages/core/src/arena.rs
+++ b/packages/core/src/arena.rs
@@ -81,12 +81,12 @@ impl VirtualDom {
self.ensure_drop_safety(id);
if let Some(root) = self.scopes[id.0].as_ref().try_root_node() {
- if let RenderReturn::Sync(Ok(node)) = unsafe { root.extend_lifetime_ref() } {
+ if let RenderReturn::Sync(Some(node)) = unsafe { root.extend_lifetime_ref() } {
self.drop_scope_inner(node)
}
}
if let Some(root) = unsafe { self.scopes[id.0].as_ref().previous_frame().try_load_node() } {
- if let RenderReturn::Sync(Ok(node)) = unsafe { root.extend_lifetime_ref() } {
+ if let RenderReturn::Sync(Some(node)) = unsafe { root.extend_lifetime_ref() } {
self.drop_scope_inner(node)
}
}
diff --git a/packages/core/src/create.rs b/packages/core/src/create.rs
index 1e0889208..239bd85fa 100644
--- a/packages/core/src/create.rs
+++ b/packages/core/src/create.rs
@@ -354,8 +354,8 @@ impl<'b> VirtualDom {
use RenderReturn::*;
match return_nodes {
- Sync(Ok(t)) => self.mount_component(scope, template, t, idx),
- Sync(Err(_e)) => todo!("Propogate error upwards"),
+ Sync(Some(t)) => self.mount_component(scope, template, t, idx),
+ Sync(None) => todo!("Propogate error upwards"),
Async(_) => self.mount_component_placeholder(template, idx, scope),
}
}
diff --git a/packages/core/src/diff.rs b/packages/core/src/diff.rs
index 7b8e33083..abf938929 100644
--- a/packages/core/src/diff.rs
+++ b/packages/core/src/diff.rs
@@ -33,26 +33,26 @@ impl<'b> VirtualDom {
use RenderReturn::{Async, Sync};
match (old, new) {
- (Sync(Ok(l)), Sync(Ok(r))) => self.diff_node(l, r),
+ (Sync(Some(l)), Sync(Some(r))) => self.diff_node(l, r),
// Err cases
- (Sync(Ok(l)), Sync(Err(e))) => self.diff_ok_to_err(l, e),
- (Sync(Err(e)), Sync(Ok(r))) => self.diff_err_to_ok(e, r),
- (Sync(Err(_eo)), Sync(Err(_en))) => { /* nothing */ }
+ (Sync(Some(l)), Sync(None)) => self.diff_ok_to_err(l),
+ (Sync(None), Sync(Some(r))) => self.diff_err_to_ok(r),
+ (Sync(None), Sync(None)) => { /* nothing */ }
// Async
- (Sync(Ok(_l)), Async(_)) => todo!(),
- (Sync(Err(_e)), Async(_)) => todo!(),
- (Async(_), Sync(Ok(_r))) => todo!(),
- (Async(_), Sync(Err(_e))) => { /* nothing */ }
+ (Sync(Some(_l)), Async(_)) => todo!(),
+ (Sync(None), Async(_)) => todo!(),
+ (Async(_), Sync(Some(_r))) => todo!(),
+ (Async(_), Sync(None)) => { /* nothing */ }
(Async(_), Async(_)) => { /* nothing */ }
};
}
self.scope_stack.pop();
}
- fn diff_ok_to_err(&mut self, _l: &'b VNode<'b>, _e: &anyhow::Error) {}
- fn diff_err_to_ok(&mut self, _e: &anyhow::Error, _l: &'b VNode<'b>) {}
+ fn diff_ok_to_err(&mut self, _l: &'b VNode<'b>) {}
+ fn diff_err_to_ok(&mut self, _l: &'b VNode<'b>) {}
fn diff_node(&mut self, left_template: &'b VNode<'b>, right_template: &'b VNode<'b>) {
// If the templates are the same, we don't need to do anything, nor do we want to
@@ -679,7 +679,7 @@ impl<'b> VirtualDom {
Component(comp) => {
let scope = comp.scope.get().unwrap();
match unsafe { self.scopes[scope.0].root_node().extend_lifetime_ref() } {
- RenderReturn::Sync(Ok(node)) => self.push_all_real_nodes(node),
+ RenderReturn::Sync(Some(node)) => self.push_all_real_nodes(node),
_ => todo!(),
}
}
@@ -856,7 +856,7 @@ impl<'b> VirtualDom {
let scope = comp.scope.take().unwrap();
match unsafe { self.scopes[scope.0].root_node().extend_lifetime_ref() } {
- RenderReturn::Sync(Ok(t)) => {
+ RenderReturn::Sync(Some(t)) => {
println!("Removing component node sync {:?}", gen_muts);
self.remove_node(t, gen_muts)
}
@@ -886,7 +886,7 @@ impl<'b> VirtualDom {
Some(Component(comp)) => {
let scope = comp.scope.get().unwrap();
match unsafe { self.scopes[scope.0].root_node().extend_lifetime_ref() } {
- RenderReturn::Sync(Ok(t)) => self.find_first_element(t),
+ RenderReturn::Sync(Some(t)) => self.find_first_element(t),
_ => todo!("cannot handle nonstandard nodes"),
}
}
@@ -902,7 +902,7 @@ impl<'b> VirtualDom {
Some(Component(comp)) => {
let scope = comp.scope.get().unwrap();
match unsafe { self.scopes[scope.0].root_node().extend_lifetime_ref() } {
- RenderReturn::Sync(Ok(t)) => self.find_last_element(t),
+ RenderReturn::Sync(Some(t)) => self.find_last_element(t),
_ => todo!("cannot handle nonstandard nodes"),
}
}
diff --git a/packages/core/src/error_boundary.rs b/packages/core/src/error_boundary.rs
index 6f40c2484..fd8810f1a 100644
--- a/packages/core/src/error_boundary.rs
+++ b/packages/core/src/error_boundary.rs
@@ -5,7 +5,7 @@ use crate::ScopeId;
/// A boundary that will capture any errors from child components
#[allow(dead_code)]
pub struct ErrorBoundary {
- error: RefCell