Closed fr-an-k closed 1 year ago
I found the shell scripts; it's a bit confusing that the instruction is in a different folder than the scripts.
When I run it in WSL it doesn't do anything, and it can't find the jq command used in the script.
It would be better to put egui_demo_app in the examples folder. The web version should be based on a quick and easy vite/wasm-pack based setup, so that newcomers can just get started with egui development right away, hot reloaded. Native hot-reload probably also requires a special setup that should be there.
It's a great and important project and deserves to be accessible to newcomers to Rust.
I guess a more portable xtask to run the web demo would be nice, if someone is willing and able to write one.
By the way, could you put your build output in a /details
tag? So other people reading the thread don't have to scroll through so many lines.
Shell scripts are inappropriate technology, especially for rust/web development.
It was quite easy to get egui examples running using vite-plugin-rsw, hot reloaded on a local webpage.
It should be automatically set up when you do it like this, but I haven't tried it:
npm init mpl@latest my-app -- --type wasm
Then add glow, egui_glow and eframe dependencies basically, with the same version, put code in lib.rs and run yarn dev
.
A main method has to be added for the web. Eframe's start_web documentation does not compile (in 0.21.x), but you can find the right usage in one of the examples.
I solved the issue for myself but unfortunately I don't have time to implement this for a pull request; I'm just leaving my thoughts here.
CodeSandbox can also do rust + wasm but it's not quite up to snuff yet.
I think it would be better to not use so many web oriented tools for the demo, though. Many people contributing to egui are not web devs, and might want to just quickly test their changes on the web demo to make sure they didn't break anything, without having to install all these tools. The shell scripts already allow that on linux and macOS, and are one missing command away from allowing it on Windows. That's why I think xtask would be a good alternative, as it removes all portability concerns and doesn't require anything more than the Rust toolchain you already need to build egui and eframe anyway.
Describe the bug Since the Android version crashes immediately on all my devices, the WSL version is aliased and buggy and the Windows version doesn't compile, I was hoping the web version could be my lifeline to adopt this in a commercial project while the others are getting fixed.
There is a link to the web demo but no instructions on how to run it yourself of how to get started with egui on the web (eframe_template doesn't explain it either and is not functional).
I spent days trying to get anything to work without success, while the documentation is very light and assuming.
The source code links in the demo refer to rust files, without a way to run it, and based on the complex main Cargo.toml which makes it impossible to get started with them or a new egui project.
The demo project is in the crates directory, rather than the examples, with no link to it anywhere. The instructions refer to .sh files, but they don't actually exist and would presumably be limited to a linux shell rather than being cross-platform.
To Reproduce Clone egui git, go to crates/egui_demo_app None of the instructions work, same for any other egui example out there.
The native build works on WSL, but the cursor does not work and the text is virtually unreadable due to aliasing; it does not appear as a supported platform.
Link to the Windows compilation bug that occurs with any egui-related example: https://github.com/emilk/egui/issues/2856 I suspect this just happens to be a temporary bug in one of the dependencies. My toolchain appears to be fine.
Expected behavior egui should have at least one working example/instructions for the promised platforms or not pretend that it does, it's very frustrating like this. The readymade web demo itself works fine.
Desktop (please complete the following information):