cli json output, dx bundle fix, dx serve --platform android, race condition, drop ssg platform (#3186)
* clean up logging to avoid random extra trace * fix race condition with updates * properly wire up verbose * fix bundling (macos) and logging * Add structured output * clean up clap names * extract out wire format * switch structured key to json * fix random println, fallback to `dioxus/platform` * clean up logging for run/build * clean up logging around project * remove manual exits * fix tokio runtime for mobile * rework dog app * rip out ssg * Switch dioxus/axum to dioxus/server * add android template inline * pre restructure for bundle prep * add the whole res directory * Better theme for the app * remove mobile demo now that most apps work natively * self-referential android * only use deep linking for assets * fix imports for android * clippy, fixup ios and android * I'm not boxing compiler message you can't make me * fix clippy on unix
This commit is contained in:
1 parent
8a998e7d49
commit
ac3e33af46
116 files changed
+2367
-6091
No files matched your search
@@ -6,15 +6,44 @@ pub use dioxus_desktop::*;
|
||||
use dioxus_lib::prelude::*;
|
||||
use std::sync::Mutex;
|
||||
|
||||
pub mod launch_bindings {
|
||||
use std::any::Any;
|
||||
|
||||
use super::*;
|
||||
pub fn launch(
|
||||
root: fn() -> Element,
|
||||
_contexts: Vec<Box<dyn Fn() -> Box<dyn Any> + Send + Sync>>,
|
||||
_platform_config: Vec<Box<dyn Any>>,
|
||||
) {
|
||||
super::launch(root);
|
||||
}
|
||||
|
||||
pub fn launch_virtual_dom(_virtual_dom: VirtualDom, _desktop_config: Config) -> ! {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
||||
/// Launch via the binding API
|
||||
pub fn launch(incoming: fn() -> Element) {
|
||||
*APP_FN_PTR.lock().unwrap() = Some(incoming);
|
||||
#[cfg(target_os = "android")]
|
||||
{
|
||||
*APP_FN_PTR.lock().unwrap() = Some(incoming);
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "android"))]
|
||||
{
|
||||
dioxus_desktop::launch::launch(incoming, vec![], Default::default());
|
||||
}
|
||||
}
|
||||
|
||||
static APP_FN_PTR: Mutex<Option<fn() -> Element>> = Mutex::new(None);
|
||||
|
||||
pub fn root() {
|
||||
let app = APP_FN_PTR.lock().unwrap().unwrap();
|
||||
let app = APP_FN_PTR
|
||||
.lock()
|
||||
.expect("APP_FN_PTR lock failed")
|
||||
.expect("Android to have set the app trampoline");
|
||||
|
||||
dioxus_desktop::launch::launch(app, vec![], Default::default());
|
||||
}
|
||||
|
||||
@@ -24,13 +53,13 @@ pub fn root() {
|
||||
pub extern "C" fn start_app() {
|
||||
tao::android_binding!(
|
||||
com_example,
|
||||
wrytest,
|
||||
androidfinal,
|
||||
WryActivity,
|
||||
wry::android_setup,
|
||||
root,
|
||||
tao
|
||||
);
|
||||
wry::android_binding!(com_example, wrytest, wry);
|
||||
wry::android_binding!(com_example, androidfinal, wry);
|
||||
}
|
||||
|
||||
/// Call our `main` function to initialize the rust runtime and set the launch binding trampoline
|
||||
|
||||
Reference in new issue
Block a user