Svelte Front end framework

So I found this The magical dissapearing UI framework.
and I have been playing with it and and Rollup as a brunch replacement. and I am quite happy with it.
Basically what it does is converting html into js modules. for then to be used as components. the end product is a single js file.

The components are functions and contain all the html, css, and js , just add data and call them up.

Just curious what you more seasoned web developer think about this way of doing things.


I think I love the idea. You can get to know it better on the introductory blog post. Particularly this part:

Given that, what if the framework didn’t actually run in the browser? What if, instead, it converted your application into pure vanilla JavaScript, just like Babel converts ES2016+ to ES5? You’d pay no upfront cost of shipping a hefty runtime, and your app would get seriously fast, because there’d be no layers of abstraction between your app and the browser.

I’m looking forward to seeing how it will end up. Sadly it may trigger some negative reactions due to it contributing to the ol’ JavaScript fatigue…

Last Day Since New Javascript Framework: 0


I think this should be counted in minutes not days to be honest. Its a jungle there in JS land.
That said anything that I can learn in 30 minutes have something up and running with in 1 hour and not being locked into some behemoth is a win in my book.

I think js fatigue wont be to much of an issue. The reason I disliked javascript in the first place was due to the requirements of having to add 10 js libraries to get anything done. That and a dislike of the syntax, here I can pretty much use the HTML 5 stuff and voila add some css where appropriate and if needed a js function. Then run a command line command to make the html into js.

its actually a bit fun to work with as js is just supporting the html not the other way around as with spa applications.

Yes, but then again Svelte does not contribute much for this; it’s just a UI framework. You still need to pick your libraries for AJAX (superagent? fetch? plain XHR?), state management (Redux? Alt?), utilities (Lodash? Ramda?), etc. Not to mention routing (unless you don’t want to make SPAs).

Rich Harris is incredibly talented—he built this library in a week. I’m very interested in what this will become.

If it’s from Rich Harris that is good news in my book. I was very impressed with Rollup.js which I used recently

As far as I understand Routing is a side effect of MVC, mapping controller to url etc. since svelte isnt a mvc framework I don`t see the router as a necessity in this case. State is held in isolation at “component” level where you can have on application state and the have nested states as your components grow.

So far I haven’t felt the need of over complicating with any 3rd party library. most of what I need I can write faster that it takes me to learn a new library.

Feel free to correct me if I am wrong here.

He is very quick to respond to issues at the Github project.

How do you like rollup ? I realy l liked the simplicity of it. I think brunch will have to step aside for it. works like a charm with phoenix.

I really like it for two main reasons. One the way it facilitates the adoption of an emerging standard. and second the fact that is is limited in scope, works well just with npm scripts.

I have to say that I really like rollup.js as well, I used it on my new home phoenix project, it is quite impressive.

I looked at svelte when I was finding good libaries to build on webcomponents, but I’ve ended up just using polymer and vanilla js so far, templating via html and the data binding is just so much easier. However svelte was the one that gave me the most notice, with vue.js after that. It looks interesting.

Seems very interesting and neat, I love it when new ideas come in and give new impulses to the space :slight_smile:

For me one tiny thing, if I understood it correctly, is that it all gets bundled up as JS? Including the HTML and CSS? As someone who still browses the Internet with Noscript I think it’s fine for real applications but fear that it’ll be used needlessly and I won’t even see normal standard HTML :slight_smile:

The HTML5 standard mandates that javascript must exist or the browser is not HTML5 compliant. :wink:

I prefer uMatrix instead of noscript, it by default allows javascript on the same domain to work, but you have to whitelist other domains it pulls from (my sites all self-host all their own JS).

Didn’t know that, thanks :blush: Still, call me grumpy but whenever I see a website that publishes some sort of articles (news/blog posts) and there needs to be JS for the content to render or even worse they get the main content via AJAX I facepalm… :frowning2:

ha thanks, I did not know that thing or that it exists :slight_smile: might be worth checking out.

uMatrix is awesome! It is a full matrix display showing all linked sources, where they come from, javascript, XHR’s, images, everything, and you can enable/disable on a site-grained basis (or more detailed if you get into the advanced settings). I cannot talk it up enough. :slight_smile:

uBlock (uOrigin? Something like that) is made by the uMatrix person, basically adblock but not heavy and is open source, and such. It is basically a uMatrix-for-dummies thing, no fine-grained control, uses lists. They’ve both been around for years now.