summaryrefslogtreecommitdiffstats
path: root/examples/integration
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector@hecrj.dev>2023-09-09 23:24:54 +0200
committerLibravatar GitHub <noreply@github.com>2023-09-09 23:24:54 +0200
commita3489e4af960388e9f73988b88df361022a654a4 (patch)
treef5bb9754aa08c4e2f27a025cf570c2f40d369d2e /examples/integration
parente3aa8f71e6d27135ddc3bddf2a141fe42375b3f9 (diff)
parentfbc9ef74c406b2a58bb2a093262323e346faf485 (diff)
downloadiced-a3489e4af960388e9f73988b88df361022a654a4.tar.gz
iced-a3489e4af960388e9f73988b88df361022a654a4.tar.bz2
iced-a3489e4af960388e9f73988b88df361022a654a4.zip
Merge pull request #2076 from Nisatru/run-web
Get web examples running again
Diffstat (limited to 'examples/integration')
-rw-r--r--examples/integration/Cargo.toml5
-rw-r--r--examples/integration/src/main.rs2
2 files changed, 5 insertions, 2 deletions
diff --git a/examples/integration/Cargo.toml b/examples/integration/Cargo.toml
index 032cc75e..a4a961f8 100644
--- a/examples/integration/Cargo.toml
+++ b/examples/integration/Cargo.toml
@@ -10,11 +10,14 @@ iced_winit.workspace = true
iced_wgpu.workspace = true
iced_widget.workspace = true
+[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tracing-subscriber = "0.3"
[target.'cfg(target_arch = "wasm32")'.dependencies]
+iced_wgpu.workspace = true
+iced_wgpu.features = ["webgl"]
+
console_error_panic_hook = "0.1"
console_log = "1.0"
-log.workspace = true
wasm-bindgen = "0.2"
web-sys = { version = "0.3", features = ["Element", "HtmlCanvasElement", "Window", "Document"] }
diff --git a/examples/integration/src/main.rs b/examples/integration/src/main.rs
index af48af5f..d0b2d891 100644
--- a/examples/integration/src/main.rs
+++ b/examples/integration/src/main.rs
@@ -29,7 +29,7 @@ use winit::platform::web::WindowBuilderExtWebSys;
pub fn main() -> Result<(), Box<dyn std::error::Error>> {
#[cfg(target_arch = "wasm32")]
let canvas_element = {
- console_log::init_with_level(log::Level::Debug)?;
+ console_log::init().expect("Initialize logger");
std::panic::set_hook(Box::new(console_error_panic_hook::hook));