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

Get web examples running again #2076

Merged
merged 5 commits into from Sep 9, 2023
Merged

Get web examples running again #2076

merged 5 commits into from Sep 9, 2023

Conversation

Nisatru
Copy link
Contributor

@Nisatru Nisatru commented Sep 9, 2023

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.

Copy link
Member

@hecrj hecrj left a comment

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!

examples/tour/Cargo.toml Outdated Show resolved Hide resolved
examples/tour/Cargo.toml Show resolved Hide resolved
@hecrj hecrj added this to the 0.12.0 milestone Sep 9, 2023
Copy link
Member

@hecrj hecrj left a comment

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
12 checks passed
@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