Live data from Hacker News

Svelte is the most beautiful web framework I've seen

thefutureoftheweb.com

151–160 of 210 posts

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

#151

Earlier quoted context omitted.

> Developers who can't solve problems because they're too busy chasing the latest framework aren't going to be getting much work. That's not really how hiring works. Nobody is going to put "I failed to get anything done because we re-wrote everything in Svelte" on their resume. > People will experiment, and it's good for the industry to have new innovation, but there's really not that much danger of constantly shifti…

I'm saying that people dont constantly switch. It's not that common at all, despite what you might hear in online discussions. And it's usually because most of these projects have real timelines and deliverables, along with a team of people who aren't interested in rewriting everything either. Of course there are a few teams (even in praised companies) that chase the fad, but they're the sames ones that do things lik…

You're saying people don't constantly switch, but even if they did, it wouldn't be much of a problem unless they don't know what they're doing.

Well, fair enough. I never claimed that businesses switch stacks "constantly" anyway. Still, at the industry level, there is constant flux - much more so than on other platforms. Unless you use one of the big players like React, chances are your framework of choice won't last and become legacy software quite soon.

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

#152

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…

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

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

#153

Earlier quoted context omitted.

What are alternatives?

For dynamic content, the only alternative to DOM manipulation is rendering to a canvas element.

Can that still be interacted with? I wouldn't even know where to start to allow clicks and such.

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

#154

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 rather than embedding the HTML in JS/DOM calls? In my rudimentary analysis of React/Vue and others (eg svelte), I can't find out how to have the end result without the framework sitting in there too. Perhaps I keep missing something in my understanding?

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

#155

Earlier quoted context omitted.

For dynamic content, the only alternative to DOM manipulation is rendering to a canvas element.

Can that still be interacted with? I wouldn't even know where to start to allow clicks and such.

A canvas element will get events like any other DOM node. From there on, it's up to you.

> I wouldn't even know where to start to allow clicks and such.

Figuring that out should be a good exercise, then. Otherwise, you might want to use some library building on top of canvas.

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

#156
post #77

Earlier quoted context omitted.

Exactly. Stuff like this is extremely simple to write in vanilla js, with a pointer to each of the dom objects you need to interact with. There's no point in using a framework (but of course you can encapsulate your vanilla js in a component to interface with whatever framework you're using).

Isn't the benefit of React/Vue the shadowDOM and not needing to do full page prints with every change? Honest question, I'm just going off what I hear everyone else saying so the vanilla JS, while the code may be more efficient, sounds less efficient since you'll need to re-print the entire page with every change.

I am surprised how many people I interview say the same thing - pure JS has to re-render the page and React doesn't, including people who have a lot of JS experience.

Changing the DOM doesn't cause a full re-render, the browser will optimize the repaints to only the parts that have changed.

People don't understand how the DOM works, and its become a great way to filter out people.

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

#157

Earlier quoted context omitted.

It looks like svelte.dev and the REPL are up and running again, so here's a quick example of a 100x10 table updating every value 100 times per second, with a red/blue class being applied to each cell depending on its value. It seems to do pretty well! I turned on the FPS meter in Chrome and scrolled around a bunch, and it seems smooth, reporting around ~50fps. It did get my CPU going pretty good, though. https://svel…

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 :(

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

#158

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…

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.

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

#159

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…

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

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

#160
post #156

Earlier quoted context omitted.

Isn't the benefit of React/Vue the shadowDOM and not needing to do full page prints with every change? Honest question, I'm just going off what I hear everyone else saying so the vanilla JS, while the code may be more efficient, sounds less efficient since you'll need to re-print the entire page with every change.

I am surprised how many people I interview say the same thing - pure JS has to re-render the page and React doesn't, including people who have a lot of JS experience. Changing the DOM doesn't cause a full re-render, the browser will optimize the repaints to only the parts that have changed. People don't understand how the DOM works, and its become a great way to filter out people.

"People don't understand how the DOM works" x 1000. Many front end devs I have worked with are not aware that the DOM IS A TREE (and implications of this)!
Post reply on HN