4 ms·
When you have to hassle the backend guys because querying <<100 comments is slow, is that the point where you stop and ask "what are we doing here".
by stefan_ 8y ago
When you have to hassle the backend guys because querying <<100 comments is slow, is that the point where you stop and ask "what are we doing here".
- hombre_fatal 8y agoTo be fair, they pointed out additional motivations to move to Vue like making the client-side UX more maintainable and improve client-side performance. Also, for all we know their server-side Rails+Haml stack took <50ms to query the database + render the comments, but they still wanted to factor that out of the initial page load to improve TTI.
- cabaalis 8y agoI thought the same thing. > Surely you could query the DOM for this. A better solution, in this case, is to let the backend developers mark the last user comment in the JSON they return. Backend developers have direct access to the database, which means they may be able to optimize the code. Then no client-side work has to be done at all, in this case. Look, I know what I am, I'm no fancy-pants silicon valley guru here. But what is described in this example is primarily a client-side function. So I think the wording for this is "a different solution" at minimum. Better? Meh. Will that new backend query ever serve any purpose other than facilitating this frontend feature? Perhaps instead of adhering to a "let's not query the DOM" at all costs, ask yourself what exactly you are complicating and for what gain.