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

egui update, wgpu based runner ui works now on the web #156

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
15 changes: 10 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,16 @@ debug = true

[patch.crates-io]
# 2022-10-02 - crate update
eframe = { git = "https://github.com/emilk/egui", rev = "77df8ca0b0a949a713a9331b7c066df775aa6582" }
egui = { git = "https://github.com/emilk/egui", rev = "77df8ca0b0a949a713a9331b7c066df775aa6582" }
egui_extras = { git = "https://github.com/emilk/egui", rev = "77df8ca0b0a949a713a9331b7c066df775aa6582" }
egui_glow = { git = "https://github.com/emilk/egui", rev = "77df8ca0b0a949a713a9331b7c066df775aa6582" }
egui-wgpu = { git = "https://github.com/emilk/egui", rev = "77df8ca0b0a949a713a9331b7c066df775aa6582" }
#eframe = { git = "https://github.com/emilk/egui", rev = "77df8ca0b0a949a713a9331b7c066df775aa6582" }
#egui = { git = "https://github.com/emilk/egui", rev = "77df8ca0b0a949a713a9331b7c066df775aa6582" }
#egui_extras = { git = "https://github.com/emilk/egui", rev = "77df8ca0b0a949a713a9331b7c066df775aa6582" }
#egui_glow = { git = "https://github.com/emilk/egui", rev = "77df8ca0b0a949a713a9331b7c066df775aa6582" }
#egui-wgpu = { git = "https://github.com/emilk/egui", rev = "77df8ca0b0a949a713a9331b7c066df775aa6582" }
eframe = { path = "../egui/crates/eframe" }
egui = { path = "../egui/crates/egui" }
egui_extras = { path = "../egui/crates/egui_extras" }
egui_glow = { path = "../egui/crates/egui_glow" }
egui-wgpu = { path = "../egui/crates/egui-wgpu" }

# Because gltf hasn't published a new version: https://github.com/gltf-rs/gltf/issues/357
gltf = { git = "https://github.com/rerun-io/gltf", rev = "3c14ded73755d1ce9e47010edb06db63cb7e2cca" }
1 change: 1 addition & 0 deletions crates/re_viewer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,4 @@ puffin_http = { version = "0.10", optional = true }
[target.'cfg(target_arch = "wasm32")'.dependencies]
console_error_panic_hook = "0.1.6"
tracing-wasm = "0.2"
wasm-bindgen-futures = "0.4"
4 changes: 2 additions & 2 deletions crates/re_viewer/src/web.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use eframe::wasm_bindgen::{self, prelude::*};
/// You can add more callbacks like this if you want to call in to your code.
#[cfg(target_arch = "wasm32")]
#[wasm_bindgen]
pub fn start(canvas_id: &str) -> std::result::Result<(), eframe::wasm_bindgen::JsValue> {
pub async fn start(canvas_id: &str) -> std::result::Result<(), eframe::wasm_bindgen::JsValue> {
// Make sure panics are logged using `console.error`.
console_error_panic_hook::set_once();

Expand All @@ -29,7 +29,7 @@ pub fn start(canvas_id: &str) -> std::result::Result<(), eframe::wasm_bindgen::J
let app = crate::RemoteViewerApp::new(&cc.egui_ctx, cc.storage.as_deref(), url);
Box::new(app)
}),
)?;
).await?;

Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/setup_web.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cd "$script_path/.."

# Pre-requisites:
rustup target add wasm32-unknown-unknown
cargo install wasm-bindgen-cli --version 0.2.82
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remember to also run cargo update -p wasm-bindgen

cargo install wasm-bindgen-cli --version 0.2.83

# Required by build_web.sh:
packagesNeeded='binaryen jq'
Expand Down