Topics

All posts

Angular: extract a module with existing components and important lesson about NgModule

Angular: extract a module with existing components and important lesson about NgModule

I often see Angular applications with bad architecture, especially no separation on modules. As a result, all components of an application are put in a single app/components folder which makes it hard to separate concerns. Which components are grouped together? Which components require a service? Which component is merely a part of another component? Are there any dumb components?

In this article, I’ll show how easy it is to refactor an Angular application and extract a new module with existing components. I’ll describe a simple case, with no global services.

Read More Read More

Automatic CHANGELOG.md or commitizer and standard-version family

Automatic CHANGELOG.md or commitizer and standard-version family

It’s been a long time since I wanted to include a variation of conventional commits to one of my projects – mostly for automated changelogs, but also often to standardize naming commits. The available packages were confusing to me until I finally started to include them in a project.

Read More Read More

Add behavior to HTML using Alpine.js – a Todo app

Add behavior to HTML using Alpine.js – a Todo app

Sometimes I create pages with minimal interaction and amount of JavaScript – for instance, with a hamburger menu, toggle or tabs. They require simple yet repetitive JavaScript code. There are nice big components or frameworks that solve this problem (like Bootstrap, React, Vue), but the problem is their size and often a complexity to set up. Recently (in November 2019), a new library emerged – Alpine.js.

Read more
I migrated to Google Tag Manager

I migrated to Google Tag Manager

I was very disappointed when a popular Google Analytics WordPress plugin moved most of its features to a $200 / year plan. I looked for a free alternative because I had very little requirements: add the tracking code to the page and track page scroll. It’s barely a dozen lines of code using autotrack. I think I have checked all WordPress plugins that appeared after searching for “Google Analytics” and I found only ONE that met the requirement. Unfortunately, it was not compatible with Google Analytics (analytics.js code), but only with Google Tag Manager (gtm.js)…

Read More Read More