TypeScript and React Guide: Added a new prop types chapter
React has a built-in way of type checking called prop types. This works at run time and is a great accompanying feature for TypeScript. I’ve added a small chapter on prop types in my React and...
View ArticleTypeScript and React Guide: Added a new render props chapter
This took me exactly one year. But mostly due to not finding a lot to talk about. Typings for React render props are extremely easy and show through typings what its all about: About sharing state...
View ArticleTypeScript and React Guide: Added a new styles chapter
CSS in JS! In all possible ways. Or at least, in 5 of them. I collected a list of popular ways on how to style React components: emotion, styled components, styled-jsx, inline styles and webpack...
View ArticleStreaming your Meetup - Part 1: Basics and Projector
When we did Script’18 in January 2018, we borrowed an A/V equipment worth of 35.000 EUR to make sure we get kick-ass videos. A+ camera, an A/V mixer and a hard disc recording system that does editing...
View ArticleStreaming your Meetup - Part 2: Speaker video
We successfully set up the projector in our last chapter. Now it’s time to record the speaker himself. I’ll show you a couple of options how you can record the speaker video. It’s up to your budget and...
View ArticleStreaming your Meetup - Part 3: Speaker audio
We successfully set up the projector in the first chapter. We are able to record the speaker’s video as described in the second chapter. Now let there be sound!
View ArticleStreaming your Meetup - Part 4: Directing and Streaming with OBS
Now that we have everything wired up, it’s time to record, direct and stream! If you missed the previous parts, check out the table of contents to quickyl jump to a previous section.
View ArticleTypeScript: The constructor interface pattern
If you are doing traditional OOP with TypeScript, the structural features of TypeScript might sometimes get in your way. Look at the following class hierachy for instance:
View ArticleTypeScript: Match the exact object shape
TypeScript is a structural type system. This means as long as your data structure satisfies a contract, TypeScript will allow it. Even if you have too many keys declared.
View ArticleTypeScript: Validate mapped types and const context
Mapped types are great, as they allow for the flexibility in object structures JavaScript is known for. But they have some crucial implications on the type system. Take this example:
View ArticleTypeScript + React: Extending JSX Elements
React typings for TypeScript come with lots of interfaces for all possible HTML elements out there. But sometimes, your browsers, your frameworks or your code are a little bit ahead of what’s possible.
View ArticleWhy I use TypeScript
You might well see that my blog starts to center around TypeScript a lot recently. This might look like a strong deviation from what I usually blog and advocate: Performant, accessible and resilient...
View ArticleSymbols in JavaScript and TypeScript
symbol is a primitive data type in JavaScript and TypeScript, which, amongst other things, can be used for object properties. Compared to number and string, symbols have some unique features that make...
View Articlevoid in JavaScript and TypeScript
If you come from traditional, strongly typed languages you might be familiar with the concept of void: A type telling you that functions and methods return nothing when called.
View ArticleBoolean in JavaScript and TypeScript
boolean is a fun primitive data type in JavaScript. In TypeScript, it allows for a total of four values Wait, four?
View ArticleTypeScript: Check for object properties and narrow down type
TypeScript’s control flow analysis lets you narrow down from a broader type to a more narrow type:
View ArticleTypeScript: Assertion signatures and Object.defineProperty
In JavaScript, you can define object properties on the fly with Object.defineProperty. This is useful if you want your properties to be read-only or similar. Think of a storage object that has a...
View ArticleTypeScript + React: Typing custom hooks with tuple types
I recently stumbled upon a question on Reddit’s LearnTypeScript subreddit regarding custom React hooks. A user wanted to create a toggle custom hook, and stick to the naming convention as regular React...
View ArticleBlack Lives Matter
Me, the author of fettblog.eu, and all contributors and peers stand in solidarity with the Black community, today and every day.
View ArticleRemake, Remodel. Part 4.
I originally wanted to launch my new website on June 1st, but there were more important things happening at the moment than relaunching a tech blog. Truth be told, it was really hard for me focussing...
View Article