typescript Tag

TGRS stands for TypeScript, GraphQL, React and serverless. Over the last couple of years we have successfully built a number of enterprise single-page applications (SPAs) using this stack of technologies, as they complement each other well. In this post I'll talk about what our motivations have been for choosing...

In this article I will show you how to write safer TypeScript code by leveraging a feature called strictNullChecks. It's quite easy to miss because it's turned off by default, but can help a lot to produce more robust code. I'll also briefly introduce another lesser-known feature of the language called type guards. Some Java full-stack developers (like me) always wanted to have statically typed JavaScript. I remember when starting a new project with GWT and being quite amazed by the possibility of using Java on both sides. Nowadays, many new languages are trying to be a replacement of JavaScript. TypeScript is one of them. I got my first experience with TypeScript when trying early betas of Angular 2. I quite liked a concept of adding static types to JavaScript. However, I also see developers trying to keep the freedom of JavaScript. Fortunately, TypeScript gives developers flexibility to decide what way they want to go and how they want to mix static vs dynamic types. To experiment with these tradeoffs, I decided to use TypeScript for a new React/Redux project. The application is a web SPA which is the front end for a typical SAAS. Users can register/login, adding credit cards, managing api keys, see billing information, etc. All the examples in this article will be from that project and have React+Redux context.
EDIT: The initial version of this post stated that the TypeScript compiler won't emit code if it finds errors in the source. This is not correct. By default, the compiler will emit code even if it detects errors, unless the --noEmitOnError flag has been set. This post has been updated accordingly. I've recently been working on a project that uses TypeScript. I also have been playing with Flow on a personal project. In this post I want to talk about why I think these tools are important, some of the fundamental differences between them, and why the choice of which one to use might best be determined by the broader toolchain that you are working within, rather than just the particular technical merits of one or the other.