I would use the tag to solve this problem. Most people don't know this exists and I have no idea why. You would probably have to rewrite the html so it no longer uses tables but I don't really consider that to be a negative. I would also question why we are saving collapsed comments. I feel like this is something that doesn't need to be persisted forever. If you want this behavior why not use local storage instead?
Why is collapsing a Hacker News comment so slow?
31–40 of 123 posts
Re: Why is collapsing a Hacker News comment so slow?
#32> There is also a GET request to https://news.ycombinator.com/collapse?id=1234567 to save the state of the collapsed/expanded comment if the user is logged in, but it's an async request so it doesn't have an impact. Is this a correct place to use 'GET'?
Isn't that vulnerable to CSRF? What if a page linked on the front of HN makes a request collapsing every single comment?
Re: Why is collapsing a Hacker News comment so slow?
#33> There is also a GET request to https://news.ycombinator.com/collapse?id=1234567 to save the state of the collapsed/expanded comment if the user is logged in, but it's an async request so it doesn't have an impact. Is this a correct place to use 'GET'?
It does modify state on the server so I would think it should be a POST or something. even better, they could do what reddit does with upvotes/downvotes, and store that information in the user's cookie, so that it gets sent with the next request to the server.
[1]: https://developers.google.com/web/updates/2015/12/background...
Re: Why is collapsing a Hacker News comment so slow?
#34Earlier quoted context omitted.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/de... This is awesome! I had no idea! You're right, I don't think most people even realize. There's often times I get upset when using Bootstrap or just doing CSS and look up ways to do specific things and don't find out of the box solutions, this is one time I'm glad I found a decent alternative. One case that comes to mind is collapsible trees and dropdown b…
Note that it's not yet supported by Edge: https://developer.microsoft.com/en-us/microsoft-edge/platfor...
Re: Why is collapsing a Hacker News comment so slow?
#35Re: Why is collapsing a Hacker News comment so slow?
#36I would use the tag to solve this problem. Most people don't know this exists and I have no idea why. You would probably have to rewrite the html so it no longer uses tables but I don't really consider that to be a negative. I would also question why we are saving collapsed comments. I feel like this is something that doesn't need to be persisted forever. If you want this behavior why not use local storage instead?
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/de... This is awesome! I had no idea! You're right, I don't think most people even realize. There's often times I get upset when using Bootstrap or just doing CSS and look up ways to do specific things and don't find out of the box solutions, this is one time I'm glad I found a decent alternative. One case that comes to mind is collapsible trees and dropdown b…
Re: Why is collapsing a Hacker News comment so slow?
#37> There is also a GET request to https://news.ycombinator.com/collapse?id=1234567 to save the state of the collapsed/expanded comment if the user is logged in, but it's an async request so it doesn't have an impact. Is this a correct place to use 'GET'?
Re: Why is collapsing a Hacker News comment so slow?
#38> There is also a GET request to https://news.ycombinator.com/collapse?id=1234567 to save the state of the collapsed/expanded comment if the user is logged in, but it's an async request so it doesn't have an impact. Is this a correct place to use 'GET'?
It does modify state on the server so I would think it should be a POST or something. even better, they could do what reddit does with upvotes/downvotes, and store that information in the user's cookie, so that it gets sent with the next request to the server.
Re: Why is collapsing a Hacker News comment so slow?
#39I cannot visually notice any delay. It seems instantaneous in my browser.
Not terrible, but there's a noticeable (maybe ~1 second on my phone) delay. My desktop is fast enough that it still feels instant.
Re: Why is collapsing a Hacker News comment so slow?
#40Earlier quoted context omitted.
Note that it's not yet supported by Edge: https://developer.microsoft.com/en-us/microsoft-edge/platfor...
Edge is turning into Chromium soon, so that shouldn't be a problem for much longer.
18% of my users are on IE11. Some industries (healthcare, for example) don't change if they don't perceive something to be broken.