logoalt Hacker News

adamzwassermanlast Thursday at 7:59 PM1 replyview on HN

Not a problem with Jinja (or any server-side templating). Both the table and dropdown render from the same context variable in one template pass. One endpoint, one data fetch, two presentation formats.

The "two endpoints" concern assumes you're fetching fragments independently. If you're composing a full page server-side, the data is already there


Replies

lbreakjailast Thursday at 9:48 PM

So now you have presentation logic, tightly coupled, spread over two places. You need to jump between two codebases to even have a clue about what is rendering on the page.

There's an example on their website where the header of a table is defined in the frontend, and the body is returned by the backend. If I wanted something as simple as switching the order of the columns, I'd actually need to create a new version of my backend endpoint, release it, change the frontend to use the new endpoint, then delete the old one. That sounds crazy to me.

show 2 replies