weeklyJS

Posts

Types as comments for plain JavaScript

Today we’re looking into the potential future of JavaScript by reading up on the types as comments proposal that seeks to introduce type information as part of the core JavaScript language.

Read More

Deno - adopt or wait?

Deno is 4 years old now and is slowly maturing. Among other things, the Node alternative has become known for the really good security principles. Deno is running in a kind of sandbox, just like the browser sandbox. Many developers really like the idea. But how mature is Deno really? Is the effort of changing your runtime worth it if you are already familiar with Node? What’s still missing from the young competitor? Architecture expert Sebastian Springer answers these questions:

Read More

Angular Changedetection Playground

Some colleagues who have not yet dealt much with the topic of ChangeDetection in Angular may find it difficult to imagine what the difference between the default and the OnPush approach is.

Read More

Avoid canceled requests when using RxJS combineLatest()

If you work with Angular in your project, then you can’t avoid the reactive framework RxJS. This offers a lot of of operators. While some are rarely used, combinedLatest is certainly one of the great favorites of any Angular developer. It is used to combine multiple observable streams. It emits a value as soon as all incoming observables emit at least one value.

Read More

Handling Conditional Classes in Angular

How do you handle conditional classes at a dom element in Angular? There are two main options: class-bindings and ngclass. But which one is better? I tested both to get a definite answer.

Read More

Writing CLI tools with TypeScript

There are quite a couple of technology options when it comes to writing a command-line interface (CLI) tool. Most modern languages at the very least provide some kind of out-of-the-box support for command-line argument parsing. In addition, the ecosystems of modern languages also typically contain at least one mature and feature-rich CLI library.

Read More

RxJS Best Practices and an Idea

There are some best practices in RxJS for several regular use cases. First of all I’ll share my personal recommandations from my long time project, before we go into an idea how to improve them.

Read More

Typesafe Mocks in TypeScript

Mocks are great, even if they represent the same API as the real implementation. In this article we use global mocks for implementations and won’t mock them multiple times.

Read More

TypeScript Error Handling

TypeScript offers many ways to handle HTTP errors. I will show you a way that works for me. In my current project we are building a server-side NestJS backend for a web application, which is the use case we’ll look into now.

Read More

Why you can’t trust TypeScript Interfaces

TypeScript usually does a pretty good job in detecting bugs already at compile time. However, sometimes it can also introduce problems that developers wouldn’t even think about, especially if they are used to naturally typed languages.

Read More

Opaque Types in TypeScript

TypeScript already gives us a lot in terms of type safety - many types of bugs that plagued us in the days of vanilla JavaScript are a thing of the past. But we can go even further by leveraging the type system in clever ways.

Read More