-
Notifications
You must be signed in to change notification settings - Fork 309
Warn & ignore when receiving null or undefined values #250
Conversation
} else { | ||
/* eslint-disable no-console */ | ||
if (console && console.warn) { | ||
console.warn('CSS value is "' + value + '" for property "' + property + '"'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add the component name as in #253?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I might be missing something, but we don't have a reference to a component
within prefixer
? Should getPrefixedStyle
be taking a component
as an argument for the sake of adding the name in the warning?
Yeah true, that would be crummy. I also wonder if we should just use |
Warn & ignore when receiving null or undefined values
@ianobermiller @AnSavvides I think it's really useful to have the component name when you're debugging these kinds of errors, as well as unsupported CSS values / properties. What about moving the responsibility of |
@bobbyrenwick if we really wanted to have the component name in the warning, I would favor just passing @ianobermiller if you think that's a good idea (either approach) feel free to create an issue, assign it to me and I'll happily sort it out :) |
Good discussion. Let's pass the component name to the prefixer just to make the warnings better. Also, thoughts on enabling warnings only in DEV? |
I would be in favor of enabling warnings only in DEV, I think that's good practice. If it makes any difference, that's how it's done in React too (here for example), so React developers should be used to only getting warnings in DEV. |
I'm also a fan of only having them in dev. We can use the same approach I used for the hot loading fix. |
Title says it all!
I also added a couple of tests and made a change to
.eslintrc
to allow the use ofundefined
since we need to compare against it & use it for testing.Closes #245.