Web Components

Articles about Web Components on omid.dev — guides, topics, and notes from the field.

Implementing Custom Web Components in Angular with Stencil.js

Published: June 26, 2024 Reading time: 6 min

In modern web development, the ability to create reusable components that work across different frameworks and libraries is crucial. This is where Web Components come into play. Web Components allow developers to create custom, reusable HTML elements with encapsulated functionality and styling. However, building Web Components from scratch can be complex and time-consuming. Enter Stencil.js, a powerful tool that simplifies the creation of Web Components. Companion resource Companion Project Try the working example in your browser or inspect the full source code behind this article. github.com/omidfarhang/example-projects/examples/angular-stencil-web-components Open live demo View on GitHub In this guide, we’ll explore how to create custom Web Components using Stencil.js and seamlessly integrate them into Angular applications. Whether you’re an experienced developer or just getting started, this comprehensive guide will walk you through each step of the process. ...

Continue Reading

Micro Frontends: Working Example

Published: May 11, 2024 Reading time: 7 min

This is the companion for Why and How. It proves one thing: a host page can load separately built Angular and React bundles as custom elements, pass a message attribute down, and take a microfrontend:message event back. It does not prove Module Federation, independent production deploys, or a shared design system. npm run dev builds the remotes, then starts one Qwik server that serves them from public/mfes/. Rust WebAssembly is a shell helper for CPU work, not a fourth micro frontend. ...

Continue Reading

Micro Frontends: How?

Published: May 9, 2024 Reading time: 9 min

Once you have a reason to split the UI, the next decision is how the pieces become one page. That assembly step is composition: the host application — the shell — decides where each slice renders and what it is allowed to see. There are a few honest ways to do it. I picked one for the companion: the browser loads separately built bundles and mounts them as custom elements — HTML tags the host did not compile. That is client-side composition. It is not the only option, and it is not a production platform by itself. ...

Continue Reading