DEV Community

loading...

Discussion on: Why I don't use web components

webreflection profile image
Andrea Giammarchi

I'd give 🔥 heresy 🔥 a chance too, it works out of the box on client/SSR and since it needs zero real DOM to work, it might easily end up on NativeScript or similar too 🦄

Thread Thread
rhymes profile image
rhymes

The article keeps saying Stencil compiles to Web Components, that's what I meant 😅

Yeah it's more than that but the final product is WC.

Anyway, frontend has so many tools 😬😬😬😱

Thread Thread
webreflection profile image
Andrea Giammarchi • Edited

hello world example

almost nothing you see in that definition is standard:

  • decorators are not there yet
  • @Prop() first: string; makes literally no sense on JS
  • the JSX return in the render also makes no sense

Stencil One is basically the most hybrid thing of them all, and once it compiles to "standrd JS", it needs a global defineCustomElements to be useful at all.

One can't really ship portable components like this, or can they?

The good news, is that it might target also NativeScript or similar platforms (I'd imagine React native, due JSX in the render), but the bad one is that Stencil One is far away from being a standard based way to develop anything, 'cause it needs, for those parts, mandatory toolchain that is not part of standard Web development.

I hope I've clarified a bit more, happy to answer further, if necessary.

Thread Thread
rhymes profile image
rhymes

I hope I've clarified a bit more, happy to answer further, if necessary.

Ok got it, I thought that Stencil's output was just pure web components, that's it.

Thread Thread
briancodes profile image
Brian • Edited

The props and decorators are removed during compilation, and the output is a Web Component. There's a lot of companies building design systems now with Stencil dev.to/ionic/apple-just-shipped-we...