Live data from Hacker News

Ask HN: What are your experiences with Svelte (JS framework)

news.ycombinator.com

61–70 of 105 posts

Re: Ask HN: What are your experiences with Svelte (JS framework)

#61
I work in the software dev industry, but not as a developer. I do some freelance and hobby development. I've made prod apps with AngularJS, Angular, and Vue. My view on development is much more from a business owner and creator perspective than a career developer. So, take that for whatever you want.

I've used Svelte (with Sapper) for two production apps. One is a small e-commerce app [1] and the other an NFL stats app [2]. They are both static sites, but I won't really get into that. There is a tweet I detailed out a little bit of the second app [3].

Personally, I find Svelte to be the best dev experience I have had and it's not close. To me (like a said, a novice dev), I find myself tripping over frameworky things all the time. The only thing is that before Svelte, I didn't really realize that is what was happening. I just thought that was how web dev was.

However, when I played with Svelte, I instantly felt more productive and confident in my ability to create what I wanted. The main benefit that I have experienced is that it is so simple. There is just less to learn because it builds upon your knowledge of the basics (CSS, HTML, JS). To me, it just organizes these into a nice single file and throws a touch of template markup at you to give you what you would expect from a framework. There's more to comment on, but for brevity, I won't.

I also am just a huge fan of the compiler approach. I know that bundle size is a rather debatable topic as to what matters and what doesn't, but if I can have a great experience building a site AND I get smaller bundles (in most cases) for free, then that is huge to me. I think it is going to allow some cool features in the future, too. I just think it makes a great deal of sense to build things in this way.

The only con I have ran into, which isn't really a knock on Svelte itself, is that the community is tiny (relative to the others). The community that does exist lives on Discord, which is awful for searchability of questions. That said, the docs are great and I have had to Google far less things than I have in the other frameworks I have used, so it is less of a ding than it would otherwise be.

So, Svelte is my new default. I'll continue to fanboy over it to my developer coworkers who love React. They will roll their eyes and become filled with contempt and pity. I'll insult their intellectual capability. We laugh. All of our apps remain in React. Life goes on.

[1] https://bigcreekbarkery.com [2] https://quickfantasystats.com [3] https://twitter.com/pjbrown_11/status/1186012274164752388

Re: Ask HN: What are your experiences with Svelte (JS framework)

#63

I've posted before about my experience with svelte ( https://news.ycombinator.com/item?id=20338175 ). Will try to reiterate a few of them here. I've been using it internally at my current job to great effect since March, after I convinced my manager to let me try it on a one-off project. That small project has led to us using it for other bigger projects, again pretty successfully. tl;dr – I probably wouldn't choose…

Testing for Svelte does exist! See my writeup on it here: https://objectcomputing.com/resources/publications/sett/july...

Oh, great! Thanks for the link. I had it on my to-do list to try something similar to what you did. Glad to learn from someone else's exploration.

Re: Ask HN: What are your experiences with Svelte (JS framework)

#64
post #54

I've posted before about my experience with svelte ( https://news.ycombinator.com/item?id=20338175 ). Will try to reiterate a few of them here. I've been using it internally at my current job to great effect since March, after I convinced my manager to let me try it on a one-off project. That small project has led to us using it for other bigger projects, again pretty successfully. tl;dr – I probably wouldn't choose…

> the time to first meaningful render in svelte is substantially, substantially lower than it is in React, and you face none of the drawbacks of using the React starter stuff (ie ejecting isn't a thing). This may seem like a weird metric, but I think it's pretty vital. I think this is the most important metric of any JS project. We rarely need to update thousands of dom elements per second, but all JS projects need t…

Thanks for the link. Incidentally I have that same talk bookmarked. Though for the record, I have needed to render thousands of dom elements per second :)

Re: Ask HN: What are your experiences with Svelte (JS framework)

#65
post #8

It's cute but I can't recommend it for a project with more than one developer. Lack of TypeScript support and the hacky component model (specifically, Svelte's equivalent of React props) are the two big deal-breakers.

I understand if you really want TypeScript support, but why do you feel the component model is hacky? I find it beautifully simple.

I elaborated below. A mix of the strict one component per file rule and the definition of props as a sequence of independent variables prevents a lot of patterns I use on larger projects.

Re: Ask HN: What are your experiences with Svelte (JS framework)

#68

I've used it for a small side project. It's fun to build in, but the testing story is almost non-existent.

The testing story just hasn't been well documented yet in the official docs. I have documented both unit and end-to-end testing with Svelte here: https://objectcomputing.com/resources/publications/sett/july...

Great link! Were you able to get unit tests with `context` working? Last time I tried (I believe with @testing-library/svelte) it didn't work because each component is compiled separately and don't share a runtime.

Re: Ask HN: What are your experiences with Svelte (JS framework)

#69

Earlier quoted context omitted.

The testing story just hasn't been well documented yet in the official docs. I have documented both unit and end-to-end testing with Svelte here: https://objectcomputing.com/resources/publications/sett/july...

Great link! Were you able to get unit tests with `context` working? Last time I tried (I believe with @testing-library/svelte) it didn't work because each component is compiled separately and don't share a runtime.

I haven't tried that.

Re: Ask HN: What are your experiences with Svelte (JS framework)

#70

Earlier quoted context omitted.

Not everything needs to be thought of as a business use case, you don't always need to think about the ability to hire additional developers who know your framework of choice. Also when I'm hiring I care very little about whether people have experience with the framework we use (Angular). Even still, I think svelte can be a good choice if your focus is on enhancing html with javascript rather than focusing on javascr…

What? "you don't always need to think about the ability to hire additional developers who know your framework of choice" Unless you are hiring a junior dev who has no experience I think this statement is pretty far fetched. The ramp up time for a new dev on a framework that isn't widely adopted yet will be way higher, plus hiring developers who would even want to work with said framework sounds like a task in itself…

I was writing Svelte code after an udemy class having done Vue prior to that. They aren't that different. anyone who can write react or vue code could be writing svelte code in a week.
Post reply on HN