But I might still use React for large projects with many components if it doesn't need animations/transitions, and the global/shared state is pretty lightweight
You're really hitting a point there with the animations. Framer is cool and all, but animating exits still sucks.
I can get by with "sort-of typescript" for Svelte, but it's a bit annoying that I can't get VS code to provide type hinting everywhere, and to also enforce "no-implicit-any". In smaller projects I'm probably not touching files I've completely forgotten all the time, so it's not too much of a problem
I can deal with the fact that the tailwind extension intellisense might not work in Svelte (or it didn't last time I tried it); for smaller Svelte projects I'm happier to use component-scoped styling 90% of the time. At that point I probably haven't typed the same combination of styles enough times that I want to share them across the project.
When the project grows, these become much more of a pain. I end up with lots of small to medium sized components, and I want to compose these along with mixins defined elsewhere (utility functions that can be pulled into them, etc). At that point I really want Typescript to be as strict as possible, and I want the Intellisense on tailwind partial class names. I'm sure there are plenty of other similar tooling issues that I'm forgetting right now.
React also has many more libraries, as you said, including the wonderful Tanstack query (I know there's a Svelte engine now, though I haven't tried it yet)
But the actual framework is so much easier in Svelte, enough so that I'd almost always choose it for smaller projects. React has its pain points even at medium scale, whereas with Svelte they really hit me harder as the project gets bigger. So it probably comes down to what I'm doing.
But yeah, I'm still going to reach for Svelte the majority of the time
I’ve been making a living as a freelance Svelte dev for years now and never struggle to find work, but your point stands — job market share matters.
Hopefully (for devs, execs, and users sake) Svelte adoption will continue to rise!
I looked into Svelte when it was first emerging and at the time it seemed a reinvented Angular.
Angular is more like Svelte+SvelteKit. Router and plumbing included. Angular 16 adds signals, so that's a recent difference.
Svelte handles shared state+reactivity as stores. Svelte contexts allows partitioning of shared state. Reactivity comes from a small superset syntax of JavaScript that acts a bit like a spreadsheet. Svelte is a compiler rather than a full-size runtime library.
Angular relies heavily on rxjs, and synchronous vs asynchronous state is quite distinct and "boilerplatey". Switching between sync and async can be a real pain sometimes. That said, Angular is VERY opinionated, which makes it predictable from a developer point of view. (I think SvelteKit is as well, but its track record is a lot shorter than Angular's.)
Variable interpolation looks about the same, but Angular uses custom HTML attributes for control flow whereas Svelte uses syntax that's more akin to Velocity templates.
Angular still has a virtual DOM, and the smallest app bundle is still often more than a megabyte even before it hits your code. Time to first render is still pretty bad. Angular's compiler, while faster in v15-v16, is still dog slow compared to many younger frameworks.
Svelte is smaller and faster at both compile time and runtime, at least when you have fewer than 250 components, give or take.
Angular components use annotations heavily and use separate files for logic, markup, and styling. Svelte components put logic, markup, and styling in a single file but with less boilerplate. Both support two-way data binding. Angular is more mature but somewhat arcane while Svelte looks much more like vanilla HTML/CSS/JS.
Svelte CSS styles are scoped to the component automatically by default without worrying about prefixes or naming conventions.
Angular routing is more programmatic. SvelteKit routing is filesystem path-based.
Svelte has a REPL. I don't know of one for Angular.
Angular has a massive ecosystem. Svelte's ecosystem is far smaller, but integration of vanilla JS libraries is typically easier with Svelte than Angular. Still, Angular's breadth of community is undeniably larger.
> Angular still has a virtual DOM
It does not.
Thank you.
Virtual DOM (React, Vue) is a technique that produces a complete version of the DOM which is then reconciled.
Incremental DOM (Angular, Svelte) is a technique that computes the DOM diff/update directly.