News for hackers. Stuff that matters.
Re:Ask HN: What small library or tool do you want that doesn... by mattlondon on Monday May 02, 2022 @06:49AM (#31233489)
Generally browsers these days are pretty good.

There are some dark corners where there are still differences but these are not in the "I just want to build a website"-level of complexity IME, and are more in the "I am building a large XXX,XXX lines-of-code enterprise SPA used for hours at a time for thousands of users as their primary job across varied OS and browser combinations" level of complexity. E.g. I recently had to debug how different browsers handle cookie eviction for more than 100 cookies under the same top-level domain. This is not the sort of issue you you face with a "I just want to build a website" problem.

Re:Ask HN: What small library or tool do you want that doesn... by OJFord on Monday May 02, 2022 @07:20AM (#31233706)
I unknowingly relied on undefined behaviour in JavaScript Array.sort; worked fine/as expected in Firefox but then got bug reports that turned out to be Chrome/Safari.

Not just dark corners IMO.

Re:Ask HN: What small library or tool do you want that doesn... by mattlondon on Monday May 02, 2022 @08:19AM (#31234159)
Interesting - what were the details? I've never heard of this and rely on this feature all the time so please do share the reproduction so we can all benefit?
Re:Ask HN: What small library or tool do you want that doesn... by OJFord on Monday May 02, 2022 @01:59PM (#31238517)

    > [2,1,3].sort((a,b) => a < b)
Sorts in Firefox (gecko), but not in V8. (resp. `a > b`.)

FF:

    Array(3) [ 3, 2, 1 ]
Node:

    [ 2, 1, 3 ]
(Obviously that's a silly example because you'd just `.sort()`, I think I was doing `a.id < b.id` or something, but it's not a significant detail.)

You can even reduce the reproduction to `[1,2].sort((a,b) => 1)`. Have fun..!