Skip to content
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

Add WSL Desktop Dependency Section #294

Merged
merged 1 commit into from
Jul 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion src/components/desktop_dependencies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ enum Platform {
Windows,
MacOS,
Linux,
Wsl,
}

impl std::fmt::Display for Platform {
Expand All @@ -14,13 +15,19 @@ impl std::fmt::Display for Platform {
Platform::Windows => "Windows",
Platform::MacOS => "MacOS",
Platform::Linux => "Linux",
Platform::Wsl => "WSL",
};
write!(f, "{}", platform)
}
}

impl Platform {
const ALL: [Platform; 3] = [Platform::Windows, Platform::MacOS, Platform::Linux];
const ALL: [Platform; 4] = [
Platform::Windows,
Platform::MacOS,
Platform::Linux,
Platform::Wsl,
];
}

pub(crate) fn DesktopDependencies() -> Element {
Expand Down Expand Up @@ -56,6 +63,9 @@ pub(crate) fn DesktopDependencies() -> Element {
Platform::Linux => rsx! {
LinuxDependencies {}
},
Platform::Wsl => rsx! {
WslDependencies {}
},
};

let mut active = use_signal(|| false);
Expand Down Expand Up @@ -148,6 +158,26 @@ fn LinuxDependencies() -> Element {
}
}

fn WslDependencies() -> Element {
rsx! {
div {
p { "While it's doable, it can be tricky to setup development in WSL for Dioxus desktop. Not everything has been figured out and some stuff may not work." }
p { "Here are the steps we used to get Dioxus running through WSL."}
ol {
li { "Update your kernel to the latest version and update WSL to version 2." }
li { "Add `export DISPLAY=:0` to `~/.zshrc`" }
li {
"Install Tauri's Linux dependencies found "
Link { "here", to: "https://beta.tauri.app/start/prerequisites/" },
"."
}
li { "For file dialogs to work, you need to install a fallback like `zenity`"}
}
p { "When running Dioxus desktop on WSL, you may get warnings from `libEGL`. There is currently not a solution for these but the app should still render."}
}
}
}

fn MacOSDependencies() -> Element {
rsx! {
div {
Expand Down