I don’t know why they’re selling lack of JSX as a feature. React works without JSX too. It’s just (very convenient) syntactic sugar.
VanJS – A no-JSX framework based on vanilla JavaScript
111–120 of 178 posts
Re: VanJS – A no-JSX framework based on vanilla JavaScript
#112Re: VanJS – A no-JSX framework based on vanilla JavaScript
#113Earlier quoted context omitted.
The fact that you have to manually maintain the binding between states and UI elements and propagate state changes to UI elements is exactly the thing offered by VanJS, or other popular reactive frameworks (despite with a much larger bundle size)
Sure thing. But it's also one of those things that comes back to bite you when you least expect it: https://vanjs.org/advanced#why-not-dom-valued-states
Re: VanJS – A no-JSX framework based on vanilla JavaScript
#114Re: VanJS – A no-JSX framework based on vanilla JavaScript
#115Re: VanJS – A no-JSX framework based on vanilla JavaScript
#116Earlier quoted context omitted.
Is this the main argument? I think the simplest answer is boundaries. Taking into account how much nesting is involved in writing HTML, it's a clear benefit having a named boundary vs a closing parenthesis.
> Taking into account how much nesting is involved in writing HTML which is another one of its flaws.
Re: VanJS – A no-JSX framework based on vanilla JavaScript
#117After reading the tutorial at https://vanjs.org/tutorial I was about to open an issue suggesting that they include constants with the SVG and MathML namespace, so that this: const {circle, path, svg} = van.tagsNS("http://www.w3.org/2000/svg") const {math, mi, mn, mo, mrow, msup} = van.tagsNS("http://www.w3.org/1998/Math/MathML") Could be expressed like this instead: const {circle, path, svg} = van.tagsNS(van.SVG) con…
Re: VanJS – A no-JSX framework based on vanilla JavaScript
#118Re: VanJS – A no-JSX framework based on vanilla JavaScript
#119I don’t know why they’re selling lack of JSX as a feature. React works without JSX too. It’s just (very convenient) syntactic sugar.
Re: VanJS – A no-JSX framework based on vanilla JavaScript
#120I don’t know why they’re selling lack of JSX as a feature. React works without JSX too. It’s just (very convenient) syntactic sugar.
It is really an odd flex. As soon as you need a transpiler, which many modern JS devs are going to want and need for the benefits they provide (Typescript being huge) then using JSX seems a benefit not a problem to solve.
I experimented with VanJS integrating into Astro. No plugin was needed & getting the SSR HTML is as simple as calling `.render()`.
I wrote a fork of VanJS called relementjs & took this concept further, using `.toString()` instead of render. Now SSR components can be rendered inside a template string.
` ${my_component()} `