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

suggestion: stop scrapping DOM and model on error #360

Open
jligeza opened this issue Jul 21, 2019 · 5 comments
Open

suggestion: stop scrapping DOM and model on error #360

jligeza opened this issue Jul 21, 2019 · 5 comments

Comments

@jligeza
Copy link

jligeza commented Jul 21, 2019

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.

@halfzebra
Copy link
Owner

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 🙂

@frou
Copy link

frou commented Feb 3, 2020

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!

@halfzebra
Copy link
Owner

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!

@frou
Copy link

frou commented Feb 3, 2020

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.

@jligeza
Copy link
Author

jligeza commented Feb 4, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants