-
-
Notifications
You must be signed in to change notification settings - Fork 957
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: device hot-reload, tools-relative adb, auto port bind #3586
Conversation
packages/mobile/src/lib.rs
Outdated
} | ||
} | ||
|
||
static APP_FN_PTR: Mutex<Option<fn() -> Element>> = Mutex::new(None); | ||
static APP_OBJECTS: Mutex<Option<BoundLaunchObjects>> = Mutex::new(None); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be a thread local instead of a static? Box<dyn Any>
is not send or sync so this looks unsound
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to test on-device to see if the android on_load is guaranteed to be fired from the main thread...
there's a chance it's not and we might need to mess with how this is structured a bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay the way we do main
has weird semantics. I think technically this is fine since the program needs to terminate before the main()
call can finish up during load. I believe this the same case as an Rc
moving between threads being sound only if you can prove it moves completely. We actually do have an assurance the Box<dyn Any>
is not held onto anything from the main thread since the main thread no longer exists.
I'll add a note about this in the code.
Fixes a number of issues:
dx serve
) #3444dx serve
does not build if the process is backgrounded #3522 backgrounded issueAttempted and failed to get code-signing working. My old prototype doesn't work anymore.
This might get us close to polishing the number of CLI bugs I'm currently aware of.