I have to do "real" ssr every once in a while via the django jinja html files we have to send emails. It makes me want to die coming from our nice typescript react SPA frontend. Every object is a mystery and jinja syntax is functional but terrible to maintain and of course you're suddenly using tables because it's an email.
I'd rather every element be a div than do one minute of editing those stupid jinja files.
It sounds like your issue is with the syntax of Jinja, and the hellscape of HTML email. I'm not sure how 20 MB of inscrutable JavaScript would help, considering it's also just template rendering with extra steps (bonus: using the user's CPU cycles and power instead of your own).
> It sounds like your issue is with the syntax of Jinja, and the hellscape of HTML email. I'm not sure how 20 MB of inscrutable JavaScript would help, considering it's also just template rendering with extra steps
20MB of inscrutable JavaScript allows you to have a) a sane structured component system where you can actually build up UIs compositionally rather than a flat glorified string substituter (i.e. not actually "just template rendering"), and b) the control and abstractions needed to make good UIs out of nested tables.
As a home assistant user, jinja in yaml files is hot steaming ass.
Every time I read the jinja manual I want to cry. And a small part of me dies in side. It's like a templating language designed to get even with the person who microwave a tuna fish sandwich in the office, for lunch, daily... That some how leaked out to the web.
There are different template engines for SSR, with drastically different syntax. I've never written any Python, but in my own opinion, Smarty for PHP and Twig-compatible ones for many different languages are the best.
While generating any moderately complex HTML on the front end is a pain in the ass for me. I prefer avoiding it. If I need to request some data from the server to dynamically update the page with, I just make that endpoint return some server-side-rendered HTML that I insert wherever it needs to go.
oopsallmagic|1 year ago
lmm|1 year ago
20MB of inscrutable JavaScript allows you to have a) a sane structured component system where you can actually build up UIs compositionally rather than a flat glorified string substituter (i.e. not actually "just template rendering"), and b) the control and abstractions needed to make good UIs out of nested tables.
zer00eyz|1 year ago
As a home assistant user, jinja in yaml files is hot steaming ass.
Every time I read the jinja manual I want to cry. And a small part of me dies in side. It's like a templating language designed to get even with the person who microwave a tuna fish sandwich in the office, for lunch, daily... That some how leaked out to the web.
grishka|1 year ago
While generating any moderately complex HTML on the front end is a pain in the ass for me. I prefer avoiding it. If I need to request some data from the server to dynamically update the page with, I just make that endpoint return some server-side-rendered HTML that I insert wherever it needs to go.