This site has been updated.
Reload to display the latest version?
(click here)

Why we need to stop validating emails at the frontend

23 November, 2018

Let’s talk about one of the most well-known features of the web - registration. Not particularly the whole process, but in particular one aspect, email. For almost anything on the web, we need an email: ordering goods, registering for a service, receiving notifications, etc. It’s logical that if we need emails so much, then we’ll need to somehow be sure that the user has provided a correct one. Ok, let’s do a quick search on the Internet and see what are the front-end solutions for email…

Reducing boilerplate in React + Redux app

22 November, 2018

First, let’s see what is the problem, then we’ll discuss possible solutions and, in the end, we’ll compare the solutions that already exist in the market. Why in this order and why not go straight to the last point? Well, first you’re more than welcome to jump right to the end and second, I just don’t think that the solution is so easy to grasp. Anyway, as I said, let’s see how we build a React-Redux application. Usually, for each ajax call, we need 3-4 different files. Those files that hold…

What is REST?

21 November, 2018

This is one of those rare occasions when disambiguation will not lead to a better understanding. We can safely use REST as a word on its own, without even considering the meaning of each letter. It’s just been decided to write it in capital letters, it doesn’t matter why. So, why do you need to know what REST is? Well, if you’re a web developer and you’re working with external API’s, or writing your own service to provide a way of communication with the external world, then you, probably, need…

How to test code that uses moment.js

05 November, 2018

I’m going to talk about unit tests here, not any other kind of tests. And unit tests have, in my opinion, the following list of criteria that they have to meet. This list makes it hard to write tests for code that use external libraries, especially ones that manipulate time: Unit tests should be able to run on the developer’s machine as well as on the remote server Unit tests shouldn’t relate to timezone Each tested class (or component) should be tested independently from external libraries…

Replacing moment.js with date-fns

04 November, 2018

It’s known that moment.js is a widely used library for date and time manipulations. Obviously it is the case because of the limitations of standard JavaScript API, but today we’re not going to judge standard language features. Let’s accept the insufficiency of built-in tools and investigate whether or not I can replace moment.js with a smaller library. Addy Osmani suggested in the recent video called “The State of JavaScript”, using date-fns.js as a replacement for moment.js. It’s not the first…

Where the default sorting of a collection should be done

03 November, 2018

Let’s say you need to display a collection that you received from the server. Usually it will come in the form of an array of objects: list of books, people, goods, etc. It’s a very common task for frontend. Actually this assignment is the main reason why we need frontend - we need to represent documents and collections in the most used way to aggregate them. Usually presentation of a collection came with it’s brother task - sorting it. And here comes the question - on which side should this…