2022-02-01
2640
#typescript
Sneh Pandya
90351
Feb 1, 2022 â‹… 9 min read

Methods for TypeScript runtime type checking

Sneh Pandya Exploring the horizon with a knack for product management. Co-host of the NinjaTalks podcast and community organizer at Google Developers Group. Explorer, adventurer, traveler.

Recent posts:

Exploring The Top Rust Web Frameworks

Exploring the top Rust web frameworks

In this article, we’ll explore the best Rust frameworks for web development, including Actix Web, Rocket, Axum, warp, Leptos, Cot, and Loco.

Abiodun Solomon
May 28, 2025 â‹… 11 min read
How To Use The CSS Cursor Property

How to use the CSS cursor property

A single line of CSS can change how users feel about your UI. Learn how to leverage the cursor property to signal intent, improve interaction flow, and elevate accessibility.

Chizaram Ken
May 28, 2025 â‹… 6 min read
Build TypeScript App Vite

How to build a React + TypeScript app with Vite

We explore the benefits of building an app with React, TypeScript, and Vite, and compare its performance to the same app built with CRA.

Clara Ekekenta
May 28, 2025 â‹… 7 min read

How to use Claude to build a web app

Learn how to build a weather app using Claude, from setting up infrastructure to creating a functional UI that displays city-based forecasts.

Andrew Evans
May 28, 2025 â‹… 8 min read
View all posts

3 Replies to "Methods for TypeScript runtime type checking"

  1. One big downside to io-ts and similar libraries, is all your types are inferred.

    This has some major drawbacks compared with literal types: there is nowhere for you to write documentation – or at least nothing that will be visible to IDE auto completion or a documentation generator. Also, error messages may be very difficult to understand – they aren’t going to point to a specific member, but instead to a complex stack of derived types. And lastly, no automated (remame) refactorings or “find usages” will be available, so you miss out on a lot of the productivity aspects of TS.

    I had high hopes for this approach, but I eventually ended up writing both validators and proper types anyhow, meaning a lot of duplication. Just something to consider before selecting this approach.

Leave a Reply