Live data from Hacker News

Show HN: Sinuous – Small, fast, reactive UI library

github.com

1–10 of 47 posts

Re: Show HN: Sinuous – Small, fast, reactive UI library

#2
I work in this space so I am curious how your library is different from its similar competitors. I read the docs, but I didn't find anything about the actual model for how it works, like whether the whole UI rerenders on any observable change or not. Maybe consider this paragraph a request for documentation.

PS: A minor suggestion: the word "blazing" is so overused in the JS world at this point, when I see it I always at first suspect the app is a parody. If it's fast, then the word "fast" suffices.

Re: Show HN: Sinuous – Small, fast, reactive UI library

#3
post #2

I work in this space so I am curious how your library is different from its similar competitors. I read the docs, but I didn't find anything about the actual model for how it works, like whether the whole UI rerenders on any observable change or not. Maybe consider this paragraph a request for documentation. PS: A minor suggestion: the word "blazing" is so overused in the JS world at this point, when I see it I alway…

https://github.com/luwes/sinuous/ seems to have a little bit more info.

Re: Show HN: Sinuous – Small, fast, reactive UI library

#4
I've toyed around with the template-strings-to-markup approach before, but couldn't quite figure out how using `map` to generate dynamic lists avoided doing a full O(n) loop upon each update without some kind of diffing engine (other than the browser's own markup diffing).

Re: Show HN: Sinuous – Small, fast, reactive UI library

#6
I kinda don't get the whole "put html in template literals". Wouldn't there be no syntax highlighting? And the framework is either putting the string into the DOM with some regex manipulations, which would lead to some very confusing error messages, or it's parsing the string into a tree, which means it needs to implement what's essentially XML parsing, which would come with an overhead. And for what? Avoiding JSX? If you don't like JSX, just desugar it to nested function calls. Or just use a templating language.

Re: Show HN: Sinuous – Small, fast, reactive UI library

#7
Kind off-topic but related: sometimes I wonder how web development would be if Lisp had somehow won as standard, since we can use to do everything the stack HTML+CSS+JS+Backend-language does, in addition to standardized syntax and standard everything.

Oh, standards. Standards.

Re: Show HN: Sinuous – Small, fast, reactive UI library

#8

I kinda don't get the whole "put html in template literals". Wouldn't there be no syntax highlighting? And the framework is either putting the string into the DOM with some regex manipulations, which would lead to some very confusing error messages, or it's parsing the string into a tree, which means it needs to implement what's essentially XML parsing, which would come with an overhead. And for what? Avoiding JSX? I…

Of course you can write a syntax highlighter for HTML in template literals. The lit-plugin VS Code extension provides syntax highlighting plus type checking for bindings.

lit-html works by passing the template strings to the built-in HTML parser, so it doesn't need to bring its own.

The benefit isn't just avoiding JSX and build steps, but more importantly avoiding VDOM and expensive diffs. Template literals separate the static parts if a template from the dynamic and remove the need to diff the parts that never change. It's more efficient.

Re: Show HN: Sinuous – Small, fast, reactive UI library

#9

I kinda don't get the whole "put html in template literals". Wouldn't there be no syntax highlighting? And the framework is either putting the string into the DOM with some regex manipulations, which would lead to some very confusing error messages, or it's parsing the string into a tree, which means it needs to implement what's essentially XML parsing, which would come with an overhead. And for what? Avoiding JSX? I…

Of course you can write a syntax highlighter for HTML in template literals. The lit-plugin VS Code extension provides syntax highlighting plus type checking for bindings. lit-html works by passing the template strings to the built-in HTML parser, so it doesn't need to bring its own. The benefit isn't just avoiding JSX and build steps, but more importantly avoiding VDOM and expensive diffs. Template literals separate…

> lit-html works by passing the template strings to the built-in HTML parser, so it doesn't need to bring its own.

What do you call this then: https://github.com/Polymer/lit-html/blob/master/src/lib/temp... ? For example, used here: https://github.com/Polymer/lit-html/blob/master/src/lib/temp...

lit-html parses strings with regexps, does an ungodly amount of string concatenation, and only then dumps the resulting string blob into the DOM.

Re: Show HN: Sinuous – Small, fast, reactive UI library

#10
post #7

Kind off-topic but related: sometimes I wonder how web development would be if Lisp had somehow won as standard, since we can use to do everything the stack HTML+CSS+JS+Backend-language does, in addition to standardized syntax and standard everything. Oh, standards. Standards.

We would probably just treat the html as data, that is normal lisp. So no syntax changes. Same for css I guess. Maybe in twenty years.
Post reply on HN