4 ms·
My 2c: I think svelte is overhyped and a poor solution to the problem it's trying to solve. First of all, I am tired of ridiculous metrics like how small svelt
by preommr 4y ago
My 2c: I think svelte is overhyped and a poor solution to the problem it's trying to solve.
First of all, I am tired of ridiculous metrics like how small svelte is when it's a really small example, and it's one or two lines of initial boilerplate.
The thing that really set svelte apart was it's better syntax and experience when it first came out. I think that was when react class components, and vue 2 was still prominent. Look at the react and vue 3 examples now. They're really close. Vue 3 in particular looks a lot like svelte with vue's sfc.
I don't even think the dissapearing part about svelte is that important. That kind of performance is rarely going to matter before other bottlenecks. And if it really is that crucial, there's nothing stopping either react or vue 3 from doing something very similar. Vue 3 already has sfc that go through a "compile" process, and it uses getter/setters to make targetted changes.
There's also some considerable challenges to svelte: it's brining in custom syntax to really tackle the problems with reactivity. That's honestly really good if we could get one unifying system. It would be wonderful. But that's a tall order. Given how much traction these other tools already have, I don't see svelte ever fully dominating. Which makes it's extra magic and custom language features even more of a burden. People already complain about vue's few dsl's in the template or react's hooks.
Finally the eco-system for the other tools have come so far. Given how much the gap has closed, and how much farther the other tools are, the better ecosystems make them much better choices. Also as much as I respect Rich Harris, it's a tough sell against people the momentum of something like Facebook or even Evan You with vue and related tools like vite. I know he's working full-time on svelte now at vercel, but the corporate side of this as well as maintaining a community around this is another hurdle. Say wha t you will about react, nobody got fired for choosing it. On the other hand, it's a punch in the gut to jump on something like sapper and then have it be oddly deprecated/rolled into sveltekit.
- 7sidedmarble 4y agoJust throwing this out there, but have you considered that React and Vue in fact also have custom non-JS syntax? JSX is not valid JS, parsers had to be written to work with it. And Vue uses templating syntax in HTML, just like Svelte. Svelte doesn't have any non-native syntax in the JS parts, just the templating.
- dmitriid 4y agoWorse than that, Vue has something like three different DSLs under the hood. Some of it JS-like but not fully JS, some of it is custom attributes, some of it is "oh, it's JS, but you have to make very specific objects"
- fendy3002 4y agoIn my opinion parser is not a problem. I'm using tsx so there'll be compiling anyway. Now if they make tsx native it'll be game changing
- preommr 4y ago> but have you considered that React and Vue in fact also have custom non-JS syntax? I 100% agree, and I never fully got this argument. But my God do people love to repeat it. So much of react's initial fervor was around "it's just javascript". I write a lot of vue code and I only use like half a dozen directives and learning all of them should take less than one afternoon. And yet, the number of people that don't like vue because of a very simple DSL has been staggering. It really doesn't make sense to me, but people seem to really hate learning something that superficially looks different.
- unsupp0rted 4y agoSame here: I write Vue every day and I use `v-if`, `v-else`, `v-for`, `v-model` and sometimes a `v-slot`. I also use about 30 different `v-` components from Vuetify, which come with so many properties, events and slots that it might as well be a giant DSL.
- ricardobeat 4y ago> I am tired of ridiculous metrics like how small svelte is when it's a really small example, and it's one or two lines of initial boilerplate. There is nothing ridiculous about it. Svelte has a tiny* runtime library by design, so naturally the code output will be much smaller. Also as a result of its design, you do end up writing less lines of code. > That kind of performance is rarely going to matter before other bottlenecks It matters a lot for complex apps. React is unoptimized by default, and the standard advice is to only "optimize when you need it", which more often than not is too late. By the time you have an app with 15 context providers and nested components hundred-levels deep, and you start noticing slowness, performance optimization is a gigantic effort. > it's brining in custom syntax to really tackle the problems with reactivity While Svelte uses a (tiny) bit of custom syntax, React makes you bring in a ton of DSLs. Hooks, the component lifecycle, and all the third party libraries you will need to build a functional app require a lot more effort. People forget just how much stuff they had to learn. * fixed from 'no runtime'
- richeyryan 4y agoSvelte absolutely has a runtime, with the two most crucial components being the scheduler and the lifecycle manager. It still comes in a lot lighter than React.
- preommr 4y ago> While Svelte uses a (tiny) bit of custom syntax, React makes you bring in a ton of DSLs. Hooks, the component lifecycle, and all the third party libraries you will need to build a functional app require a lot more effort. People forget just how much stuff they had to learn. I don't disagree with this, but people unfairly complain about it anyway, and it's another roadblock in the adoption process that makes it less exciting to fight for. > and nested components hundred-levels deep, and you start noticing slowness, performance optimization is a gigantic effort. That right there is the problem. The DOM is optimized for something like 32 levels of depth which is also the standard used for lighthouse scores. It's always possible to go over that, a little bit, but hundreds? At that point, it's not a question of svelte vs react, but really advanced dom (if even that) manipulation.
- davidjfelix 4y agoRe: Sapper -> Sveltekit, you might say the same thing for React Router users who adopted Reach-router, back to react-router and are now on remix-router or next.js router. Also I found it weird that you mention Evan You WRT vite as a counter to why Rich might be up against stronger devs, but Rich made rollup, which was foundational to Vite's bundling.
- preommr 4y agoI don't doubt Rich Harris' skills as a developper. But project governance is very different from have strong technical skills. Things like communication, prioritizing features important for the community, dealing with idiots way beyond when it stops becoming fun, gathering money, writing good documentation, etc. Rollup is cool, but it's a very different beast from a f/e framework. For a lot of projects, migrating from rollup to webpack might be a few hours or a week. Migrating from svelte to react, is months if not many man-years.
- davidjfelix 4y agoWhat's wrong with svelte's documentation or the community interaction that's happening around svelete? My point is that you've seemingly taken points away from Rich for the same reasons you're giving Evan You validity. Migrating between react and vue would take probably the same amount of time -- I'm not really sure what your point is here. My point is that you've unfairly discounted Svelte on the same standards you're raising vue.
- fsociety999 4y ago> Migrating from svelte to react, is months if not many man-years. I’m not sure what your argument is here, but I’m pretty sure you have it backwards. The fact that it might take a while to migrate a svelte project to react is not because of poor documentation or tooling or communication or anything like that. It’s because so many things work out of the box in svelte, and to do the same things in react would take tons of boilerplate or third party libraries. Some things may not even be possible to port, at least not easily. This doesn’t show that svelte is bad though. It shows that react lacks functionality and is more difficult to use.
- kolme 4y ago> I don't even think the dissapearing part about svelte is that important. That kind of performance is rarely going to matter before other bottlenecks. And if it really is that crucial, there's nothing stopping either react or vue 3 from doing something very similar. Vue 3 already has sfc that go through a "compile" process, and it uses getter/setters to make targetted changes. It matters a lot, especially on mobile phones with less processing power and spotty internet connection. It's a huge factor, actually. Downloading and parsing React+React-DOM on mobile phones, especially if they are not high end, is miserably slow. Also, it's not only a user experience problem, your "Google Rank" is influenced by your lighthouse scores. So I'd argue "that kind of performance" is business critical on several levels. At least in my experience.