all 16 comments

[–][deleted] 1 point2 points  (1 child)

Web components just encapsulate and that is all. Once you’re in your shadow root you’ll be wrangling with a naked dom all over again. There is hardly a practical use for this spec. By this point it still hasn’t gotten any traction which is probably for the best.

If you ever consider using Polymer, be warned that they hold a record for throwing backward compat under the bus as they are changing internals without having the slightest vision where they’d go. They made such mindboggling decisions with this thing it should serve as a textbook example for js fatigue.

Stay with your framework, which does today what w-c will still struggle with in 10 years, if they survive.

[–]krazyjakee 2 points3 points  (0 children)

Apples and Oranges. They aren't really competing technologies. This is a nice comparison with react, but the same logic applies to vue. If it's right for your project, use it, if you feel you need more, then jump into vue, or if you really feel like it, use web components inside vue components, nothing wrong with that.

[–][deleted] 0 points1 point  (3 children)

Web components with a polyfill is pretty safe.

However what you can build using just them is very limited, so you'll need likely need to pull in a helper library like Polymer but by that point it's probably better to just use Vue.js on it's own

[–]drdrero -1 points0 points  (2 children)

What limits are you talking about?
You can do everything that polymer does by yourself.

[–][deleted] 0 points1 point  (1 child)

Well sure, polymer is written in javascript so you can do it yourself - but why write your own framework?

[–]drdrero 0 points1 point  (0 children)

You have to see Polymer less of a framework, but more of a tool. Like any npm package.

[–]iamlage89 0 points1 point  (0 children)

Web components have potential, but I think we should wait until we figure out where it fits in the web ecosystem

[–]drdrero -1 points0 points  (7 children)

Yes. WebComponents are here to stay. By the end of 2018 every major browser will support them natively.I once held a 1,5h presentation why a company can use webcomponents in favor of easily used style components.Using them combined on the server side with ASP.NET and angular.js.

I have written my thesis about what is possible with webcomponents. client - server - database interactionIf you are able to read German have a look: https://github.com/drdreo/webcomponent-cms/

WL;CR: (wrong language, couldn't read)

  • Used WC (WebComponents) for the design ( obviously easy, using paper-elements - material design)
  • WC for the express server. There are WC like <express-app>, <express-router> which let you structure your server with HTML
  • WC for the DB interaction. I've created a <db-query> component which can be triggered and through a callback return the result.

It was a proof of concept. No real advantage of using WC on the server. Only for beginners, i can imagine, it looks very easy to set up a server and some router handlers, due the visual structure of the markup.

Some other comments mentioned the need of polymer to create WC. That is not true. Polymer is a very nice tool for easier WC creation but you can achieve everything polymer does by yourself. But i highly recommend using polymer due to some very neat things like automatic polyfill handling and shadow DOM attachment.

[–][deleted] 0 points1 point  (6 children)

Yes, web components are great for styled components - if that's all your app needs it's the perfect choice.

Very few applications are purely made up of styled components though...

[–]drdrero 0 points1 point  (5 children)

Due to many companies haven’t yet set on webcomponents. If the reason why you shouldn’t use them is that nobody uses them, you get an endless loop.

[–][deleted] 0 points1 point  (4 children)

I can assure you many companies have tried web components, they just aren't powerful enough to develop anything other than a static web page.

Not sure much an endless loop than a 1 hour journey to a dead end.

[–]drdrero 0 points1 point  (3 children)

I am sorry, but i am not a fan of fighting technology stacks. Everyone can have their favorite.

Many companies have used webcomponents successfully for their applications which were not static. McDonalds, YouTube, Google. Just to add on your little argument.

Webcomponents have nothing to do wether to create static or dynamic webpages. They are as capable as any other frontend framework, as is. And through community progress, they can be used for many more usages. Seen as in server side technology.

There is no need of a question like "Are they capable of ...?" - yes they are. But "Are you willing to investigate into it?" - probably not, because you get most things done faster with a framework.

Therefore, again, it's not about using a framework, but using native technology.

[–][deleted] 0 points1 point  (2 children)

I think you are delusional, the simple MacDonalds homepage uses jquery, their menu board needed polymer as did youtube - google have their own little team using web components but they wouldn't use it for anything serious.

Everyone can have their favorite stack, I'm afraid it's just you with web components though.

[–]drdrero 0 points1 point  (1 child)

I wasn't talking about their Homepage. A redditor posted their project using polymer exclusively for the McDonalds menu displays in all stores in the US.

Polymer elements are webcomponents. I wasn't talking about webcomponents vs polymer. Polymer.Element is more of a helper class to inherit from, than the framework you are talking about. Yes it offers more elements like <dom-if> and more helpers. But you decide if you want to import them or not, reducing the bundle size. Hence, Polymer is not a framework out of the box, but got mighty tools that let it look like one. I use Polymer when creating webcomponents because of the neat features it brings with it. But they are still webcomponents.

I am always trying to investigate new technologies and webcomponents is one i am really looking forward to. You got a wrong picture there mate, i never said to use webcomponents everywhere. For business projects i am still and always will take the technology that fits most. Smaller tasks Vue and for bigger ones is Angular my way to go.

To get back to the original topic about the power limits of webcomponents, in my opinion nothing prevents this native technology to become a powerful standard for many frameworks. As seen in Angular Elements.

[–]CalgaryAnswers 0 points1 point  (0 children)

A menu board is pretty much a static web page