From 3de54d0b5202aca678d485a68ef8de006a63e21b Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Sun, 16 May 2021 03:01:36 -0400 Subject: [PATCH] Feat: remove old code --- packages/core-macro/src/rsxt.rs | 29 + packages/core/old/builderconstructors.rs | 589 ------------- packages/core/old/old.rs | 1006 ---------------------- packages/core/old/patch.rs | 80 -- packages/core/old/percydiff.rs | 329 ------- packages/core/old/validation.rs | 40 - packages/core/old/virtual_node.rs | 0 packages/core/src/virtual_dom.rs | 2 +- packages/ssr/src/tostring.rs | 16 +- 9 files changed, 37 insertions(+), 2054 deletions(-) delete mode 100644 packages/core/old/builderconstructors.rs delete mode 100644 packages/core/old/old.rs delete mode 100644 packages/core/old/patch.rs delete mode 100644 packages/core/old/percydiff.rs delete mode 100644 packages/core/old/validation.rs delete mode 100644 packages/core/old/virtual_node.rs diff --git a/packages/core-macro/src/rsxt.rs b/packages/core-macro/src/rsxt.rs index 12df6ce8b..5de701a27 100644 --- a/packages/core-macro/src/rsxt.rs +++ b/packages/core-macro/src/rsxt.rs @@ -497,3 +497,32 @@ fn try_parse_bracketed(stream: &ParseBuffer) -> Result { syn::braced!(content in stream); content.parse() } + +// // Used to uniquely identify elements that contain closures so that the DomUpdater can +// // look them up by their unique id. +// // When the DomUpdater sees that the element no longer exists it will drop all of it's +// // Rc'd Closures for those events. +// // It doesn't quite make sense to keep this here, perhaps just in the html crate? +// // Dioxus itself shouldn't be concerned with the attribute names +// // a ftk! +// static SELF_CLOSING_TAGS: Lazy> = Lazy::new(|| { +// [ +// "area", "base", "br", "col", "hr", "img", "input", "link", "meta", "param", "command", +// "keygen", "source", +// ] +// .iter() +// .cloned() +// .collect() +// }); + +// /// Whether or not this tag is self closing +// /// +// /// ```ignore +// /// use dioxus_core::validation::is_self_closing; +// /// assert_eq!(is_self_closing("br"), true); +// /// assert_eq!(is_self_closing("div"), false); +// /// ``` +// pub fn is_self_closing(tag: &str) -> bool { +// SELF_CLOSING_TAGS.contains(tag) +// // SELF_CLOSING_TAGS.contains(tag) || is_self_closing_svg_tag(tag) +// } diff --git a/packages/core/old/builderconstructors.rs b/packages/core/old/builderconstructors.rs deleted file mode 100644 index deac5e343..000000000 --- a/packages/core/old/builderconstructors.rs +++ /dev/null @@ -1,589 +0,0 @@ -// we don't want to necessarily adhere to the spec for dioxus core -// 3rd party libs can implement their own builders if they want - -// macro_rules! builder_constructors { -// ( $( -// $(#[$attr:meta])* -// $name:ident; -// )* ) => { -// $( -// $(#[$attr])* -// #[inline] -// pub fn $name<'a, B>( -// bump: B, -// ) -> ElementBuilder< -// 'a, -// bumpalo::collections::Vec<'a, Listener<'a>>, -// bumpalo::collections::Vec<'a, Attribute<'a>>, -// bumpalo::collections::Vec<'a, VNode<'a>>, -// > -// where -// B: Into<&'a Bump> -// { -// ElementBuilder::new(bump, stringify!($name)) -// } -// )* -// }; -// ( $( -// $(#[$attr:meta])* -// $name:ident <> $namespace:tt; -// )* ) => { -// $( -// $(#[$attr])* -// #[inline] -// pub fn $name<'a>( -// bump: &'a Bump, -// ) -> ElementBuilder< -// 'a, -// bumpalo::collections::Vec<'a, Listener<'a>>, -// bumpalo::collections::Vec<'a, Attribute<'a>>, -// bumpalo::collections::Vec<'a, VNode<'a>>, -// > { -// let builder = ElementBuilder::new(bump, stringify!($name)); -// builder.namespace(Some($namespace)) -// } -// )* -// } -// } - -// // Organized in the same order as -// // https://developer.mozilla.org/en-US/docs/Web/HTML/Element -// // -// // Does not include obsolete elements. -// builder_constructors! { -// // Document metadata - -// /// Build a -// /// [``](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base) -// /// element. -// base; -// /// Build a -// /// [``](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/head) -// /// element. -// head; -// /// Build a -// /// [``](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link) -// /// element. -// link; -// /// Build a -// /// [``](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta) -// /// element. -// meta; -// /// Build a -// /// [`