DioxusLabs / dioxus

Fullstack app framework for web, desktop, mobile, and more.
https://dioxuslabs.com
Apache License 2.0
20.47k stars 786 forks source link

Check type of launch config #2125

Closed ealmloff closed 6 months ago

ealmloff commented 6 months ago

I ran into this issue a couple times while updating apps to the new launch builder API. The launch builder currently accepts any type and silently fails when you pass it the wrong type.

This can lead to situations where you pass in a config and see no errors, but your config is not applied.

This PR changes the launch builder to check the type of the config at compile type instead of using a boxed any type.

srid commented 6 months ago

Aside: I was wondering if this PR helped address this compile error with LaunchBuilder, but it didn't.

EDIT: Only happens when desktop feature is enabled along with liveview

jkelleyrtp commented 6 months ago

Played around with it locally but not super happy with it since we still have the platform methods here that don't work with the config they specify. Will likely punt on it unless there's a quick fix to allow Builder::desktop().with_cfg()

ealmloff commented 6 months ago

Played around with it locally but not super happy with it since we still have the platform methods here that don't work with the config they specify. Will likely punt on it unless there's a quick fix to allow Builder::desktop().with_cfg()

Builder::desktop().with_cfg()

now works even if you have the web feature enabled as well.