Wolk Software Engineering

A group of young and ambitious people dedicated to creating cutting-edge applications in combination with beautiful and functional design.

Page 2


About object-oriented design and the “class” & “extends” keywords in TypeScript / ES6

A few weeks ago I found an interesting article titled In Defense of JavaScript Classes. The article exposed some concerns about the class keyword in ES6 / TypeScript:

These days it feels like everyone is attacking classes in JavaScript. Developers I respect say ES6 classes are a virus. We’ve compiled long lists on the reasons that ES6 classes are not awesome. Apparently, if we’re still brave enough to try them, we need advice on how to use classes and still sleep at night.

The problems that I see with the class and extends keywords in ES6 / TypeScript are not something new. I believe that these problems are cause by bad object-oriented (OO) design and I’m sure that the source of most of the criticism is coming from programmers with a strong interest in functional programming and I understand their fears. They are afraid of some of the OOP “monsters”:

  • Inheritance
  • Internal classes...

Continue reading →


Introducing redux-bootstrap

 Bootstrapping function for Redux applications

We are happy to announce that we just open-sourced a small library for the redux ecosystem called redux-bootstrap.

18735372.png

redux-bootstrap is a bootstrapping function for Redux applications. Redux bootstrap does not generate files for you. It is not a project template or project scaffolding tool and it is not related with Bootstrap (responsive web apps framework).

Redux-bootstrap handles most of the common application initialisation / bootstrapping that takes place every time you create a new Redux project.

 Motivation

When you create a new Redux project you usually need to take care of a few things:

  • Install dependencies.
  • Integrate the React router with Redux.
  • Create a Root reducer.
  • Enable DevTools is environment is development / Disable if environment is production.
  • Integrate Immutable with Redux.
  • Apply middleware.
  • Combine reducers into a...

Continue reading →


The current state of dependency inversion in JavaScript

Learn about the past, present and future of dependency inversion in JavaScript

Over the last year and a half, I’ve been reading a lot about dependency inversion and taking a look to the source code of many open-source IoC containers for JavaScript. At the same time I’ve been working on the development of InversifyJS (a powerful IoC container for JavaScript apps powered by TypeScript).

I have spent a lot of time thinking and talking about DI in JavaScript with many developers and I found this topic to be quite controversial. I’m writing this post to share what I’ve learn.

 Debunking the JavaScript IoC container myths

Before I go into details about past, present and future of dependency inversion in JavaScript I will try to debunk what I believe are some myths.

Screen Shot 2016-03-20 at 21.46.05 (2).png

 Myth 1: There is no place for IoC containers in JavaScript

When I have a conversation about decoupling and modularity in...

Continue reading →


Introducing InversifyJS 2.0

A powerful IoC container for JavaScript apps powered by TypeScript

I released InversifyJS 1.0 about a year ago. Back then it had some nice features like transient and singleton scope but it was far from what I wanted to achieve.

InversifyJS is an open-source inversion of control (IoC) container for TypeScript applications.

logo.png

InversifyJS 2.0 (v2.0.0-alpha.3) is finally here and I’m really excited to be able to show you what it is capable of.

ruTOvtWIVo.gif

InversifyJS 2.0 is lightweight library because one of my main goals is to add a little run-time overhead as possible. The latest build is only 4 KB (gzip) and it has no dependencies.

Screen Shot 2016-03-11 at 02.52.58.png

Another nice thing is that InversifyJS can be used in both web browsers and Node.js. However, in some environments some features may require some ES6 shims (e.g. Providers requires Promises and Proxy requires ES6 Proxies).

Note: This version is a...

Continue reading →


Setting up a TypeScript + Visual Studio Code development environment

An introduction to the development of TypeScript applications with VS Code

In this post we are going to learn how to configure a TypeScript + VS Code development environment. We are going to use the following tools:

  • Gulp
  • TsLint
  • Mocha
  • Chai
  • Browserify
  • BrowserSync
  • Wallaby.js

Let’s get started!

Note: The entire VS Code project used in this post is available at GitHub.

 1. Download and installing VS Code and some extensions

We are going to download and install VS Code and some extensions that will help us to maximize our productivity.

uhzasc137en4sg_small.png

Let’s start by downloading VS Code for your OS here and Node.js here.

Let’s now install some VS code extensions. Open VS Code when you are ready and use Shift + Command + p to access the command panel. The command panel will display the matching commands as you type.

Go ahead and type “install extensions”:

Screen Shot 2016-02-13 at 15.49.46.png

Select the Install Extension command...

Continue reading →


“Micro-libraries”: the future of front-end development?

Everybody has been talking a lot about JS frameworks over the last few years. There has been a large number of attempts to create the ultimate front-end framework but there is no clear winner.

While the high doses of innovation and the thrill of trying something new are great, the rapid change of technologies has become a critical risk.

Every six months, a hot new framework hits the mainstream, and our community explodes with excitement.

react.jpg.001.jpg

We can’t avoid making a decisions and answering questions like:

  • Should I train my team on Angular, React, Ember… ?
  • Should I use Angular, React, Ember… in a project that is expected to have a life cycle of 10 years?

While we can try to back-up our choice…

Most technology decision makers use metrics like community size, popularity, and big company support to justify their choice of framework.

Choosing the wrong answer could lead us to undesired...

Continue reading →


Working with React and TypeScript

An introduction to the development of React applications with Atom and TypeScript

We are about to develop the famous TODO App from the TodoMVC project using React and TypeScript:

Screen Shot 2015-10-12 at 12.20.29 a.m..png

In this post you will learn about the following:

  • 1. Setting up the environment
  • 2. Setting up the project
  • 3. The basics about React components
  • 4. Developing React components with TypeScript
  • 5. Compiling the application
  • 6. Running the application

Let’s get started!

 1. Setting up the environment

We will start by setting up the environment:

  • Download an install Node.js from https://nodejs.org.

  • Install TypeScript and tsd using npm:

$ npm install -g typescript tsd

Note: use sudo if you are using OSX

  • Download and install atom from https://atom.io/.

Screen Shot 2015-10-11 at 11.58.23 p.m..png

  • Install the atom-typescript plugin for atom:
$ apm install atom-typescript

This plugin has some cool features like HTML to TSX:

68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f547970655374726f6e672f61746f6d2d747970657363726970742d6578616d706c65732f6d61737465722f73637265656e732f68746d6c746f7473782e676966.gif

Or dependency...

Continue reading →


Decorators & metadata reflection in TypeScript: From Novice to Expert (Part IV)

 An in-depth look to the TypeScript implementation of decorators and how they make possible new exciting JavaScript features like reflection or dependency injection.

This article is the fourth part of a series:

  • PART I: Method decorators
  • PART II: Property decorators & Class decorators
  • PART III: Parameter decorators & Decorator factory
  • PART IV: Types serialization & The metadata reflection API

I will assume that you have already read all the previous posts of these series.

In the previous post in this series we learned what are decorators and how they are implemented in TypeScript. We know how to work with class, method, property and parameter decorators, how to create a decorator factory and how to use a decorator factory to implement configurable decorators.

In this post we will learn about:

  • 1. Why we need reflection in JavaScript?
  • 2. The metadata reflection API
  • 3. Basic type...

Continue reading →


Decorators & metadata reflection in TypeScript: From Novice to Expert (Part III)

 An in-depth look to the TypeScript implementation of decorators and how they make possible new exciting JavaScript features like reflection or dependency injection.

This article is the third part of a series:

  • PART I: Method decorators
  • PART II: Property decorators & Class decorators
  • PART III: Parameter decorators & Decorator factory
  • PART IV: Types serialization & The metadata reflection API

In the previous post in this series we learned what are decorators and how they are implemented in TypeScript. We know how to work with class, method and property decorators.

In this post we will learn about:

  • The remaining type of decorator: the parameter decorator.
  • How to implement a decorator factory.
  • How to implement configurable decorators.

We are going to use the following class to showcase these concepts.

class Person { 

  public name: string;
  public surname: string;
...

Continue reading →


Decorators & metadata reflection in TypeScript: From Novice to Expert (Part II)

 An in-depth look to the TypeScript implementation of decorators and how they make possible new exciting JavaScript features like reflection or dependency injection.

This article is the second part of a series:

  • PART I: Method decorators
  • PART II: Property decorators & Class decorators
  • PART III: Parameter decorators & Decorator factory
  • PART IV: Types serialization & The metadata reflection API

In the previous post in this series we learned that we can find the available decorators signatures in the TypeScript source-code.

We also learned how to implement a method decorator and we answered some basic questions about the way decorators work in TypeScript:

  • Where is decorator being invoked?
  • Who is providing the decorator arguments?
  • Where is the __decorate function declared?

I will assume that you have already read the Part I of these series and you know the answer to these...

Continue reading →