1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-29 04:40:03 -04:00

eframe web: detect and report panics during startup (#2992)

* Detect panics during initialization and show them to the user

* PanicHandler now also logs the panics

* Add example of how to call into your app from JS

* Refactor: break out AppRunner and AppRunnerRef to own files

* Hide AppRunner

* Simplify user code

* AppRunnerRef -> WebRunner

* Better docs

* Don't paint until first animation frame

* Update multiple_apps.html

* Update web demo

* Cleanup and fixes

* left-align panic message in html
This commit is contained in:
Emil Ernerfeldt
2023-05-16 22:22:09 +02:00
committed by GitHub
parent ff8e4826b3
commit ea71b7f20b
15 changed files with 791 additions and 716 deletions

View File

@@ -2,15 +2,21 @@
#![allow(clippy::missing_errors_doc)] // So many `-> Result<_, JsValue>`
mod app_runner;
pub mod backend;
mod events;
mod input;
mod panic_handler;
pub mod screen_reader;
pub mod storage;
mod text_agent;
mod web_logger;
mod web_runner;
pub(crate) use app_runner::AppRunner;
pub use panic_handler::{PanicHandler, PanicSummary};
pub use web_logger::WebLogger;
pub use web_runner::WebRunner;
#[cfg(not(any(feature = "glow", feature = "wgpu")))]
compile_error!("You must enable either the 'glow' or 'wgpu' feature");
@@ -31,12 +37,9 @@ pub use backend::*;
pub use events::*;
pub use storage::*;
use std::collections::BTreeMap;
use std::sync::Arc;
use egui::Vec2;
use wasm_bindgen::prelude::*;
use web_sys::{EventTarget, MediaQueryList};
use web_sys::MediaQueryList;
use input::*;