Earlier quoted context omitted.
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…
This is a really helpful way of describing the problem. Concretely describing behavioural coupling in terms of graphs is much less hand-wavy than the normal, "things become tightly coupled and which becomes hard to deal with."
Svelte – A UI framework that compiles into tiny standalone JavaScript modules
181–190 of 236 posts
Re: Svelte – A UI framework that compiles into tiny standalone JavaScript modules
#182TodoMVC 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…
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 standalone JavaScript modules
#183TodoMVC 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…
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.
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.
Re: Svelte – A UI framework that compiles into tiny standalone JavaScript modules
#184Earlier quoted context omitted.
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.
FWIW Rich Harris' other stuff is pretty solid: Ractive, Rollup, Bublé.
Re: Svelte – A UI framework that compiles into tiny standalone JavaScript modules
#185We move React to Svelte at work. We saw a huge file size decrease. almost 50%.
Why are people porting apps to a framework that is a few days old?
I find it very difficult to believe that your app, with it's 50% size decrease, has any more complexity than a todo app.
Just, why?
Re: Svelte – A UI framework that compiles into tiny standalone JavaScript modules
#186Earlier quoted context omitted.
I believe most of the brokenness of current day frameworks comes from templates. Here is what you get by JSX being JavaScript: 1. Easy to write typechecking for the templates. The compiled template is just function calls (or well, factory function calls) and the typechecker can work with that. How many template language authors will write a typechecker for the template language? 2. Sane scope sharing - you can take a…
Thank you for the detailed answer, I have a few questions here but I think you've nailed it for the most part, I'm just trying to gauge how well I understood what you wrote. 1) what is meant by type checking in this context? do you mean that now that HTML is converted to JSX in JS context, you can test HTML as if they were Javascript Objects? 2) so the ease of importing functions to JSX + use of existing "encapsulati…
Re encapsulation, the way that JS provides it is scope. JavaScript's lexical scope ensures that things you define in a function are only visible in that function, or that things you define in an ES6 module are only visible in that module. Even with the tiny quirks of function based lexical scope, its natural and intuitive: if you can see the definition (or import) in the (function/module) parent(s) of the code you're looking at, its available. Its a tried and true solution.
Template languages don't always bother to add something like "import" or the concept of lexical scope, so when you want to share something from JS (or other templates) with them (like data, or processing functions, or components) you need to somehow put it in their own custom scope. Many template based frameworks make the mistake of working around this not by adding import mechanisms to the template language, but by registering things globally - e.g. when you register a component in Angular or Vue it becomes globally available. This has the same problem any other global variables have. (I suspect this in Angular 1 is what led to the totally parallel "module system" with dependency injection, although maybe they just didn't like the existing ones)
Regarding supporting first class components in template languages, its not really that difficult. Its just that we believe the fallacy that we need the template language to be underpowered. Also, once you add support for first class components and JS scope sharing (or at least import/export) mechanisms to a template language, you've basically reinvented JSX (perhaps with a different syntax)
Sandboxing isn't harmful, its just extremely hard. Angular spent years trying to write a proper expression sandbox and every new version of it was broken successfully - thats why 1.6 removed the sandbox.
What I'm hoping for is that someone works out what contributes the most to popular framework's size, takes the common parts and provides them as built in API in the browser in such a way that the frameworks can take advantage of that instead of writing their own implementations.
Re: Svelte – A UI framework that compiles into tiny standalone JavaScript modules
#187Earlier quoted context omitted.
I didn't study the thing, but the first question that comes to my mind is: if each component is rendered as a self contained piece of vanilla js, isn't the size of an app with lots of components going to increase much faster than with the library approach? A complete library by itself can be pretty big, but it stays the same size no matter how many components you add.
Good point. I tested the demos and found the output (compiled down to ES5 and minified) is around 2-3KB for the minimal demos, and 9KB for the complex SVG clock demo. The equivalent JSX output for that clock demo is about 1KB. So yes, I would guess that apps with many components would end up bigger (in total JS bundle size) than equivalent React apps. Possible counterarguments: - Bundling and gzipping several Svelte…
Re: Svelte – A UI framework that compiles into tiny standalone JavaScript modules
#188We move React to Svelte at work. We saw a huge file size decrease. almost 50%.
Why exactly did you choose to move to a framework that, according to it's commit history, had its first commit 15 days ago? Why are people porting apps to a framework that is a few days old? I find it very difficult to believe that your app, with it's 50% size decrease, has any more complexity than a todo app. Just, why?
Re: Svelte – A UI framework that compiles into tiny standalone JavaScript modules
#189TodoMVC 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…
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 standalone JavaScript modules
#190Earlier quoted context omitted.
Why exactly did you choose to move to a framework that, according to it's commit history, had its first commit 15 days ago? Why are people porting apps to a framework that is a few days old? I find it very difficult to believe that your app, with it's 50% size decrease, has any more complexity than a todo app. Just, why?
We want cleaner approach in writing code. We like inferno and riot, but we choose Svelte. Results have been amazing.