Earlier quoted context omitted.
What are the long term theoretical benefits of vdom? Concurrent rendering?
At least with solid, you can't do `const a = ` without caveats. Instead you have to store it as `const a = () => ` (which isn't quite the same, having problems managing state/renders). In React I was optimizing things by storing vdom in state/memo & then interpolating that exact vdom. Or sharing vdom in multiple places. Without vdom you can't throw jsx results around so haphazardly In solid there's also managing batc…
VanJS – A no-JSX framework based on vanilla JavaScript
61–70 of 178 posts
Re: VanJS – A no-JSX framework based on vanilla JavaScript
#62Re: VanJS – A no-JSX framework based on vanilla JavaScript
#63Why do people dislike JSX? For me the lack of JSX is a negative point. Why would I want to write nested functions everywhere? JSX is HTML on steroids, but it can be just HTML if you wish it.
Why would you insist to write the function name both before AND after the call? args vs DoStuff(args)
Re: VanJS – A no-JSX framework based on vanilla JavaScript
#64Earlier quoted context omitted.
What are the long term theoretical benefits of vdom? Concurrent rendering?
At least with solid, you can't do `const a = ` without caveats. Instead you have to store it as `const a = () => ` (which isn't quite the same, having problems managing state/renders). In React I was optimizing things by storing vdom in state/memo & then interpolating that exact vdom. Or sharing vdom in multiple places. Without vdom you can't throw jsx results around so haphazardly In solid there's also managing batc…
Re: VanJS – A no-JSX framework based on vanilla JavaScript
#65This is where most libraries are going. Svelte 5 builds upon these signals / derivations as well, and I guess a bunch of other libraries. It would be time for them to get together and standardize on a signals library at this point that could be adopted to be a web standard and help interoperability between web components built with different frameworks.
Solid's attempt feels more promising since it's building on existing native functionality (proxies / getters), and has intuitive, low-footprint usage (just function calls and reference comparisons).
Edit: It seems I'm not up to speed in fact, I hadn't seen Svelte 5 and runes yet, which are not compile-time. I will need to give it another try. I agree in general that signals and signal-based APIs are the future and definitely better than hooks at least, and a single agnostic standard would be good for everyone.
Re: VanJS – A no-JSX framework based on vanilla JavaScript
#66Why do people even reinvent this wheel every few months? Does the Anyone can build a "reactive" type framework by following tutorials online now, they're super in vogue. Is my cynicism here warranted, or am I just jaded from 20 years of watching pendulums swing left and right and watching the wheel be reinvented over and over?
For privacy reasons, resources are no longer cached across origins, so the size does matter (though arguably 1KB more or less makes absolutely no difference on any webpage that has a medium-sized image, especially if you have SSR for the first paint). But the better reason why these projects exist is for experimentation and iteration. It's not like everyone who uses React will switch to this over the holidays, but ma…
Re: VanJS – A no-JSX framework based on vanilla JavaScript
#67Earlier quoted context omitted.
Why would you insist to write the function name both before AND after the call? args vs DoStuff(args)
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.
which is another one of its flaws.
Re: VanJS – A no-JSX framework based on vanilla JavaScript
#68Re: VanJS – A no-JSX framework based on vanilla JavaScript
#69Earlier quoted context omitted.
Size does still matter. Just because we _can_ serve huge amounts of data over the pipe quickly doesn't mean we _should_.
Except... the huge amount is photos and fonts and whatnot. As you can see on the vanjs size, the biggest framework Angular weights 85 kB and it will be cached. Compared to what Angular also brings in functionality, i don't see size of the framework as an argument anymore. Consider Hackernews: hn.js comes with 21,4 kB. The Y logo on the upper left is a 46,32 kB SVG! What should i care about 1kB minimal framework or 85…
hn.js is just north of 5.2kB (2.3kB compressed), and the logo is 315 bytes.
Re: VanJS – A no-JSX framework based on vanilla JavaScript
#70Earlier quoted context omitted.
For privacy reasons, resources are no longer cached across origins, so the size does matter (though arguably 1KB more or less makes absolutely no difference on any webpage that has a medium-sized image, especially if you have SSR for the first paint). But the better reason why these projects exist is for experimentation and iteration. It's not like everyone who uses React will switch to this over the holidays, but ma…
It is strange when this was rolled out as to why decentralizeyes like functionality was not targeted to be built into browsers enabled by default.
But something like Decentraleyes prevents site A from seeing what resources you requested on site A.
(Or rather, whichever CDN provider site A is using.)
You could have both at the same time, but they are orthogonal. As for why it's not in browsers, assuming good intent, I'd think it's because it requires you to bundle a whole lot of libraries with the browser for it to be useful as a local CDN. If browser vendors decided which JS frameworks are bundled with the download and which ones are not, I'm not sure if that would help decentralisation!