mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-10 06:34:20 +00:00
fix cargo check
This commit is contained in:
parent
b1de7d850c
commit
4f654d61b7
7 changed files with 63 additions and 32 deletions
|
@ -42,11 +42,11 @@ impl Build {
|
|||
.platform
|
||||
.unwrap_or(crate_config.dioxus_config.application.default_platform);
|
||||
|
||||
if let Some(target) = self.build.target {
|
||||
if let Some(target) = self.build.target.clone() {
|
||||
crate_config.set_target(target);
|
||||
}
|
||||
|
||||
crate_config.set_cargo_args(self.build.cargo_args);
|
||||
crate_config.set_cargo_args(self.build.cargo_args.clone());
|
||||
|
||||
// #[cfg(feature = "plugin")]
|
||||
// let _ = PluginManager::on_build_start(&crate_config, &platform);
|
||||
|
|
|
@ -49,14 +49,14 @@ pub struct ConfigOptsBuild {
|
|||
/// The feature to use for the server in a fullstack app [default: "ssr"]
|
||||
#[clap(long, default_value_t = { "ssr".to_string() })]
|
||||
pub server_feature: String,
|
||||
|
||||
/// Rustc platform triple
|
||||
#[clap(long)]
|
||||
pub target: Option<String>,
|
||||
|
||||
/// Extra arguments passed to cargo build
|
||||
#[clap(last = true)]
|
||||
pub cargo_args: Vec<String>,
|
||||
/// Rustc platform triple
|
||||
#[clap(long)]
|
||||
pub target: Option<String>,
|
||||
|
||||
/// Extra arguments passed to cargo build
|
||||
#[clap(last = true)]
|
||||
pub cargo_args: Vec<String>,
|
||||
}
|
||||
|
||||
impl From<ConfigOptsServe> for ConfigOptsBuild {
|
||||
|
@ -73,9 +73,10 @@ impl From<ConfigOptsServe> for ConfigOptsBuild {
|
|||
server_feature: serve.server_feature,
|
||||
skip_assets: serve.skip_assets,
|
||||
force_debug: serve.force_debug,
|
||||
cargo_args: serve.cargo_args,
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default, Deserialize, Parser)]
|
||||
pub struct ConfigOptsServe {
|
||||
|
@ -143,7 +144,7 @@ pub struct ConfigOptsServe {
|
|||
/// The feature to use for the server in a fullstack app [default: "ssr"]
|
||||
#[clap(long, default_value_t = { "ssr".to_string() })]
|
||||
pub server_feature: String,
|
||||
|
||||
|
||||
/// Rustc platform triple
|
||||
#[clap(long)]
|
||||
pub target: Option<String>,
|
||||
|
|
|
@ -2,7 +2,6 @@ use crate::{
|
|||
any_props::AnyProps,
|
||||
any_props::VProps,
|
||||
bump_frame::BumpFrame,
|
||||
|
||||
innerlude::{DynamicNode, EventHandler, VComponent, VNodeId, VText},
|
||||
lazynodes::LazyNodes,
|
||||
nodes::{IntoAttributeValue, IntoDynNode, RenderReturn},
|
||||
|
|
|
@ -16,7 +16,9 @@ use crate::{
|
|||
use futures_util::{pin_mut, StreamExt};
|
||||
use rustc_hash::{FxHashMap, FxHashSet};
|
||||
use slab::Slab;
|
||||
use std::{any::Any, cell::Cell, collections::BTreeSet, future::Future, ptr::NonNull, rc::Rc, sync::Arc};
|
||||
use std::{
|
||||
any::Any, cell::Cell, collections::BTreeSet, future::Future, ptr::NonNull, rc::Rc, sync::Arc,
|
||||
};
|
||||
|
||||
/// A virtual node system that progresses user events and diffs UI trees.
|
||||
///
|
||||
|
|
|
@ -221,7 +221,7 @@ fn app(cx: Scope) -> Element {
|
|||
desktop_context.close();
|
||||
}
|
||||
|
||||
cx.render(rsx! {
|
||||
render! {
|
||||
div {
|
||||
button {
|
||||
id: "button",
|
||||
|
@ -229,14 +229,11 @@ fn app(cx: Scope) -> Element {
|
|||
println!("{:?}", event.data);
|
||||
assert!(event.data.modifiers().is_empty());
|
||||
assert!(event.data.held_buttons().is_empty());
|
||||
assert_eq!(event.data.trigger_button(), Some(dioxus_html::input_data::MouseButton::Primary));
|
||||
received_events.modify(|x| *x + 1)
|
||||
},
|
||||
assert_eq!(
|
||||
event.data.trigger_button(),
|
||||
Some(dioxus_html::input_data::MouseButton::Primary),
|
||||
);
|
||||
recieved_events.modify(|x| *x + 1)
|
||||
received_events.modify(|x| *x + 1)
|
||||
}
|
||||
}
|
||||
div {
|
||||
|
@ -244,7 +241,12 @@ fn app(cx: Scope) -> Element {
|
|||
onmousemove: move |event| {
|
||||
println!("{:?}", event.data);
|
||||
assert!(event.data.modifiers().is_empty());
|
||||
assert!(event.data.held_buttons().contains(dioxus_html::input_data::MouseButton::Secondary));
|
||||
assert!(
|
||||
event
|
||||
.data
|
||||
.held_buttons()
|
||||
.contains(dioxus_html::input_data::MouseButton::Secondary),
|
||||
);
|
||||
received_events.modify(|x| *x + 1)
|
||||
}
|
||||
}
|
||||
|
@ -253,8 +255,16 @@ fn app(cx: Scope) -> Element {
|
|||
onclick: move |event| {
|
||||
println!("{:?}", event.data);
|
||||
assert!(event.data.modifiers().is_empty());
|
||||
assert!(event.data.held_buttons().contains(dioxus_html::input_data::MouseButton::Secondary));
|
||||
assert_eq!(event.data.trigger_button(), Some(dioxus_html::input_data::MouseButton::Secondary));
|
||||
assert!(
|
||||
event
|
||||
.data
|
||||
.held_buttons()
|
||||
.contains(dioxus_html::input_data::MouseButton::Secondary),
|
||||
);
|
||||
assert_eq!(
|
||||
event.data.trigger_button(),
|
||||
Some(dioxus_html::input_data::MouseButton::Secondary),
|
||||
);
|
||||
received_events.modify(|x| *x + 1)
|
||||
}
|
||||
}
|
||||
|
@ -263,9 +273,19 @@ fn app(cx: Scope) -> Element {
|
|||
ondoubleclick: move |event| {
|
||||
println!("{:?}", event.data);
|
||||
assert!(event.data.modifiers().is_empty());
|
||||
assert!(event.data.held_buttons().contains(dioxus_html::input_data::MouseButton::Primary));
|
||||
assert!(event.data.held_buttons().contains(dioxus_html::input_data::MouseButton::Secondary));
|
||||
assert_eq!(event.data.trigger_button(), Some(dioxus_html::input_data::MouseButton::Secondary));
|
||||
assert!(
|
||||
event.data.held_buttons().contains(dioxus_html::input_data::MouseButton::Primary),
|
||||
);
|
||||
assert!(
|
||||
event
|
||||
.data
|
||||
.held_buttons()
|
||||
.contains(dioxus_html::input_data::MouseButton::Secondary),
|
||||
);
|
||||
assert_eq!(
|
||||
event.data.trigger_button(),
|
||||
Some(dioxus_html::input_data::MouseButton::Secondary),
|
||||
);
|
||||
received_events.modify(|x| *x + 1)
|
||||
}
|
||||
}
|
||||
|
@ -274,8 +294,16 @@ fn app(cx: Scope) -> Element {
|
|||
onmousedown: move |event| {
|
||||
println!("{:?}", event.data);
|
||||
assert!(event.data.modifiers().is_empty());
|
||||
assert!(event.data.held_buttons().contains(dioxus_html::input_data::MouseButton::Secondary));
|
||||
assert_eq!(event.data.trigger_button(), Some(dioxus_html::input_data::MouseButton::Secondary));
|
||||
assert!(
|
||||
event
|
||||
.data
|
||||
.held_buttons()
|
||||
.contains(dioxus_html::input_data::MouseButton::Secondary),
|
||||
);
|
||||
assert_eq!(
|
||||
event.data.trigger_button(),
|
||||
Some(dioxus_html::input_data::MouseButton::Secondary),
|
||||
);
|
||||
received_events.modify(|x| *x + 1)
|
||||
}
|
||||
}
|
||||
|
@ -285,7 +313,10 @@ fn app(cx: Scope) -> Element {
|
|||
println!("{:?}", event.data);
|
||||
assert!(event.data.modifiers().is_empty());
|
||||
assert!(event.data.held_buttons().is_empty());
|
||||
assert_eq!(event.data.trigger_button(), Some(dioxus_html::input_data::MouseButton::Primary));
|
||||
assert_eq!(
|
||||
event.data.trigger_button(),
|
||||
Some(dioxus_html::input_data::MouseButton::Primary),
|
||||
);
|
||||
received_events.modify(|x| *x + 1)
|
||||
}
|
||||
}
|
||||
|
@ -312,7 +343,6 @@ fn app(cx: Scope) -> Element {
|
|||
assert_eq!(event.data.location, 0);
|
||||
assert!(event.data.is_auto_repeating());
|
||||
received_events.modify(|x| *x + 1)
|
||||
|
||||
}
|
||||
}
|
||||
input {
|
||||
|
@ -354,5 +384,5 @@ fn app(cx: Scope) -> Element {
|
|||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -216,8 +216,7 @@ pub(super) async fn desktop_handler(
|
|||
request: Request<Vec<u8>>,
|
||||
custom_head: Option<String>,
|
||||
custom_index: Option<String>,
|
||||
#[allow(unused_variables)]
|
||||
assets_head: Option<String>,
|
||||
#[allow(unused_variables)] assets_head: Option<String>,
|
||||
root_name: &str,
|
||||
asset_handlers: &AssetHandlerRegistry,
|
||||
edit_queue: &EditQueue,
|
||||
|
|
|
@ -122,7 +122,7 @@ fn Route3(cx: Scope, dynamic: String) -> Element {
|
|||
.collect::<Vec<_>>();
|
||||
|
||||
let navigator = use_navigator(cx);
|
||||
|
||||
|
||||
render! {
|
||||
input {
|
||||
oninput: move |evt| *current_route_str.write() = evt.value.clone(),
|
||||
|
|
Loading…
Reference in a new issue