Don't install console panic hook and tracing wasm subscriber in egui_web (#1230)
Do so in egui_demo_app instead
This commit is contained in:
parent
2f042ababd
commit
1ebb5ccabf
|
@ -1039,9 +1039,11 @@ dependencies = [
|
|||
name = "egui_demo_app"
|
||||
version = "0.16.0"
|
||||
dependencies = [
|
||||
"console_error_panic_hook",
|
||||
"eframe",
|
||||
"egui_demo_lib",
|
||||
"tracing-subscriber",
|
||||
"tracing-wasm",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -1095,7 +1097,6 @@ name = "egui_web"
|
|||
version = "0.16.0"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
"console_error_panic_hook",
|
||||
"egui",
|
||||
"egui_glow",
|
||||
"epi",
|
||||
|
@ -1103,7 +1104,6 @@ dependencies = [
|
|||
"ron",
|
||||
"serde",
|
||||
"tracing",
|
||||
"tracing-wasm",
|
||||
"tts",
|
||||
"wasm-bindgen",
|
||||
"wasm-bindgen-futures",
|
||||
|
|
|
@ -30,3 +30,7 @@ eframe = { version = "0.16.0", path = "../eframe" }
|
|||
|
||||
egui_demo_lib = { version = "0.16.0", path = "../egui_demo_lib", features = ["extra_debug_asserts"] }
|
||||
tracing-subscriber = "0.3"
|
||||
|
||||
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||
console_error_panic_hook = "0.1.6"
|
||||
tracing-wasm = "0.2"
|
|
@ -13,6 +13,12 @@ use eframe::wasm_bindgen::{self, prelude::*};
|
|||
#[cfg(target_arch = "wasm32")]
|
||||
#[wasm_bindgen]
|
||||
pub fn start(canvas_id: &str) -> Result<(), wasm_bindgen::JsValue> {
|
||||
// Make sure panics are logged using `console.error`.
|
||||
console_error_panic_hook::set_once();
|
||||
|
||||
// Redirect tracing to console.log and friends:
|
||||
tracing_wasm::set_as_global_default();
|
||||
|
||||
let app = egui_demo_lib::WrapApp::default();
|
||||
eframe::start_web(canvas_id, Box::new(app))
|
||||
}
|
||||
|
|
|
@ -56,10 +56,8 @@ egui_glow = { version = "0.16.0",path = "../egui_glow", default-features = false
|
|||
epi = { version = "0.16.0", path = "../epi" }
|
||||
|
||||
bytemuck = "1.7"
|
||||
console_error_panic_hook = "0.1.6"
|
||||
js-sys = "0.3"
|
||||
tracing = "0.1"
|
||||
tracing-wasm = "0.2"
|
||||
wasm-bindgen = "0.2"
|
||||
wasm-bindgen-futures = "0.4"
|
||||
|
||||
|
|
|
@ -281,12 +281,6 @@ impl AppRunner {
|
|||
/// Install event listeners to register different input events
|
||||
/// and start running the given app.
|
||||
pub fn start(canvas_id: &str, app: Box<dyn epi::App>) -> Result<AppRunnerRef, JsValue> {
|
||||
// Make sure panics are logged using `console.error`.
|
||||
console_error_panic_hook::set_once();
|
||||
|
||||
// Redirect tracing to console.log and friends:
|
||||
tracing_wasm::set_as_global_default();
|
||||
|
||||
let mut runner = AppRunner::new(canvas_id, app)?;
|
||||
runner.warm_up()?;
|
||||
start_runner(runner)
|
||||
|
|
Loading…
Reference in New Issue