9 ms·
I've worked with all three frameworks, but as a mostly single dev/engineer I very very much prefer Svelte because it lacks a lot of boilerplate that React has,
by yawnxyz 4y ago
I've worked with all three frameworks, but as a mostly single dev/engineer I very very much prefer Svelte because it lacks a lot of boilerplate that React has, and it's easier to think about than Vue's clunky way to write variables and functions.
But I'm a "hacker type" and don't work in a large tech company. I haven't seen Svelte in any sort of "real tech companies", haven't seen it on job boards, and it doesn't seem a very desirable skill.
Does this mean that Svelte "doesn't work" for large teams, because it lacks the boilerplate of React?
- dstick 4y agoOut of curiosity, what do you find clunky about Vue's variables vs Svelte? I've been working exclusively with Vue for the last... 6 years. Since the launch of v2. So my mind is already conditioned ;-)
- oefrha 4y agoYou don’t need to write .value’s everywhere, that’s about all. And Vue is a lot more convenient in other ways.
- tinco 4y agoDo you mean .value when writing a component that's some sort of form field? How do you refer to that value in Svelte components? edit: oh nvm, we haven't upgraded our codebase to Vue 3 yet, there are a lot more ".value"'s if you click through to the Vue 3 examples in the original post.
- lcrz 4y agoVue has `refs`, which are reactive proxy objects that are used for tracking things like re-rendering. Since vue does not hide the fact that something is a ref, you need to call `myRef.value` to get to the underlying value of `const myRef = ref(10)`. In a new and currently experimental syntax, you can use `const myRef = $ref(10)`, at which point you can just use `myRef` directly. This will then be converted by the Vue SFC compiler. Another option is to use a reactive object as the state: `const state = reactive({ myVal: 10 })`, at which point you can just use `state.myVal`.
- b0afc375b5 4y ago> In a new and currently experimental syntax, you can use `const myRef = $ref(10)`, Oh sweet didn't know that. I keep forgetting to type `.value` and debugging it wastes a couple of seconds here and there. https://vuejs.org/guide/extras/reactivity-transform.html#refs-vs-reactive-variables https://vuejs.org/guide/extras/reactivity-transform.html#ref...
- oefrha 4y agoHuh, I forgot reactivity transform is already out! Meant to try it but didn't get the chance. Good thing I happen to be starting a new project today.
- solardev 4y agoWhat is the `10` here? Is it a reference to the literal value `10`...?
- preommr 4y agoIn vue 2, objects are made reactive with getters/setters, so changing a field on an object can be tracked. That still exists in vue 3, but a separate api was needed for primitives like numbers or strings, without a parent object that they'be set to. Vue3's solution is to wrap it in a wrapper object called a ref, and to read it's value you have to use .value. It's a pretty simple concept. In svelte, top level variables are automatically reactive.
- yawnxyz 4y agoYes! This was exactly what I felt was more "natural" in Svelte. I also like Svelte's "writable store" model rather than React's Redux which forces data to flow a certain way, through the dispatcher. Svelte Stores make it a little too easy to "shoot yourself in the foot" if you're not too careful though, as you can make data bi-directional, and you can make children set parent data. This makes prototyping super easy and fast, but probably creates massive code readability problems down the line, especially for larger teams.
- solardev 4y agoThese days in reactland, you can easily get app-wide state using useContext (which is much MUCH simpler to work with than Redux). It's just a global store (well, or you can limit it to a certain part of the tree) that any child or sibling can read/write to at will. But just like you said, it can be a footgun if you're not careful.
- acemarke 4y agoFWIW, Redux and Context are different tools that solve different problems, with some overlap. Context is a Dependency Injection tool for a single value, used to avoid prop drilling. Redux is a tool for predictable global state management, with the state stored outside React. Note that Context itself isn't the "store", or "managing" anything - it's just a conduit for whatever state _you_ are managing, or whatever other value you're passing through it (event emitter, etc). I wrote an extensive article specifically to answer this frequently asked question, including details about what the differences are between Context and Redux, and when to consider using either of them - I'd recommend reading through this: - https://blog.isquaredsoftware.com/2021/01/context-redux-differences/ https://blog.isquaredsoftware.com/2021/01/context-redux-diff...
- oefrha 4y agoI'm talking about reactive references in the composition API; the options API is too different from Svelte to make a direct comparison. You can use reactive() to hide some .value's but they are more limited and I personally avoid them. There have been proposals to add more transformations to @vue/compiler-sfc to make refs more "magical" like Svelte.
- mritchie712 4y agoIt's a case of "Nobody ever got fired for choosing X"[0]. No one would blame you for choosing React for a major project / new startup, but someone could definitely poke holes in choosing Svelte ("theres no package for X", "it doesn't scale", "we can't find devs that know it", etc.) 0 - https://www.quora.com/What-does-the-phrase-Nobody-ever-got-fired-for-choosing-IBM-mean https://www.quora.com/What-does-the-phrase-Nobody-ever-got-f...
- ricardobeat 4y agoAbsolutely. I tried to push us to try Svelte at my last job at BigCo for over four years, to replace an internal templating system. We didn't even use React or Node yet, so not only we had to convince the old guard to adopt something new, but also deal with the React-grown crowd protesting. You can't imagine the amount of flak I've taken for that. Managed to get it on a back-of-the-house system, while we built a massively complex React app for the main product. Everyone who worked on it loved it, but was still considered risky. Now that it has a gazillion GH stars and is mentioned in 1 out of 3 blog posts, of course things are much easier.
- solardev 4y agoMan, on one hand... evaluating frameworks is just part of the job, right? Same as evaluating a vendor service, or a third-party package, or an architecture or a pattern... On the other hand, novelty burnout is a real thing. Javascript has mutated so much in a short period of time that it's become impossible to keep up with -- especially once you factor in frameworks and tooling. Times like this, I wish vanilla JS/ECMAscript was more powerful out of the box. For a language designed to work with the HTML DOM -- the ONLY language that works natively with it -- it is so woefully underpowered. Why do we need a framework at all to do a simple stateful AJAX UI? =/ For many sites and apps, the business logic SHOULD be the focus of dev time, but it's not... it's implementing trivial business logic inside of the ever-growing monster that is the JS ecosystem. There are 1000 ways to do anything in JS, but never just one good way.
- neon_electro 4y ago
- msdrigg 4y agoI know svelte is a very common choice for larger news sites to build interactive stories. Ive specifically heart of NYT using it as well as pudding.cool. It makes sense for this small website extension because you can build and compile a small component without having to bundle the entire react runtime in.
- zozbot234 4y ago> It makes sense because you can build and compile a small component without having to bundle the entire react runtime in. Fixed.
- d1sxeyes 4y agoThe guy who created it, Rich Harris, used to work for the New York Times and developed it while he was there. So it's not a big surprise that NYT use it. I'm not sure about many other 'larger news sites' using it, but one place I have seen it out in the wild in a big production app is the Apple Music web app.
- vbezhenar 4y agoHow did he managed to push his own framework. I’d love to rewrite the world, that’s so much more fun than converting Json to sql. But it would be a very hard sell to management to write our own framework instead of using something battle tested like spring boot.
- pastor_bob 4y agoWell the Jeremy Ashkenas (of Backbone, Underscore, CoffeeScript) and Mike Bostock (of D3) used to work there as well and I'm pretty sure the NYTimes pretty heavily embraced some of those libraries with impressive results, so it's probably part of the culture there.
- azemetre 4y agoRich Harris did a lot of data viz work (IIRC) during his tenure at the NYT. I don't know if you have experience working with D3 and other template/view libraries but it's always been painful. D3 can also append the dom, so it makes certain parts of the API harder to use. There's also the need to work with large amounts of array values that are uniquely made with D3 (various SVG paths). I can easily see multiple teams adopting it if it makes writing interactive data visualizations that much easier. Supposedly Svelte is able to do this very well, haven't had the chance to try it with D3 myself.
- spuz 4y agoCheck out https://sveltejobs.com/ https://sveltejobs.com/ And also the #jobs channel on the Svelte Discord https://svelte.dev/chat https://svelte.dev/chat There are jobs being posted every day. And btw, we're one of those looking for Svelte engineers.
- whiddershins 4y agoI’m an engineer who has recently done a large project and a few small ones in Svelte. Where do I apply?
- spuz 4y agoI work at digivault.com in London, UK and we provide custody for digital assets. I've just prepared our job listing and posted it to the Svelte Discord. You'll find all the details about the role there. Hopefully I can also get details on our website soon.
- datavirtue 4y agoSeems like you could put any engineer on Svelte.
- illegalmemory 4y agoApple Music Web version is made using Svelte https://beta.music.apple.com/us/browse https://beta.music.apple.com/us/browse
- jraines 4y agoWe use it at Stylitics for our main user-facing product, a highly configurable 3rd party js widget, with many millions of engagements daily. It’s a small team that works on it directly, but we’re “real” and have to meet fairly stringent/“real” requirements from our big brand/retailer clients (and we’re hiring, email & link in profile)
- cutler 4y agoOne of React's competitive advantages is React Native. That's hard to beat.
- eikaramba 4y agothere is svelte-native based on Nativescript. it is similar fast or faster[1] and provides the ability to directly use every native function in JS without having to rely on new interfaces or build versions (e.g. you can directly access new APIs from JS). beeing able to use Svelte makes it sooo much easier to develop mobile apps. [1] https://blog.nativescript.org/perf-metrics-universal-javascript-part1/ https://blog.nativescript.org/perf-metrics-universal-javascr...
- shroompasta 4y agosvelte native is nowhere near react native in maturity. Discord uses React Native. What larger companies uses Svelte Native?
- mcronce 4y agoThis is my experience as well (in a similar situation to you). I also found Svelte far easier to grok, as someone who is generally not a web developer, than alternatives. Not having to bundle a huge runtime and deal with all the virtual DOM cruft is a nice bonus for performance, but the reality is that it's probably not a measurable difference for anything I'm doing on the front end.
- gherkinnn 4y agoSvelte is indeed more svelte and might appeal more to some, but React doesn’t have a lot of boilerplate to begin with. Sure, calling useState is more work than simply declaring a value and useEffect is badly designed. That’s about it. Nowhere near enough “to work for large teams”, as is the argument for Angular and the Java world it gets its bad ideas from.
- nightski 4y agoDepends on your needs. Personally I hate Svelte's data model and how it changes the semantics of your code by injecting state handling (it's a mental burden). If you are basically writing blogs or very simple content this is probably not a problem. Writing complex apps though I much prefer deterministic top-down data flow and not arbitrary reactivity. If you hate React for some reason I'd consider SolidJS a much more principled framework.
- danra 4y agoNot a large company, but we did choose Svelte and are actively seeking hiring someone experienced with it.
- swyx 4y agolist of real tech companies using svelte: https://twitter.com/sveltesociety/status/1260209026563858432?s=21&t=oT1R6bfLJpHjRu7ugYaMEw https://twitter.com/sveltesociety/status/1260209026563858432...
- Existenceblinks 4y agoIt's a mixed bag of marketing, hiring pool, late mover, and cult problems. The latest one doesn't contribute much but to deaccelerate. The critical point of adoption is libraries, there must be variety of them to serve broad kind of application. That's "late mover" problem, people are tired of re-implementing stuff again. I wish popular frameworks would pass down some funding to vanilla js libs individuals. Marketing, it's about image of "facebook's engineering team" vs "these individuals guys". (often time, big corp's team is not that smart, really) Hiring pool. Small companies couldn't afford shinny things (risks management), so the larger pools of dev, the less risk. Cult, ahaa.. It seems to LOTs of devs agree that Re*ct sucks. Leaving a cult is not easy, it's leaving community. Most people don't want to leave at all, and in a sense they hate that people are leaving too! They become angry and defensive. So we don't make progress more quickly here.