Re:Universal Jinja: a crazy idea for a Python-ready front end
by deckar01 on Saturday July 15, 2017 @01:49PM
(#14777915)
When I see JSX in a project I can't help but notice how similar it is to PHP pages that inline all the applications logic with the template making it unreadable. When it comes to react I think JSX is even worse than PHP when javascript objects are passed in and out of JSX directives. It is so hard to debug, and a nightmare to read.
[ Parent
| on HN ]
Re:Universal Jinja: a crazy idea for a Python-ready front end
by captainmuon on Saturday July 15, 2017 @02:08PM
(#14778029)
That is true, but it is somewhat alleviated by the fact that react restricts what you can (or should) do in a component. A good component has one-way data flow and behaves like a pure function (modulo some AJAX, or interfacing with non-React code, but you can isolate that pretty nicely). Yes, it is not enforces, and JSX can be a footgun. Also, the separation of concerns is along a different line (not markup / behavior / style, but between components. If you want to "theme" your website, its kind of hard). I'm not a diehard functional fan, but I find if you go with it it can actually be pretty maintainable and clean. Tooling is also very good, especially with TypeScript (TSX).
Re:Universal Jinja: a crazy idea for a Python-ready front end
by eropple on Saturday July 15, 2017 @04:41PM
(#14778816)
TSX has kinda driven me nuts because react-redux connect doesn't seem to type cleanly. Has that improved?
Re:Universal Jinja: a crazy idea for a Python-ready front end
by captainmuon on Sunday July 16, 2017 @05:09AM
(#14781211)
I haven't tried redux with tyepscript yet. One thing that doesn't seem to be typed correctly is immutability-helpers (it catches some errors, but some stuff seems to be `any`).
It is impressive though how often you have types when I wouldn't expect it.