Previously we were loading the comment tree by using the search api. This was nice but there are a few drawbacks:
When adding a comment, there is some delay before the comment shows up in the response. This means we would have to juggle some local state, or just treat it as a fire and forget request.
If we like a comment, updating the backing comment tree is a bit more complex then, say, updating a list of comments.
Since we were already scraping the comments page for upvote links for each comment, I figured we could try just using the comments page as our data source for comments. The results were fairly good, a simplified model of comments, and immediate updated when we post a top-level comment.
This does get rid of the parent-child relationship between comments, which probably should be revisited, especially when it comes to hiding comment sub-trees. However, this makes the rest of the experience much better.
Previously we were loading the comment tree by using the
search
api. This was nice but there are a few drawbacks:Since we were already scraping the comments page for upvote links for each comment, I figured we could try just using the comments page as our data source for comments. The results were fairly good, a simplified model of comments, and immediate updated when we post a top-level comment.
This does get rid of the parent-child relationship between comments, which probably should be revisited, especially when it comes to hiding comment sub-trees. However, this makes the rest of the experience much better.