How can we untrack files that are already commited based on .gitignore file?

Let’s imagine the scenario:

  • we have added/committed some unwanted files to our git repository (for instance some .log files or /dist folder).
  • another developer wanted to git pull our work and it turned out that they are conflicts in files e.g. .log.
  • or perhaps our CI pipeline stopped building because of the conflicts in the files

To solve our issue, we probably have added the unwanted file to our .gitignore file and hoped that this solves our issue. It turns out it’s not enough.

It’s not enough, because these files are still present in our repository index. …


and how can we stop it as professionals

In order to successfully introduce anti-patterns to the codebase, developer has to bypass several guards, i.e. code review.

The article is sarcastic. It is meant to show us the importance of quality code review.

In this article I will show some patterns how to write a legitimate looking code that over time will add up to create really bad codebase.

I can think of at least four reasons why a software developer willingly want to introduce anti-pattern:

  1. He just doesn’t have enough knowledge i.e. …

And what to do instead (3 mins).

I think every React developer sooner or later gets the following warning in his console: Each child in a list should have a unique “key” prop.

In this article I will use real life example why it’s important not to ignore that warning.

We will learn about one anti-pattern and one recommended solution.

The article is based on React examples but same concept applies to other FE libraries i.e. Vue.

TL;DR

Save the team and yourself from bugs and always use stable, unique identifiers as list keys instead of array indexes.

How do we get the warning?

To start with, let’s consider how do we get the…


And how can we profit from using them (5 mins including Redux example)

Pure Functions is one of these terms that yet again sound very elitist and difficult to understand. In fact it’s rather simple concept.

The pure function is very commonly used by lot’s of major players i.e. Redux, React, Angular and so on. We can also extract expensive pure function to a web worker and increase performance of our application. There are plenty of potential use cases.

It’s also one of the programming concepts that’s not JavaScript unique. It’s also very common interview question.

As such it’s a must have in every developer toolbox.

In this article I will explain the…


Explained in simple terms with examples in 4 mins

The new keyword in JavaScript is one of these things that are often misunderstood or even feared by the people starting with JS.

Things become much easier to understand once we check what thenewis doing behind the scenes.

In this article I will go through simple examples and show you what’s new is doing for us behind the scenes.

Since ES6 we don’t see newthat often anymore but it’s still a must have knowledge for any dev.

The example

Let’s use the very classic example.

Suppose we need a function that creates us an employee object. …


Get to know iffy in JS (or refresh your memory in 3 mins :))

The Immediately Invoked Function Expression term sounds very elitist and advanced but truth is it’s very simple.

I’ve prepared some examples for you as well as common traps you might encounter during the job interview.

Getting right to it

The IIFE is a way to execute functions immediately, as soon as they are created. We can do that by enclosing the entire function in brackets, followed by ().

It’s a good way to protect the scope of your function and the variables defined in it. The IIFE creates it’s own scope.

The examples

Basic syntax (note the wrapping parenthesis)

(function() { /* your work…


Closures are special thing in the JS world. It’s time to finally understand them.

Many agree that closures are confusing at the beginning, but once you put some time into understanding them you will find them perhaps even intuitive.

There are lot’s of benefits coming from understanding them i.e.:

  • In opinion of many software leads, understanding closures is one of these things that separate the junior from the rest.
  • There are patterns coming from functional programming i.e. partial application that make use of closures.
  • if you are a React girl/guy, the React Hooks rely on closures
  • It’s almost a certain…


Every frontend developer at some point of his career has stumbled into thisin JavaScript and my bet is the first experience wasn’t very clear.

It turns out that in fact this in JavaScript can be understood and that we can even follow a simple 4 step procedure to determine it’s value.
Let’s solve this riddle.

Introduction

If you are looking into thisit probably means one of the three things:

  • you stumbled upon some bug, lost hours and have thought to yourself that it’s finally time to understand this. Or maybe you have to support some legacy project
  • you are preparing for…


Higher Order Components in React are considered an advanced React topic.
I will try to simplify it and show one real life example that we will hopefully use (or base on it) in real life.

Let’s consider our day to day task which is to fetch data from somewhere and display them in the UI. We also need to handle errors and show loader messages to the user. This article will focus on the loader component.

For the sake of this exercise we will consider two approaches:

  • in the first approach we will handle loader in the component
  • in the…


I recently wanted to publish a bunch of React hooks as an NPM package.
I also needed it to be unit tested and written in TypeScript.

It turned out to be an interesting journey. I have decided to write down my findings and prepare a boilerplate with simple example, so that others can learn start to finish the full process.

I hope you will enjoy reading this guide and that you will find something useful for yourself as I have touched wide scope of topics.

In this article I will cover the following:

  • how to create an NPM package exporting…

Igor Łuczko

Technical Lead. Seeking to make a change. Doing quality work that matters for people who care.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store