Live data from Hacker News

Ways to make a web component

webcomponents.dev

1–10 of 200 posts

Re: Ways to make a web component

#2
It is very interesting that it includes the build size including compressed size, it makes me thing that one of the reasons that we don't have a popular repository of interchangable Webcomponents yet, is that if you commit to a framework to make things easier, then the size of the bundle is easier to justify if you keep all the components made within the same framework.

Importing components that have been made with different framework come with their extra bunde overhead, at least that what looks to me at first glance.

Re: Ways to make a web component

#3
Alternate title: The fractured state of web UI design explained using a simple counter.

I say that only slightly in jest, as it is a neat way to show all (or most) of your options.

Although it doesn't have my at-the-moment favorite way to make web components, blazor/web assembly. For me, it's made front-end development fun again, which I haven't enjoyed in a long time.

Re: Ways to make a web component

#7
Super cool, thanks for this!

Now regarding the results: Are there any actual usecases where one would choose Angular over some other library?

From what i’ve seen from before and now this, i am not aware of a single reason why would anyone choose to use it, if they are not constrained by legacy codebase or if there are no stubborn developers who swear by it.

Re: Ways to make a web component

#8
GPT-3 has an interesting contribution to this: https://twitter.com/sharifshameem/status/1284095222939451393...

Tell it what you want in plain English, then it builds you a web component in a random language that happens to be React.

I wonder if in the future we’ll be comparing the size of components generated by an ML model...

Re: Ways to make a web component

#9
post #6

I love the simplicity of StencilJS. Not sure why it's adoption is so low but those guys have put a lot of work. Much better than what Google is doing with Lit Element.

'cuz Facebook spent a bazillion dollars to push the developer community towards React? They are really good at––how should I say this––controlling the 'community direction and sentiments'. Even countries for that matter.

Re: Ways to make a web component

#10
post #4

This is neat, but I wish there were more examples than just a counter. I would never use something like Angular, React, or Vue to implement something so trivial.

This distills the differences into the simplest possible example, which given the number of examples is incredibly useful.

Also if you're in a React project, yes, you would use it for a counter. Obviously you wouldn't use React for just a counter, but it's a great way to show the basics of working with each option.

Post reply on HN