f00f the f00fy 1730078179375

When spark said quoting was supported I thought they meant forum-style quoting

which is just this, but with a link to the original post and usually the ability to collapse the quote

not twitter-style quoting, which I don't like as much, but it's nice that it's here


Reactions

Comments
Leave a comment
spark 1730079573709 *

Yeah, this is unfortunately the best way to do it though. You've always been able to quote things this way (the "Follow-up" button has always used this), but I've changed the way they look now because it was needed to improve performance.

When we pulled responses previously, we did this:

if reply.is_empty() {
    None
} else {
    match Box::pin(self.get_response(reply, recurse)).await {
        Ok(r) => Some(Box::new((r.0, r.1, r.2, r.3))),
        Err(_) => None,
    }
},

Since we render everything on the server, this quickly stacked up to a page containing 50 responses ending up with 100 responses. For every single response, we also fetch the author and its question (+ the question's author) if applicable. This means we were running over 200 SQL queries to load a single 50 response page.

This quickly tanked performance on profiles which uses "Follow-up" a lot, leading to >1500ms load times.

Since I've been splitting the templates/ directory into using "partials" (sub templates which are just a single component), I decided to add a partial for rendering responses:

https://neospring.org/_app/components/response.html?id=7418214140306cbe06159b5770b62a853bfc09ed2deafe0d778f1b5392e0c15e&do_render_nested=false

(Note this is the same way chat messages are rendered! We still render everything on the server, just at different times now.)

The has taken load times on such heavy profiles from 1s+ to around 400ms on average. I had to change the template for follow-ups because:

  1. I didn't really like it, I think the Twitter-like format looks a little better (although it can still be cleaned a little more here to make it more visually obvious)
  2. Everything is loaded through the include-partial custom element, which is like an iframe if it didn't use ShadowDOM. It's much easier to make a clean HTML template using this instead of the other solution

Anyway, hope that helps explain some things! Forum-style quoting has also been mostly supported, though, since that's mainly just on the Markdown parser (except for the interactions).

1

Pressing continue will bring you to the following URL:

Are sure you want to go there?


Continue