Precompilation is cool, but please don't imply that your framework is the first to do it. Precompiled templates significantly predate HTML, they were common in the mainframe world. In the HTML world there are tons of other templaters that allow precompilation. Handlebars is a common one: http://handlebarsjs.com/precompilation.html This is a huge part of Javascript fatigue for me. I love the fact that we're recycling…
Handlebars templates have a runtime dependency (even when precompiled). Svelte does not. Also, a precompiled Handlebars template is just a function for outputting an HTML string (with a runtime dependency). By comparison, the compiled Svelte output is a dependency-free JavaScript module for a dynamic view, which knows how (and when) to granularly update the browser DOM in response to state changes. It's unprecedented…
Svelte – A UI framework that compiles into tiny standalone JavaScript modules
21–30 of 236 posts
Re: Svelte – A UI framework that compiles into tiny standalone JavaScript modules
#22does it try and do as much as it can without javascript?
Re: Svelte – A UI framework that compiles into tiny standalone JavaScript modules
#23Precompilation is cool, but please don't imply that your framework is the first to do it. Precompiled templates significantly predate HTML, they were common in the mainframe world. In the HTML world there are tons of other templaters that allow precompilation. Handlebars is a common one: http://handlebarsjs.com/precompilation.html This is a huge part of Javascript fatigue for me. I love the fact that we're recycling…
Handlebars templates have a runtime dependency (even when precompiled). Svelte does not. Also, a precompiled Handlebars template is just a function for outputting an HTML string (with a runtime dependency). By comparison, the compiled Svelte output is a dependency-free JavaScript module for a dynamic view, which knows how (and when) to granularly update the browser DOM in response to state changes. It's unprecedented…
Re: Svelte – A UI framework that compiles into tiny standalone JavaScript modules
#24This looks nice: a Javascript framework for expressing _concepts_ that compiles down to vanilla JS. It looks like it ships a lot less code to the user. From the project's first [blog post]( https://svelte.technology/blog/frameworks-without-the-framew... ): > The Svelte implementation of TodoMVC weighs 3.6kb zipped. For comparison, React plus ReactDOM without any app code weighs about 45kb zipped. It takes about 10x a…
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.
Re: Svelte – A UI framework that compiles into tiny standalone JavaScript modules
#25This looks nice: a Javascript framework for expressing _concepts_ that compiles down to vanilla JS. It looks like it ships a lot less code to the user. From the project's first [blog post]( https://svelte.technology/blog/frameworks-without-the-framew... ): > The Svelte implementation of TodoMVC weighs 3.6kb zipped. For comparison, React plus ReactDOM without any app code weighs about 45kb zipped. It takes about 10x a…
The Preact TodoMVC version is ~2x bigger than this example, but it states nowhere how this stuff scales with more components.
Re: Svelte – A UI framework that compiles into tiny standalone JavaScript modules
#26I like how they solved scoped css. Looks way more elegant than most css-in-js solutions I've seen. I could give it a shot for this reason alone.
Re: Svelte – A UI framework that compiles into tiny standalone JavaScript modules
#27Love 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…
Yes. I have the feeling most programmers are just lazy, that's why they use 2WB. And I can't blame them. Redux is much more boilerplate than MobX, for example.
For me at least, the reason boilerplate bothers me so much is that it impacts the readability of my code. Ideally, I'd like my codebase to express the business requirements of my solution as succinctly as possible - every line of boilerplate code I need to include to express yet again how to make an AJAX call, or update a piece of state, is a distraction from what I'm actually trying to accomplish with the application.
Re: Svelte – A UI framework that compiles into tiny standalone JavaScript modules
#28The 'Mustaches' bit killed it for me, but up until then I was enjoying the simplicity of the API. I like React (and React-like implementations) because of being able to use JS to build up a view
React also uses curly braces for interpolation, not that different.
Re: Svelte – A UI framework that compiles into tiny standalone JavaScript modules
#29Earlier quoted context omitted.
Yes. I have the feeling most programmers are just lazy, that's why they use 2WB. And I can't blame them. Redux is much more boilerplate than MobX, for example.
Trying to avoid boilerplate is in my experience not about laziness - especially when you consider the extreme lengths a lot of developers will go to to eliminate duplication and boilerplate from their codebases. Copying a Redux reducer that implements a standard set of CRUD actions is lazier in my mind than trying to abstract common patterns away. For me at least, the reason boilerplate bothers me so much is that it…
But if you hide boilerplate you not really improve readability. Not seeing what is really happening just creates the illusion of readability.
Re: Svelte – A UI framework that compiles into tiny standalone JavaScript modules
#30Precompilation is cool, but please don't imply that your framework is the first to do it. Precompiled templates significantly predate HTML, they were common in the mainframe world. In the HTML world there are tons of other templaters that allow precompilation. Handlebars is a common one: http://handlebarsjs.com/precompilation.html This is a huge part of Javascript fatigue for me. I love the fact that we're recycling…
Handlebars templates have a runtime dependency (even when precompiled). Svelte does not. Also, a precompiled Handlebars template is just a function for outputting an HTML string (with a runtime dependency). By comparison, the compiled Svelte output is a dependency-free JavaScript module for a dynamic view, which knows how (and when) to granularly update the browser DOM in response to state changes. It's unprecedented…