@@ -20,6 +20,7 @@ use syn::spanned::Spanned;
20
20
21
21
pub ( crate ) struct AppRunner {
22
22
pub ( crate ) running : Option < AppHandle > ,
23
+ pub ( crate ) app : Option < AppBundle > ,
23
24
pub ( crate ) krate : DioxusCrate ,
24
25
pub ( crate ) ignore : Gitignore ,
25
26
pub ( crate ) applied_hot_reload_message : HotReloadMsg ,
@@ -45,6 +46,7 @@ impl AppRunner {
45
46
pub ( crate ) fn start ( krate : & DioxusCrate ) -> Self {
46
47
let mut runner = Self {
47
48
running : Default :: default ( ) ,
49
+ app : Default :: default ( ) ,
48
50
file_map : Default :: default ( ) ,
49
51
applied_hot_reload_message : Default :: default ( ) ,
50
52
ignore : krate. workspace_gitignore ( ) ,
@@ -72,39 +74,8 @@ impl AppRunner {
72
74
return futures_util:: future:: pending ( ) . await ;
73
75
} ;
74
76
75
- use ServeUpdate :: * ;
76
- let platform = handle. app . build . build . platform ( ) ;
77
77
tokio:: select! {
78
- Some ( Ok ( Some ( msg) ) ) = OptionFuture :: from( handle. app_stdout. as_mut( ) . map( |f| f. next_line( ) ) ) => {
79
- StdoutReceived { platform, msg }
80
- } ,
81
- Some ( Ok ( Some ( msg) ) ) = OptionFuture :: from( handle. app_stderr. as_mut( ) . map( |f| f. next_line( ) ) ) => {
82
- StderrReceived { platform, msg }
83
- } ,
84
- Some ( status) = OptionFuture :: from( handle. app_child. as_mut( ) . map( |f| f. wait( ) ) ) => {
85
- match status {
86
- Ok ( status) => {
87
- handle. app_child = None ;
88
- ProcessExited { status, platform }
89
- } ,
90
- Err ( _err) => todo!( "handle error in process joining?" ) ,
91
- }
92
- }
93
- Some ( Ok ( Some ( msg) ) ) = OptionFuture :: from( handle. server_stdout. as_mut( ) . map( |f| f. next_line( ) ) ) => {
94
- StdoutReceived { platform: Platform :: Server , msg }
95
- } ,
96
- Some ( Ok ( Some ( msg) ) ) = OptionFuture :: from( handle. server_stderr. as_mut( ) . map( |f| f. next_line( ) ) ) => {
97
- StderrReceived { platform: Platform :: Server , msg }
98
- } ,
99
- Some ( status) = OptionFuture :: from( handle. server_child. as_mut( ) . map( |f| f. wait( ) ) ) => {
100
- match status {
101
- Ok ( status) => {
102
- handle. server_child = None ;
103
- ProcessExited { status, platform }
104
- } ,
105
- Err ( _err) => todo!( "handle error in process joining?" ) ,
106
- }
107
- }
78
+ update = handle. wait( ) => ServeUpdate :: HandleUpdate ( update) ,
108
79
else => futures_util:: future:: pending( ) . await
109
80
}
110
81
}
@@ -456,7 +427,7 @@ impl AppRunner {
456
427
_ = std:: fs:: create_dir_all ( & cache_dir) ;
457
428
}
458
429
459
- pub async fn patch ( & mut self , bundle : AppBundle ) -> Result < ( ) > {
430
+ pub async fn patch ( & mut self , bundle : & AppBundle ) -> Result < ( ) > {
460
431
let Some ( running) = self . running . as_mut ( ) else {
461
432
return Ok ( ( ) ) ;
462
433
} ;
0 commit comments