Or you can skip the attempts to provide pseudo-reactivity on top of JS and clumsy shoehorning of GUI apps into finite state machines. Just use Svelte instead.
In a recent presentation Evan You mentioned Svelte and basically said that their approach is better and if it weren't for backwards compatibility he'd have taken a lot more of their ideas for Vue 3
I actually tried out Vue after I had a production app made using svelte 3 and was amazed how verbose Vue is in comparison. Not to mention Svelte's smaller bundle sizes due to absent run-time library.
The fact render functions are made on build time does not mean Svelte has no runtime. Svelte has nice things going for it but you guys are just writing bullshit in order to criticize Vue.
Not close to fully runtime-less sure, but about as close as you can get. It's the same way C isn't runtime-less compared to assembly because it has crt.0 but compared to Java it effectively is.
> Not close to fully runtime-less sure, but about as close as you can get.
Have you looked at transpiled Svelte code? It's 5-10x bigger than the source code because an entire runtime library is injected and your code is rewritten to use that library at compile time.
How does Svelte help with static analysis? Genuinely curious here.
I've had my eye on this issue[1] for a while. I'm excited about the idea behind Svelte, but without static typing support, there's no way I could feel comfortable using it on a real project.
Static analysis as in tracking variable mutation propagation on the compiler level. You don't need types for that.
GUI programs are inherently stateful and the functional model used by React and others boils down to shoving everything into a giant finite state machine. You explicitly specify all possible states when you code so the state of your GUI is explicit instead of implicit. In traditional GUI terms, immediate-mode versus retained-mode (immediate in the sense of DOM updates, the reference here is how often and how much do you mutate the DOM and not frames per second because the DOM is also stateful which is one of the reasons why web programming require so many hacks). Now this isn't easy in practice because of obvious reasons - the state space explodes as the number of variables increases and trying to having a single store to keep everything in sync can be difficult and annoying. Sure your code will be somewhat more bug-free in the end but you have to spend a lot of effort and end up with verbose code. Svelte on the other hand make variables reactive on the compiler level. So you get both the Excel-style reactive feeling out of the box and at the same time optimized runtime-less code that only mutates when it has to (current solutions all require a library runtime to keep track of things, diff DOMs etc.). In other words, like traditional hand written code but with the compiler preventing bugs due undefined state/variables getting out of sync issues.
My explanation is probably inaccurate/simplified in some aspects so please feel free to elaborate upon it.
I've used svelte for one site that ended up being a good fit. Ended up using Sapper to build out the static site and was pretty impressed with the load times
https://svelte.dev
Transpilation and static analysis are the ways to go.