Live data from Hacker News

Svelte is the most beautiful web framework I've seen

thefutureoftheweb.com

171–180 of 210 posts

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

#171

Earlier quoted context omitted.

> *"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…

So this is what Svelte does, the app gets built at build time so you don't need the include any script in the browser for it to run. I remember RH talking about the React Hooks inspiration thing, so whether the API will go more in that direction (and eventually be a runtime thing), I'm not too sure.

GP wants something that compiles down to HTML and CSS.

Svelte compiles down to JS.

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

#172

Earlier quoted context omitted.

> 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.

Not until version 3 in 2008, after which it became Apache Flex. Maybe you should try to get both your facts and attitude straight.

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

#173

Earlier quoted context omitted.

Rails burned out in under 10 years. The reason I say React will be gone in another 5 years is because it's already been popular for 5 and the muttering has started. Do you remember Adobe Flex? React is following a shockingly similar path and timeline.

> 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…

> 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...

I'm not sure this chart is very good evidence of this claim. There are so many other things named "react" -- Nike React shoes, Kids React videos, reactionary politics, and so on -- that it's a bit like claiming Trump.js is the most popular JavaScript library in the world because of this chart: https://trends.google.com/trends/explore?date=all&geo=US&q=r...

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

#174

Earlier quoted context omitted.

> Adobe Flex was a closed-source and proprietary That confirms it: you aren't old enough to remember Flex. It was open source.

Not until version 3 in 2008, after which it became Apache Flex. Maybe you should try to get both your facts and attitude straight.

[deleted]

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

#175

My main gripes are no TypeScript support and going to mustache-like templates after working with JSX/TSX is a step back for me. Also losing React Native, which is non-issue if you're just developing a web app.

I looked at the github, and end of last year there was a request for TS support, Rich said S3 was being built with it in mind, but I don't see anything since then

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

#176
post #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 r…

That's what we did too with Vue table library, made our own sorting algorithm and showed the first 100 results async and continued with rest of results in background until user cancels or changes sorting entirely

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

#177

Earlier quoted context omitted.

when I click through, it seems to just sit there going "loading Svelte compiler..." forever. Tried both firefox/chrome

Ah ok. Maybe it was working in my region and still broken in others :(

Try - https://svelte-website-mrf26sti4q-uc.a.run.app/repl/061b958e...

btw, Looks really snappy on my laptop.

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

#179

Earlier quoted context omitted.

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.

> And a hashmap lookup is not free.

They are basically free when you have this little data. 1k cells updates 10 times a second means that you have around 100 micro seconds per cell, you can do thousands of lookups in that time. The only things which could even come close to costing 100 micro seconds are if you accidentally re-flow the html each cell update, re-render the html each cell update, send a http request each cell update or if you go through all the data each cell or the framework you are using is extremely inefficient or other unnecessary work. Each of those are easily fixable by doing the html and javascript by hand instead of using frameworks.

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

#180

Earlier quoted context omitted.

when I click through, it seems to just sit there going "loading Svelte compiler..." forever. Tried both firefox/chrome

Ah ok. Maybe it was working in my region and still broken in others :(

works now, works well for me also, good FPS. looks pretty smooth also.

I would say his next problem is going to be getting the data fast enough to feed the the UI, a nicely packed websocket protocol would work well I'd guess

Post reply on HN