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

Modernizr #6

Closed
jt3k opened this issue Mar 20, 2020 · 6 comments
Closed

Modernizr #6

jt3k opened this issue Mar 20, 2020 · 6 comments

Comments

@jt3k
Copy link

jt3k commented Mar 20, 2020

Please explain how you replace the Modernizr with @babel/preset-env

Do the creators of Modernizr know that they are not recommended? =)

@slikts
Copy link
Owner

slikts commented Mar 20, 2020

The preferred alternative to feature detection is polyfilling, and @babel/preset-env is the simplest way to polyfill. Modernizr hasn't been relevant for a long time.

@jt3k
Copy link
Author

jt3k commented Mar 20, 2020

are you really sure that @babel/preset-env can detect mix-blend-mode or cssgrid support and provide this information inside my css file?

@rejas
Copy link

rejas commented Mar 23, 2020

I agree with @jt3k Modernizr still has some features that cant just be transpiled or polyfilled.

@slikts
Copy link
Owner

slikts commented Mar 23, 2020

The legacy browser market share keeps shrinking, so the complexity of having branching logic based on feature detection for legacy browsers is increasingly not justified. The idea is to have recommendations for general use cases, and in general polyfilling should be preferred, even though it doesn't replace feature detection for every use case.

Here's a graph that tells the same story; specifically, that Modernizr hit its peak when the legacy browser presence was much more significant.

@jt3k
Copy link
Author

jt3k commented Mar 24, 2020

I see that both searches are popular in my country(Russia). But in the end, it's up to you.
Let’s at least add under the paragraph with modernizr why it is not recommended, and make a link to this issue

@slikts
Copy link
Owner

slikts commented Mar 28, 2020

The trend looks about the same in Russia. I've added a link to this discussion.

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

No branches or pull requests

3 participants