▲ | emacsen 11 hours ago | |
Let's break this down a bit. > I don't think having the server render the table HTML and you injecting it is a good idea. HTMX, Alpine AJAX and other similar progressive web frameworks work exactly this way, as do server side rendered React.js and friends. > What if the server has downtime, and returns a 200 response but with a "maintenance mode" page If the server is in maintence mode, it should not display the web application/web page, but instead show a "We're in maintenance mode" messages. > Having it render only on a successful response and correct parsing of JSON data is more reliable. You're comparing making a simple web page with either no secondary calls or a single secondary call using a few lines of code to writing a client side web application. It's a bit like comparing a car with a bicycle. > You also start complicating things in terms of separation of concerns. You potentially have to adapt any styling considerations in your API, for instance if the table needs a class adding to it. Overall, not a good idea, imho. This is certainly an opinion and that works for you, but HTMX and similar actually make much of my life easier, rather than harder since all that styling, etc. can live alongside my server logic, rather than being in an entirely separate second application. | ||
▲ | 10 hours ago | parent [-] | |
[deleted] |