Live data from Hacker News

Rich Harris joins Vercel to work on Svelte full time

twitter.com

531–540 of 571 posts

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

#531

Earlier quoted context omitted.

Not the GP, but here's an example of abstraction leaking straight from their intro tutorial: > A simple rule of thumb: the name of the updated variable must appear on the left hand side of the assignment. For example this... const foo = obj.foo; foo.bar = 'baz'; > ...won't trigger reactivity on obj.foo.bar, unless you follow it up with obj = obj. This looks like a huge footgun to me, and it's not even an exotic useca…

It's not an abstraction leaking, it's an important point to understand about mutating objects. You are allowed to use `const` to declare an object and then modify its properties, because modifying properties is not the same as reassigning. You're absolutely right that it's something that might catch you out, but not understanding the difference between reassigning and mutating is likely to lead to other bugs and fall…

Other reactive frameworks like MobX will react when you only mutate objects. APIs like the useState hook at least make it obvious that you need to replace the whole object. Svelte on the other hand presents this "it's cool man, just change your plain JS state like normal!" paradigm, and it would be very reasonable without being told otherwise to assume that this applies to mutating objects as well. But then it doesn't.

If re-assignment of the whole object is what I have to do anyway, I'd much rather just be given an API that's slightly clunkier but makes that fact obvious. Otherwise the behavior will be surprising and error-prone to those not closely familiar with it yet.

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

#532

Earlier quoted context omitted.

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

Can you give an example of tooling that is not compatible with encountering the $: label? I can only think of a linter complaining about an unused label "$" or a redefined label "$". Compare this e.g. with how React linting has to know which functions are actually (custom) hooks, and they cannot have any idea about the semantics of custom hooks.

I'm sure it will let you make that label, but it won't be able to make any sense of it. Maybe I was slightly wrong that only syntax highlighting will be helped by the "standard" syntax, but the point remains that none of the (existing) tooling can properly make sense of those parts of the code. That $ isn't really a label, it's a reaction, which your linter knows nothing about and can't help you with; at best it can "work around" it.

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

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

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

His point is you don't have to read some project's documentation to know how some "await blocks" work.

With JSX you can use native JS features instead, you only need to know the language.

For example, instead of looking up how to loop in the template syntax, you use an iterator.

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

#534
post #367

Earlier quoted context omitted.

Perhaps a shift in mindset about how to approach using Svelte would help. Svelte is not React, and using React for an extended period really changes how you think about frontend code (structure-wise etc). As a quick example, the Svelte 'ecosystem' is simply the Javascript ecosystem, which existed well before React. You can import any npm module to a Svelte app. Outside of the React-specific packages (which I argue ar…

Redux is not React specific. I assume you could use it with Svelte somehow. That said, most React components are lightyears ahead of native Javascript components, simply because everyone uses React.

Yes, and in fact we even have a demo of our new RTK Query data fetching API (part of our official Redux Toolkit package) being used with Svelte:

https://redux-toolkit.js.org/rtk-query/usage/examples#svelte

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

#535

Earlier quoted context omitted.

It's never two-way in react. You're always in charge of updating the state in the event handler, which means you know where the update came from

Not to argue semantics, but that pattern is still called two-way databinding in my neck of the woods. In this deprecated page from the official docs, two-way databinding is defined as: > Two-way binding — implicitly enforcing that some value in the DOM is always consistent with some React state — is concise and supports a wide variety of applications. [1] https://reactjs.org/docs/two-way-binding-helpers.html

Well, that mixin has never been the standard way and has been deprecated for years (and for good reasons)

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

#536
post #311

I like React’s opinionated top-down model (with callbacks passed downwards as needed either directly as props or through a store / context) for handling state changes, as this improves composability and ability to reason about state. My understanding is that Svelte’s main difference from React is that it is not opinionated in this way, and this is considered a positive feature by its proponents. Is my understanding i…

Svelte's main differences include being compiled, and being truly reactive.

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

#537

Earlier quoted context omitted.

Not to argue semantics, but that pattern is still called two-way databinding in my neck of the woods. In this deprecated page from the official docs, two-way databinding is defined as: > Two-way binding — implicitly enforcing that some value in the DOM is always consistent with some React state — is concise and supports a wide variety of applications. [1] https://reactjs.org/docs/two-way-binding-helpers.html

Well, that mixin has never been the standard way and has been deprecated for years (and for good reasons)

The mixin is irrelevant to the point I was making. :) The point is that even the official React docs defines two-way binding as I describe it.

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

#538
post #79

Earlier quoted context omitted.

Denoflare ( https://news.ycombinator.com/item?id=29142772 ) is compelling.

Do you have experience with denoflare? I really would like to try it, but I can't even get the basic `hello-worker` sample working, see https://github.com/skymethod/denoflare/issues/2

Hi there, denoflare is still in early development, thanks for trying it out - that issue you found should be fixed in the latest release 0.3.1

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

#539
post #79

Earlier quoted context omitted.

Denoflare ( https://news.ycombinator.com/item?id=29142772 ) is compelling.

Also not Cloudflare (to my knowledge)

Correct - no affiliation, just a happy customer.

Cloudflare seems to be disciplined about releasing solid lower-level platform building blocks first (e.g. durable objects), and leaving the "developer go-to framework for their advanced Worker stuff" to be built on top later.

Seems like a smart approach to me, but I agree the space is moving fast and even though they release stuff at a pretty rapid pace, it never seems fast enough for early adopters

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

#540
post #97

Earlier quoted context omitted.

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

We'll likely be hiring more DevRel folks focused on Svelte in the future! We have one currently (Steph) and she's great :)
Post reply on HN