Live data from Hacker News

Rich Harris joins Vercel to work on Svelte full time

twitter.com

291–300 of 571 posts

Re: Rich Harris joins Vercel to work on Svelte full time

#291
post #281
post #277

I have a stupid question: The cool thing about Svelte is that it compiles your code in a way so that when variables change, bindings in HTML change, but only that HTML and not an entire DOM re-render. (Right?) So, if this is the case, how come React couldn't do the same thing? They'd lose the ability to just include react in a script file, but why can't a smart compiler look at your JSX and throw out the virtual DOM…

i did try that - https://twitter.com/swyx/status/1294310598419689472 but when the core team is not interested in it there's only so much i want to push it on my own - rather just move to Svelte where the community already gets it

Looks great! Seems to me that there’s just not enough pain around this. Ironically, React being “good enough” at performance (in most cases) probably means that there’s not appetite for squeezing out the last few millimeters (again for the vast majority of use cases — clearly there is some need otherwise svelte wouldn’t exist).

Re: Rich Harris joins Vercel to work on Svelte full time

#292

I'm tired of having to learn yet another templating language without a very compelling reason. Why do I have to learn, what is essentially, a new programming language for each of these frameworks (Angular, Svelte, Vue, React... Do I really need to learn yet another language construct for stuff like `loops`, `if/else`, event handlers...etc. Why must all of these frameworks re-invent the wheel? At least with React it i…

The problem with each of these frameworks is that they make the mistake of surfacing the underlying standards like HTML and the DOM. This is why they look remarkably similar and can only possibly be incrementally better, at best.

HTML and the DOM are still essentially modeled on static documents. Building apps that deal directly with these standards is an impedance mismatch that, remarkably, people keep trying to solve by adhering to those same standards, but in a slightly different way.

Why should we know or care about HTML or the DOM?

A robust, event-driven, component-based framework that manages the low level Web standards could offer true advancement.

Re: Rich Harris joins Vercel to work on Svelte full time

#294
Svelte is really great. It really needs this boost in cash to polish the rough edges and improve tooling etc. I’d add that most people here who are hating on the syntax didn’t go to check what svelte is actually about. I say that even though I work with React professionally

Re: Rich Harris joins Vercel to work on Svelte full time

#295

Earlier quoted context omitted.

Frontend developers like to change frameworks every week it seems like, so it's in my best interest to learn every framework (or at least some abstracted part of it) in order to stay employable and up-to-date. The problem is that each framework has their own abstraction and language that you have to learn. Compare it to "old-school" Java frameworks, where things were much simpler and you didn't have to worry about eg…

> Frontend developers like to change frameworks every week it seems like This sentiment is so old and played out.

Is it false though? If it’s true, then maybe we need to look at why it’s true.

It’s not just front end developers though. I think other domains and their frameworks went through the same thing. This is just the time for front end.

Re: Rich Harris joins Vercel to work on Svelte full time

#296

Earlier quoted context omitted.

Frontend developers like to change frameworks every week it seems like, so it's in my best interest to learn every framework (or at least some abstracted part of it) in order to stay employable and up-to-date. The problem is that each framework has their own abstraction and language that you have to learn. Compare it to "old-school" Java frameworks, where things were much simpler and you didn't have to worry about eg…

> Frontend developers like to change frameworks every week it seems like This sentiment is so old and played out.

Agree, and it’s nice to see this worn-out trope getting downvoted for once. Sneering at JS / Frontend developers is one of the more distasteful tendencies of HN.

Re: Rich Harris joins Vercel to work on Svelte full time

#297

Earlier quoted context omitted.

> If you know HTML you JSX is very intuitive. That's a poor assumption that appears to be based on your personal preferences and what you're comfortable with. I personally find both require some learning, but prefer the svelte version.

And JSX isn't JavaScript and it isn't HTML, and if you know JavaScript and HTML you still don't know JSX, so you're still using "yet another language" in addition to JavaScript and HTML.

JSX is just JS with brackets instead of nested function calls. I expected more from this community than this kind of commentary.

Re: Rich Harris joins Vercel to work on Svelte full time

#299
post #277

I have a stupid question: The cool thing about Svelte is that it compiles your code in a way so that when variables change, bindings in HTML change, but only that HTML and not an entire DOM re-render. (Right?) So, if this is the case, how come React couldn't do the same thing? They'd lose the ability to just include react in a script file, but why can't a smart compiler look at your JSX and throw out the virtual DOM…

Hm, I think this isn't possible with React. You'd have to impose lots of constraints on how a component renders. Currently it's basically anything goes. IMHO, the result just wouldn't be React anymore.

In fact, Angular works exactly like this. Only the DOM nodes that have bindings/directives attached are updated, the rest is static during a component's lifetime. Though all this still involves tons of runtime framework code.

Re: Rich Harris joins Vercel to work on Svelte full time

#300

Earlier quoted context omitted.

What how can you say that??? {myItems.map({id, title}) => {title} } vs... svelte {#each myItems as item} {item.title} {/each} One is literally just javascript and html the other is an entirely different template language. You might say... JSX is not HTML... well it's very very similar... If you know HTML you JSX is very intuitive.

But React isn't just JSX. It's also the entire runtime library, hooks, event handling, forms, state handling, etc. The example you shared is a bit too simple to understand where Svelte shines because it doesn't introduce any of those concerns. By having it's own templating language, Svelte is able to compile the templates to JavaScript in a way that addresses many of those concerns in a way that I think it easier to…

Not to mention it takes reactivity to new heights while adding amazingly little actual syntax.

When property changes, the fetch refires, loading appears until the fetch resolves then it displays whatever array someFetch resolved to.

I came from Vue and that plus the way Svelte does stores (literally nothing special about them) was a breath of fresh air.

    
        {#await someFetch(property)}
            Loading...
        {:then data}
        
            {#each data as item, index}
                {item}
            {/each}
    
        {/await}
    
Post reply on HN