Live data from Hacker News

Rich Harris joins Vercel to work on Svelte full time

twitter.com

471–480 of 571 posts

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

#471
post #178

Well, this is awesome -- but fuck me: Vue is the only major player not under the Vercel umbrella now, haha. Looks like I might have to phone in half a decade of experience. Svelte is close enough to Vue with "script setup" mode anyways, the major difference is whether your logic/keywords go INSIDE the HTML tags or OUTSIDE. Svelte doesn't support JSX/TSX though =(

> Svelte doesn't support JSX/TSX though =( It actually supports the next best thing: HTML! Now in all seriousness, JSX does have its benefits like being able to write a small function that returns a piece of JSX. But in my experience, using Svelte is a huge productivity booster than I don't mind losing JSX's benefits.

>It actually supports the next best thing: HTML!

Haha - Oh where will our crazy tech take us next :D

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

#472

I have recently joined a team that had invested in Svelte. I had previous experience in Angular and React. I was happy with React, but I decided to drink the koolaid and go all-in and do my best with Svelte. 6 months later, we're moving to React. It is partly because our Svelte code was messy enough to warrant a rewrite, and partly because we wanted to leverage the React ecosystem in that rewrite. It was also partly…

> - Special syntax for reactivity is not javascript Well, JSX syntax isn't JS either. And hooks semantics is not JS. Learning new syntax is easy but we should consider how much the new semantics cause mistakes and to what extent they are incompatible with tools such as linters.

As I see it, the main issue with new syntaxes is the fact that they break compatibility with existing tooling. JSX is not fundamentally different in this regard, except for the fact that it gained so much mindshare that it brute-forced its way to getting first-class support in editors, language servers, different frameworks, even TypeScript. I don't predict that very many new JS-adjacent syntaxes will get that treatment from the industry.

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

#473
post #369

Earlier quoted context omitted.

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…

But what does ‘#await someFetch’ actually do ? The thing I like most about react is that it’s just executing plain Javascript most of the time.

https://svelte.dev/tutorial/await-blocks Explains it better.

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

#475

I have recently joined a team that had invested in Svelte. I had previous experience in Angular and React. I was happy with React, but I decided to drink the koolaid and go all-in and do my best with Svelte. 6 months later, we're moving to React. It is partly because our Svelte code was messy enough to warrant a rewrite, and partly because we wanted to leverage the React ecosystem in that rewrite. It was also partly…

I've been developing websites and apps with Svelte for almost 2 years now, and my experience couldn't be more different from yours.

> - Too much magic. The abstraction leaks and when it does, it requires a good mental model of Svelte's magic. I noticed this threw our juniors off.

Since Svelte runs vanilla JS and works with the DOM directly, my experience debugging any "magic" has been extremely straightforward compared to other frameworks. I'm curious what specific issues you have encountered.

> - I find the javascript-native flexibility of JSX far more expressive than any custom templating

Not once have I wished I had JSX in a Svelte project, and the readability of Svelte's minimal templating sugar is a breath of fresh air for myself. What's an example of a limitation you've faced in practice?

> - There are major trade offs made by doing things at compile time. Things that are easy in React at runtime turn out to be surprisingly difficult in Svelte.

I would love an example of this, as I've yet to run into any situations where I felt there was something I couldn't accomplish at runtime.

> - Two-way data binding is a constant source of bugs

It's rare that I use two-way data binding, but in the rare cases where it's appropriate, it's very convenient. The improper use of a utility doesn't necessarily discredit the value of said utility.

> - Svelte practically requires let-style variable rebinding, often at a file wide scope, which again caused our juniors in particular to write bad code

I'm not sure this is true- with access to JS modules, stores, nullish coalescing, and lifecycle hooks, let-style rebinding can be avoided entirely.

> - Built in reactive store is cool, but our developers all ended up using it for tight coupling and global variables

Inexperienced developers will write bad code with or without powerful tools like Svelte stores. I don't think a framework is meant to replace experience, guidance, and coaching.

> - The style system is too opinionated for me. I also find it necessary to break into the global scope for any minor restyling of a subcomponent (or worse, pass in the style as a prop)

Considering you Svelte lets you style things in a plethora of different ways (including the traditional method of external css files), I'm curious how you came to the conclusion that it's opinionated.

> - The strict one component per file approach can be cumbersome. It's not possible to write a one-line function component or similar

While it _can_ be, a single function shouldn't be a "component"- but Svelte "actions" are an awesome feature designed to make single functions easy to compose and reuse across components. That being said, there is talk of supporting multiple Svelte components per file (although it's rather controversial and largely unnecessary in Svelte projects).

> - Much smaller ecosystem than React, requiring much more to be done in house (exacerbated by all of the above).

Considering any JS library (most importantly, ones that interact with the DOM) is plug-and-play in a Svelte file- I've never found myself needing something that didn't exist on NPM. Nonetheless, the DX and power of Svelte enables us to create complex libraries and components that would ordinarily be too cumbersome or time consuming to produce in-house, and with much less code than with React. This usually pays dividends in the long-run, as custom solutions are typically easier to debug and extend.

> - The faster runtime speed in no way made up for any of the above. Bad Svelte code is still slow compared to good React code.

The runtime speed is pretty low on my list of reasons I prefer Svelte above other solutions. While the performance gains from Svelte are amazing for users (especially ones with low-end devices or shotty internet speeds), the unparalleled DX, development speed, maintainability (do more with less code = less bugs = easier to maintain), community, and overall fun involved in working with Svelte overshadow the free optimization done by the compiler at build-time.

Anyways, I hope that round 2 will be more fruitful for you and your team! I'm highly skeptical that React will solve more problems than it causes when your primary bottleneck is developer experience, but I'm sure we will both be able to learn from your experience regardless of the outcome!

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

#476

Earlier quoted context omitted.

> By being an extension of JS it is JS. The two are mutually inclusive. This is absurd. If JSX were JavaScript, JavaScript wouldn’t need to be extended to include JSX. The whole point of it being an extension is that JavaScript doesn’t include it, therefore JSX extends it. If JSX were JavaScript, then JavaScript wouldn’t need to be extended. The two are mutually exclusive . > > We are not talking about the value of J…

Are decorators JS? Answer that question and I'll respond to the rest of your comment. We're talking in circles a bit so I'd like to drill that down first.

Decorators are a stage two proposal. This means that they are not yet JavaScript, but are expected to be soon.

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

#477

Earlier quoted context omitted.

> - Special syntax for reactivity is not javascript Well, JSX syntax isn't JS either. And hooks semantics is not JS. Learning new syntax is easy but we should consider how much the new semantics cause mistakes and to what extent they are incompatible with tools such as linters.

As I see it, the main issue with new syntaxes is the fact that they break compatibility with existing tooling. JSX is not fundamentally different in this regard, except for the fact that it gained so much mindshare that it brute-forced its way to getting first-class support in editors, language servers, different frameworks, even TypeScript. I don't predict that very many new JS-adjacent syntaxes will get that treatm…

True, although Svelte's syntax is chosen cleverly in a way that is not incompatible with existing tooling. (Starting a statement with $: is syntactically legal JS and a no-op.)

Another question is how much of Vercel's resources would it take to contribute Svelte support into all the major tools.

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

#478
post #408

Earlier quoted context omitted.

Yeah, but that's harder in practice. You often copy html snippets into your code, for example from tailwind or bootstrap samples. This is easier in JSX syntax; you'd just need to copy and fix up some attribute names.

> You often copy html snippets into your code, for example from tailwind or bootstrap samples. This is easier in JSX syntax; you'd just need to copy and fix up some attribute names. I literally never do this, but I suppose there are people who use React/JSX as a glorified templating library. Even then I probably wouldn't do this and rather use a proper templating library where HTML is valid.

It's very common if you're working with Tailwind (since the markup is self-contained). No need to be condescending.

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

#479

Earlier quoted context omitted.

As I see it, the main issue with new syntaxes is the fact that they break compatibility with existing tooling. JSX is not fundamentally different in this regard, except for the fact that it gained so much mindshare that it brute-forced its way to getting first-class support in editors, language servers, different frameworks, even TypeScript. I don't predict that very many new JS-adjacent syntaxes will get that treatm…

True, although Svelte's syntax is chosen cleverly in a way that is not incompatible with existing tooling. (Starting a statement with $: is syntactically legal JS and a no-op.) Another question is how much of Vercel's resources would it take to contribute Svelte support into all the major tools.

It's not technically incompatible, but it's mostly parseable nonsense in the plain language. So it really only serves to make sure syntax highlighters still work, which is just one of many aspects of tooling

Considering JSX's current level of support involved cooperation from multiple FAAMNGs, I doubt Vercel could match it

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

#480

Earlier quoted context omitted.

At least this time Svelte is a step closer toward the native browser stack rather than yet another abstraction layer.

Why not use the native browser stack? It's pretty good now.

This is the real question.
Post reply on HN