Fix the router and stub out a number of crates to get compiling
This commit is contained in:
226 files changed
+1057
-1482
No files matched your search
@@ -166,10 +166,10 @@ impl State for Border {
|
||||
}
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
fn app(cx: Scope) -> Element {
|
||||
let count = use_state(cx, || 0);
|
||||
fn app() -> Element {
|
||||
let count = use_state(|| 0);
|
||||
|
||||
use_future(cx, (count,), |(count,)| async move {
|
||||
use_future((count,), |(count,)| async move {
|
||||
loop {
|
||||
tokio::time::sleep(std::time::Duration::from_secs(1)).await;
|
||||
count.set(*count + 1);
|
||||
@@ -185,7 +185,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
})
|
||||
}
|
||||
|
||||
fn Comp(cx: Scope) -> Element {
|
||||
fn Comp() -> Element {
|
||||
cx.render(rsx! {
|
||||
div{
|
||||
border: "",
|
||||
|
||||
@@ -201,7 +201,7 @@ fn traverse() {
|
||||
use crate::prelude::*;
|
||||
use dioxus::prelude::*;
|
||||
#[allow(non_snake_case)]
|
||||
fn Base(cx: Scope) -> Element {
|
||||
fn Base() -> Element {
|
||||
render!(
|
||||
div{
|
||||
div{
|
||||
@@ -299,7 +299,7 @@ fn persist_removes() {
|
||||
use crate::prelude::*;
|
||||
use dioxus::prelude::*;
|
||||
#[allow(non_snake_case)]
|
||||
fn Base(cx: Scope) -> Element {
|
||||
fn Base() -> Element {
|
||||
let children = match generation() % 2 {
|
||||
0 => 3,
|
||||
1 => 2,
|
||||
@@ -375,7 +375,7 @@ fn persist_instertions_before() {
|
||||
use crate::prelude::*;
|
||||
use dioxus::prelude::*;
|
||||
#[allow(non_snake_case)]
|
||||
fn Base(cx: Scope) -> Element {
|
||||
fn Base() -> Element {
|
||||
let children = match generation() % 2 {
|
||||
0 => 3,
|
||||
1 => 2,
|
||||
@@ -428,7 +428,7 @@ fn persist_instertions_after() {
|
||||
use crate::prelude::*;
|
||||
use dioxus::prelude::*;
|
||||
#[allow(non_snake_case)]
|
||||
fn Base(cx: Scope) -> Element {
|
||||
fn Base() -> Element {
|
||||
let children = match generation() % 2 {
|
||||
0 => 3,
|
||||
1 => 2,
|
||||
|
||||
@@ -115,7 +115,7 @@ macro_rules! test_state{
|
||||
#[test]
|
||||
fn state_reduce_initally_called_minimally() {
|
||||
#[allow(non_snake_case)]
|
||||
fn Base(cx: Scope) -> Element {
|
||||
fn Base() -> Element {
|
||||
render!{
|
||||
div {
|
||||
div{
|
||||
|
||||
@@ -256,10 +256,10 @@ impl CustomElement for CustomElementWithNoSlot {
|
||||
|
||||
#[test]
|
||||
fn custom_elements_work() {
|
||||
fn app(cx: Scope) -> Element {
|
||||
let count = use_state(cx, || 0);
|
||||
fn app() -> Element {
|
||||
let count = use_state(|| 0);
|
||||
|
||||
use_future!(cx, |count| async move {
|
||||
use_future!(|count| async move {
|
||||
count.with_mut(|count| *count += 1);
|
||||
});
|
||||
|
||||
@@ -333,7 +333,7 @@ fn custom_elements_work() {
|
||||
#[test]
|
||||
#[should_panic]
|
||||
fn slotless_custom_element_cant_have_children() {
|
||||
fn app(cx: Scope) -> Element {
|
||||
fn app() -> Element {
|
||||
cx.render(rsx! {
|
||||
customelementnoslot {
|
||||
testing132 {}
|
||||
@@ -362,7 +362,7 @@ fn slotless_custom_element_cant_have_children() {
|
||||
|
||||
#[test]
|
||||
fn slotless_custom_element() {
|
||||
fn app(cx: Scope) -> Element {
|
||||
fn app() -> Element {
|
||||
cx.render(rsx! {
|
||||
customelementnoslot {
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ enum DynamicNodeType {
|
||||
Other,
|
||||
}
|
||||
|
||||
fn create_random_template(name: &'static str) -> (Template<'static>, Vec<DynamicNodeType>) {
|
||||
fn create_random_template(name: &'static str) -> (Template, Vec<DynamicNodeType>) {
|
||||
let mut dynamic_node_type = Vec::new();
|
||||
let mut template_idx = 0;
|
||||
let mut attr_idx = 0;
|
||||
@@ -175,7 +175,7 @@ fn create_random_template(name: &'static str) -> (Template<'static>, Vec<Dynamic
|
||||
)
|
||||
}
|
||||
|
||||
fn create_random_dynamic_node(cx: &ScopeState, depth: usize) -> DynamicNode {
|
||||
fn create_random_dynamic_node(, depth: usize) -> DynamicNode {
|
||||
let range = if depth > 3 { 1 } else { 3 };
|
||||
match rand::random::<u8>() % range {
|
||||
0 => DynamicNode::Placeholder(Default::default()),
|
||||
@@ -207,7 +207,7 @@ fn create_random_dynamic_node(cx: &ScopeState, depth: usize) -> DynamicNode {
|
||||
}
|
||||
}
|
||||
|
||||
fn create_random_dynamic_attr(cx: &ScopeState) -> Attribute {
|
||||
fn create_random_dynamic_attr() -> Attribute {
|
||||
let value = match rand::random::<u8>() % 6 {
|
||||
0 => AttributeValue::Text(Box::leak(
|
||||
format!("{}", rand::random::<usize>()).into_boxed_str(),
|
||||
@@ -269,7 +269,7 @@ fn create_random_element(cx: Scope<DepthProps>) -> Element {
|
||||
format!("{}", rand::random::<usize>()).into_boxed_str(),
|
||||
))),
|
||||
DynamicNodeType::Other => {
|
||||
create_random_dynamic_node(cx, cx.props.depth + 1)
|
||||
create_random_dynamic_node(cx.props.depth + 1)
|
||||
}
|
||||
})
|
||||
.collect();
|
||||
|
||||
@@ -96,16 +96,16 @@ fn native_core_is_okay() {
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::time::Duration;
|
||||
|
||||
fn app(cx: Scope) -> Element {
|
||||
let colors = use_state(cx, || vec!["green", "blue", "red"]);
|
||||
let padding = use_state(cx, || 10);
|
||||
fn app() -> Element {
|
||||
let colors = use_state(|| vec!["green", "blue", "red"]);
|
||||
let padding = use_state(|| 10);
|
||||
|
||||
use_effect(cx, colors, |colors| async move {
|
||||
use_effect(colors, |colors| async move {
|
||||
sleep(Duration::from_millis(1000)).await;
|
||||
colors.with_mut(|colors| colors.reverse());
|
||||
});
|
||||
|
||||
use_effect(cx, padding, |padding| async move {
|
||||
use_effect(padding, |padding| async move {
|
||||
sleep(Duration::from_millis(10)).await;
|
||||
padding.with_mut(|padding| {
|
||||
if *padding < 65 {
|
||||
|
||||
Reference in new issue
Block a user