Live data from Hacker News

Why Svelte is our choice for a large web project

github.com

61–70 of 136 posts

Re: Why Svelte is our choice for a large web project

#61
post #6

I have switched to pure HTML/CSS/Javascript for frontend. And I am very happy with it. I sometimes use external libraries. For example handlebars if I want to template something clientside. But no more frameworks. I think pure Javascript is plenty enough these days. For those who can't live without a framework: What would you miss?

>For those who can't live without a framework: What would you miss?

Well, my favourite of choice is Elm, and it's correctness guarantees are really a huge deal to me. Whenever I have to do react or even just vanilla js for work, unless it's really miniscule I will nearly always run into runtime errors because I just forget to check something for null or do something stupid like not awaiting a promise (and that's before any other developers get involved). Typescript helps out a certain extent but I find it isn't nearly prescriptive enough. It's not like I'll ever convince my company to adopt Elm though (and believe me, I tried), so c'est la vie.

Although I suppose these might be considered different languages rather than just a framework, which is where the benefit comes from? It might be just that I'm not very good with dealing with JS as a language rather than needing a framework specifically.

Re: Why Svelte is our choice for a large web project

#62
post #15

I love svelte. but now resorting to server rendered html pages with sprinkles of JS. shit I work on and I have noticed in the world doesn't really need frameworks like react, svelte, vue etc.

Yeah if you're building a relatively simple webpage, a frontend framework really isn't needed.

Re: Why Svelte is our choice for a large web project

#63
post #6

I have switched to pure HTML/CSS/Javascript for frontend. And I am very happy with it. I sometimes use external libraries. For example handlebars if I want to template something clientside. But no more frameworks. I think pure Javascript is plenty enough these days. For those who can't live without a framework: What would you miss?

Svelte isn’t reaaaally a framework in the way React is, although they do share some commonalities. It’s pretty innovative in that it’s not really big JS bundle, but more of a compiler for what is essentially quite vanilla JS code. In the end, if you use Svelte, then your final product will be pure HTML/CSS/JS. I love it because it lets me bundle logically related markup, styling, AND javascript in the same .svelte fi…

React isn't a framework either, nor is it marketed as one. It doesn't have routing, state management, etc. baked in.

Re: Why Svelte is our choice for a large web project

#64
Going back to React a week ago after doing Svelte seriously since Oct 2018 is tough. Asides from the obvious stuff - Svelte's speed and bundle a size of 0: JSX isn't HTML, using weird helpers to enable a class when a JS ternary would do fine, setting state is clumsy, and there's way too much complexity if you're not already used to using React.

That said, I'm also really enjoying TS so could understand why someone may want to stick with React for a new project until Svelte gets TS.

My big Svelte project isn't public but my personal site is a Svelte app too: https://mikemaccana.com source is at https://github.com/mikemaccana/mikemaccana.com

Re: Why Svelte is our choice for a large web project

#65
The lack of a large and mature ecosystem would prevent me for starting a "large" web project. Svelte is still missing UI frameworks like Material UI or Vuetify. Won't you need date range picker ? Full powered data-tables ? Treeview ? Advanced cards or other layouts ? Awesome effects / styles for a rich UI ? Svelte Material UI is a start : https://sveltematerialui.com/ But I will definitely give Svelte a try for my next "medium" size project.

Re: Why Svelte is our choice for a large web project

#66
post #55
post #6

I have switched to pure HTML/CSS/Javascript for frontend. And I am very happy with it. I sometimes use external libraries. For example handlebars if I want to template something clientside. But no more frameworks. I think pure Javascript is plenty enough these days. For those who can't live without a framework: What would you miss?

> For those who can't live without a framework: What would you miss? The thing I miss the most is a good component and state abstraction. That's it. I would be very happy using ASP.NET WebForms today: components are rendered 100% in the server but the state is persisted by the client using a field. The server can be 100% stateless. Too bad it is impossible to convince anyone to pick up ASP.NET WebForms in 2020 :) Mod…

part of our code base is a bunch of webforms, it really does work quite well and surprisingly easy to work with in many cases. Would've been interesting if they had kept innovating around the concept.

Re: Why Svelte is our choice for a large web project

#67
post #6

I have switched to pure HTML/CSS/Javascript for frontend. And I am very happy with it. I sometimes use external libraries. For example handlebars if I want to template something clientside. But no more frameworks. I think pure Javascript is plenty enough these days. For those who can't live without a framework: What would you miss?

Svelte is not like other frameworks. The core is basically one thing, which is to generate code that updates components when data they depend on changes, just like you would do it yourself when not using a framework. There is no runtime or shadow DOM or anything.

That means you can write in a more functional style: input data -> output HTML+CSS.

Re: Why Svelte is our choice for a large web project

#70

I enjoyed learning Svelte; it was fun to use when I rebuilt a personal project from scratch using it[1]. I'm trying to think of some downsides to balance my enthusiasm for the framework, but can't think of any. The article mentions the smaller community as a possible issue, but the community on Discord seem very welcoming. Re "using Svelte means adopting a new language" - it didn't feel like that to me. Every framewo…

> Re "using Svelte means adopting a new language" - it didn't feel like that to me.

Me neither, but I've been around long enough to remember the handlebars.js days. To someone that's only used React I imagine that at first sight things like {#if} {/if} look ugly as hell. To those people I can only say to stick it out: it starts to feel very natural very quickly.

Post reply on HN