News for hackers. Stuff that matters.
Re:Svelte – A UI framework that compiles into tiny standalon... by mambodog on Wednesday November 30, 2016 @11:17AM (#13071914)
TodoMVC is a useless benchmark for the problem that this claims to be addressing. The limits we're hitting with our applications now are with BIG applications, with many routes, many views, and lots of client side logic. We're talking hundreds of files (in some cases, thousands). Of course a framework, with it's fixed overhead, is going have a bigger payload for a tiny demo app like TodoMVC, than something like this which compiles to some amount of overhead which grows seemingly linearly with application size.

That said, I'm not criticizing the framework here, and I welcome new ideas, but a better choice of benchmark is sorely needed to be persuasive here.

Re:Svelte – A UI framework that compiles into tiny standalon... by lhorie on Wednesday November 30, 2016 @11:32AM (#13072075)
I had done some back-of-envelope calculations[1] when I saw it on Reddit

My conclusion was that it seemed like the file size would grow fairly quickly

[1](https://www.reddit.com/r/javascript/comments/5fcwhz/svelte_t...)

Re:Svelte – A UI framework that compiles into tiny standalon... by christophilus on Thursday December 01, 2016 @11:15PM (#13085956)
Just to follow up on this. I wrote a little CRUD app (managing a list of users). I wrote it in both preact and in svelte, wanting to see how the two grew as I added new features.

When adding the "Edit User" feature:

Svelte's unminified size grew 1.39x. Its min+gzip grew 1.2x. Preact's unminified size grew 1.06x. Its min+gzip grew 1.05x.

The final tally for an almost line-for-line equivalent app in both:

Preact:

- Minified: 15.8KB

- Min+GZ: 6.2KB

Svelte:

- Minified: 23KB

- Min+GZ: 4.8KB

So for a trivially small app, when minified and gzipped, Svelte does produce very compact results. But its growth rate (1.2x) vs preacts (1.05x) indicates to me that it would probably outgrow preact on a normal-sized app.

It would take a long time for it to outgrow the typical React or Angular stack, though.

[Edit: grammar]

Re:Svelte – A UI framework that compiles into tiny standalon... by shams93 on Wednesday November 30, 2016 @11:24AM (#13071987)
Yeah the lack if a realistic benchmarking tool is a major part of this whole front end fatigue, is it just another project or can it realistically prove itself to be a real benefit for performance.
Re:Svelte – A UI framework that compiles into tiny standalon... by mercer on Wednesday November 30, 2016 @11:58AM (#13072350)
FWIW Rich Harris' other stuff is pretty solid: Ractive, Rollup, Bublé.
Re:Svelte – A UI framework that compiles into tiny standalon... by scotttrinh on Wednesday November 30, 2016 @12:38PM (#13072758)
I was very shrug-y about this new non-framework until you pointed out it was a Rich Harris project. Definitely interested now...
Re:Svelte – A UI framework that compiles into tiny standalon... by progx on Thursday December 01, 2016 @03:40AM (#13078079)
Interessting, it all depends on who create a project, not what the project does.
Re:Svelte – A UI framework that compiles into tiny standalon... by jgalt212 on Wednesday November 30, 2016 @01:44PM (#13073435)
I agree. Ractive is very cool, and with a little luck could have been the hotness that vue.js has developed into.
Re:Svelte – A UI framework that compiles into tiny standalon... by skinofstars on Thursday December 01, 2016 @07:03AM (#13078813)
Yeah, Ractive and Vue felt like very similar style frameworks, though Ractive's SVG support is awesome. Shame it isn't more popular.
Re:Svelte – A UI framework that compiles into tiny standalon... by arxpoetica on Thursday December 01, 2016 @04:23PM (#13083643)
We use it and it is hotness.
Re:Svelte – A UI framework that compiles into tiny standalon... by proyb2 on Wednesday November 30, 2016 @12:29PM (#13072675)
Minified with Closure help with reduce size. I find Svelte can compile to IIFE which prove high performance than other patterns.
Re:Svelte – A UI framework that compiles into tiny standalon... by mstijak on Wednesday November 30, 2016 @01:51PM (#13073492)
I find wrong that most frameworks do not include any component library. Even if there is a vibrant community, you end up with 30 dependencies which do not play well together.

I'm the author of a commercial framework for BIG applications [1]. Once you put everything on the table you can see which features should go into the framework and you end up with things like localization, date/number formatting, form validation, keyboard navigation, layouts, tooltips, routing, modals, etc. Once you have all that, you can build a coherent widget/charting library on top of it.

[1]: http://cx.codaxy.com/v/master/docs/intro/feature-list

Re:Svelte – A UI framework that compiles into tiny standalon... by straws on Wednesday November 30, 2016 @11:28AM (#13072037)
Are there any alternatives to TodoMVC out in the wild?

I rather like https://github.com/staltz/flux-challenge myself, but I wonder if there are any other projects that are focused on more complex examples.

Re:Svelte – A UI framework that compiles into tiny standalon... by kgr on Wednesday November 30, 2016 @12:03PM (#13072397)
The 7-GUIs suite looks better, but so far only one JS framework implements it. The problem with more realistic benchmark apps (or suites) is that they require more effort to implement, so you have a selection bias towards easy-to-implement yet too-small-to-be-useful demonstrations like TodoMVC.

Something like a GmailMVC would be better.

https://github.com/eugenkiss/7guis/wiki

Re:Svelte – A UI framework that compiles into tiny standalon... by lhorie on Wednesday November 30, 2016 @12:32PM (#13072697)
I like ThreadItJS[1], it's basically a mini HN.

About 100-200LOC to implement, does recursive views, xhr, routing, dynamic state tree, and the server periodically responds w/ errors (on purpose) to force you to implement loading and error states.

[1](http://threaditjs.com/)

Re:Svelte – A UI framework that compiles into tiny standalon... by rich_harris on Wednesday November 30, 2016 @11:29AM (#13072047)
Agree. It is useful insofar as you can quickly get a sense of what working in a given framework feels like, but the community could use some alternatives.