lamplightdev

How to server side render Web Components

Almost all modern framworks provide a way to server side render (SSR) a web site by running the framework code on a JavaScipt server side framework, such as express, to produce an intial string of HTML that can be sent to the browser. The same component code that runs in...

Why is my Web Component inheriting styles?

One of the great features of the Shadow DOM in Web Components is that styles are encapsulated to the component - you can style your component without worrying about any specifier (id, class, etc.) conflicts or styles ‘leaking out’ to other elements on the page. This often leads to the...

How to pass data between Web Components?

A common question to those first experimenting with Web Components is how to communicate between different components on the same page. It might seem at first sight that the very thing Web Components are designed for - encapsulating DOM, CSS and behaviour inside of discrete elements - means that they...

What are Web Components?

Web Components is the umbrella term for a collection of independent but closely related features being added by the W3C to the HTML and DOM specifications to facilitate developing first class web components using standard browser features. Those features are: HTML Templates HTML Imports Custom Elements Shadow DOM All these...

A simple ServiceWorker app

The lack of offline access for the web is often touted as one of the major drawbacks for web apps over native apps. The appcache has been around for a while and does offer offline capability but is well documented to have its limitations (to put it politely). However a...