Most TypeScript tutorials show you code. I wanted something where you write code and the compiler talks back – like tsc --watch in a real project, but without any setup. So I built ts-dojo.

👉 Try chapter 1 in your browser: https://markusbeer.github.io/ts-dojo-site/demo/
👉 Full app for Windows (free): https://apps.microsoft.com/detail/9PLBZK8QNZ7X

What it does

You get an editor on the left and three views on the right: the compiler's diagnostics, the emitted JavaScript, and your program's output. 53 lessons lead from type annotations and unions through generics, mapped and conditional types to four small projects: a state machine, a Result type, a typed event emitter and typed API routes.

Each lesson checks your solution automatically. If you're stuck, hints get more specific step by step, and there's a reference solution with a diff view.

Real compiler feedback in the browser

The editor is Monaco, and the diagnostics come from Monaco's built-in TypeScript worker running in strict mode. To run your code, the app asks that same worker for the emitted JavaScript plus a source map, and executes it in a sandboxed Web Worker. If your code throws, the source map points the error back to your line in the TypeScript file. Infinite loops are detected and the worker is terminated, so a while (true) won't freeze anything.

You can also write // ^? under an expression to see its inferred type – the same trick the TypeScript playground uses.

The cheating problem

When I worked through all lessons myself, I found that I could pass some of them without solving them. In one exercise you convert temperatures, and the checks only looked at the program's output for a single Fahrenheit value. Hardcoding that one number was enough.

The fix was hidden tests: after your program runs, the app runs it a second time, invisibly, with extra calls appended – different inputs your code has never seen. Only a real solution passes both runs.

To keep the checks honest in the other direction, every lesson in the test suite also has near misses: almost-correct solutions (like the hardcoded one) that must fail at least one check. If a check gets too lax, the test suite goes red.

Writing for people who are really new

My first lesson texts were short: two sentences of explanation, then the task. Someone who already knows TypeScript can follow that. A real beginner can't. So I rewrote every lesson intro using the same structure:

  1. Why – what goes wrong without this concept
  2. What – the idea in plain words
  3. Example – a small example that is not the solution, with comments showing what the compiler says
  4. Pitfall – the typical beginner mistake
  5. Task – exactly what to do and what output is expected

Every example in the texts is compiled against the same TypeScript version the app uses, so the quoted error messages are real.

Offline and private by design

The desktop app is Electron, packaged as MSIX for the Microsoft Store. It loads only its own files, has no telemetry, no account and no network access. Your progress lives in local storage, and you can export and import it. The browser demo works the same way: nothing leaves your browser.

Feedback welcome

If you try it, I'd love to hear where an explanation didn't click or which topic you'd want next.