Matt Pocock
banner
mattpocock.com
Matt Pocock
@mattpocock.com
Full-time TypeScript educator. Used to be a voice coach. He/him. Author of Total TypeScript 🧙 Hire me to teach your team TypeScript!
Some smoooooooth template literal types spotted in Vercel's Chat SDK

Gives you automatically typed error codes for multiple features at once.
May 27, 2025 at 2:16 PM
Hilarious use case for a mapped type:

Use it to rename an object key your backend developers consistently misspell

parms -> params
May 26, 2025 at 10:32 AM
Spotted in the wild today: a Mutable<T> type.

Does the opposite of Readonly<T>. Weird that TS doesn't have this built-in.
April 8, 2025 at 1:50 PM
Two cool things in this snippet:

1. You can use 'glob' from Node instead of a library! (still experimental, available in 22+)

But glob returns an async iterator, which can be annoying to work with. So...

2. Array.fromAsync lets you turn an async iterator into an array. Beautiful.
April 1, 2025 at 11:20 AM
"The AI Engineer Roadmap" dropping soon.

Covering everything you need to enter the AI world:

- What LLM's are used for
- The AI engineer mindset
- Evals
- 17 techniques for improving your LLM-powered apps
March 26, 2025 at 10:36 AM
I have worked with TypeScript for 7 years.

I have written a book, produced 5 courses, made countless videos and articles, and delivered workshops about TypeScript.

And today I learned that TS can do this:
March 23, 2025 at 12:28 PM
It's the evals, stupid
March 21, 2025 at 11:32 AM
Trying to define an agentic loop in the fewest amount of words.
March 21, 2025 at 10:33 AM
Nearly ready...
March 12, 2025 at 5:01 PM
Next.js, do you even know who I am?
March 4, 2025 at 1:33 PM
Jina's open source DeepSearch implementation is fascinating, but SUPER hard to read.

So, as a research project, I refactored the code to make the underlying logic clearer.
March 3, 2025 at 11:40 AM
VSCode catching up with Cursor.

Add this to get Cursor-like tab completions for suggesting the next edit.
February 14, 2025 at 8:58 AM
One fascinating decision with building LLM integrations is Agent vs Workflow.

Agent: give the LLM control of execution. Slower, but better at a wider range of things.
Workflow: use code to control execution. Faster, but more specialised.

Ultimately, it comes down to the product you're building.
February 13, 2025 at 3:27 PM
Deepseek R1 is pretty good at TypeScript, y'all.

These are its reasoning tokens, not the text emitted to the user.
January 30, 2025 at 3:16 PM
I've been messing about with a pattern where the agent persists small snippets in its working memory.

This small change has a pretty huge impact on the user experience. Feels like your agent is really getting to know you.
January 27, 2025 at 3:16 PM
My first AI course is complete... And it's free!

It's a 16-lesson tutorial on Vercel's AI SDK. It's the missing piece for working with AI in TypeScript.

No bullshit, no hype. Just solid, practical advice.

https://www.aihero.dev/vercel-ai-sdk-tutorial
January 20, 2025 at 4:30 PM
However much I focus on AI, the TS stuff keeps being relevant.

This time, it's the AI SDK not providing a built-in type for tool calls - so I've got to extract it using:

- Awaited<T>, to unwrap the promise
- [number], to turn the array of tool calls to a single member
January 20, 2025 at 11:32 AM
🔥 Massive Content Drop 🔥

I'm open-sourcing AI Hero, the repo of material I'm putting together for my course.

So far, there are 16 runnable examples on Vercel's AI SDK. Full tutorial dropping any day now.

https://github.com/ai-hero-dev/ai-hero/
January 17, 2025 at 1:12 PM
MattGPT, answering the important questions.

- 100% TypeScript
- AI SDK
- Question-matching retrieval based on a custom dataset
- Clack for beautiful CLI
January 17, 2025 at 9:14 AM
Yet another nice example of template literal types, spotted in the AI SDK codebase.

This forces the 'size' property in generateImage to match `${number}x${number}`. Beautiful.
January 16, 2025 at 11:32 AM
LLM routers seem like a fascinating pattern to me.

- Lets you separate concerns into different prompts
- Makes your system more testable

Really interesting for agents/workflows with several discreet concerns, like searching, handling git, and file editing.
January 10, 2025 at 4:03 PM
We're not messing about with AI Hero.

Bringing everything the team has learned from Total TypeScript for an awesome AI course.
January 6, 2025 at 2:35 PM
Done something a bit cheeky on my latest package.

If folks use it with an out-of-date tsconfig.json (that doesn't support entrypoints like my-package/a or my-package/b), I direct them to a .d.ts file like this:

It still works at runtime, but on the type level it'll warn them.
December 29, 2024 at 6:45 AM
Two updates to the Node/TS announcement:

- Node 22 WILL be getting TypeScript support by default.
- Type-only namespaces (which I actually have started using and quite like) will be supported by default.

www.totaltypescript.com/typescript-i...
December 28, 2024 at 9:51 AM
TSConfigs aren't that hard.

They're basically just 2 if/else statements in a trenchcoat.

More info:

www.totaltypescript.com/tsconfig-che...
December 17, 2024 at 8:50 AM