Ver código fonte

Merge branch 'master' of github.com:DioxusLabs/dioxus

Jonathan Kelley 2 anos atrás
pai
commit
e7f6bc85f0

+ 2 - 2
packages/core/src/scheduler/task.rs

@@ -59,9 +59,9 @@ impl Scheduler {
 
     /// Drop the future with the given TaskId
     ///
-    /// This does nto abort the task, so you'll want to wrap it in an aborthandle if that's important to you
+    /// This does not abort the task, so you'll want to wrap it in an aborthandle if that's important to you
     pub fn remove(&self, id: TaskId) {
-        self.tasks.borrow_mut().remove(id.0);
+        self.tasks.borrow_mut().try_remove(id.0);
     }
 }
 

+ 1 - 1
packages/core/src/scheduler/wait.rs

@@ -34,7 +34,7 @@ impl VirtualDom {
             self.scopes[task.scope.0].spawned_tasks.remove(&id);
 
             // Remove it from the scheduler
-            tasks.remove(id.0);
+            tasks.try_remove(id.0);
         }
     }
 

+ 1 - 1
packages/native-core/Cargo.toml

@@ -25,7 +25,7 @@ crossbeam-deque = "0.8.2"
 dashmap = "5.4.0"
 
 # for parsing attributes
-lightningcss = "1.0.0-alpha.38"
+lightningcss = "1.0.0-alpha.39"
 
 [dev-dependencies]
 rand = "0.8.5"

+ 12 - 4
packages/native-core/src/layout_attributes.rs

@@ -160,7 +160,9 @@ pub fn apply_layout_attributes(name: &str, value: &str, style: &mut Style) {
                         align::ContentDistribution::SpaceEvenly => SpaceEvenly,
                         align::ContentDistribution::Stretch => Stretch,
                     },
-                    align::AlignContent::ContentPosition(_, position) => match position {
+                    align::AlignContent::ContentPosition {
+                        value: position, ..
+                    } => match position {
                         align::ContentPosition::Center => Center,
                         align::ContentPosition::Start | align::ContentPosition::FlexStart => {
                             FlexStart
@@ -181,7 +183,9 @@ pub fn apply_layout_attributes(name: &str, value: &str, style: &mut Style) {
                             _ => return,
                         }
                     }
-                    align::JustifyContent::ContentPosition(_, position) => match position {
+                    align::JustifyContent::ContentPosition {
+                        value: position, ..
+                    } => match position {
                         align::ContentPosition::Center => Center,
                         // start ignores -reverse flex-direction but there is no way to specify that in Taffy
                         align::ContentPosition::Start | align::ContentPosition::FlexStart => {
@@ -199,7 +203,9 @@ pub fn apply_layout_attributes(name: &str, value: &str, style: &mut Style) {
                     align::AlignSelf::Auto => Auto,
                     align::AlignSelf::Stretch => Stretch,
                     align::AlignSelf::BaselinePosition(_) => Baseline,
-                    align::AlignSelf::SelfPosition(_overflow, position) => match position {
+                    align::AlignSelf::SelfPosition {
+                        value: position, ..
+                    } => match position {
                         align::SelfPosition::Center => Center,
                         align::SelfPosition::Start
                         | align::SelfPosition::SelfStart
@@ -216,7 +222,9 @@ pub fn apply_layout_attributes(name: &str, value: &str, style: &mut Style) {
                 style.align_items = match align {
                     align::AlignItems::BaselinePosition(_) => Baseline,
                     align::AlignItems::Stretch => Stretch,
-                    align::AlignItems::SelfPosition(_overflow, position) => match position {
+                    align::AlignItems::SelfPosition {
+                        value: position, ..
+                    } => match position {
                         align::SelfPosition::Center => Center,
                         align::SelfPosition::FlexStart => FlexStart,
                         align::SelfPosition::FlexEnd => FlexEnd,

+ 0 - 4
packages/native-core/src/real_dom.rs

@@ -79,10 +79,6 @@ impl<S: State<V>, V: FromAnyValue> RealDom<S, V> {
         if self.node_id_mapping.len() <= element_id.0 {
             self.node_id_mapping.resize(element_id.0 + 1, None);
         }
-        if let Some(Some(old_id)) = self.node_id_mapping.get(element_id.0) {
-            // free the memory associated with the old node
-            self.tree.remove(*old_id);
-        }
         self.node_id_mapping[element_id.0] = Some(node_id);
     }
 

+ 0 - 0
packages/tui/examples/tui_all_events.rs → packages/tui/examples/all_events.rs


+ 0 - 0
packages/tui/examples/tui_border.rs → packages/tui/examples/border.rs


+ 0 - 0
packages/tui/examples/tui_buttons.rs → packages/tui/examples/buttons.rs


+ 0 - 0
packages/tui/examples/tui_color_test.rs → packages/tui/examples/color_test.rs


+ 0 - 0
packages/tui/examples/tui_colorpicker.rs → packages/tui/examples/colorpicker.rs


+ 0 - 0
packages/tui/examples/tui_components.rs → packages/tui/examples/components.rs


+ 0 - 0
packages/tui/examples/tui_flex.rs → packages/tui/examples/flex.rs


+ 0 - 0
packages/tui/examples/tui_hover.rs → packages/tui/examples/hover.rs


+ 0 - 0
packages/tui/examples/tui_list.rs → packages/tui/examples/list.rs


+ 0 - 0
packages/tui/examples/tui_margin.rs → packages/tui/examples/margin.rs


+ 0 - 0
packages/tui/examples/tui_quadrants.rs → packages/tui/examples/quadrants.rs


+ 0 - 0
packages/tui/examples/tui_readme.rs → packages/tui/examples/readme.rs


+ 0 - 0
packages/tui/examples/tui_task.rs → packages/tui/examples/task.rs


+ 0 - 0
packages/tui/examples/tui_text.rs → packages/tui/examples/text.rs


+ 0 - 0
packages/tui/examples/tui_widgets.rs → packages/tui/examples/widgets.rs