-
-
Notifications
You must be signed in to change notification settings - Fork 230
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
Remove isarray dep. #137
Remove isarray dep. #137
Conversation
One of the selling points is that this module supports everything from IE6 and up. I see no reason to remove this dep. |
IE6 has less than 0.2% market share on a dead ~16yr old OS. The |
Backward compatibility is not an academic exercise. I am one of those 0.2% who has no other choice but to use a dead ~16yr old OS. Our image acquisition software cannot be updated to a newer OS due to driver compatibility issues. Until usage is 0% and will forever remain 0%, backward compatibility matters. People at the margins are still people, and their concerns should not be dismissed so readily in the name of modernity. |
Update: Clarified things a bit. @kgryte The next bump of Lodash will poison (kinda scary term) the unshimmed API so that it'll throw an error informing folks to add a shim. I don't anticipate major problems as the fringes should already be using something like es-shim. However, if there's major problems I'll revert. With everyone using shims it frees up library authors to worry about other things 🙌 |
@jdalton I understand where you're coming from -- pruning unneeded dependencies is one of my favorite pastimes. It's something that I wish more node developers took seriously, especially for packages that just run on the server-side, a much simpler and predictable environment. Reducing install time, decreasing security attack surface area, increasing site performance, and simplifying codebases are all great benefits. So I'm definitely on your side in the fight for "dependency hygiene". But this PR drops support for IE8 a bit prematurely, IMO. IE 6-8 together account for .77% of the US market (.08% IE6 + .07% IE7 + .62% IE8). There are 269.35 million US internet users, so this PR leaves behind 2.07 million people. And that's just in the US. If the complexity or file size savings were meaningful, I could justify it. But this only saves 3 lines of code. Is this really the right tradeoff? |
If I understand this correctly -- you're saying that going forward anyone who uses Is this really necessary? |
EDIT: I was wrong, my bad! "It prevents anyone else from easily detecting that Array.isArray is missing." |
Naw. It's more of a show of intent since currently Lodash v4 doesn't work on an unshimmed IE8 in the first place (requires es-shim). Lodash v3 on the only hand has legacy support out of the box. It may make more sense to implement the experiment there. |
Hmm, I see. So, you're saying that lodash users already need to use I still feel like doing a hostile takeover of the If you want to help unshimmed IE8 users, you can just print them a helpful console warning or throw an exception as soon as |
@feross |
I think it's fine to drop support for older browsers in a major version of If we start using |
Sweet! Would you dig creating a v5 branch to apply PRs to? (I'll change the base of this one)
Sure thing, happy to help! |
@jdalton Okay, I created a v5 branch. Want to re-send this PR? |
@feross Thanks! Github introduced a feature so there's no need to close and re-send. I can just change the target of this one. If you re-open it should be pointing to the v5 branch. |
🤘 |
- Super fast. Backed by Typed Arrays (`Uint8Array`/`ArrayBuffer`, not `Object`) | ||
- Extremely small bundle size (**5.04KB minified + gzipped**, 35.5KB with comments) | ||
- Excellent browser support (IE 6+, Chrome 4+, Firefox 3+, Safari 5.1+, Opera 11+, iOS, etc.) | ||
- Excellent browser support (IE, Edge, Chrome, Firefox, Safari, Opera, iOS, etc.) |
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.
Thanks for adding Edge to the list here, but can you keep the browser versions for all but Edge, Chrome, and Firefox (the evergreen browsers). That is useful information.
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.
No prob!
Would you like to list the supported IE version by MS or technically by the code?
(it means either IE11 or IE9).
Do you consider Opera and Safari evergreen?
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.
Let's list IE11. If we also drop IE9 and IE10 while we're at it, we can kill off the Object implementation of Buffer entirely, and just leave the Uint8Array implementation which would reduce file size significantly.
IE10 technically has Uint8Array but it's buggy, so it uses the Object implementation.
Opera is evergreen, but Safari is not because it doesn't have a silent autoupdater.
Hi @feross!
The isarray package is being deprecated since IE < 11 is no longer supported by MS & IE 8 was the last browser that needed it. For the fringes, folks tend to use something like es-shim.
The
Array.isArray
method is supported by all Node versions, Rhino, iOS, Android, and headless browser enviros (like PhantomJS v1, SlimerJS).With that in mind this PR removes it from
buffer
.Note: I don't think test fails are related to this change.