anandthakker / doiuse

:bomb: Lint CSS for browser support against caniuse database.
MIT License
1.23k stars 50 forks source link

Better partial support checks #160

Open RJWadley opened 1 year ago

RJWadley commented 1 year ago

This pull request improves checking for partially supported properties by using MDN to check if the specific value we're using is unsupported or not.

For example, appearance: auto got support in chrome 83, so it would warn with chrome 81 but not with chrome 83. Meanwhile, appearance: none gained support much earlier, so it wouldn't warn with either 83 or 81.

As of right now it only checks declaration value pairs. the behavior is unchanged for other types of css features

details

MDN isn't part of feature detection, which remains unchanged. This is focused on providing better messages to the end user instead. Whenever partial support is detected, we then get more information from MDN to determine if we need to report the issue at all, and report with a more specific message if needed.

One thing to consider is that MDN adds a lot of weight (something like 10MB). This isn't a big issue for most environments, but it may matter for some. For example, if someone wanted to use this in the browser (why would they?) it would be much too large. If we think this is a problem we could gate this behind an option and import the data dynamically.

Closes

fixes #70 fixes #71 fixes #106 fixes #146

clshortfuse commented 1 year ago

I added this to a 6.1 milestone, since I would like to get 6.0 out as fast as possible. I would like to use some benchmarks to see the performance costs before adding in MDN.

gian1200 commented 11 months ago

Any update on this?

Looks like it also close #83, #166 and #167

kkmuffme commented 7 months ago

Any update/what's pending for this to get merged?