Check out "Do you speak JavaScript?" - my latest video course on advanced JavaScript.
Language APIs, Popular Concepts, Design Patterns, Advanced Techniques In the Browser

White-labeling React apps

posted in JavaScript on 2021-08-16   react whitelabel webpack

A white label app is an app that we build once and "resell" it to other people/companies. Very often we are talking about applying different themes but sometimes we have to change logic too. Such changes should be as declarative as possible so they scale well. Otherwise is more of a copy/paste exercise. In this article I want to sketch out a couple of approaches for white labeling in React applications.

read more

Configure Google domain email in Vercel with ImprovMX

posted in Architecture on 2021-01-27   vercel email google improvmx

Back in February last year I blog on topic Email not working after DNS change. Well, I had kinda similar situation but not exactly. This time I bought a domain from Google and wanted to use an email with it. The setup wasn't obvious for me so I decided to document the process.

read more

Transpile to ES modules with Babel

posted in JavaScript on 2021-01-14   es babel javascript transpile typescript

While I was working on Navigo an issue popped out. It was about using the library in the context of Web Dev Server where we have everything in TypeScript. And something was not ok with Navigo. The npm package wasn't exported properly and we were keep getting a does not provide an export named 'default' error. It turned out the problem is that Navigo is not exported properly as ES module (also known as ESM).

read more

Replacing code for production with Babel transformation

posted in JavaScript on 2020-11-29   babel transform plugin production replacement

If you are building some sort of an app, Babel is probably part of your build system. It is that thing which converts our fancy code to valid, working in a browser, JavaScript. Just recently at work I had to design a solution that swaps a class based on the environment. Or in another words, we have logic that should not reach our users. The file should be available locally and on our staging environment but not in production. A tiny Babel plugin was the cheapest solution for me so I decided to share the result.

read more

Recreating Facebook's Recoil library

posted in JavaScript on 2020-07-12   recoil facebook state management mycoil facebook s recoil counter atoms atom component library formattedcountervalue selector key function javascript subscribers hook const return

This weekend I decided to play with the new kid on the block - Facebook's Recoil library for managing state. I did the trivial counter example to see how it works. It's pretty simple idea so I wondered how much it takes to replicate its features. I found the exact answer - 70 lines of code. Obviously, my implementation didn't cover everything but it was fun so I decided to share my findings.

(A side note: I did not look at the code of Recoil. I didn't want to be bias on how to write my version.)

read more

A journey into software development with Lea Verou

posted in Inspiration on 2020-06-05   lea verou journey software development

Lea Verou, known in the community as the "Queen of CSS", shares her personal story about how she became a web developer. She discusses how her passion for computers began in her childhood and her dream of living outside Greece.

read more

NADCAST.24 с Радо Станков

posted in NADCAST on 2020-03-26   nadcast remote productivity work tips home working remotely separation https rstankov biz 24_radostankov mp3 cbox biz 24_radostankov host003 cbox biz ws host003 cbox outset ws host003 nadcast outset ws http nadcast outset mp3 http nadcast

В тези смутни времена се чуваме online с Радо Станков за да си поговорим за remote working. Не че по принцип не се чуваме така, но сега е малко по-различно. В този 24-ти епизод споделяме нашия опит в работа от разстояние. Приятно слушане.

read more

My top 3 tips for working remotely

posted in Other on 2020-03-20   remote home work tips productivity working remotely separation working

These days working from home is a norm. We all know why. This f.cking virus is all over the globe. I bet there are tons of articles on how to work remotely efficiently but I wanted to give my two cents.

read more

VSCode go to definition/implementation fixed

posted in JavaScript on 2020-01-17   vscode typescript intellisense problem implementation working common fixed definition

I just spent ~2 hours on this and I had to blog about it. I bet I will come back to the same problem and it will be nice to have a quick solution at hand. And the problem that I'm talking about is the non working Go to definition or Go to implementation feature of VSCode. Or in other words the JavaScript IntelliSense was not working for me. Of course it was annoying because I had to navigate to files manually via the folder tree on the left or typing the name of the file in the Cmd+Shift+P popup.

read more

Hopa - zero config CLI that runs JavaScript and TypeScript

posted in JavaScript on 2020-01-12   hopa runner typescript javascript babel typescript io webpack https code don t krasimir hopa

Yesterday was one of those days. I stumbled a task and wanted to find the right tool for it. That same task is on my way at least twice a week and I always refuse to optimize it. Because it was a weekend I decided to spend some time and research a proper tool for the job. Well, I find nothing that suites my need. I time-boxed a hour and said F.ck it!. I will code it myself. That's how Hopa was born - a zero config CLI that runs JavaScript and TypeScript. Transpiles, bundles, watches and executes code.

read more

Part 3: Riew - reactive view in patterns

posted in Riew on 2020-01-06   riew csp routine go javascript channels console log yield krasimir riew https github function state const

In this article we will see some use cases of Riew. Those are patterns which I found repeating while using the library. There are other blog posts part of the same series and I will suggest checking at least this one so you get a basic understanding before jumping into the code snippets below.

read more

Part 1: We need channels! A gentle introduction to communicating sequential processes.

posted in Riew on 2020-01-06   riew csp routine go javascript channels put javascript fibonacci index function return pattern fibonacci number

CSP is a formal language for describing patterns of interaction in concurrent systems. It's used in Go, Crystal, Clojure's core.async and a couple of other places. The idea in its core is nothing so complicated but it offers some interesting capabilities. Surprisingly enough it is not really popular in JavaScript. Recently I'm exploring this pattern and here are my findings.

read more

Part 2: Riew - reactive view basics

posted in Riew on 2020-01-06   riew csp routine go javascript channels channels channel const javascript function ch view console log

Riew is a library based on communicating sequential processes (CSP). It is made to help with communication and synchronization between your view and business logic. It's distributed as a npm package, it has 0 dependencies and adds ~8KBs (gzip) to your application on production.

read more

Reactive view - the concept

posted in Riew on 2020-01-04   riew csp routine go javascript channels kitty ch const function view https react redux

Something bugs me last couple of years. I'm using React for some time now and there is always this doubt if I'm placing the business logic on the right place. I'm trying to be pragmatic, to follow best practices and listen what the community is saying. However, I still feel that something is not ok. This blog post presents the idea of the reactive view. That is nothing new per se but I came up with this term because it fits well in my idea.

read more

Meet Evala - your terminal in the browser

posted in JavaScript on 2018-02-14   shell evala socket terminal app open browser term data web chrome

On my machine I have four applications always open - VSCode, Chrome, iTerm and Slack. I spend most of my time in Chrome and VSCode. My editor is full with awesome extensions and I feel pretty good there. What I am doing for the browser is making sure that I have fewer tabs open and install only extensions that I really use. One thing though I can achieve so far. I can't find the perfect new tab extension.

read more

Meet the JavaScript pattern of the year or how to handle async like a boss

posted in JavaScript on 2017-11-24   generator player function result return position error const console log yield call player

Sometimes when you learn something new you get really excited. Excited to that level so you want to teach it to someone. That is the case with the concept which I found a couple of months ago. It is an implementation of the command pattern using generators. Or the well known saga used in the redux-saga library. In this article we will see how the idea makes our asynchronous code simpler and easy to read. We will also implement it ourself using generators.

read more

README driven development

posted in Architecture on 2017-09-06   library readme driven development api code writing make documentation started helped

I was doing a podcast episode with Kent C. Dodds when he mentioned README-driven development. And so I decided to try it out with a new library which I just started. Here’s what I found.

read more

8 Years of blogging

posted in Must-see on 2017-01-02   javascript top year years pseudo elements css visits blog convert html string practice node js

The first article on this blog is published on 22th of August 2008. It’s about a website which I saw at FWA. Eight years later I’m still publishing stuff here and because it is the beginning of a new year I decided to give you some statistics.

read more

The bare minimum to work with React

posted in JavaScript on 2016-06-13   react app function file babelrc return babelify browserify render superclass

The setup here is available at GitHub here.

Half an year ago I published A modern React starter pack based on webpack. The starter provides the basic tooling around React. However, I noticed that very often I need even less stuff than that. That’s usually when I want to hack something quickly. In this blog post we’ll see what’s the bare minimum to work with React.

read more

Thoughts on semantic versioning, npm and JavaScript ecosystem as a whole

posted in JavaScript on 2016-05-11   browserify npm dependencies version package release don t versions features

If you are front-end developer dealing with single page applications you probably know that JavaScript ecosystem is not perfect at all. A few things may go wrong and break your build. In this article I’ll go through those features. Features which are, by my humble opinion, problematic.

read more

The earthquake in the JavaScript community

posted in JavaScript on 2016-03-25   kik npm modules module company azer developer left pad

You probably heard about Kik, NPM and left-pad saga this week. Shortly, a company Kik asked a developer Azer Koçulu to give the ownership on a NPM module. The module name matches the name of the company. The developer refuses and the company reaches the registry (NPM). The module was transfered to the company based on a NPM policy. The developer then decided to remove all his modules from the registry. The bad thing is that one of these modules left-pad is a dependency of many other modules. As a result of the un-publishing all the packages that depend on left-pad can not be built. Some really popular tools like Babel and React started getting broken builds.

read more

My new experiment is released - 10 Lessons in Front-end ebook

posted in Must-see on 2016-03-10   front end html ll book lessons released

It's finally done. My first self-publishing ebook is released. The book is available here. I'm running a free giveaway for the next five days. So, subscribe for my newsletter at this address http://eepurl.com/bKt0TD and you'll get a free coupon that will lower the price to 0$.

read more

Unexpected usage of Array.length

posted in JavaScript on 2016-01-14   arr length array b c d string undefined elements c d arr var arr words text

I like reading code of other developers. It’s a nice way to learn patterns, techniques and small tricks. Recently I found something about Array.prototype.length which caught my attention.

read more

Start your own JavaScript library using webpack and ES6

posted in JavaScript on 2015-12-30   library js webpack babel true var file module exports eslint function build

Two months ago I published a starter pack for React based on webpack. Today I found out that I need almost the same thing but without the React bit. This simplifies the setup but there are still some tricky parts. So, I made a brand new repository webpack-library-starter and placed all the stuff that we need for creating a JavaScript library.

read more

Using Mocha with ES6 spec files

posted in JavaScript on 2015-12-23   mocha babel es6 package json file es5 babel preset es2015 tests test results javascript mocha reading spec files written

The new ES6 specification of JavaScript simply works better for me. It helps expressing my ideas in a shorter and cleaner way. So, I want to write ES6 everywhere. Even while I’m testing my applications.

read more

Distributing React components

posted in JavaScript on 2015-11-23   js react component file build react place src jsx browserify babel js map

While I was open sourcing react-place I noticed that there is some complexity around preparing the component for releasing. I decided to document the process here so I have a solid resource next time. You may be surprised but writing the working jsx file doesn’t mean that the component is ready for publishing and is usable for other developers.

read more

CSSSteal - Chrome extension that extracts CSS

posted in CSS3 on 2015-09-17   css styles var section el small li element rules

We had to update some of our old pages adding new elements. This means mixing old and new code. Placing HTML markup and JavaScript in legacy pages is not that difficult. Yes, it brings some issues but they are easily solvable. However, the CSS is a whole new story. That’s why I did CSSSteal. It helps me extract the needed styles.

read more

ToDoMVC with AbsurdJS

posted in JavaScript on 2014-07-26   model function js todos app main css component absurdjs event

You've probably heard about ToDoMVC project. It's same ToDo application made with different frameworks. It's interesting how the same problem is solved by different programmers following different concepts. This article is about making the ToDoMVC application with AbsurdJS.

read more

Sorry, Chrome killed the terminal

posted in Nodejs on 2014-06-04   yez extension browser terminal node js chrome shell commands running task

That's right. I'm not using the terminal anymore. Instead of that I'm using Chrome. Yes, the Google's browser. There is an extension called Yez! that connects to a Node.js module via web socket. It executes the shell commands and returns the result. And even works under Windows.

read more

Testing responsiveness

posted in HTML5 on 2014-05-14   width content viewport device browser panel nav href chrome

We all know what responsive means nowadays. We, as developers, normally develop responsive applications. There is a dozen of instruments helping us achieving our goals. Some of us use extensions and even pay for them. However, I'm using one thing - Google Chrome browser. In this article, we will see what the Chrome's capabilities for testing responsiveness are.

read more

Codefront.io is around the corner

posted in Must-see on 2014-04-25   developer open io front end css javascript talk speakers interesting conference linz

There are only two weeks left before the international front-end conference in Linz - Codefront.io. It's organized by the guys from WebBox and it's scheduled for 10th of May. You still have a chance to buy a ticket and listen interesting talks about our lovely Web.

read more

Book review: Getting Started with Grunt: The JavaScript Task Runner

posted in Nodejs on 2014-04-21   book grunt experience free javascript task runner helpful started

I just finishing reading Getting Started with Grunt: The JavaScript Task Runner. The same book that we (I and Packt publishing) run a contest for. You could still joint it here and win a free copy.

read more

Mastering the DOM access

posted in JavaScript on 2014-02-28   el parent var dom api return selector function val element

If you build web applications you probably communicate with the DOM a lot. Accessing and manipulating DOM elements is the thing which we do almost every day. Very often we collect information from different controls, we need to set values, change the content of div or span tags. Of course there are million libraries which handle these actions. The most popular jQuery, is de factor a standard. However, sometimes you need something smaller. In this article we will build our own class for managing DOM elements.

read more

Revealing the magic: How to properly convert HTML string to a DOM element

posted in JavaScript on 2014-01-23   wrapmap table tr element tbody var html td div map

This seems like a trivial task. However, it is not. There are few popular solutions, but they have a big problem and if you use them a lot you will spot the issue.

read more

An alternative JavaScript for loop syntax

posted in JavaScript on 2013-11-08   users var syntax user users var users undefined elements array

As javascript developers we all have to write a lot of for loops. Before a couple of months I saw an alternative syntax, which I really liked. It saves some time and it looks much nicer. However, one of my colleagues reported that this fancy syntax is not working as it should.

read more

Select drop-down broken under Firefox

posted in CSS3 on 2013-09-27   element firefox

Firefox has problems if you use