-
-
Notifications
You must be signed in to change notification settings - Fork 209
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
[V2] Error and Warning Handlers #4
Comments
I like having very clear error messages, that could prove important. Let's see what we can do in our build system to strip those out in production but have them in dev! |
Setting the bar for error messages would be a huge differentiator for this project. |
@bhough Is there a util that structures output like this already, or something we'd invent? The last one I looked at was: I believe we'd be able to throw an object that contained fields like |
Reusing some common util would be great for this, or writing our own in a separate package! |
I do like One of the tricks I wanted to implement with this is to remove this error/warning functionality when the package is built for prod. I imagine that while useful for debugging during development, it would prove to be superfluous code for production. Does that assumption hold up with everyone? |
Yeah that sounds very reasonable to me! |
@mxstbr @nikgraf Question on this. As far as what errors we want to expose in dev/production. Right now I have formatted errors/warnings working in dev and completely disabled in prod (meaning no custom errors are thrown in prod at all). Are we fine with this, or do we want to draw a specific line between for what we leave in prod when it comes to custom errors. |
That sounds reasonable to me @bhough! Do you have a WIP PR? |
@bhough good question. It makes sense, but I'm not sure how we deal with inputs that don't make any sense e.g. rgb(66)? |
Given that this is acting as a CSS compiler of sorts, each module should have error/warning handling that informs the user if they have provided the invalid values/syntax/etc... These should only be use in development and will be stripped out by webpack for production.
In my experiments I've been loosely following the formatting used in ELM. So they come out looking sort of like this:
Would love everyone's thoughts on this.
The text was updated successfully, but these errors were encountered: