flying-pig
Re:VanJS: A 0.9KB JavaScript UI framework
on Friday December 22, 2023 @07:54PM (#38740605)
Tbh I can't follow your logic here. You mentioned that in VanJS there are things that need to be careful with. But the same is true for other frameworks, even for plain Vanilla JavaScript. Thus what exactly the point that you're trying to make?
Complexity can't be avoided for extremely complex use cases. But that doesn't mean a simple solution that can work for most of the use cases has no value.
Re:VanJS: A 0.9KB JavaScript UI framework
on Thursday December 21, 2023 @05:53PM (#38728240)
With bundler like esbuild, all JS code, including 3rd party libraries can be bundled into a single file. You don't need an extra round trip for a library.
Re:VanJS: A 0.9KB JavaScript UI framework
on Wednesday December 20, 2023 @04:59PM (#38714210)
Well said! You got the point.
Re:VanJS: A 0.9KB JavaScript UI framework
on Wednesday December 20, 2023 @04:56PM (#38714171)
> when every framework ends up importing jquery anyways
Evidence?
Re:VanJS: A 0.9KB JavaScript UI framework
on Wednesday December 20, 2023 @04:54PM (#38714151)
No offense. What exactly is the cost of using "var" instead of "const"? You seem to pretend it to be a big deal.
Re:VanJS: A 0.9KB JavaScript UI framework
on Wednesday December 20, 2023 @04:31PM (#38713904)
I don't get you. Could you elaborate?
Re:VanJS: A 0.9KB JavaScript UI framework
on Wednesday December 20, 2023 @04:28PM (#38713873)
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 0.9KB JavaScript UI framework
on Wednesday December 20, 2023 @12:49PM (#38711419)
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)
Re:VanJS: A 0.9KB JavaScript UI framework
on Wednesday December 20, 2023 @09:52AM (#38709274)
Agreed. JSX is a bug, not a feature.
Re:VanJS: A 0.9KB JavaScript UI framework
on Wednesday December 20, 2023 @09:49AM (#38709232)
FWIW, VanJS's performance is very impressive. At least much better than React: https://vanjs.org/#performance
How UI frameworks work behind the scenes? (a 7-min video)
Re:VanJS (abbreviated Vanilla JavaSript, smallest reactive framework) ...
on Monday July 31, 2023 @01:11PM (#36945729)
Very neat API indeed! Thanks for bringing it up.
Re:Ask HN: Anyone else notice that HN isn’t full of JavaScript framewo...
on Wednesday July 19, 2023 @10:07AM (#36786586)
https://vanjs.org is another example in that direction. It illustrates that it's even possible to have a full-fledged solution of composing complex reactive DOM tree with just plain JavaScript functions.