Are web components alive?

  • 0
    Even a couple of years ago, there was a lot of noise around Web-components.
    Google's polymer still exists , and the polyfill project https: // ... < / a> lives quite actively - the last commit was less than a month ago.

    However, there are no recent publications on the network. Yandex Wordstat shows the oscillator:!/ history? words = web-co ...

    In short, I could not figure out if the technology has a future or if it was beaten to death by reactive frameworks like Vue.

    Does anyone use it actively? How are your impressions? What do you think about the future?
    JavaScript Anonymous, Oct 2, 2020

  • 2 Answers
  • 0
    My own answer after studying the topic and reading foreign colleagues will be like this:

    The technology was promising and interesting at the start. To support it, Google even came up with a separate HTML Imports specification: https: //w3c.github. io / webcomponents / spec / imports / i ... (you don't have to go, there is 404), which made it possible to include single-file components directly into the document like this:

    & lt; link rel = "import" href = "my-component.html" & gt;

    Cool isn't it?

    But the technology did not gain popularity, perhaps because it was too simple and understandable, and it was at this time that npm, gulp came to the peak of fame and that's all. Incomprehensible magic, the loss of control over the code and all sorts of optimizers that made it possible to make a bundle of one and a half, and sometimes 2-3 MB for one slider on the main page, came into fashion. code, and all this without any jQuery there.

    The guys changed their minds and removed the HTML Imports specification, proposing to split the components into 3 separate files - js, css and html with a template. Moreover, js had to be connected on the page, css too, and html had to be loaded, as conceived by the creators, into js itself. This approach made it possible to dramatically complicate the work with web-components and make the code unmanageable again, but it was too late - the technology had already lost ground to competitors.

    Of course it was sarcasm if someone didn't understand.

    Life in this idea is still glimmering, but now we are offered to write the code in three files, or put it entirely in js, or use it with special loaders, which is comparable to using some framework, the same Vue, which gives the theme much greater opportunities through efforts and there is no point in using web components.

    In short, the technology is good by design, but in practice it is not applicable, therefore it does not receive wide distribution.

  • 0
    They were just devoured by all sorts of frameworks that do the same thing but with blackjack. Some frameworks use them under the hood. But by themselves, practically no one uses it. I suppose this is because any task that requires the use of web components is in itself quite complex that it makes little sense to do it without some kind of framework.

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!