Live data from Hacker News

VanJS – A no-JSX framework based on vanilla JavaScript

vanjs.org

111–120 of 178 posts

Re: VanJS – A no-JSX framework based on vanilla JavaScript

#111
post #87

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.

JSX is redundant, at best. VanJS demonstrated ordinary JavaScript syntax is as good as JSX, if not better. How can something feel sugar-ish if it's actually more verbose than ordinary JS code? Plus, you can't really execute JSX code in browser's developer console.

Re: VanJS – A no-JSX framework based on vanilla JavaScript

#113
post #86

Earlier 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

I don't get you. Could you elaborate?

Re: VanJS – A no-JSX framework based on vanilla JavaScript

#116

Earlier 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.

Not to me, it isn’t. It aligns with how the box model itself works.

Re: VanJS – A no-JSX framework based on vanilla JavaScript

#117
post #108

After 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…

Oh wow, didn't know ChatGPT could de-obfuscate code!!

Re: VanJS – A no-JSX framework based on vanilla JavaScript

#119
post #87

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.

Build simplicity. It's nice to work with functions all the way down. VanJS could add JSX on top of it though.

Re: VanJS – A no-JSX framework based on vanilla JavaScript

#120
post #87

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.

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.

JSX is still a dependency with different variants which can cause issues. For example, SolidJS uses JSX but a different variant of JSX, which is a bit more slimmer (innerHTML instead of dangerouslySetInnerHTML).

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()} `

Post reply on HN