emilk / egui

egui: an easy-to-use immediate mode GUI in Rust that runs on both web and native
https://www.egui.rs/
Apache License 2.0
20.65k stars 1.5k forks source link

no instructions on how to run web demo #2859

Closed fr-an-k closed 1 year ago

fr-an-k commented 1 year ago

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):

fr-an-k commented 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.

``` Downloaded basic-http-server v0.8.1 Downloaded 1 crate (21.7 KB) in 1.00s Installing basic-http-server v0.8.1 Updating crates.io index Blocking waiting for file lock on package cache Installing wasm-bindgen-cli v0.2.84 Blocking waiting for file lock on package cache Downloaded quote v0.6.13 Downloaded serde v1.0.159 Downloaded serde_derive v1.0.159 Downloaded proc-macro2 v1.0.54 Downloaded serde_json v1.0.95 Downloaded syn v0.15.44 Downloaded proc-macro2 v0.4.30 Downloaded pest v2.5.7 Downloaded pest_generator v2.5.7 Downloaded pest_meta v2.5.7 Downloaded syn v2.0.12 Downloaded crossbeam-queue v0.1.2 Downloaded lock_api v0.3.4 Downloaded unicode-xid v0.1.0 Downloaded rustc_version v0.2.3 Downloaded pin-project-internal v0.4.30 Downloaded http v0.1.21 Downloaded mio-uds v0.6.8 Downloaded pest_derive v2.5.7 Downloaded unicase v2.6.0 Downloaded smallvec v0.6.14 Downloaded futures-channel-preview v0.3.0-alpha.19 Downloaded humantime v1.3.0 Downloaded string v0.2.1 Downloaded unchecked-index v0.2.2 Downloaded twoway v0.2.2 Downloaded unicode_categories v0.1.1 Downloaded typed-arena v1.7.0 Downloaded derive_more v0.15.0 Downloaded futures-sink-preview v0.3.0-alpha.19 Downloaded pin-project v0.4.30 Downloaded parking_lot v0.9.0 Downloaded itoa v0.4.8 Downloaded futures-core-preview v0.3.0-alpha.19 Downloaded entities v1.0.1 Downloaded quick-error v1.2.3 Downloaded futures-executor-preview v0.3.0-alpha.19 Downloaded futures-util-preview v0.3.0-alpha.19 Downloaded futures-preview v0.3.0-alpha.19 Downloaded bytes v0.4.12 Downloaded semver-parser v0.7.0 Downloaded semver v0.9.0 Downloaded memoffset v0.5.6 Downloaded crossbeam-channel v0.3.9 Downloaded handlebars v1.1.0 Downloaded futures-io-preview v0.3.0-alpha.19 Downloaded parking_lot_core v0.6.3 Downloaded mime_guess v2.0.4 Downloaded maybe-uninit v2.0.0 Downloaded crossbeam-utils v0.6.6 Downloaded crossbeam-deque v0.7.4 Downloaded crossbeam-epoch v0.8.2 Downloaded generic-array v0.14.7 Downloaded crossbeam-utils v0.7.2 Downloaded env_logger v0.6.2 Downloaded comrak v0.6.2 Downloaded hyper v0.13.0-alpha.4 Downloaded tokio-io v0.2.0-alpha.6 Downloaded tokio-fs v0.2.0-alpha.6 Downloaded tokio-net v0.2.0-alpha.6 Downloaded tower-service v0.3.0-alpha.2 Downloaded tokio-codec v0.2.0-alpha.6 Downloaded tokio-timer v0.3.0-alpha.6 Downloaded tokio-macros v0.2.0-alpha.6 Downloaded http-body v0.2.0-alpha.3 Downloaded structopt-derive v0.2.18 Downloaded tower-make v0.3.0-alpha.2a Downloaded structopt v0.2.18 Downloaded tokio v0.2.0-alpha.6 Downloaded tokio-sync v0.2.0-alpha.6 Downloaded tokio-executor v0.2.0-alpha.6 Downloaded h2 v0.2.0-alpha.3 Downloaded 72 crates (3.0 MB) in 1.34s Blocking waiting for file lock on package cache Compiling proc-macro2 v1.0.54 Compiling unicode-ident v1.0.8 Compiling quote v1.0.26 Compiling libc v0.2.140 Compiling autocfg v1.1.0 Compiling memchr v2.5.0 Compiling log v0.4.17 Compiling syn v1.0.109 Compiling cfg-if v1.0.0 Compiling cfg-if v0.1.10 Compiling futures-core-preview v0.3.0-alpha.19 Compiling lazy_static v1.4.0 Compiling futures-sink-preview v0.3.0-alpha.19 Compiling maybe-uninit v2.0.0 Compiling byteorder v1.4.3 Compiling pin-project-internal v0.4.30 Compiling semver-parser v0.7.0 Compiling thiserror v1.0.40 Compiling pin-utils v0.1.0 Compiling futures-io-preview v0.3.0-alpha.19 Compiling fnv v1.0.7 Compiling scopeguard v1.1.0 Compiling crossbeam-utils v0.6.6 Compiling once_cell v1.17.1 Compiling version_check v0.9.4 Downloaded linux-raw-sys v0.3.1 Compiling pin-project-lite v0.2.9 Downloaded threadpool v1.8.1 Downloaded tempfile v3.5.0 Downloaded multipart v0.18.0 Downloaded env_logger v0.8.4 Downloaded safemem v0.3.3 Downloaded id-arena v2.2.1 Compiling futures-channel-preview v0.3.0-alpha.19 Downloaded wit-text v0.8.0 Downloaded wasmparser v0.59.0 Downloaded wasm-bindgen-cli-support v0.2.84 Downloaded tiny_http v0.12.0 Downloaded wit-schema-version v0.1.0 Downloaded wit-walrus v0.6.0 Downloaded wasm-bindgen-wasm-interpreter v0.2.84 Downloaded wasm-bindgen-externref-xform v0.2.84 Downloaded wit-parser v0.2.0 Downloaded wasm-bindgen-threads-xform v0.2.84 Downloaded walrus v0.19.0 Compiling semver v0.9.0 Downloaded twoway v0.1.8 Downloaded wasm-bindgen-wasm-conventions v0.2.84 Downloaded wit-writer v0.2.0 Compiling proc-macro2 v0.4.30 Downloaded wit-validator v0.2.1 Downloaded wasm-bindgen-multi-value-xform v0.2.84 Downloaded walrus-macro v0.19.0 Downloaded buf_redux v0.8.4 Downloaded wast v21.0.0 Downloaded rouille v3.6.1 Compiling ucd-trie v0.1.5 Downloaded wasmparser v0.77.0 Downloaded base64 v0.9.3 Downloaded chunked_transfer v1.4.1 Downloaded ascii v1.1.0 Downloaded leb128 v0.2.5 Downloaded docopt v1.1.1 Downloaded rustix v0.37.5 Downloaded 34 crates (2.4 MB) in 0.32s Compiling tracing-core v0.1.30 Compiling unicode-xid v0.1.0 Compiling autocfg v1.1.0 ] 12/187: quote(build.rs), futures-channel-preview, tracing-core, semver, pin-project-internal(build.rs), log(build.rs), t... Compiling libc v0.2.140 Compiling cfg-if v1.0.0 Compiling proc-macro2 v1.0.54 Compiling unicode-ident v1.0.8 Compiling quote v1.0.26 Compiling version_check v0.9.4 Compiling crossbeam-utils v0.8.15 Compiling log v0.4.17 Compiling leb128 v0.2.5 Compiling scopeguard v1.1.0 Compiling anyhow v1.0.70 Compiling rayon-core v1.11.0 Compiling pkg-config v0.3.26 Compiling syn v1.0.109 Compiling cc v1.0.79 Compiling either v1.8.1 Compiling unicode-segmentation v1.10.1 Compiling slab v0.4.8 Compiling memchr v2.5.0 ] 13/187: quote(build.rs), futures-channel-preview, tracing-core, semver, pin-project-internal(build.rs), log(build.rs), t... Compiling wasmparser v0.77.0 Compiling memoffset v0.5.6 Compiling crossbeam-utils v0.7.2 Compiling crossbeam-epoch v0.8.2 Compiling rustc_version v0.2.3 Compiling unicase v2.6.0 Compiling typenum v1.16.0 Compiling io-lifetimes v1.0.9 Compiling crossbeam-channel v0.3.9 Compiling serde_derive v1.0.159 Compiling serde v1.0.159 Compiling crossbeam-queue v0.1.2 Compiling rustix v0.37.5 Compiling serde_derive v1.0.159 Compiling syn v0.15.44 Compiling smallvec v0.6.14 Compiling indexmap v1.9.3 Compiling lock_api v0.3.4 Compiling unicase v2.6.0 Compiling regex-syntax v0.6.29 Compiling parking_lot_core v0.6.3 Compiling heck v0.3.3 Compiling parking_lot v0.9.0 Compiling memoffset v0.8.0 Compiling crossbeam-epoch v0.9.14 Compiling aho-corasick v0.7.20 Compiling unicode-width v0.1.10 Compiling generic-array v0.14.7 Compiling serde v1.0.159 Compiling wit-schema-version v0.1.0 Compiling num-traits v0.2.15 Compiling quote v0.6.13 Compiling bitflags v1.3.2 Compiling itoa v0.4.8 Compiling safemem v0.3.3 Compiling syn v2.0.12 Compiling linux-raw-sys v0.3.1 Compiling tinyvec_macros v0.1.1 Compiling futures-util-preview v0.3.0-alpha.19 Compiling tinyvec v1.6.0 Compiling num-integer v0.1.45 Compiling textwrap v0.11.0 Compiling iovec v0.1.4 Compiling crossbeam-channel v0.5.7 Compiling httparse v1.8.0 Compiling fastrand v1.9.0 Compiling bytes v0.4.12 Compiling serde_json v1.0.95 Compiling num_cpus v1.15.0 Compiling ppv-lite86 v0.2.17 Compiling net2 v0.2.38 Compiling atty v0.2.14 Compiling quick-error v1.2.3 Compiling mio v0.6.23 Compiling openssl-sys v0.9.83 Compiling http v0.1.21 Compiling strsim v0.8.0 Compiling hashbrown v0.12.3 Compiling libz-sys v1.1.8 Compiling mime_guess v2.0.4 Compiling syn v2.0.12 Compiling crossbeam-deque v0.8.3 Compiling crossbeam-deque v0.7.4 Compiling bitflags v1.3.2 Compiling curl-sys v0.4.61+curl-8.0.1 Compiling aho-corasick v0.7.20 Compiling vec_map v0.8.2 Compiling wit-parser v0.2.0 Compiling wit-writer v0.2.0 Compiling regex v1.7.3 Compiling serde_json v1.0.95 Compiling unicode-normalization v0.1.22 Compiling httparse v1.8.0 Compiling mio-uds v0.6.8 Compiling percent-encoding v2.2.0 Compiling unicode-segmentation v1.10.1 Compiling ryu v1.0.13 Compiling wasm-bindgen-shared v0.2.84 Compiling regex-syntax v0.6.29 Compiling ansi_term v0.12.1 Compiling num_cpus v1.15.0 Compiling heck v0.3.3 Compiling getrandom v0.2.8 Compiling crypto-common v0.1.6 Compiling block-buffer v0.10.4 Compiling string v0.2.1 Compiling rand_core v0.6.4 Compiling tokio-sync v0.2.0-alpha.6 Compiling mime v0.3.17 Compiling clap v2.34.0 Compiling itoa v1.0.6 Compiling mime_guess v2.0.4 Compiling unicode-bidi v0.3.13 Compiling digest v0.10.6 Compiling same-file v1.0.6 Compiling itoa v1.0.6 Compiling ryu v1.0.13 Compiling rand_chacha v0.3.1 Compiling tower-service v0.3.0-alpha.2 Compiling form_urlencoded v1.1.0 Compiling try-lock v0.2.4 Compiling rand v0.8.5 Compiling unchecked-index v0.2.2 Compiling http-body v0.2.0-alpha.3 Compiling idna v0.3.0 Compiling want v0.3.0 Compiling twoway v0.2.2 Compiling walkdir v2.3.3 Compiling futures-executor-preview v0.3.0-alpha.19 Compiling humantime v1.3.0 Compiling rayon v1.7.0 Compiling time v0.1.45 Compiling twoway v0.1.8 Compiling entities v1.0.1 Compiling buf_redux v0.8.4 Compiling wast v21.0.0 Compiling typed-arena v1.7.0 Compiling cpufeatures v0.2.6 Compiling unicode_categories v0.1.1 Compiling quick-error v1.2.3 Compiling wasmparser v0.59.0 Compiling termcolor v1.2.0 Compiling mime v0.3.17 Compiling curl v0.4.44 Compiling time-core v0.1.0 Compiling futures-preview v0.3.0-alpha.19 Compiling structopt-derive v0.2.18 Compiling iana-time-zone v0.1.54 Compiling thiserror-impl v1.0.40 Compiling percent-encoding v2.2.0 Compiling byteorder v1.4.3 Compiling env_logger v0.6.2 Compiling regex v1.7.3 Compiling num_threads v0.1.6 Compiling ascii v1.1.0 Compiling httpdate v1.0.2 Compiling chunked_transfer v1.4.1 Compiling tempfile v3.5.0 Compiling time v0.3.20 Compiling base64 v0.9.3 Compiling multipart v0.18.0 Compiling wit-validator v0.2.1 Compiling tiny_http v0.12.0 Compiling structopt v0.2.18 Compiling chrono v0.4.24 Compiling sha1 v0.10.5 Compiling url v2.3.1 Compiling threadpool v1.8.1 Compiling atty v0.2.14 Compiling wit-text v0.8.0 Compiling id-arena v2.2.1 Compiling pest v2.5.7 Compiling filetime v0.2.20 Compiling socket2 v0.4.9 Compiling tracing-attributes v0.1.23 Compiling lazy_static v1.4.0 Compiling tokio-macros v0.2.0-alpha.6 Compiling derive_more v0.15.0 Compiling termcolor v1.2.0 Compiling strsim v0.10.0 Compiling humantime v2.1.0 Compiling openssl-probe v0.1.5 Compiling base64 v0.13.1 Compiling rustc-demangle v0.1.22 Compiling pest_meta v2.5.7 Compiling env_logger v0.8.4 Compiling pest_generator v2.5.7 Compiling walrus-macro v0.19.0 Compiling pin-project v0.4.30 Compiling tokio-io v0.2.0-alpha.6 Compiling tracing v0.1.37 Compiling tokio-codec v0.2.0-alpha.6 Compiling tower-make v0.3.0-alpha.2a Compiling tokio-executor v0.2.0-alpha.6 Compiling pest_derive v2.5.7 Compiling h2 v0.2.0-alpha.3 Compiling tokio-net v0.2.0-alpha.6 Compiling tokio-timer v0.3.0-alpha.6 Compiling tokio-fs v0.2.0-alpha.6 Compiling comrak v0.6.2 Compiling walrus v0.19.0 Compiling tokio v0.2.0-alpha.6 Compiling hyper v0.13.0-alpha.4 Compiling handlebars v1.1.0 Compiling wasm-bindgen-wasm-conventions v0.2.84 Compiling wasm-bindgen-externref-xform v0.2.84 Compiling wasm-bindgen-multi-value-xform v0.2.84 Compiling wit-walrus v0.6.0 Compiling wasm-bindgen-wasm-interpreter v0.2.84 Compiling wasm-bindgen-threads-xform v0.2.84 Compiling docopt v1.1.1 Compiling wasm-bindgen-cli-support v0.2.84 Compiling rouille v3.6.1 Compiling basic-http-server v0.8.1 Compiling wasm-bindgen-cli v0.2.84 Finished release [optimized] target(s) in 1m 00s Installing /home/frank/.cargo/bin/basic-http-server Installed package `basic-http-server v0.8.1` (executable `basic-http-server`) starting server… serving at http://localhost:8888 [INFO ] basic-http-server 0.8.1 [INFO ] addr: http://127.0.0.1:8888 [INFO ] root dir: . [INFO ] extensions: false Finished release [optimized] target(s) in 1m 00s Installing /home/frank/.cargo/bin/wasm-bindgen Installing /home/frank/.cargo/bin/wasm-bindgen-test-runner Installing /home/frank/.cargo/bin/wasm2es6js Installed package `wasm-bindgen-cli v0.2.84` (executables `wasm-bindgen`, `wasm-bindgen-test-runner`, `wasm2es6js`) Building rust… Downloaded spin v0.5.2 Downloaded rustls v0.20.8 Downloaded webpki-roots v0.22.6 Downloaded poll-promise v0.2.0 Downloaded shlex v1.1.0 Downloaded ureq v2.6.2 Downloaded tracing-wasm v0.2.1 Downloaded oxilangtag v0.1.3 Downloaded atomic_refcell v0.1.9 Downloaded ehttp v0.2.0 Downloaded peeking_take_while v0.1.2 Downloaded dyn-clonable-impl v0.9.0 Downloaded bindgen v0.64.0 Downloaded dyn-clone v1.0.10 Downloaded clang-sys v1.4.0 Downloaded dyn-clonable v0.9.0 Downloaded jobserver v0.1.25 Downloaded webpki v0.22.0 Downloaded untrusted v0.7.1 Downloaded sct v0.7.0 Downloaded speech-dispatcher v0.16.0 Downloaded wasm-bindgen-futures v0.4.34 Downloaded ring v0.16.20 Downloaded cexpr v0.6.0 Downloaded speech-dispatcher-sys v0.7.0 Downloaded tts v0.25.0 Downloaded 26 crates (6.3 MB) in 1.15s (largest was `ring` at 5.1 MB) Compiling cfg-if v1.0.0 Compiling wasm-bindgen-shared v0.2.84 Compiling once_cell v1.17.0 Compiling bumpalo v3.12.0 Compiling wasm-bindgen v0.2.84 Compiling bitflags v1.3.2 Compiling ttf-parser v0.18.1 Compiling pin-project-lite v0.2.9 Compiling ab_glyph_rasterizer v0.1.8 Compiling serde v1.0.152 Compiling num-traits v0.2.15 Compiling num-integer v0.1.45 Compiling ahash v0.8.3 Compiling crc32fast v1.3.2 Compiling adler v1.0.2 Compiling atomic_refcell v0.1.9 Compiling libc v0.2.139 Compiling nohash-hasher v0.2.0 Compiling bytemuck v1.13.0 Compiling base64 v0.13.1 Compiling num-rational v0.4.1 Compiling lazy_static v1.4.0 Compiling tracing-core v0.1.30 Compiling slotmap v1.0.6 Compiling miniz_oxide v0.6.2 Compiling thiserror v1.0.38 Compiling memoffset v0.6.5 Compiling dyn-clonable-impl v0.9.0 Compiling log v0.4.17 Compiling dyn-clone v1.0.10 Compiling color_quant v1.1.0 Compiling jpeg-decoder v0.3.0 Compiling tts v0.25.0 Compiling byteorder v1.4.3 Compiling sharded-slab v0.1.4 Compiling thread_local v1.1.4 Compiling oxilangtag v0.1.3 Compiling percent-encoding v2.2.0 Compiling wasm-bindgen-backend v0.2.84 Compiling tracing v0.1.37 Compiling flate2 v1.0.25 Compiling static_assertions v1.1.0 Compiling unicode_names2 v0.6.0 Compiling poll-promise v0.2.0 Compiling time v0.1.45 Compiling png v0.17.7 Compiling dyn-clonable v0.9.0 Compiling tracing-subscriber v0.3.16 Compiling wasm-bindgen-macro-support v0.2.84 Compiling owned_ttf_parser v0.18.1 Compiling ab_glyph v0.2.20 Compiling image v0.24.5 Compiling wasm-bindgen-macro v0.2.84 Compiling ecolor v0.21.0 (/home/frank/repos/egui/crates/ecolor) Compiling emath v0.21.0 (/home/frank/repos/egui/crates/emath) Compiling ron v0.8.0 Compiling enum-map v2.4.2 Compiling epaint v0.21.0 (/home/frank/repos/egui/crates/epaint) Compiling js-sys v0.3.61 Compiling console_error_panic_hook v0.1.7 Compiling tracing-wasm v0.2.1 Compiling egui v0.21.0 (/home/frank/repos/egui/crates/egui) Compiling web-sys v0.3.61 Compiling iana-time-zone v0.1.53 Compiling chrono v0.4.23 Compiling wasm-bindgen-futures v0.4.34 Compiling egui_extras v0.21.0 (/home/frank/repos/egui/crates/egui_extras) Compiling egui_demo_lib v0.21.0 (/home/frank/repos/egui/crates/egui_demo_lib) Compiling glow v0.12.0 Compiling ehttp v0.2.0 Compiling egui_glow v0.21.0 (/home/frank/repos/egui/crates/egui_glow) Compiling eframe v0.21.3 (/home/frank/repos/egui/crates/eframe) Compiling egui_demo_app v0.21.0 (/home/frank/repos/egui/crates/egui_demo_app) Finished release [optimized] target(s) in 12.00s ./sh/build_demo_web.sh: line 65: jq: command not found Downloaded accesskit_consumer v0.14.1 Downloaded imagesize v0.10.1 Downloaded gpu-allocator v0.21.0 Downloaded simplecss v0.2.1 Downloaded usvg v0.28.0 Downloaded wgpu-hal v0.15.1 Downloaded wgpu-core v0.15.0 Downloaded wgpu-types v0.15.0 Downloaded windows-implement v0.44.0 Downloaded zstd v0.11.2+zstd.1.5.2 Downloaded zstd-safe v5.0.2+zstd.1.5.2 Downloaded block-buffer v0.10.3 Downloaded async-trait v0.1.64 Downloaded block2 v0.2.0-alpha.6 Downloaded malloc_buf v0.0.6 Downloaded jni-sys v0.3.0 Downloaded rgb v0.8.35 Downloaded rfd v0.11.0 Downloaded objc v0.2.7 Downloaded toml_datetime v0.5.1 Downloaded cairo-sys-rs v0.16.3 Downloaded valuable v0.1.0 Downloaded android-properties v0.2.2 Downloaded toml_edit v0.18.1 Downloaded system-deps v6.0.3 Downloaded cxx-build v1.0.89 Downloaded errno-dragonfly v0.1.2 Downloaded core-foundation-sys v0.8.3 Downloaded core-foundation v0.9.3 Downloaded android_system_properties v0.1.5 Downloaded num_enum_derive v0.5.9 Downloaded redox_syscall v0.2.16 Downloaded num_enum v0.5.9 Downloaded atspi-macros v0.2.0 Downloaded gobject-sys v0.16.3 Downloaded wasi v0.11.0+wasi-snapshot-preview1 Downloaded kurbo v0.8.3 Downloaded zstd-sys v2.0.6+zstd.1.5.2 Downloaded ndk-context v0.1.1 Downloaded zvariant_derive v3.10.0 Downloaded cxxbridge-flags v1.0.89 Downloaded error-code v2.3.1 Downloaded io-lifetimes v1.0.6 Downloaded wepoll-ffi v0.1.2 Downloaded objc2-encode v2.0.0-pre.2 Downloaded proc-macro-crate v1.3.0 Downloaded ordered-stream v0.1.4 Downloaded windows-targets v0.42.1 Downloaded pango-sys v0.16.3 Downloaded zbus_macros v3.9.0 Downloaded zvariant v3.10.0 Downloaded xmlparser v0.13.5 Downloaded winapi-wsapoll v0.1.1 Downloaded jni v0.20.0 Downloaded android-activity v0.4.0 Downloaded gdk-pixbuf-sys v0.16.3 Downloaded polling v2.5.2 Downloaded uds_windows v1.0.2 Downloaded wasi v0.10.0+wasi-snapshot-preview1 Downloaded redox_users v0.4.3 Downloaded objc_exception v0.1.2 Downloaded version-compare v0.1.1 Downloaded errno v0.2.8 Downloaded scratch v1.0.3 Downloaded rustc-demangle v0.1.21 Downloaded cxxbridge-macro v1.0.89 Downloaded windows_i686_msvc v0.42.1 Downloaded rustix v0.36.9 Downloaded redox_syscall v0.3.4 Downloaded ruzstd v0.3.0 Downloaded gio-sys v0.16.3 Downloaded windows_i686_gnu v0.42.1 Downloaded atspi v0.10.1 Downloaded objc-foundation v0.1.1 Downloaded link-cplusplus v1.0.8 Downloaded iana-time-zone-haiku v0.1.1 Downloaded fastrand v1.8.0 Downloaded serde_json v1.0.92 Downloaded objc2 v0.3.0-beta.3 Downloaded cxx v1.0.89 Downloaded objc-sys v0.2.0-beta.2 Downloaded zbus v3.9.0 Downloaded clipboard-win v4.5.0 Downloaded slab v0.4.7 Downloaded gtk-sys v0.16.0 Downloaded core-graphics-types v0.1.1 Downloaded core-graphics v0.22.3 Downloaded combine v4.6.6 Downloaded roxmltree v0.15.1 Downloaded puffin v0.14.2 Downloaded gimli v0.27.1 Downloaded futures-task v0.3.26 Downloaded nom8 v0.2.0 Downloaded futures-core v0.3.26 Downloaded dispatch v0.2.0 Downloaded cgl v0.3.2 Downloaded accesskit_unix v0.3.2 Downloaded glib-sys v0.16.3 Downloaded gdk-sys v0.16.0 Downloaded ndk-sys v0.4.1+23.1.7779620 Downloaded windows_aarch64_msvc v0.42.1 Downloaded async-broadcast v0.5.0 Downloaded windows_aarch64_gnullvm v0.42.1 Downloaded str-buf v1.0.6 Downloaded metal v0.24.0 Downloaded orbclient v0.3.42 Downloaded cfg-expr v0.11.0 Downloaded cesu8 v1.1.0 Downloaded accesskit_macos v0.6.2 Downloaded async-io v1.12.0 Downloaded objc_id v0.1.1 Downloaded ndk v0.7.0 Downloaded pollster v0.3.0 Downloaded pico-args v0.5.0 Downloaded paste v1.0.11 Downloaded glutin_wgl_sys v0.4.0 Downloaded futures-util v0.3.26 Downloaded futures-sink v0.3.26 Downloaded atk-sys v0.16.0 Downloaded d3d12 v0.6.0 Downloaded float-cmp v0.9.0 Downloaded block-sys v0.1.0-beta.1 Downloaded async-recursion v1.0.2 Downloaded async-lock v2.6.0 Downloaded windows_x86_64_gnullvm v0.42.1 Downloaded accesskit_windows v0.13.2 Downloaded windows-interface v0.44.0 Downloaded svgtypes v0.8.2 Downloaded data-url v0.2.0 Downloaded wgpu v0.15.0 Downloaded type-map v0.5.0 Downloaded socket2 v0.4.7 Downloaded serde_repr v0.1.10 Downloaded resvg v0.28.0 Downloaded rctree v0.5.0 Downloaded range-alloc v0.1.2 Downloaded puffin_http v0.11.1 Downloaded windows_x86_64_gnu v0.42.1 Downloaded windows_x86_64_msvc v0.42.1 Downloaded windows-sys v0.45.0 Downloaded windows-sys v0.42.0 Downloaded futures-io v0.3.26 Downloaded windows v0.43.0 Downloaded windows v0.44.0 Downloaded 144 crates (42.1 MB) in 1.62s (largest was `windows` at 11.5 MB) ```

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.

YgorSouza commented 1 year ago

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.

fr-an-k commented 1 year ago

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.

YgorSouza commented 1 year ago

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.