Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* no_implicit_prelude in macro tests * #[automatically_derived] and #[doc(hidden)] * Span::call_site() -> Span::mixed_site()
- Loading branch information
Showing
14 changed files
with
73 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
packages/yew-macro/tests/function_component_attr/no-name-default-pass.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
use yew::prelude::*; | ||
#![no_implicit_prelude] | ||
|
||
#[derive(Clone, Properties, PartialEq)] | ||
#[derive(::yew::prelude::Properties, ::std::prelude::rust_2021::PartialEq,)] | ||
struct Props { | ||
a: usize, | ||
} | ||
|
||
#[function_component] | ||
fn Comp(props: &Props) -> Html { | ||
html! { | ||
#[::yew::prelude::function_component] | ||
fn Comp(props: &Props) -> ::yew::prelude::Html { | ||
::yew::prelude::html! { | ||
<p> | ||
{ props.a } | ||
</p> | ||
} | ||
} | ||
|
||
fn main() { | ||
let _ = html! { | ||
let _ = ::yew::prelude::html! { | ||
<Comp a={0} /> | ||
}; | ||
} |
20 changes: 10 additions & 10 deletions
20
packages/yew-macro/tests/function_component_attr/with-defaulted-type-param-pass.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
use yew::prelude::*; | ||
#![no_implicit_prelude] | ||
|
||
#[derive(Properties, Debug)] | ||
#[derive(::yew::prelude::Properties, ::std::fmt::Debug)] | ||
pub struct CompProps<A> { | ||
#[prop_or_default] | ||
_phantom: std::marker::PhantomData<A>, | ||
_phantom: ::std::marker::PhantomData<A>, | ||
} | ||
|
||
impl<A> PartialEq for CompProps<A> { | ||
impl<A> ::std::cmp::PartialEq for CompProps<A> { | ||
fn eq(&self, _rhs: &Self) -> bool { | ||
true | ||
} | ||
} | ||
|
||
#[function_component(Comp)] | ||
pub fn comp<A = ()>(_props: &CompProps<A>) -> Html { | ||
todo!() | ||
#[::yew::prelude::function_component(Comp)] | ||
pub fn comp<A = ()>(_props: &CompProps<A>) -> ::yew::prelude::Html { | ||
::std::todo!() | ||
} | ||
|
||
#[function_component(App)] | ||
pub fn app() -> Html { | ||
html! { <Comp /> } // No generics here. | ||
#[::yew::prelude::function_component(App)] | ||
pub fn app() -> ::yew::prelude::Html { | ||
::yew::prelude::html! { <Comp /> } // No generics here. | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
use yew::prelude::*; | ||
#![no_implicit_prelude] | ||
|
||
fn compile_pass_lit() { | ||
html! { if true {} }; | ||
html! { if true { <div/> } }; | ||
html! { if true { <div/><div/> } }; | ||
html! { if true { <><div/><div/></> } }; | ||
html! { if true { { html! {} } } }; | ||
html! { if true { { { let _x = 42; html! {} } } } }; | ||
html! { if true {} else {} }; | ||
html! { if true {} else if true {} }; | ||
html! { if true {} else if true {} else {} }; | ||
html! { if let Some(text) = Some("text") { <span>{ text }</span> } }; | ||
html! { <><div/>if true {}<div/></> }; | ||
html! { <div>if true {}</div> }; | ||
::yew::html! { if true {} }; | ||
::yew::html! { if true { <div/> } }; | ||
::yew::html! { if true { <div/><div/> } }; | ||
::yew::html! { if true { <><div/><div/></> } }; | ||
::yew::html! { if true { { ::yew::html! {} } } }; | ||
::yew::html! { if true { { { let _x = 42; ::yew::html! {} } } } }; | ||
::yew::html! { if true {} else {} }; | ||
::yew::html! { if true {} else if true {} }; | ||
::yew::html! { if true {} else if true {} else {} }; | ||
::yew::html! { if let ::std::option::Option::Some(text) = ::std::option::Option::Some("text") { <span>{ text }</span> } }; | ||
::yew::html! { <><div/>if true {}<div/></> }; | ||
::yew::html! { <div>if true {}</div> }; | ||
} | ||
|
||
fn compile_pass_expr() { | ||
let condition = true; | ||
|
||
html! { if condition {} }; | ||
html! { if condition { <div/> } }; | ||
html! { if condition { <div/><div/> } }; | ||
html! { if condition { <><div/><div/></> } }; | ||
html! { if condition { { html! {} } } }; | ||
html! { if condition { { { let _x = 42; html! {} } } } }; | ||
html! { if condition {} else {} }; | ||
html! { if condition {} else if condition {} }; | ||
html! { if condition {} else if condition {} else {} }; | ||
html! { if let Some(text) = Some("text") { <span>{ text }</span> } }; | ||
html! { <><div/>if condition {}<div/></> }; | ||
html! { <div>if condition {}</div> }; | ||
::yew::html! { if condition {} }; | ||
::yew::html! { if condition { <div/> } }; | ||
::yew::html! { if condition { <div/><div/> } }; | ||
::yew::html! { if condition { <><div/><div/></> } }; | ||
::yew::html! { if condition { { ::yew::html! {} } } }; | ||
::yew::html! { if condition { { { let _x = 42; ::yew::html! {} } } } }; | ||
::yew::html! { if condition {} else {} }; | ||
::yew::html! { if condition {} else if condition {} }; | ||
::yew::html! { if condition {} else if condition {} else {} }; | ||
::yew::html! { if let ::std::option::Option::Some(text) = ::std::option::Option::Some("text") { <span>{ text }</span> } }; | ||
::yew::html! { <><div/>if condition {}<div/></> }; | ||
::yew::html! { <div>if condition {}</div> }; | ||
} | ||
|
||
fn main() {} |
2f3b90c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yew master branch benchmarks (Lower is better)
yew-struct-keyed 01_run1k
188.318
208.3555
0.90
yew-struct-keyed 02_replace1k
193.585
225.2485
0.86
yew-struct-keyed 03_update10th1k_x16
397.521
398.384
1.00
yew-struct-keyed 04_select1k
88.763
75.3695
1.18
yew-struct-keyed 05_swap1k
102.404
102.787
1.00
yew-struct-keyed 06_remove-one-1k
30.794
34.772499999999994
0.89
yew-struct-keyed 07_create10k
2496.348
2793.7484999999997
0.89
yew-struct-keyed 08_create1k-after1k_x2
418.7985
473.5455
0.88
yew-struct-keyed 09_clear1k_x8
199.747
221.926
0.90
yew-struct-keyed 21_ready-memory
1.4005584716796875
1.4005584716796875
1
yew-struct-keyed 22_run-memory
1.6621437072753906
1.66949462890625
1.00
yew-struct-keyed 23_update5-memory
1.698455810546875
1.7012710571289062
1.00
yew-struct-keyed 24_run5-memory
1.949310302734375
1.714313507080078
1.14
yew-struct-keyed 25_run-clear-memory
1.421672821044922
1.421672821044922
1
yew-struct-keyed 31_startup-ci
1731.35
1731.306
1.00
yew-struct-keyed 32_startup-bt
28.525999999999996
35.414
0.81
yew-struct-keyed 34_startup-totalbytes
330.5498046875
330.5498046875
1
This comment was automatically generated by workflow using github-action-benchmark.