Skip to content

Get web examples running again#2076

Merged
hecrj merged 5 commits into
iced-rs:masterfrom
Nisatru:run-web
Sep 9, 2023
Merged

Get web examples running again#2076
hecrj merged 5 commits into
iced-rs:masterfrom
Nisatru:run-web

Conversation

@Nisatru

@Nisatru Nisatru commented Sep 9, 2023

Copy link
Copy Markdown
Contributor

Heya!

First things first, thanks for developing this great library!

I recently started experimenting with integrating iced into an existing wgpu application that targets native as well as the web.

Im well aware that web is not the main focus of development, but since there are some examples that have some setup for running on the web, I updated them to build and run again.

The following (web) examples have been updated:

  • Counter
  • Integration
  • Todos
  • Tour

With getting the tour example running again this should fix #1522 .
The cause for the RuntimeError: unreachable as described in the issue #1522 back then is likely not the same as now, since the example changed in the meantime.

Anyways the issue description still fits the current situation "When starting the tours app it crashes on load (only web)".

The reason for the RuntimeError: unreachable is the line tracing_subscriber::fmt::init(); which panics when running on the web.

I added console_log for logging and a panic hook to also log panics in the browser console, similar to the integration example, so next time we encounter a RuntimeError: unreachable we should get a more descriptive error message.


I have also updated the READMEs where necessary.


Note: Text is not rendered on the web because no font is loaded, which is ignored here because it is another already known topic.

@hecrj hecrj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! Looks good. Just a small suggestion!

Hopefully we can remove the webgl feature soon!

Comment thread examples/tour/Cargo.toml Outdated
Comment thread examples/tour/Cargo.toml
@hecrj hecrj added this to the 0.12.0 milestone Sep 9, 2023

@hecrj hecrj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Awesome! Thanks 🙇

@hecrj hecrj enabled auto-merge September 9, 2023 21:16
@hecrj hecrj merged commit a3489e4 into iced-rs:master Sep 9, 2023
@Nisatru Nisatru deleted the run-web branch September 11, 2023 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tour example fails on the web: RuntimeError: unreachable

2 participants