DEV Community

Frank Lemanschik
Frank Lemanschik

Posted on

It is Importent to have a central place to register your Web Components.

Most people under estimate the importance of general structures in web applications they tend to over engineer and this way create unmaintainable software i want to provide you a Good Level of Abstraction for your Applications.

The way to migrate your unmaintainable application into a maintainable one is a simple manifest this allows you to declare what gets loaded. The Content should Only Change when the Manifest it self Changes. And the Manifest it self should not need changes without total new content added as replacement for the old. Note the word replacement its not talking about additions additions should be do able without much modification of the existing manifest it should simple be able to reference other manifests.

If you keep this fundamentals you will come to the conclusion that the right way to Modify Software is the registration of custom elements for sections of your page but only if it is content that gets replaced often.

else the registration of custom elements makes zero sense it is even harmful direct rendered static content always wins. And then Incremental Add Functionality to it.

In Previous decades we archived a lot of this sperations via css but today this makes no sense anymore and adds only overhead so we replace css by JS that inserts CSS where needed in a cacheable way without bloating or inferences with other css.

// When you define customElements
class myTagName extends HTMLElement {} // => <my-tag-name>, define('my-tag-name') optional parse HTMLDiv HTML*Element and lower it put it into ,{ extends: 'div'}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)