trunk icon indicating copy to clipboard operation
trunk copied to clipboard

Error overlay in rendered html

Open lukechu10 opened this issue 3 years ago • 4 comments

When an error occurs in Trunk, whether it's in the Rust compilation or a unresolved file, it would be great for Trunk to create an overlay in the generated html to display the error to the user. Snowpack, a JS bundler, has one of the most esthetically pleasing error overlays out there: image

lukechu10 avatar Mar 05 '21 22:03 lukechu10

Love it. This will tie in quite nicely with our work on the WebSocket auto-reload feature.

I’ll get this issue triaged and labeled shortly.

thedodd avatar Mar 06 '21 00:03 thedodd

I’m thinking that what we will want to do is actually build a mini WASM app which we can put on our release page. It will encapsulate all of the WebSocket log, overlay code/css &c. Then we inject that code when running in dev mode.

thedodd avatar Mar 06 '21 00:03 thedodd

I’m thinking that what we will want to do is actually build a mini WASM app which we can put on our release page. It will encapsulate all of the WebSocket log, overlay code/css &c. Then we inject that code when running in dev mode.

Is a Rust WASM app, no matter how "mini" really necessary? I believe it would be much simpler to write it in about 100 lines of good ol' JS and be done with it. Really, all we need to do is listen for a message on a web socket and reload the page or display an error in a modal.

In addition, even a simple WASM app that interfaces with DOM using web-sys would be 50KB at best and 90+ KB at worst.

lukechu10 avatar Mar 06 '21 01:03 lukechu10

I would like to work on this.

lukechu10 avatar Aug 22 '21 23:08 lukechu10

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Nov 30 '23 00:11 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Dec 05 '23 00:12 github-actions[bot]