Live data from Hacker News

Introducing Svelte, and Comparing Svelte with React and Vue (2021)

joshcollinsworth.com

191–200 of 213 posts

Re: Introducing Svelte, and Comparing Svelte with React and Vue (2021)

#191

Earlier quoted context omitted.

It'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-f...

Nope, dude at my job totally got "laid off" for choosing to write a feature in an ecommerce system in React. He had used it before at a previous job and was familiar with it. Problem was: - No one else in the team was familiar with React. - React did not play nice with the rest of the app and developer work flow. - It was huge and slow - He didn't know React as well as he thought he did and we had endless bugs. - He…

He didn't get fired for choosing React though, he got fired for not being a good developer. If the task was so small you could write it in 4 days it should be easy for any competent developer to write a fast small React version.

Re: Introducing Svelte, and Comparing Svelte with React and Vue (2021)

#192
post #103

Earlier quoted context omitted.

Funnily enough, IDEs a decade ago (more, even) solved this for PHP already, as even back then a lot of PHP was still HTML and PHP (and JS) intermixed in one file. It’s a shame we haven’t solved it properly in modern editors without having to rebuild the tooling over and over again for every new framework.

You just gave me flashbacks of the 3000+ lines .phtml files I was working on a few years back, definitely not the most pleasant experience I had as a developer.

God it was such a horrible mess haha. I have weird Stockholm syndrome fond memories of it.

Re: Introducing Svelte, and Comparing Svelte with React and Vue (2021)

#193

Earlier quoted context omitted.

FWIW, 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 othe…

Thanks for sharing. I think you touch on some of the more powerful features of Redux (middleware, selectors, pass by reference instead of value, etc.) But IMHO a lot of that is overkill when your only goal is global state. Context solves that problem very nicely (in conjunction with state and reducer, yes, but context is the big piece there). Prop drilling was a major hurdle to global state management. But redux intr…

I see people ask on a literal daily basis "does Context replace Redux?". So, I was trying to make a few points in that post, mostly clarifying common misconceptions, because the question itself is rooted in some major misunderstandings about what these tools even _do_ in the first place:

- that Context doesn't "manage" anything by itself, and definitely not "state"

- That there are significant technical differences between the combo of `useReducer` + `useContext` and Redux/React-Redux, in terms of render performance, data access, and usage patterns.

- That this means there are also different use cases for those tools as well.

I wouldn't use Redux to maintain state for a form or isolated chunk of the app, I'd use context + `useReducer`. On the flip side, if I do have "global" state, I would pretty quickly switch over to putting it in Redux instead.

Re: Introducing Svelte, and Comparing Svelte with React and Vue (2021)

#194
post #6

Earlier quoted context omitted.

And what makes it experimental in your opinion?

The fact that there's never a v1.0

https://github.com/sveltejs/svelte/blob/master/CHANGELOG.md

Svelte is currently version 3.5

Re: Introducing Svelte, and Comparing Svelte with React and Vue (2021)

#195

Earlier quoted context omitted.

Thanks for sharing. I think you touch on some of the more powerful features of Redux (middleware, selectors, pass by reference instead of value, etc.) But IMHO a lot of that is overkill when your only goal is global state. Context solves that problem very nicely (in conjunction with state and reducer, yes, but context is the big piece there). Prop drilling was a major hurdle to global state management. But redux intr…

I see people ask on a literal daily basis "does Context replace Redux?". So, I was trying to make a few points in that post, mostly clarifying common misconceptions, because the question itself is rooted in some major misunderstandings about what these tools even _do_ in the first place: - that Context doesn't "manage" anything by itself, and definitely not "state" - That there are significant technical differences b…

Yeah, except... the technicalities make it seem like no, but in reality use context CAN replace redux a lot of times. The power of redux is often unnecessary (or just gets in the way, really), and context is enough.

Your post makes it seem like they are wildly different when in fact they often meet the same need. Use context is helpful precisely because it can replace redux in many situations.

It doesn't really matter how different they are under the hood. Redux is often used only as a global store of state, and context makes that much easier... even globally.

Maybe redux is good for some edge cases, but otherwise it's just overengineered bloat. Context is much more elegant and intuitive. There's no reason to force yourself to use the Flux pattern if you don't have to. I'd certainly never add redux to a project unless I absolutely needed to, it's such a pain...

Re: Introducing Svelte, and Comparing Svelte with React and Vue (2021)

#196
post #22

Personally to me the best framework is no framework at all. Instead I use libraries of code and Web Components. The libraries are either my own or some existing ones. Overall writing web front end this way for me is the most natural way. In my personal experience I spend less time creating the web front ends this way comparatively to when using "frameworks". No "compiling" is needed either, other then optional minimi…

Do you get web components somewhere or write most of them from scratch? And how do you organize the layout, using flexbox? And how do you set states, react to events etc do you write all of the render stuff manually?

Re: Introducing Svelte, and Comparing Svelte with React and Vue (2021)

#197

I've recently started working with Svelte and have been loving it compared to React. A lot of stuff flows through very intuitively. However, for any front-end framework, the UI is paramount, and the most full-fledged component framework I found was Carbon Components[0]. I've heard rave reviews about Quasar[1] for Vue 3. Are there any equivalent UI component frameworks for Svelte? [0]: https://carbondesignsystem.com/d…

You might check out Skeleton (full disclosure, I'm one of the creators)

https://skeleton.brainandbonesllc.com/

https://github.com/Brain-Bones/skeleton

When my partner and I were getting started with Svelte we noticed there was plenty of wrapper libraries, but very few that lean into the benefits of Svelte specifically. We wanted something like Mantine from the React world.

We're still early days (open source and public for about a month) but the feedback has been really positive. The one thing to note is we pair heavily with Tailwind, so if that's not your jam the library may not be for you. However for any sizable app where you're building with a design system, something like this can fit right in.

Hopefully you can give it a try and it helps out! My username is the same on our Discord if you need any help!

Re: Introducing Svelte, and Comparing Svelte with React and Vue (2021)

#198
post #48

I think svelte is a project that will always remain experimental.

Svelte is used in production by several high profile companies. NYT in primis, since its creator Rich Harris worked there, but also Spotify, Ikea, Reuters, Brave...we can debate if it's not as mature as other frameworks, but definitely is not experimental.

By experimental, I don't mean unsuitable for production. As a development culture, I think that they are in a structure that constantly tries something within themselves. So if I start using it for an application today, the codes I use in a few months may be depreceted. this is my personal observation. I wanted to share.

Re: Introducing Svelte, and Comparing Svelte with React and Vue (2021)

#199
post #115

I've recently started working with Svelte and have been loving it compared to React. A lot of stuff flows through very intuitively. However, for any front-end framework, the UI is paramount, and the most full-fledged component framework I found was Carbon Components[0]. I've heard rave reviews about Quasar[1] for Vue 3. Are there any equivalent UI component frameworks for Svelte? [0]: https://carbondesignsystem.com/d…

I'm using Svelte with Daisy UI [0] which is based on Tailwind CSS. It is incredibly simple and beautiful. [0]: http://daisyui.com

Daisyui.com seems to disable scrolling with arrow keys, page up, and page down. Is this a general problem when using Daisy UI, or is there something wrong with the page?

Re: Introducing Svelte, and Comparing Svelte with React and Vue (2021)

#200

Earlier quoted context omitted.

To be fair, as frustrating as it is sometimes for those of us who want to use the best tool, for those who have jobs affected by the risk in their decisions, it's a sound principle to default to.

I think the nuance is that much of the IT world moves much, MUCH slower than the web frontend. "Nobody ever got fired for choosing IBM/AWS/Google/Microsoft/ESRI" will culturally last a loooooong time (5-10 years? 15?) "Nobody ever got fired for choosing jQuery? Angular? React? Vue? Svelte? NPM? Yarn? Node? Deno? Next? Gatsby? Netlify? Webpack? Parcel? Babel? Bun? Canvas? WebGL? WASM? Workers? Cloudflare? Fly? Leaflet…

Nobody ever got fired for choosing standard browser technologies, I would have thought :-) Which, from your list, would include canvas, webgl, wasm, and workers. As for the rest — they may very well have been :-)
Post reply on HN