> It's the reason I never went for JSX or other frameworks that put logical code into templates or things like that
That's not mixing business logic with display code, your confusing (or conflating) 2 entirely different things here.
> It's the reason I never went for JSX or other frameworks that put logical code into templates or things like that
That's not mixing business logic with display code, your confusing (or conflating) 2 entirely different things here.
Letting any control flow into your HTMX/JSX templates is begging for trouble. It boggles the mind that people abandoned PHP - where at least the output was static and checkable - for something exactly like mixed HTML/code where some processing was done on the front end and everything was supposed to be dehydrated. Only to pivot again to hydration on the back-end.
JSX and React came on the scene 10 years after I first realized using the client for anything logical was an anti-pattern. Back then, I remember people would write things like:
CustomerFormForClientX extends CustomerFormForClientZ [...]
and put a bunch of validation on the client side, too. Clients are dumb terminals. That's it. I'm not confusing the use of logic-in-JSX with business-logic-in-display. One only has to look at every basic JSX example on the web that's taught to newbies to see a million ways it can go wrong.