←back to thread

174 points tipiirai | 2 comments | | HN request time: 0s | source
Show context
spankalee ◴[] No.42732666[source]
I help maintain Lit[1], which I consider a very standards-first non-framework.

With Lit you can build full apps with standard and plain JS, CSS, and HTML; standard web components; and no build tools.

I don't immediately see how this is any more standards-first, especially when it mentions Markdown, tooling, and a CLI. I don't actually really see what exactly this even is from this landing page. It would help to show something up front.

[1]: https://lit.dev

replies(4): >>42733153 #>>42734977 #>>42738855 #>>42747207 #
jeswin ◴[] No.42734977[source]
Lit is amazing. But I don't like template strings for HTML. The IDE doesn't understand it automatically, and lit jsx had a bunch of issues last time I tried to use it.

In my view, JSX will be the true legacy of React. Applications are code. Many frameworks (such as htmx) extend HTML to bring a bit of programmability into it; but I felt they were just framework-specific, non-standard rules to learn. JSX is more standardized, and isn't as framework dependent.

Shameless plug: Magic Loop [1], a Lit alternative (that nobody knows about) which uses WebJSX [2] underneath.

[1]: https://github.com/webjsx/magic-loop

[2]: https://www.webjsx.org

replies(5): >>42735285 #>>42735961 #>>42738541 #>>42738926 #>>42741130 #
1. spankalee ◴[] No.42738541[source]
We're in a thread talking about "standards first" things, and JSX just isn't a standard part of the web platform, nor is it in anyway standard within the ecosystem of JSX.

JSX has no semantics, only syntax. What a JSX expression means changes depending on the transform you use and the framework you use with it. Some JSX transforms produce values, some produce side-effects. Values produced with JSX under different transforms have different types and are not compatible with each other.

Maybe one day some form of JSX will be standardized, but until then tagged template literals work great with no tools and their behavior is fully determined by the template tag that you use, not an external transform. They're also more expressive than JSX (In Lit we support explicit attribute, property and event bindings rather than overload a single namespace for all 3).

Support for syntax highlighting, type-checking, and intellisense are available to IDEs via plugins and LSPs.

replies(1): >>42749767 #
2. 8n4vidtmkvmk ◴[] No.42749767[source]
I don't really know what any given tagged template literal is going to do with its content either. It can also produce a value or run side-effects. The only difference is that the parser now has to be inside the browser, and that has a runtime cost instead.

> In Lit we support explicit attribute, property and event bindings rather than overload a single namespace for all 3

I'd like to know more about this. I don't know what that even means.