Put asset collection behind a feature flag
This commit is contained in:
3 files changed
+13
-4
No files matched your search
@@ -52,7 +52,7 @@ muda = "0.11.3"
|
||||
|
||||
[target.'cfg(any(target_os = "windows",target_os = "macos",target_os = "linux",target_os = "dragonfly", target_os = "freebsd", target_os = "netbsd", target_os = "openbsd"))'.dependencies]
|
||||
# This is only for debug mode, and it appears mobile does not support some packages this uses
|
||||
manganis-cli-support = { git = "https://github.com/DioxusLabs/collect-assets", features = [
|
||||
manganis-cli-support = { git = "https://github.com/DioxusLabs/collect-assets", optional = true, features = [
|
||||
"webp",
|
||||
"html",
|
||||
] }
|
||||
@@ -67,6 +67,12 @@ objc_id = "0.1.1"
|
||||
core-foundation = "0.9.3"
|
||||
objc = "0.2.7"
|
||||
|
||||
[target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
|
||||
gtk = { version = "0.18", features = [ "v3_24" ] }
|
||||
webkit2gtk = { version = "=2.0", features = [ "v2_38" ] }
|
||||
percent-encoding = "2.1"
|
||||
|
||||
|
||||
[features]
|
||||
default = ["tokio_runtime", "hot-reload", "wry/objc-exception"]
|
||||
tokio_runtime = ["tokio"]
|
||||
@@ -74,6 +80,7 @@ fullscreen = ["wry/fullscreen"]
|
||||
transparent = ["wry/transparent"]
|
||||
devtools = ["wry/devtools"]
|
||||
hot-reload = ["dioxus-hot-reload"]
|
||||
asset-collect = ["manganis-cli-support"]
|
||||
gnu = []
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
|
||||
@@ -82,6 +82,8 @@ impl<P: 'static> App<P> {
|
||||
};
|
||||
|
||||
// Copy over any assets we find
|
||||
// todo - re-enable this when we have a faster way of copying assets
|
||||
#[cfg(feature = "collect-assets")]
|
||||
crate::collect_assets::copy_assets();
|
||||
|
||||
// Set the event converter
|
||||
@@ -119,7 +121,6 @@ impl<P: 'static> App<P> {
|
||||
});
|
||||
}
|
||||
|
||||
//
|
||||
pub fn handle_new_window(&mut self) {
|
||||
for handler in self.shared.pending_webviews.borrow_mut().drain(..) {
|
||||
let id = handler.desktop_context.window.id();
|
||||
@@ -320,7 +321,6 @@ impl<P: 'static> App<P> {
|
||||
let Some(view) = self.webviews.get_mut(&id) else {
|
||||
return;
|
||||
};
|
||||
println!("poll_vdom");
|
||||
|
||||
view.poll_vdom();
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
mod app;
|
||||
mod assets;
|
||||
mod cfg;
|
||||
mod collect_assets;
|
||||
mod desktop_context;
|
||||
mod edits;
|
||||
mod element;
|
||||
@@ -23,6 +22,9 @@ mod shortcut;
|
||||
mod waker;
|
||||
mod webview;
|
||||
|
||||
#[cfg(feature = "collect-assets")]
|
||||
mod collect_assets;
|
||||
|
||||
#[cfg(any(target_os = "ios", target_os = "android"))]
|
||||
mod mobile_shortcut;
|
||||
|
||||
|
||||
Reference in new issue
Block a user