by Etheryte on 12/15/2024, 6:21:32 PM
by potsandpans on 12/15/2024, 6:31:58 PM
Only partially related to the blog post, but...
The thing that is lost on me with all of these webcomponents solutions is that they inevitably rely on tagged templates to do the heaviest lifting.
I don't want to write strings, I want to write statically analyzable code. IDEs do some heavy lifting here for visual hints, and there are a few html-in-js linting solutions, but none of them are very compelling.
by nilslice on 12/16/2024, 12:30:14 AM
Enhance is super cool and the fact that it can be called from basically any server language makes web components really powerful & reusable.
I work on one of the underlying libraries that provide it said portability, Extism, and I love to see how WebAssembly actually bring some of the coolest parts of the web browser into other applications.
by sirwhinesalot on 12/15/2024, 7:00:34 PM
Great stuff, but if you are writing your own components just stick to light DOM and do not write code to generate DOM elements for the component to look right.
Let's say you are making a splitter component. Do not do this:
<my-splitter>
<div slot="left">
<my-handle slot="handle">
<div slot="right">
</my-splitter>
With some divs on the inside assigned to slots. Instead do this: <my-splitter>
<div data-slot="left">
<my-handle data-slot="handle">
<div data-slot="right">
</my-splitter>
Looks almost the same right? Except the one at the bottom is trivially server-side rendered. *It already is*.Stay on the light side.
by egeozcan on 12/15/2024, 7:41:44 PM
Lit has an experimental SSR plugin:
https://lit.dev/docs/ssr/overview/
I also sort of made SSR work under next.js (not to be mixed with server-components), but that took a lot of hacks and going off the beaten path:
by yakshaving_jgt on 12/16/2024, 3:11:23 AM
Front-end people keep using the word “isomorphic”.
I don’t think it means what they think it means.
To me, two types of values are isomorphic if they share the same cardinality. The isomorphism between two isomorphic types is a pair of morphisms (functions) that when composed one after the other is the same as doing nothing.
This word is a couple hundred years old, so it long predates front-end development. It has a pretty specific and established meaning in mathematics. It’s not right to use this word when you just mean “shared code”.
I don't really think server-side rendering is an important reason why most people don't use web components. Most web applications that use components of any sort are largely SPAs of some variety and don't care one bit about server-side rendering. In my opinion, the main reason web components aren't widely used is that the alternatives are just better. I'm yet to see a strong case being made where web components are favorable for a reason other than purism.