4 ms·
They just need to add JSX support. Half the reason people use react is because of JSX.
by Onavo 3y ago
They just need to add JSX support. Half the reason people use react is because of JSX.
- IgorPartola 3y agoMaybe unpopular opinion but JSX is inferior to something like the Vue templating system. I much prefer to have HTML with some JS sprinkled in than JS that looks like HTML but isn’t.
- Klathmon 3y agoAnd to wage this holy war a little, I personally much prefer JSX over a templating system that looks like html attributes but acts different, while trying to act like javascript but can't. Honestly at the end of the day they both get the job done, but for me personally working in JSX is just so easy to pickup and use, and while it's not perfect, I do prefer it over having to learn yet another library specific templating kinda-sorta language.
- TheMajor 3y agoMost of us devs had "separation of concerns is critical" drilled into us for many, many years. For that reason alone, JSX just gives me the baddest of smells when I look at it.
- troupo 3y agoThis way of looking at separation of concerns helps: https://x.com/simonswiss/status/1664736786671869952 https://x.com/simonswiss/status/1664736786671869952
- mardifoufs 3y agoHow does jsx not have separation of concerns? I get what you are referring to but that's not SoC as I know it
- troupo 3y ago> I much prefer to have HTML with some JS sprinkled That's not what vue templates are. It's three or four different templating DSLs in one. v-for alone will show that it's not HTML with Javascript: https://news.ycombinator.com/item?id=28059397 https://news.ycombinator.com/item?id=28059397 And there's more: https://news.ycombinator.com/item?id=19199423 https://news.ycombinator.com/item?id=19199423
- preommr 3y ago> That's not what vue templates are. It's three or four different templating DSLs in one. The pattern is very obvious? If array: (value, index)=>void If object: (value, key, index)=>void If it's an array, it's the call signature for the args of the forEach method, i.e. (value, index)=>void, but can be assigned a function that's just (value)=>void if index is unneeded. If it's an object, it's an extension of the same logic with (value, key, index). It's not 4 dsls in one, anymore than jsx is a 1000 markups in one.
- troupo 3y ago> The pattern is very obvious? It's not > It's not 4 dsls in one, anymore than jsx I "like" that when discussing these things everyone completely ignores everything, and focuses on one specific thing. So, again. The claim was that Vue templates is "HTML + Javascript" 1. As v-for clearly shows it's not even close to Javascript, as there are no Javascript constructs that correspond to this 2. As everything else, not just v-for shows, it's neither HTML (so many custom attributes with extensions and shorcuts etc.) nor Javascript.
- mock-possum 3y agoAnd vue templates are in turn inferior to lit-html
- kijin 3y agoI think you can already do that by wiring together something like NakedJSX. You just need a fancy jQuery plugin to make it more ergonomic.
- technojunkie 3y agoIf "they" is WordPress, have you tried modern PHP? 8.x has come a long way to looking and feeling like a modern programming language. So many new things reminding me of Typescript, Javascript, Python, etc.
- quickthrower2 3y agoShould be easy. It is just a case of presenting the right interface to the generated code. For example Mithril supports it (with some quirks admittedly). But in simple terms it is an adaptor.
- rpncreator 3y agoA variant of this was tried over a decade ago, but never made it live - jQuery Templates. Not quite the same… https://github.com/BorisMoore/jquery-tmpl https://github.com/BorisMoore/jquery-tmpl
- boredtofears 3y agoFully agreed. I built a mostly vanilla JS app using a bare bones JSX lib[1] a few months ago and was surprised at how little I missed the rest of React. [1] https://github.com/alex-kinokon/jsx-dom https://github.com/alex-kinokon/jsx-dom