halfzebra / create-elm-app

🍃 Create Elm apps with zero configuration

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

suggestion: stop scrapping DOM and model on error

jligeza opened this issue · comments

Every time I make an error in code, the entire DOM (and model) is scrapped and replaced with an error report. It would be so much better if it worked like parcel - an overlay with error report is added, and when the error is fixed, the overlay is removed and the app updated with HMR. I think it would be even better if the error was only displayed in console - literally everything is better than resetting the model. With the current behavior, HMR is almost useless.

Hello Jakub!

Indeed this is a very good suggestion, I was looking into fixing this quite a while ago in it was not possible due to some internal webpack-related technical decisions. I will give this another stab when I'll have time and we'll see how it goes 🙂

This is big. As it stands, the user gets a major punishment for making any typo or error in their code. Hitting save is like Russian Roulette!

Hi Duncan!

Thank you for your feedback!
I have a POC of error overlay working, but it requires maintaining a fork of https://github.com/facebook/create-react-app/tree/master/packages/react-error-overlay.
With my current workload, I'm afraid it would be a very costly project to maintain.

I have considered swapping the error overlay for https://github.com/xpl/panic-overlay, maybe it would be less of a risk to depend on the much smaller codebase. 🤔

Let me know what you think!

Eduard - obviously you've thought about this way more than me. But what about, if in HMR mode, an Elm compiler error is simply shown in the Terminal only and not in the Browser? The Elm compiler errors are designed to be shown monospaced with ANSI colours, so they're not really at home in a GUI anyway.

It is much better DX to have errors on the overlay. People who are new to elm, maybe who start their first toy project with this tool, would especially appreciate this.