const krasimirtsonev.com = [ 'newsletter''books''talks' ].join('check out my');

Meet sequence expression

posted in JavaScript on 2016-02-02

You have no idea how fun is to transpiler JavaScript. I’m digging into that last few weeks and there is a step where I have to transform an AST into valid code. There is one tree node which I really like - sequence expression.

read more comments

Unexpected usage of Array.length

posted in JavaScript on 2016-01-14

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 comments

The return statement is not the end (but it should be)

posted in JavaScript on 2016-01-05

Well, I kind of lied in the title of this article. Of course that it is the end of the function. Once we call return everything else after that is simply not executed. Ops … I did it again, I kind of lied again.

read more comments

Deep dive into client-side routing

posted in JavaScript on 2016-01-03

(This blog post is inspired by A modern JavaScript router in 100 lines and heavily related to Navigo router project)


If you build single page applications you probably know that one of the must-have parts is the router. The bit that knows how to tweak the content of the address bar and notifies the rest of the system for URL changes. In this article we will discuss the various aspects of the routing in the browser.

read more comments

Start your own JavaScript library using webpack and ES6

posted in JavaScript on 2015-12-30

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 comments

JavaScript's reduce could be really helpful

posted in JavaScript on 2015-12-25

I love using functions like map, filter or reduce. They are an important part of my arsenal and I simply can’t stop using them. Today I had to solve an interesting problem and I ended up using reduce.

read more comments

Using Mocha with ES6 spec files

posted in JavaScript on 2015-12-23

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 comments

Apache .htaccess for HTML5 push state manipulations

posted in Architecture on 2015-12-20

This is a quick post so I document my two hours research. I'm working on a open source library for routing in the browser. Or in other words JavaScript library that uses the history API. The thing is that locally I'm using Apache as a dev server and I wanted all the request to specific folder to be redirected to index.html.

read more comments

Dissection of Flux architecture or how to write your own

posted in JavaScript on 2015-12-18

The Flux implementation discussed in this article is available here github.com/krasimir/fluxiny. Feel free to use it in a browser directly or as a npm dependency.


I’m obsessed by making my code simpler. I didn’t say smaller because having less code doesn’t mean that is simple and easy to work with. I believe that big part of the problems in the software industry come from the unnecessary complexity. Complexity which is a result of our own abstractions. You know, we (the programmers) like to abstract. We like placing things in black boxes and hope that these boxes work together.


read more comments

A story about currying

posted in JavaScript on 2015-12-15

I hope you know about currying. If not then please read this book. It’s basically a process of calling a function with less parameters than it expects. Ok, not exactly calling the function but prepare another function that will run the original one. Some people call the returned function higher-order factory function. Really powerful concept.

read more comments
Old articles