-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
JavaScript browser compatibility checker which checks against »can I use« data #103
Comments
The only thing I could find is https://github.com/amilajack/eslint-plugin-compat |
Thanks. Missed that. Looks pretty neat. But I would prefer to have something as a standalone tool. Is this still a valid module request? |
Yes, I was just sharing prior art. |
Tried eslint-plugin-compat extensively. |
@mischah Did you find anything since your last post? |
@CodeByAlex Nope. |
A few colleagues and I came up with some things that such a tool could do (before we found this issue). It needs to be borne in mind that APIs can be polyfilled whereas language features cannot. Will it workIn which browsers/versions will this work? Will this work in these browsers/versions? Making it workHow could I change this to make it work in these browsers/versions? Change this to make it work in these browsers/versions. How might I change this to make it work in more browsers/versions? PolyfillingGive me a JavaScript expression that determines if I need to load any polyfills to make this work in the current browser (for use in Which polyfills do I need (worst case scenario) to make this work in these browsers/versions? Create a polyfills file (worst case scenario) to make this work in these browsers/versions. Give me only the polyfills needed to make this work in the current browser. Tools and resources for implementationWhich APIs does this use? Which language features does this use? Is this API or language feature supported in this browser? |
I did some experimentation to investigate the feasibility of this: https://github.com/robatwilliams/workie I posted some notes there - in conclusion, it would be possible, but there are some limitations and I think it's quite a niche use case. |
Focusing on the language feature aspect, I created an ESLint plugin and companion CLI tool which use browserslist and the MDN browser compatibility data. https://github.com/robatwilliams/es-compat I've just released a beta version which covers ES2018 and 2019. It shouldn't be much more work to add the other ES20xx versions for a MVP. Let me know if you have any feedback. |
There are already tools for checking CSS compatibility like the following:
But I could b’t find any for JavaScript.
It would be awesome to have a node module (with a CLI) for that.
Related:
caniuse API
The text was updated successfully, but these errors were encountered: