4 ms·
I think this library has gotten steadily worse over time. After 1.2.2, each new release just introduces more configurability that >99.99% of sites won’t want, m
by chrismorgan 6y ago
I think this library has gotten steadily worse over time. After 1.2.2, each new release just introduces more configurability that >99.99% of sites won’t want, more complications, more bugs and more misfeatures. Most notably version 5 introduced triggering load on mouse down, which I call catastrophically wrong, 100% dealbreaker with prejudice. 5.1.0 made it opt-in, but it’s still functionality that just shouldn’t exist.
I golfed 1.2.2 down a long way, removing other configurability and functionality that I didn’t want; see https://news.ycombinator.com/item?id=23204741 https://news.ycombinator.com/item?id=23204741, part of the discussion a few months ago at https://news.ycombinator.com/item?id=23203658 https://news.ycombinator.com/item?id=23203658 (where there was much wringing of hands about the whole load-on-mousedown mess). 5.1.0 is 2,842 bytes, 1,169 gzipped; my version got to 981 bytes, 532 gzipped. At that point it’s almost certainly cheaper to inline it than to have it as an external script (though if your CSP has script-src excluding unsafe-inline, you’ll need to give it a nonce or sha hash if you want to do it inline).
- pimterry 6y ago> version 5 introduced triggering load on mouse down, which I call catastrophically wrong, 100% dealbreaker with prejudice. Could you provide more context? Why is that catastrophically wrong?
- chrismorgan 6y agoSee some of the discussion on https://news.ycombinator.com/item?id=23203658 https://news.ycombinator.com/item?id=23203658. It breaks how links work normally.
- celsoazevedo 6y agohttps://instant.page/changelog https://instant.page/changelog I agree it was a bad decision to do that by default, but it's opt-in since 5.1: "Make triggering clicks on mousedown opt-in".
- chrismorgan 6y agoPlease reread my top-level comment.
- andrewzah 6y agoDo you maintain that as a fork anywhere?
- chrismorgan 6y agoNo. I golfed it because I enjoy doing that, and thought I might want to use it at some point; I now doubt I ever will, which is also a part of the reason it’s entirely untested. I consider it a complete work of art needing no maintenance, although it is possible that some years down the track some form of alteration may be reasonable. If you want to use it, copy and paste it! :)
- pbowyer 6y agoThank you for the golfed version - tested and works. And does everything I want it to (preload the page, what more is needed?)