Live data from Hacker News

Svelte – A UI framework that compiles into tiny standalone JavaScript modules

svelte.technology

201–210 of 236 posts

Re: Svelte – A UI framework that compiles into tiny standalone JavaScript modules

#201
post #145

Why didn't we think of this sooner? Because we did! For instance, this is exactly the approach that we have released back in 2009 with http://opalang.org Naturally, there are things we would implement differently today, but the OCaml codebase of the compiler is still, in my humble and biased opinion, pretty valid.

is opa still alive and being used? i was pretty excited about it when it was released (especially when it still had the ML syntax), but it never seemed to gain any traction.

Re: Svelte – A UI framework that compiles into tiny standalone JavaScript modules

#202

The precompilation is a nice idea, but I'm not buying the "vanilla JS" argument. The reason why React and other frameworks have a runtime is also because they optimize rendering. The Svelte doc says: every call to `component.set()` produces a synchronous DOM update. I can already see how this leads to very poor rendering performance in applications with a large number of nested components. React and the Virtual DOM s…

We'll publish some benchmarks soon showing how much better Svelte's performance is than React's. There's a lot of misconceptions around virtual DOM diffing.

Changing a single cell in a table with hundreds of rows and a dozen columns would be a good test.

Re: Svelte – A UI framework that compiles into tiny standalone JavaScript modules

#203
post #75

Earlier quoted context omitted.

Currently JS frontend folks also classify MVC as "problematic", yet a lot of successful software was written that way. So along with J2EE folks, this isn't really the community to look for style standards by default.

Honestly, given that I know of no two developers that have the same understanding of what MVC is and how the code should be divided, I have a feeling there's something wrong with the pattern itself, too.

I don't have a link handy, but I read a piece by one of the original MVC pioneers claiming that the pattern was designed for encapsulated components, usually fairly small, not entire applications. I suspect many of the quirks and disagreements between different MV* architectures derive from this fundamental misapplication of the pattern.

Re: Svelte – A UI framework that compiles into tiny standalone JavaScript modules

#205

Earlier quoted context omitted.

But the google closure compiler have no concept of a tree of components and their lifecycle. The library is old, java-like and I never heard about someone using it :p

Don't quote me on this but I'm pretty sure gmail uses it. I'd say that's a pretty big endorsement.

From what I've read, also Docs/Drive and Maps.

It IS old (well, 2009 counts as old I guess), but it's still maintained, and still doing what it says on the tin. That's quite an achievement in and of itself.

Re: Svelte – A UI framework that compiles into tiny standalone JavaScript modules

#206
post #71

Love it. I think the most discussion-worthy quote I found in the docs is this: > It's currently fashionable to avoid two-way binding on the grounds that it creates all sorts of hard-to-debug problems and slows your application down, and that a one-way top-down data flow is 'easier to reason about'. This is in fact high grade nonsense. It's true that two-way binding done badly has all sorts of issues, and that very la…

My understanding is that there are two issues with two-way binding that are structural, and will be difficult to fix no matter how you approach it. First is that if you look at the system as a graph of updates, automatically closing all cycles between variable update and widget means that any additional two-way binding links you add become a cycle, which makes it difficult to implement, model, and debug. If the frame…

Excellent overview. Definitely helped me understand the issues better.

Re: Svelte – A UI framework that compiles into tiny standalone JavaScript modules

#207
post #71

Love it. I think the most discussion-worthy quote I found in the docs is this: > It's currently fashionable to avoid two-way binding on the grounds that it creates all sorts of hard-to-debug problems and slows your application down, and that a one-way top-down data flow is 'easier to reason about'. This is in fact high grade nonsense. It's true that two-way binding done badly has all sorts of issues, and that very la…

My understanding is that there are two issues with two-way binding that are structural, and will be difficult to fix no matter how you approach it. First is that if you look at the system as a graph of updates, automatically closing all cycles between variable update and widget means that any additional two-way binding links you add become a cycle, which makes it difficult to implement, model, and debug. If the frame…

"...you also really ought to make sure the transforms are able to be roundtripped without data loss, ..." In my experience this happens inevitably; either you code it right the first time or end users discover it and it comes back as an issue that gets fixed later. There is little math involved in my experience and it's pretty hard to miss this kind of issue unless you're a complete cowboy coder or have never seen it before. Once it bites you in the ass it's not likely to recurr.

Re: Svelte – A UI framework that compiles into tiny standalone JavaScript modules

#208
post #201
post #145

Why didn't we think of this sooner? Because we did! For instance, this is exactly the approach that we have released back in 2009 with http://opalang.org Naturally, there are things we would implement differently today, but the OCaml codebase of the compiler is still, in my humble and biased opinion, pretty valid.

is opa still alive and being used? i was pretty excited about it when it was released (especially when it still had the ML syntax), but it never seemed to gain any traction.

Thanks zem! Yes, Opa is still used in several projects and pretty stable. But the project is asleep and not very active as of now.

Re: Svelte – A UI framework that compiles into tiny standalone JavaScript modules

#209
post #100

I can not keep up with all the new X flavored js frameworks, where X is [React, Angular, Vue, Mithril, Redux, Mobx,...]. This is exactly why I chose Clojurescript for my pet stuff and with hopes, that I will be able to use it for making money too. Learning curve can be steep for someone not used to functional way and/or lisp, but at the end you get a very mature, simpler and consistent language with great tooling. Fi…

I cannot keep up with random javasscript frameworks... therefore I use [random framework in some other language]...

It's not that I cant, I don't want to do it anymore, sorry I didn't express myself correctly above. And there aren't that many client side framework choices in Clojurescript, which I see as an advantage. But not everyone will see it that way, I can understand. Whatever makes you happy.

Re: Svelte – A UI framework that compiles into tiny standalone JavaScript modules

#210

Earlier quoted context omitted.

The Svelte compiler uses some ES2015 features (for...of, etc) that aren't currently supported in all browsers. It's designed primarily for use in Node.

Also doesn't work on Safari 9. Why not transpile the Svelte compiler to ES5 so it will run on all browsers? Otherwise devs may get the impression Svelte generated applications will not work on all browsers.

Exactly. My main gripe is that it won't even display the source code. I would be okay with the execution part of the REPL not working, but this just creates the impression that Svelte literally cannot display a block of text without ES6.
Post reply on HN