Live data from Hacker News

Svelte 3: Rethinking Reactivity

svelte.dev

51–60 of 186 posts

Re: Svelte 3: Rethinking Reactivity

#51

Congratulations on the launch, Rich! It's looking like we're really starting to approach the form and function of what "a language to build the web" ought to be. One small question about some of the pragmatic choices in Svelte 3: What was the decision process behind choosing to smuggle the new reactive features under a "standard" JavaScript skin? ($:, export let, etc.) Is it just to avoid needing to rewrite all exist…

Thanks Jeremy! As I've expressed elsewhere, observablehq.com provided important inspiration. I've also been influenced by your own comments in the past about a language for building web apps. It's exactly that — there's so much tooling in the JS ecosystem that we can lean on, and by inventing new syntax we'd be throwing all that away. It'd be great if we could do `prop answer = 42` and `a <= b`, but it's just not wor…

> I've also been influenced by your own comments in the past about a language for building web apps

Hey Rich have you seen Imba?

http://imba.io/

It's not reactive, but it doesn't need to since everything is memoized. I think it's interesting that they made their own language to solve the front end problem.

They used it to build https://scrimba.com/ which is pretty awesome.

Re: Svelte 3: Rethinking Reactivity

#52

From the tutorial: > Svelte is giving us a warning: > A11y: element should have an alt attribute > When building web apps, it's important to make sure that they're accessible to the broadest possible userbase, including people with (for example) impaired vision or motion, or people without powerful hardware or good internet connections. Accessibility (shortened to a11y) isn't always easy to get right, but Svelte will…

Eslint already warns you about issues like this, and is framework-agnostic. Does Svelte just use eslint under the hood? Otherwise you risk fracturing the ecosystem with framework-specific a11y requirements.

Re: Svelte 3: Rethinking Reactivity

#53

This is roughly how QML works too right? > Cybernetically enhanced web apps That is pretty terrible! It seems to me that the main think that distinguishes Svelt is that more work is done at compile-time? Why not a slogan that says just that? "Compile-time optimised reactivity." or "Low overhead reactive web apps" or something like that. Cybernetics is nonsense waffle. Anyway good luck! Seems like a better approach th…

Agreed: compile-time optimization is a pretty good pitch. Rust and Typescript and Haskell have done all the PR necessary for this pitch; you have a prepared audience.

Re: Svelte 3: Rethinking Reactivity

#54
post #39

One area where the virtual DOM seems to be important is for rich text editors, where the VDOM can basically take the input, diff it using an immutable structure, then render it to properly structured HTML. An example use case where this would be valuable: a user hightlights text, bolds it, then highlights it again plus some more text, and bolds it. A naive approach would have: This text is bolded plus I bolded this w…

If you need a rich text editor, I would just plug in a framework-agnostic rich text editor (e.g. ProseMirror).

Re: Svelte 3: Rethinking Reactivity

#55
post #36

"The magical disappearing UI framework" was a much better tagline than "Cybernetically enhanced web apps" …

We certainly debated this one over in the Discord channel...

What about "Faster web apps with less code?"

or "Faster, smaller, web apps?"

They seem to be the main benefits for using Svelte.

Re: Svelte 3: Rethinking Reactivity

#56

Nice handling of reactivity - I think this should already be in language as well. I'm not sure I like this single components approach and embedding JS in HTML. The problem with this is that it's too frameworkish. The big benefit of JSX/React rendering is that it's composable and declarative (as it's just functions), but it's also simple to get - render just returns wanted structure, given the state and you can use si…

Mobx-state-tree is a really nice balance of state management that also is compatible with all the nice Redux browser tools https://github.com/mobxjs/mobx-state-tree

Re: Svelte 3: Rethinking Reactivity

#59
Congratulations on the release, Rich!

Minor suggestion: it should be easier to find how to get started (read install) for people trying to give Svelte a try. I had already played a bit with Svelte before but wanted to try v3 and the only thing I could find about how to install it was in https://svelte.dev/blog/the-easiest-way-to-get-started.

Post reply on HN