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
Rich Harris joins Vercel to work on Svelte full time
291–300 of 571 posts
Re: Rich Harris joins Vercel to work on Svelte full time
#292I'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…
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
#293This is really exciting news.
Re: Rich Harris joins Vercel to work on Svelte full time
#294Re: Rich Harris joins Vercel to work on Svelte full time
#295Earlier 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.
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
#296Earlier 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.
Re: Rich Harris joins Vercel to work on Svelte full time
#297Earlier 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.
Re: Rich Harris joins Vercel to work on Svelte full time
#298Re: Rich Harris joins Vercel to work on Svelte full time
#299I 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…
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
#300Earlier 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…
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}