add a third party feature for freya

This commit is contained in:
Evan Almloff 2024-02-14 09:56:29 -06:00
parent f42bc61288
commit 5f8d0f6c40
3 changed files with 9 additions and 0 deletions

View file

@ -54,6 +54,8 @@ salvo = ["dioxus-fullstack?/salvo", "ssr", "dioxus-liveview?/salvo"]
warp = ["dioxus-fullstack?/warp", "ssr", "dioxus-liveview?/warp"]
rocket = ["dioxus-liveview?/rocket"]
tui = ["dioxus-tui", "dioxus-config-macro/tui"]
# This feature just disables the no-renderer-enabled warning
third-party-renderer = []
# This feature enables some nightly flags that make it more clear what structs/methods are available in each feature
nightly-doc = []

View file

@ -1,6 +1,10 @@
fn main() {
// Warn the user if they enabled the launch feature without any renderers
if feature_enabled("launch") {
if feature_enabled("third-party-renderer"){
return;
}
let liveview_renderers = [
"liveview",
"axum",

View file

@ -211,6 +211,9 @@ mod current_platform {
contexts: Vec<Box<super::ValidContext>>,
platform_config: (),
) {
#[cfg(feature = "third-party-renderer")]
panic!("No first party renderer feature enabled. It looks like you are trying to use a third party renderer. You will need to use the launch function from the third party renderer crate.");
panic!("No platform feature enabled. Please enable one of the following features: liveview, desktop, mobile, web, tui, fullstack to use the launch API.");
}
}