The Proxy API, aiming to revolutionize the JavaScript development experience and make previously impossible feats possible, was introduced in 2015 with ES6. This is an advanced concept, but if you ever want to master JavaScript, the Proxy API is something you absolutely will have to learn.
read more “To infinity and beyond with JavaScript Proxy API”Month: January 2020
NodeOS: how much is too much?
The number and variety of npm packages were always a topic for irony and ridicule. If you are not getting what I am talking about, check out the is-odd npm package with 76 million downloads, is-positive/is-negative packages, literally a package to bless your code and many others. While this seems funny, this poses a serious problem, which may lead to negative consequences. But this time, the community pushed even further and introduced NodeOS, an “operating system powered by node.js and npm”. I am going to explain why this is not true and what it says about the JS community.
read more “NodeOS: how much is too much?”No, you do not need Windows to develop with JavaScript
The desktop operation systems market is split between 3 major players: the monopolistic behemoth Microsoft with its Windows, pricy Apple with macOS and a myriad of Linux distributions, both community-run and commercially supported. In this article, I will try to convince you to try Linux if you are an active Windows user by giving you very good reasons and busting some myths.
read more “No, you do not need Windows to develop with JavaScript”Builder pattern in JavaScript without classes
Design patterns are a vital part of software development. They describe common problems and solutions to them. One such pattern is the builder pattern. As Wikipedia puts it, it is “a design pattern designed to provide a flexible solution to various object creation problems in object-oriented programming”. However, I am here to show you that it does not only apply to object-oriented languages and can be achieved in JavaScript without classes.
read more “Builder pattern in JavaScript without classes”Code Review: Redux
Redux is a state management library used by millions. It provides a simple way to manage your global state, subscribe to it and update it safely. Most of you know what it is, but not many have an idea of how it works under the hood. In this article, I will show you how this project is structured, how it was written and the philosophy behind it. By the end of the reading, you can expect to know how Redux was designed and be able to read its source code freely.
read more “Code Review: Redux”Improve code readability by getting rid of comments
Code commenting, while controversial, is still considered a good practice. Comments are most often used to improve code readability, make it easier to maintain and explain certain decisions. But do comments always help, or do they bring more harm than good?
read more “Improve code readability by getting rid of comments”Deep dive into ES6 Symbols
ES6, released in 2015, introduced a lot of features: the class
keyword, generators, const
/let
declarations and so on. But one feature that kind of went under the radar is the Symbol
data structure. In this post, I will explain what ES6 Symbols are, why you might want to use it and how it works.
Please stop using classes in JavaScript
For years, OOP (object-oriented programming) was the de-facto standard in software engineering. The concepts of classes, polymorphism, inheritance, and incapsulation dominated and revolutionized the development process. But everything has an expiration date, programming paradigms included. In this article I will talk about why were classes introduced in the first place, why it is a bad idea to use classes in JavaScript, and what are some of the alternatives.
I am not going to talk about why OOP is fading away in general, but you can check out this great article for more info.
read more “Please stop using classes in JavaScript”Managing React Native Form State with Redux-Form
Chances are, you have had to implement some kind of a form while developing your mobile apps. It may be a simple login form or a complex reporting system, nevertheless, you will face some challenges. How do you validate the data? Where do you store the form state? How do you control the form’s lifecycle? Answers to these and many other questions are waiting below, where I tell you how to use Redux Form with React Native.
read more “Managing React Native Form State with Redux-Form”Advanced testing in React Native with Jest: Redux integration
This post is part of my series on unit testing with Jest in React Native. You can find the introduction here.
By now you should have a solid understanding of how testing works in React Native. But there is one important concept left to go over, that is integrating redux into your tests. Redux is the industry standard for global state management in React applications. Even though React Context is supposed to replace Redux, it is not there yet. So how do we test Redux-connected components with Jest and react-native-testing-library?
read more “Advanced testing in React Native with Jest: Redux integration”