Live data from Hacker News

Svelte is the most beautiful web framework I've seen

thefutureoftheweb.com

161–170 of 210 posts

Re: Svelte is the most beautiful web framework I've seen

#161

Earlier quoted context omitted.

Well you might like Hyperscript or Elm, those are two approaches that work quite well using simple function calls. The thing with JSX is introduces a syntax that is familiar to the rendered output (which is the status quo), and there's a relatively clear visual separation between the declarative and imperative parts; which is hard to enforce in pure JS.

The problem with JSX (and it's the same problem with all declarative languages) is you have no control over the control flow.

That's because JSX doesn't concern itself with control flow; it's not its job. Your framework has that job.

Re: Svelte is the most beautiful web framework I've seen

#162

I have a table of 100 rows x 10 columns mostly of numbers which change 10 times a second (think trading). The source data sits in an array of objects. On each update, I need to update the table cells with the latest values from the source array. The content of each cell can change, possibly it's css class too (from red it become blue for example). I'm using Vue/Bootstrap-Vue table at the moment, but it's quite slow.…

This is also a very good use case to actually dive under the abstraction a little and use hooks or lifecycle methods to directly manipulate the table.

You still gain a lot of benefits from your component framework this way (composability, life cycle management, easy interop with the rest of the app). It’s more work that you wouldn’t want to do all the time, of course.

Re: Svelte is the most beautiful web framework I've seen

#163

Earlier quoted context omitted.

The problem with JSX (and it's the same problem with all declarative languages) is you have no control over the control flow.

That's because JSX doesn't concern itself with control flow; it's not its job. Your framework has that job.

No, that's my job.

Re: Svelte is the most beautiful web framework I've seen

#164

So I just read about "Choosing Boring Technology" before coming into this thread. I guess React.js is the boring technology (already 5-6 years) one and Svelte is the new and exiting one! :)

To be clear, this is Svelte version 3, and the first commit was Nov 15, 2016. So the framework is technically 3+ years old.

That said, I don't think boring is about age, but about real-world exposure

Re: Svelte is the most beautiful web framework I've seen

#165

Earlier quoted context omitted.

At a job I had years back, we built our application with Ractive, it was really nice to use.

I had a similar experience. I wish Ractive would have gained more traction; it was a good balance of "enough functionality that a web UI requires" and "simple enough to avoid cognitive overload and allowed for quick ramp up".

Reactive is still actively being worked on. We use it for all our projects. Fantastic library, powerful and simple to use.

Re: Svelte is the most beautiful web framework I've seen

#166

Earlier quoted context omitted.

If you update all the data why is this more efficient?

contents _can_ change, not _will_ change. So this approach should update fewer cells per update cycle.

For a realtime view of stock symbols, it's highly likely they will change. And a hashmap lookup is not free.

You really have to profile the code to figure out what's expensive. Maybe there is no scaling wrt. the number of nodes that change because repainting/relayouting is more expensive than updating the DOM.

Re: Svelte is the most beautiful web framework I've seen

#167

I have a table of 100 rows x 10 columns mostly of numbers which change 10 times a second (think trading). The source data sits in an array of objects. On each update, I need to update the table cells with the latest values from the source array. The content of each cell can change, possibly it's css class too (from red it become blue for example). I'm using Vue/Bootstrap-Vue table at the moment, but it's quite slow.…

100 rows x 10 columns is about 1000 elements minimum. HN has an obsession towards the fastest js framework but most of the time its not the JS where the most time is spent, it's the render->paint cycle of the browser.

I bet if those 100 rows aren't even in the viewport you can get a big perf boost by only rendering a subset and rendering more when the user scrolls.

We've gotten ~30x boost on our tables with 100s of rows by using a progressive rendering algorithm.

virtualdom - preact/react/vue/snabbdom e.t.c is usually fast for most things. you can diff about a million things under a 10ms timeframe. Rendering a million things is an entirely different ballgame.

Re: Svelte is the most beautiful web framework I've seen

#168

Let the "soap box brigade" commence! I got introduced to Rich Harris via a podcast (not personally), but am a big fan of his perspective on JS. I think we can all agree that; if you don't like Svelte, then fine. If you love JSX/TSX - then great! If you're a Vue person, then awesome - its exactly what makes this community great - the diversity & innovation. Not the soap-boxing antics, polarised opinions & vilification…

> *"always bet on Javascript" I've been keeping all the modern javascript frameworks at arms distance, because I've always preferred to bet on HTML, for the client at least. That said, I've no issues with heavy reliance on JS on the developer machine, but I always prefer pages that can work without the reliance on JS. So, it seems opportune to ask: Is there a JS framework around that actually compiles to HTML and CSS…

Some client-side libraries can also perform server-side rendering, giving them the label isomorphic. Most such are ones that use a VDOM, which makes it easy to do (though it becomes a bit harder again if you worry about rehydration, which is strictly optional but normally desirable, so that you can still add things like event handlers on the client side). Svelte is one that does it more efficiently, compiling to a different result: fiddle in its playground and look at what it compiles to depending on whether you ask for the dom target or the ssr (server-side rendering) target.

Re: Svelte is the most beautiful web framework I've seen

#169

Earlier quoted context omitted.

> Rails burned out in under 10 years It may not be the glory days, but Rail's is still going strong 13 years later. React, however, has reached a popularity many times larger than RoR ever did. https://trends.google.com/trends/explore?date=all&geo=US&q=r... There has never been a project (I can think of), other than the Linux kernel, with the resources that companies and developers have put behind React. > Do you rem…

So is Flex[0]. What's your point? It's not popular anymore and hundreds if not thousands of code bases are being converted from both of these technologies into something else. [0]: https://trends.google.com/trends/explore?date=all&geo=US&q=r...

> What's your point?

Seriously? Adobe Flex was a closed-source and proprietary commercial offering capitalizing on the prior decade's popularity of Flash.

React is open source with a vast and robust ecosystem of even more open source to go along with it. It couldn't be more night & day.

Re: Svelte is the most beautiful web framework I've seen

#170

Earlier quoted context omitted.

So is Flex[0]. What's your point? It's not popular anymore and hundreds if not thousands of code bases are being converted from both of these technologies into something else. [0]: https://trends.google.com/trends/explore?date=all&geo=US&q=r...

> What's your point? Seriously? Adobe Flex was a closed-source and proprietary commercial offering capitalizing on the prior decade's popularity of Flash. React is open source with a vast and robust ecosystem of even more open source to go along with it. It couldn't be more night & day.

> Adobe Flex was a closed-source and proprietary

That confirms it: you aren't old enough to remember Flex. It was open source.

Post reply on HN