fix no default features on the web renderer
This commit is contained in:
1 parent
ca1a502714
commit
b54f7dd5d2
6 files changed
+21
-4
No files matched your search
+1
-1
@@ -59,7 +59,7 @@ dioxus-core = { path = "packages/core", version = "0.4.2" }
|
|||||||
dioxus-core-macro = { path = "packages/core-macro", version = "0.4.0" }
|
dioxus-core-macro = { path = "packages/core-macro", version = "0.4.0" }
|
||||||
dioxus-router = { path = "packages/router", version = "0.4.1" }
|
dioxus-router = { path = "packages/router", version = "0.4.1" }
|
||||||
dioxus-router-macro = { path = "packages/router-macro", version = "0.4.1" }
|
dioxus-router-macro = { path = "packages/router-macro", version = "0.4.1" }
|
||||||
dioxus-html = { path = "packages/html", version = "0.4.0" }
|
dioxus-html = { path = "packages/html", default-features = false, version = "0.4.0" }
|
||||||
dioxus-hooks = { path = "packages/hooks", version = "0.4.0" }
|
dioxus-hooks = { path = "packages/hooks", version = "0.4.0" }
|
||||||
dioxus-web = { path = "packages/web", version = "0.4.0" }
|
dioxus-web = { path = "packages/web", version = "0.4.0" }
|
||||||
dioxus-ssr = { path = "packages/ssr", version = "0.4.0" }
|
dioxus-ssr = { path = "packages/ssr", version = "0.4.0" }
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ features = [
|
|||||||
serde_json = "1"
|
serde_json = "1"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["serialize", "mounted"]
|
default = ["serialize", "mounted", "eval"]
|
||||||
serialize = [
|
serialize = [
|
||||||
"serde",
|
"serde",
|
||||||
"serde/rc",
|
"serde/rc",
|
||||||
@@ -66,6 +66,10 @@ mounted = [
|
|||||||
"web-sys/ScrollBehavior",
|
"web-sys/ScrollBehavior",
|
||||||
"web-sys/HtmlElement",
|
"web-sys/HtmlElement",
|
||||||
]
|
]
|
||||||
|
eval = [
|
||||||
|
"serde",
|
||||||
|
"serde_json"
|
||||||
|
]
|
||||||
wasm-bind = ["web-sys", "wasm-bindgen"]
|
wasm-bind = ["web-sys", "wasm-bindgen"]
|
||||||
native-bind = ["tokio"]
|
native-bind = ["tokio"]
|
||||||
hot-reload-context = ["dioxus-rsx"]
|
hot-reload-context = ["dioxus-rsx"]
|
||||||
@@ -38,9 +38,11 @@ pub use events::*;
|
|||||||
pub use global_attributes::*;
|
pub use global_attributes::*;
|
||||||
pub use render_template::*;
|
pub use render_template::*;
|
||||||
|
|
||||||
|
#[cfg(feature = "eval")]
|
||||||
pub mod eval;
|
pub mod eval;
|
||||||
|
|
||||||
pub mod prelude {
|
pub mod prelude {
|
||||||
|
#[cfg(feature = "eval")]
|
||||||
pub use crate::eval::*;
|
pub use crate::eval::*;
|
||||||
pub use crate::events::*;
|
pub use crate::events::*;
|
||||||
pub use crate::point_interaction::PointInteraction;
|
pub use crate::point_interaction::PointInteraction;
|
||||||
|
|||||||
@@ -65,7 +65,9 @@ hot_reload = [
|
|||||||
"web-sys/WebSocket",
|
"web-sys/WebSocket",
|
||||||
"web-sys/Location",
|
"web-sys/Location",
|
||||||
]
|
]
|
||||||
eval = []
|
eval = [
|
||||||
|
"dioxus-html/eval",
|
||||||
|
]
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
dioxus = { workspace = true }
|
dioxus = { workspace = true }
|
||||||
|
|||||||
@@ -173,6 +173,7 @@ impl WebsysDom {
|
|||||||
pub fn apply_edits(&mut self, mut edits: Vec<Mutation>) {
|
pub fn apply_edits(&mut self, mut edits: Vec<Mutation>) {
|
||||||
use Mutation::*;
|
use Mutation::*;
|
||||||
let i = &mut self.interpreter;
|
let i = &mut self.interpreter;
|
||||||
|
#[cfg(feature = "mounted")]
|
||||||
// we need to apply the mount events last, so we collect them here
|
// we need to apply the mount events last, so we collect them here
|
||||||
let mut to_mount = Vec::new();
|
let mut to_mount = Vec::new();
|
||||||
for edit in &edits {
|
for edit in &edits {
|
||||||
@@ -228,6 +229,7 @@ impl WebsysDom {
|
|||||||
match *name {
|
match *name {
|
||||||
// mounted events are fired immediately after the element is mounted.
|
// mounted events are fired immediately after the element is mounted.
|
||||||
"mounted" => {
|
"mounted" => {
|
||||||
|
#[cfg(feature = "mounted")]
|
||||||
to_mount.push(*id);
|
to_mount.push(*id);
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
@@ -248,6 +250,7 @@ impl WebsysDom {
|
|||||||
edits.clear();
|
edits.clear();
|
||||||
i.flush();
|
i.flush();
|
||||||
|
|
||||||
|
#[cfg(feature = "mounted")]
|
||||||
for id in to_mount {
|
for id in to_mount {
|
||||||
let node = get_node(id.0 as u32);
|
let node = get_node(id.0 as u32);
|
||||||
if let Some(element) = node.dyn_ref::<Element>() {
|
if let Some(element) = node.dyn_ref::<Element>() {
|
||||||
@@ -326,7 +329,12 @@ impl HtmlEventConverter for WebEventConverter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn convert_mounted_data(&self, event: &dioxus_html::PlatformEventData) -> MountedData {
|
fn convert_mounted_data(&self, event: &dioxus_html::PlatformEventData) -> MountedData {
|
||||||
MountedData::from(downcast_event(event).element.clone())
|
#[cfg(feature = "mounted")]
|
||||||
|
{MountedData::from(downcast_event(event).element.clone())}
|
||||||
|
#[cfg(not(feature = "mounted"))]
|
||||||
|
{
|
||||||
|
panic!("mounted events are not supported without the mounted feature on the dioxus-web crate enabled")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn convert_mouse_data(&self, event: &dioxus_html::PlatformEventData) -> dioxus_html::MouseData {
|
fn convert_mouse_data(&self, event: &dioxus_html::PlatformEventData) -> dioxus_html::MouseData {
|
||||||
|
|||||||
@@ -54,6 +54,7 @@
|
|||||||
// - Do DOM work in the next requestAnimationFrame callback
|
// - Do DOM work in the next requestAnimationFrame callback
|
||||||
|
|
||||||
pub use crate::cfg::Config;
|
pub use crate::cfg::Config;
|
||||||
|
#[cfg(feature = "file_engine")]
|
||||||
pub use crate::file_engine::WebFileEngineExt;
|
pub use crate::file_engine::WebFileEngineExt;
|
||||||
use dioxus_core::{Element, Scope, VirtualDom};
|
use dioxus_core::{Element, Scope, VirtualDom};
|
||||||
use futures_util::{
|
use futures_util::{
|
||||||
|
|||||||
Reference in new issue
Block a user