Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context / before
WebRunner::start
fails nothing is shown in HTML, the user has to open the console to see if something happened (a.k.a. halting problem)What changed / now
panic!
in this case (as it did)How does it look
What exactly changed
web-sys
loading_text
div that shows the spinner text during loading, or error if loading failsmain.rs
) after the app has been loaded, and remove the spinner, or show an errorloading_text
(like when someone removes the div fromindex.html
) - nothing happensDiscussion
web-sys
, but, I don't see any other simple way to access the spinnerjs
side (like it was before), however, I don't see a way to receive events fromWebRunner
lds-dual-ring
)Alternative solution
A more thorough solution (in
main.rs
) is master...sedsedus:eframe_template:fix-css-spinner-install-hook, where all panics are caught to show HTML error.I encountered this myself, where I would mistype the canvas id and wait a few seconds wondering why the app doesn't load, only to discover in the console that something failed.
This is more thorough (but at the same time a little more complex / less clean due to hook insertion) because this "invalid canvas id error" wouldn't get caught by the proposal in this PR