Actually, array-flatten and ismobilejs are not that useless. For example, array-flatten could be a little bit older than the standard Array.prototype.flat, which was not available before 2019.
Doing software development since I can remember. Big fan of the JavaScript and Rust ecosystems. Long-time Java and JavaScript developer. Music producer wanna-be. ;)
Location
Warsaw, Poland
Work
Software Architect | Senior Full-stack Java/JS Developer at ISOLUTION
15% of my users. UK corporates that are not technical (Plumbers, Builders, Contractors etc). IE11 still shipped with W10. etc etc. Check out the Wikipedia stats, they still get ~5% of visitors on IE11. Can't wait until I say "not supported" lol.
Actually, that is wrong. Babel by itself cannot transform prototype methods. That would require type information, which babel does not have. For example, a.includes(b) could be a call to an array method, or a method of your own Collection class (e.g. mobx ObservableArray).
And while babel turns language syntax into pre-es6, you still require polyfills.
You can get them all in a 'bulk' by importing from corejs, but it's a different story.
Man you really just picked one part out of my comment which is the only part which you knew you could counter and then ignored the actual point. It is kind of irrelevant to the point that it isn't that complex, not all people want to use Babel, and saying that a package is useless because another package can do it is a horrible mindset and a horrible argument.
Look at the comment I answered. "As said before, not everyone wants to use Babel and setup complex build environments." just that. Even if we pick your other replies, they were "Yeah, because people want to support older browsers" and "Yes, Babel has polyfills, but not everyone wants to create complex build systems and may just want to stay a little more basic"
The second one's basically the one I answered, so stop coming up with random stuff. Babel not only has polyfills, but isn't complex and supports older browsers. That's all 3 of your replies countered.
As for "not everyone wants to use Babel", that's life. In a world where build tools or Babel didn't exist, a package that's a polyfill was useful. But it's been established as a great tool for quite some time now, so it's just using outdated/more complex solutions. Or in cases where you can't, which brings us to:
array-includes is used by 442 packages. One of those is create-react-app. Each app created with it also downloads array-includes. Which is not to say that people are willingly choosing to use it.
By the way, Babel has 24m weekly downloads, for all the "not everyone wants to use Babel and setup complex build environments" talk.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Actually, array-flatten and ismobilejs are not that useless. For example, array-flatten could be a little bit older than the standard
Array.prototype.flat
, which was not available before 2019.Same with array-includes: it might have been a polyfill at some point. I didn't check the dates on it though, so I'm only assuming that was the case.
javaascript array includes has support for all browser.
array-includes has a weekly downloads of 12,377,891.
So , I am thinking who are these 12,377,891 folks.
Definitely not "all browsers". If you bothered to check, there are a few browsers that do not support it, but they definitely exist.
For example, Internet Explorer 11 is definitely still supported in many websites.
there are a bunch of browsers available in the market. But we consider only the top modern browsers.
internet explorer is going to end very soon. So , i think majority of users dont use this browser as they have moved to edge.
15% of my users. UK corporates that are not technical (Plumbers, Builders, Contractors etc). IE11 still shipped with W10. etc etc. Check out the Wikipedia stats, they still get ~5% of visitors on IE11. Can't wait until I say "not supported" lol.
In which case you can use Babel to turn you code into pre-ES6 instead of importing such a package.
Actually, that is wrong. Babel by itself cannot transform prototype methods. That would require type information, which babel does not have. For example, a.includes(b) could be a call to an array method, or a method of your own Collection class (e.g. mobx ObservableArray).
And while babel turns language syntax into pre-es6, you still require polyfills.
You can get them all in a 'bulk' by importing from corejs, but it's a different story.
As said before, not everyone wants to use Babel and setup complex build environments.
Said complex build environment:
babel.config.json
{
"minified": true,
"presets": [["@babel /env", { "targets": { "node": "current" }}]]
}
package.json
"scripts": {
"build": "babel src --out-dir dist",
},
"devDependencies": {
"@babel /cli": "^7.14.5",
"@babel /core": "^7.14.6",
"@babel /preset-env": "^7.14.7",
}
Man you really just picked one part out of my comment which is the only part which you knew you could counter and then ignored the actual point. It is kind of irrelevant to the point that it isn't that complex, not all people want to use Babel, and saying that a package is useless because another package can do it is a horrible mindset and a horrible argument.
Look at the comment I answered. "As said before, not everyone wants to use Babel and setup complex build environments." just that. Even if we pick your other replies, they were "Yeah, because people want to support older browsers" and "Yes, Babel has polyfills, but not everyone wants to create complex build systems and may just want to stay a little more basic"
The second one's basically the one I answered, so stop coming up with random stuff. Babel not only has polyfills, but isn't complex and supports older browsers. That's all 3 of your replies countered.
As for "not everyone wants to use Babel", that's life. In a world where build tools or Babel didn't exist, a package that's a polyfill was useful. But it's been established as a great tool for quite some time now, so it's just using outdated/more complex solutions. Or in cases where you can't, which brings us to:
array-includes is used by 442 packages. One of those is create-react-app. Each app created with it also downloads array-includes. Which is not to say that people are willingly choosing to use it.
By the way, Babel has 24m weekly downloads, for all the "not everyone wants to use Babel and setup complex build environments" talk.