Live data from Hacker News

Rich Harris joins Vercel to work on Svelte full time

twitter.com

451–460 of 571 posts

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

#451
post #412
post #407

Earlier quoted context omitted.

> I find the javascript-native flexibility of JSX far more expressive than any custom templating JSX is the most significant contribution that React brought to front-end programming. Personally I don't always use React, but I use JSX quite often. It's intuitive in a way custom syntax (the dozens of) never will be.

JSX popularized it but we built it with opalang.org first (also with strong static typing before TS)

Opa was pioneering. Very impressive. Ahead of it's time.

What stack do you prefer these days?

It seems some folks still have their eye on the "full stack / single language" holy grail.

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

#452

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…

Yes, clearly it is not for purists.

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

#453
post #97
post #81

Can someone explain what Vercel does. I'm familiar with Svelte, but interestingly not with Vercel. A scan of their website wasn't completely clear, but that is probably just me. Edit: thanks to all who answered, very helpful.

Hey! I'm Lee, Head of DevRel at Vercel :) Happy to answer any questions you have. Vercel is a frontend cloud platform that integrates with any framework you prefer (or just plain HTML!). We are also the creators of Next.js, which is a React framework. We try to make it as easy as possible for you to write some code and put it on the web, globally.

Hey Lee, just listened to your chat with swyx the other day. It was great hearing how Vercel positions itself and your thoughts on devrel!

I know Vercel has a great developer relations team already— what would the appetite be for more Svelte DevRels in future? I've been working as a developer advocate and love Svelte enough to have even given talks on it. Would be an opportunity I could see myself in for years :)

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

#454

Earlier quoted context omitted.

I've not used any Svelte significantly yet, so your points may stand. I have, however, written React for years. If anything in Svelte is more confusing to juniors than how useEffect works, especially in conjunction with unstable references, I would be literally amazed. useEffect is a loaded automatic pointed at your face if you don't fully understand it. It is truly a terrible API due to how intimately you have to un…

Agree 100%. The migration from componentDidMount, componentDidUpdate, etc to useEffect was a major regression in terms of readability. The return function in useEffect vs. componentWillUnmount is just terrible. This is always a bizarre topic for juniors.

I agree, but it can be made easier by exposing named functions that help like useUnmount

https://github.com/streamich/react-use/blob/master/src/useUn...

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

#455
post #328
post #191

Earlier quoted context omitted.

The complexity and the over engineering going on, mostly. Things such as redux, rxjs, observables, thunks, etc really put me off when you compare that to just MVC with Rails for example, plus most applications I worked with React were just forms anyway, with some fancy controls/widgets on top. Not having a clear way, even today with Next, to load data (client side, without doing SSR) before a route transition happens…

I don't agree that everything has to revolve around MVC. It's not a hammer for every problem. This is why other patterns like MVVM, MVP and other abbreviations were introduced to solve broader needs. React starting as purely a UI library paved the way for people to find new ways to manage state and data for different kinds of applications and needs. That's how we ended up with what we have today. You can say what you…

We seem to agree. I'm not saying React's approach isn't justifiable. It is what it is for reasons.

I just don't agree all that complexity is worth when you need to ship things fast with a decent robustness and performance. Specially when you don't have 100s of devs in the project.

I'm just saying that given React vs Rails, for 80% of projects I'd pick Rails+hotwire+etc... But given Svelte vs Rails, I'm more inclined to pick Svelte now, because it is not so complex, for now at least.

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

#456

Earlier quoted context omitted.

useEffect makes easy things easy and hard things very hard indeed. After building a few non trivial apps in React with hooks I'm convinced that what you really need for that model to work smoothly is a new language that tracks things like hook dependencies for you.

Eslint will ensure all dependencies are listed in the array. Is there something more you’re wishing for?

The ESLint plugin helps. But it depends on static analysis. And static analysis is fundamentally incapable of taking advantage of any information only available (or more easily accessible) at runtime.

One limitation that pops up fairly frequently in my experience: Only React's first party hooks can get exceptional treatment by the plugin, i.e. the setState function returned from useState can be assumed to never change and omitted from dependency lists, because those cases are hard coded into the static analysis. There's no way for custom/third-party hooks to indicate to the plugin that the thing they return will never change in the same manner, even if all they're doing is passing through a setState function directly from a useState call that will very obviously also never change reference, for instance.

They can probably offer some rudimentary support for this use case with static analysis by offering some kind of exceptions API for the user to spell out the names of the hooks and return values that should get this preferential treatment, like they have with the additionalHooks config option [1], but the DX around integration with third party modules is going to remain a messy unsolved problem.

Language/runtime level support for this pattern would hopefully be flexible enough to know that the thing we returned from our custom hook or third-party hook is fundamentally the same thing as (or shares some runtime property with) the setState returned from a useState hook, and treat it the same way, regardless of what our hook is called or how it's implemented or where it's from.

Unfortunately it sounds like the React team is planning to double down on static analysis to improve hook DX, so this doesn't seem to be an area they'd be likely to invest in. I think that's a shame because static analysis is much more difficult for users to extend and experiment with new paradigms for than runtime abstractions, and will start to stifle innovation in the ecosystem as we come to rely on it for more and more heavy lifting.

[1] Which, by the way, stops working as soon as you deviate even a tiny bit from the assumptions made in the static analysis, in ways that would be completely trivial to infer as functionally identical for any runtime system. The only way to address these shortcomings is to send in a PR to make the static analysis make fewer assumptions (unlike a runtime system which you can usually extend through some clever wrapping if it's just a function), for which YMMV: https://github.com/facebook/react/pull/20051

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

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

Plus JSX is based on a "Virtual DOM", and "Virtual DOM is Pure Overhead":

https://svelte.dev/blog/virtual-dom-is-pure-overhead

>Virtual DOM is pure overhead

>Let's retire the 'virtual DOM is fast' myth once and for all

>Rich Harris, THU DEC 27 2018

>If you've used JavaScript frameworks in the last few years, you've probably heard the phrase 'the virtual DOM is fast', often said to mean that it's faster than the real DOM. It's a surprisingly resilient meme — for example people have asked how Svelte can be fast when it doesn't use a virtual DOM.

>It's time to take a closer look.

>[...great article...]

>Why do frameworks use the virtual DOM then?

>It's important to understand that virtual DOM isn't a feature. It's a means to an end, the end being declarative, state-driven UI development. Virtual DOM is valuable because it allows you to build apps without thinking about state transitions, with performance that is generally good enough. That means less buggy code, and more time spent on creative tasks instead of tedious ones.

>But it turns out that we can achieve a similar programming model without using virtual DOM — and that's where Svelte comes in.

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

#458
post #369

Earlier quoted context omitted.

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.

Not just most of the time — all of the time! JSX is converted to plain JS (react.createElement) before it gets to the browser.

Isn't it actually the opposite? Svelte code is compiled to plain JS whereas React has a large runtime.

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

#459
post #186

Earlier quoted context omitted.

As a backend guy who moved away from frontend long ago for these very reasons, I have to ask: why are people downvoting this? Is it wrong? I'm genuinely asking, because from a bystander's point of view, it certainly seems like the pattern of the Framework Du Jour hasn't really slowed down much in the frontend community.

No, it's not wrong, it's absolutely correct. There's a lot of flexing around who can come up with the most elegant abstraction which ignores the important point: making sure what's necessary to understand the framework, use it long-term, and move away from it after is focusing on the core technologies of the web (HTML, CSS, and JavaScript). The abstractions are cool, but completely unnecessary (see link to my framewo…

The parenthetical makes the comment!

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

#460

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…

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

What? Can you expand on that? Makes no sense.

Post reply on HN