I have build a JavaScript toolkit in Angular which contains a lot of 'basic' components, like buttons and fields. For a new project, I am doing some research for a more framework-agnostic way to implement such components, so I can reuse my components in other JavaScript frameworks as well.
During my research I found just one alternative: web components, using custom elements. According to so many resources and blogs a web component is the best and only way to create a framework-agnostic component. How can I considering a new technology if there is just one? Or am I missing something?
The Web Component API, as far as I know, is the only built in framework for Web Components.
There are plenty of other frameworks for making components but those normally come with lots of extras that have nothing to do with components.
I had a system I wrote years ago that was just for creating a component and nothing else. But it was very limited and I have since moved to Web Components for everything.
Writing a true, native Web Component allows you to reuse that code in any and all frameworks. I have some components that have been used, without change in Vanilla JS, AngularJS, Angular, VUE and React.
There are issues with a shadowDOM element and styling between projects but that is small compared to being able to reuse all of your components when your company insist on changing frameworks.