Earlier 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.
The biggest problem with web apps today is the initial load time, not the total size of the app. If you can't render the first page the user lands on without serving a large framework, you're stuck. But yes, an app built entirely out of standalone components would eventually overtake the total size of an app built using a more conventional framework. (By the time you get there, your app is probably already too big an…
Svelte – A UI framework that compiles into tiny standalone JavaScript modules
211–220 of 236 posts
Re: Svelte – A UI framework that compiles into tiny standalone JavaScript modules
#212Earlier quoted context omitted.
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.
The guy did some incredible work - he wrote all of this code in a week. I'll look at the REPL code to see if there's a simple fix. All the levels of indirection, code generation and bundling may take a while for my non-Rich-Harris brain to sort out.
Re: Svelte – A UI framework that compiles into tiny standalone JavaScript modules
#213Re: Svelte – A UI framework that compiles into tiny standalone JavaScript modules
#214Re: Svelte – A UI framework that compiles into tiny standalone JavaScript modules
#215I 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.
With some css preprocessing + vulcanizing you can even use separate js/css files from your component templates if that is your thing - they can get inlined in the build process.
Re: Svelte – A UI framework that compiles into tiny standalone JavaScript modules
#216Love 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…
I also implemented my own two-way/omnidirectional data binding system ages ago (before I knew what it would even be called) in Java Swing for another audio UI, and all the challenges you mention are real, but as you say, not insurmountable. Multiple copies of my UI can be controlling the same hardware, and they will all remain in sync without infinite feedback loops, but getting there took lots of work.
Re: Svelte – A UI framework that compiles into tiny standalone JavaScript modules
#217Earlier quoted context omitted.
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
#218Love 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…
Dataflow constraints with solvers like DeltaBlue solve these problems and allow you to incrementally add additional constraints.
I show how this works for a simple example in my paper "Constraint as Polymorphic Connectors"[1]. I also show that constraints are useful for expressing the high-level architecture of many interactive systems and suggest how to two might be connected.
[1] https://www.hpi.uni-potsdam.de/hirschfeld/publications/media...
Re: Svelte – A UI framework that compiles into tiny standalone JavaScript modules
#219Earlier quoted context omitted.
Er, can you explain further with an example? I'm confused about using both something like {{#if}} and pure JS
See e.g. http://bit.ly/2fRcyJq . The {{#if ...}} part is a control flow directive that allows Svelte to understand the structure of your app, but the condition of that if block is just a JS expression
Re: Svelte – A UI framework that compiles into tiny standalone JavaScript modules
#220Earlier quoted context omitted.
checkout css-modules! https://github.com/css-modules/css-modules
Yep, happily using css modules too. The only tiny issue left with that approach is that you still can't share code (for instance, colors) between JS & CSS. but overall, I think it's the best compromise today.