Settings

Theme

Ask HN: What are you using – React, Vue or Svelte?

4 points by FunnyGunther 2 years ago · 7 comments · 1 min read


Will love if you can elaborate the exact reasons why you chose it in first place.

Looking for some insights from experienced people.

DamonHD 2 years ago

None - flat static light HTML with no JS on most pages, and all CSS inlined, to minimise page weight and client and server CPU load.

  • FunnyGuntherOP 2 years ago

    I do love that route too. Though I see this as a contextual thing. If you want to go for enterprise use cases, saving time, focusing on functionality, performance, scalability and maintainability becomes very significant.

    I am learning REACT due to same from last two days and I see the benefits though find it over-complicating some simple stuff. Appreciate you answering pal. Have a great day!

  • 0xblinq 2 years ago

    Nice, but this works only for simple and minimal stuff. Maybe up to a landing page. Anything else and this totally breaks down.

  • tonyoconnell 2 years ago

    Astro is very good at building flat static light HTML with no JS on most pages. It strips the JS from the page and loads it in "islands" only when needed.

meiraleal 2 years ago

Lit/Web Components. Now WC are good enough to build once and run on every frontend framework so I'm sticking with the faster and simpler.

tonyoconnell 2 years ago

I switched from React to Svelte just recently because the code is so much more beautiful and succinct. I am so happy with the decision. Here are some reasons why you should choose Svelte over React and Vue ...

Zero Runtime Overhead: Svelte shifts much of the work to compile time, producing highly optimized vanilla JavaScript at build time. Unlike React and Vue, which use a virtual DOM to update the browser's DOM, Svelte writes code that updates the DOM when the state of your app changes. This results in faster initial loads and smoother runtime performance.

Simpler Syntax and Less Boilerplate: Svelte offers a cleaner and more intuitive syntax compared to React and Vue, reducing the amount of boilerplate code developers need to write. Its reactive assignments feature allows you to write reactive statements naturally, without needing to use special APIs or functions like useState or useEffect in React, or computed and watch in Vue.

Built-in State Management: Svelte's reactivity model is baked into the language itself, eliminating the need for external state management libraries (like Redux for React or Vuex for Vue) for most applications. This simplifies the development process and reduces the bundle size.

Faster Load Times and Better Performance: Due to its compile-time optimizations and the absence of a virtual DOM, Svelte applications generally have faster load times and better runtime performance. This can lead to improved user experience, especially on mobile devices and in low-bandwidth environments.

Enhanced Developer Experience: Svelte's simpler syntax, fewer concepts to learn, and less boilerplate code contribute to a smoother developer experience. The framework's tooling, including SvelteKit for building server-side rendered applications, is designed to be straightforward and easy to use, further enhancing productivity.

Community and Innovation: While smaller than the communities for React and Vue, the Svelte community is rapidly growing and highly passionate, contributing to a rich ecosystem of tools, libraries, and resources. Svelte's innovative approach to web development is pushing the boundaries of what's possible, making it an exciting choice for projects looking to leverage the latest in web technology.

Better SEO and Performance Out of the Box: SvelteKit, Svelte's application framework, offers server-side rendering (SSR) and static site generation (SSG) capabilities out of the box. This can lead to better SEO and faster page load times, which are crucial for user engagement and retention.

Future-Proofing Your Project: By focusing on compile-time improvements and adhering to modern JavaScript standards, Svelte positions projects to take advantage of current best practices and future web optimizations. This can help ensure your project remains relevant and performant in the evolving web landscape.

  • FunnyGuntherOP 2 years ago

    OMG, this is exactly the kind of direction that I was looking. Tony highly appreciate your in depth points.

    - Yes, useState and use useEffect felt like an overhead to me. - I was super confused why we need external library to make react talk and maintain state and data (Redux?)

    I am giving Svelte a try today itself

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection