We Should Stop Hating Web Components
Harsh Singh
Posted on April 30, 2021
So you just heard about this thing called web components and you did a quick google search. apart from a few tutorials and some github pages you also see these catchy articles whose headings starts with "Web Components Doomed" or "Web Components are not the future". The Words might be different but each of those articles try to woo you away from using or even trying out Web Components.
They tell you that Web Components are not being used anywhere and it was destined to fail. but they are telling you only the half truth.
Although its true that Web Components aren't as popular as React or Vue or any other framework, but that does not means they are not being used anywhere. Google has been using web components for a while in many of its platforms. infact Angular also uses Web Components Under the hood.
Github uses a set of custom elements called Github Elements
They also try to scare you by saying there are only a few libraries available for making web components. But the fact is that there a lot of libraries available for easing the development process of web components like LitElements, FastElements by Microsoft and Lightning Web Components By Salesforce. These Libraries are not just actively maintained but infact the number of their users is also increasing. The State Of JS 2020 ranks LitElements above Angular. There's also stencil, which is not a framework but a compiler which allows you to use technologies such as JSX and Virtual DOM for creating web components.
But In the end, I accept at first Web Components seem to make simple tasks more complex because you have to use VanillaJS for interacting with the DOM and the state management is still a mystery. but it allows you to create a functional web app without any build process and its also very fast. What Web Components lack now are resources and good tutorials.
Leave your thoughts about Web Components in the comments.
Jai Hind!
Posted on April 30, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.