Hacker News new | ask | show | jobs
Ask HN: Can i really write framework agnostic components for web?
5 points by palmanis 3469 days ago
The web-components API gave some hope, that if we could leverage that, and create native like components, then we can compose them and make complex stuff. To make them work with any other framework like Angular, React, etc we could write small adapters for those frameworks, which give us data-binding, etc. That ways we're not really dependent on any framework for the core components, and can support many (if not all) the frameworks being used in our organization.

But after looking at it for last few days, it seems like pretty much nothing works on IE, even if it does, it's with way too many limitations.

So is it really possible to write framework agnostic components in today's JS landscape ?

1 comments

Not really.... - custom element polyfill build is failing - https://cdnjs.com/libraries/webcomponentsjs seem to support v0 spec and not v1

And at best, you could get something working (as long as you accept lesser performance) on IE11, anything lower does not really work or requires even more polyfills.

Well then it seems like Web Components aren't a solution for IE users.

But on the other hand, how much IE users are left? Statcounter says that IE usage is on 12% globally and shrinking.

I think web components are the future. The sooner we have a sophisticated toolkit (think jQuery UI, Kendo UI, etc.) based on them the better.

Big players like React will steal this, if we're not careful. They want to be seen as a view library to build components and not as a general data-flow library that uses web components. I think this could be dangerous in the long run.

i would say a few lucky ones have the luxury of working on projects, where they can say lets ignore the IE users. Most of us can't !!

And i completely agree with your last point. The reason we've been exploring web-components was because we had developed a component library based on Angular 1, and had a really painful time making it upgradable to Angular 2, and realized in the process that it was a mistake to write component library closely coupled to any framework. While i am really excited about web-components, but their current state disappoints me.

It's kind of weird, pretty much same companies are the standards committee, browser makers and framework writers... probably thats why we have multiple ways to write web-component like things using propriety technologies, but not much progress still in writing web-components natively based on the specs.