Quantcast
Channel: fettblog.eu | TypeScript, JavaScript, Jamstack
Browsing all 203 articles
Browse latest View live

TypeScript: Improving Object.keys

TypeScript’s predefined types in lib.d.ts are usually very well-typed and give tons of information on how to use built-in functionality as well as providing you with extra-type safety. Until they...

View Article


TypeScript: Variadic Tuple Types Preview

TypeScript 4.0 is supposed to be released in August 2020, and one of the biggest changes in this release will be variadic tuple types. And even though his feature is hot of the press at the time of...

View Article


Are large node module dependencies an issue?

The other day, I had some friends frowning over the 800KB size of a node application. This brought to my attention that I never really worried about the size of my dependencies in a Node.js application.

View Article

11ty: Generate Twitter cards automatically

For the redesign of this blog, I created Twitter title cards that are generated automatically. So whenever people share my stuff on social media, they get a nice card telling them the article’s title...

View Article

TypeScript: Union to intersection type

Recently, I had to convert a union type into an intersection type. Working on a helper type UnionToIntersection<T> has taught me a ton of things on conditional types and strict function types,...

View Article


Vite with Preact and TypeScript

Update: Please note that this article already has some age and Vite has seen significant updates. Also, the Preact team has created their own preset for Vite which you can find here. Be sure to check...

View Article

TypeScript: Augmenting global and lib.dom.d.ts

Recently I wanted to use a ResizeObserver in my application. ResizeObserver recently landed in all major browsers, but when you use it in TypeScript — at the time of this writing — ResizeObserver won’t...

View Article

TypeScript + React: Component patterns

This list is a collection of component patterns for React when working with TypeScript. See them as an extension to the TypeScript + React Guide that deals with overall concepts and types. This list...

View Article


TypeScript + React: Why I don't use React.FC

In my recent article on TypeScript and React component patterns I’ve stated that I don’t use the built-in type React.FC<> but rather be explicit with typing children. I didn’t state why, and it...

View Article


TypeScript and ECMAScript Modules

Working with real, native, ECMAScript modules is becoming a thing. Tools like Vite, ES Dev server, and Snowpack get their fast development experience from leaving module resolution to the browser....

View Article

this in JavaScript and TypeScript

Sometimes when writing JavaScript, I want to shout “This is ridiculous!”. But then I never know what this refers to.

View Article

Go Preact! ❤️

You might have heard of Preact, the tiny 3KB alternative to React. It has been around for a while, and since its inception, it claims to be API and feature compatible compared to the more widely used...

View Article

My new book: TypeScript in 50 Lessons

I’ve written a new book! On October 6, the pre-release of TypeScript in 50 Lessons started. It’s 450 pages, published by the wonderful people at Smashing Magazine, and available to read right now! The...

View Article


Tidy TypeScript: Prefer union types over enums

This is the first article in a series of articles where I want to highlight ways on how to keep your TypeScript code neat and tidy. This series is heavily opinionated, so don’t be angry if I ditch a...

View Article

Tidy TypeScript: Prefer type aliases over interfaces

This is the second article in a series of articles where I want to highlight ways on how to keep your TypeScript code neat and tidy. By nature, this series is heavily opinionated and is to be taken...

View Article


Tidy TypeScript: Avoid traditional OOP patterns

This is the third article in a series of articles where I want to highlight ways on how to keep your TypeScript code neat and tidy. This series is heavily opinionated and you might find out things you...

View Article

Tidy TypeScript: Name your generics

My book TypeScript in 50 Lessons features interludes. Short texts on TypeScript culture that provide room to breathe between heavy, technical tutorials. One of those interludes gives some opinionated...

View Article


TypeScript: Low maintenance types

I write a lot about TypeScript and I enjoy the benefits it gives me in my daily work a lot. But I have a confession to make, I don’t really like writing types or type annotations. I’m really happy that...

View Article

TypeScript: Narrow types in catch clauses

When you are coming from languages like Java, C++, or C#, you are used to doing your error handling by throwing exceptions. And subsequently, catching them in a cascade of catch clauses. There are...

View Article

Learning Rust and Go

My blog is a chronicle of learning new things. Most of the articles I write are notes on how I solved problems that I found in my everyday work. And every now and then I have to urge to learn something...

View Article
Browsing all 203 articles
Browse latest View live