DEV Community

Vivek
Vivek

Posted on

WebJs - AI first web components framework

I experimented building a web components framework I always wanted but didn't exist: webjs.dev Ofcourse, I made it AI friendly!

Feedback and contributions are most welcome.

Top comments (2)

Collapse
 
dannyengelman profile image
Danny Engelman • Edited

IMHO, you copied the bad parts from Lit.

 return html`
   <button @click=${() => { this.count--; this.requestUpdate(); }}>-</button>
   <output>${this.count}</output>
   <button @click=${() => { this.count++; this.requestUpdate(); }}>+</button>
   `;
Enter fullscreen mode Exit fullscreen mode

Looks great in a small counter example,
but becomes HTML (Horrible Twisted Messy Lines) in real applications...
Not to mention all whitespace and linebreaks end up in the delivered minified file.

Can all be done without a Framework or HTML:

Collapse
 
vivek7405 profile image
Vivek

The decision to borrow the web components API from LIT is that the AI agents are largely trained with LIT. Plus, I do like the DX of LIT compared to other web component libraries. WebJs intentionally doesn't minify any of the files, and I think that's an advantage since agents can read the code as it was written from the browser console, plus it is proven in production by products like hey.com that unminified code works equally well in production.