β€’

tech

Everything, anything, everywhere with Typescript

You can build anything with Typescript: create client apps for web, desktop, and mobile, create games, create server apps, scripts, cloud apps, and much more.


Sandro Maglione

Sandro Maglione

Software

What language should I learn? Typescript.

This answer is becoming more and more absolute for me.

As I explored some new libraries and patterns this week, it never stops surprising me how extensive is the Typescript ecosystem, and how much can you do with it (TLDR anything 🀯)

This is what I discovered πŸ‘‡


Always bet on "it's just Typescript"

Typescript runs everywhere: client, server, mobile, desktop, iot.

Result: When a library is pure Typescript, such library can be used everywhere, in any project

This thought came out as people started considering Effect a "different language".

It's not. It's just Typescript. And that's exactly what makes it so powerful πŸ”₯

Make games with Typescript

If I can use Typescript for anything, how about games? πŸ€”

Turns out that you can (of course πŸ’πŸΌβ€β™‚οΈ).

I tried a library called excaliburjs.

What's more, since all Typescript libraries can work together, why not use Effect at the same time?

Turns out that you can (of course πŸ’πŸΌβ€β™‚οΈ).

I made games with every tool (Unity, Godot, Flutter, Constructor). Looking forward to try a full game also in Typescript with excaliburjs πŸ”œ

There is more 🀩

Every week I dive headfirst into a topic, uncovering every hidden nook and shadow, to deliver you the most interesting insights

Not convinced? Well, let me tell you more about it

Actor model: yes you can in Typescript!

Another rabbit hole I explored this week is XState.

Wait, again? Yes.

I have been talking about XState a lot in the past, but it turns out there is still more to discover πŸ‘€

XState v5 makes actor-to-actor messaging a breeze. This allows to implement state machines in isolation and communicate between them by sending events.

XState also allows to access each machine context with ease, everywhere you have an actor πŸͺ„

There is even more πŸš€ `useSelector` allows to access the internal context of a spawned actor πŸͺ„ All type safe and performant 🀝

Image
Image
Sandro Maglione
Sandro Maglione
@SandroMaglione

Actors in XState v5 are insane πŸ”₯ @statelyai Isolate state machines logic and emit events to interact between them πŸ” πŸ‘‰ `spawn` machines πŸ‘‰ `emit` events from spawned machine πŸ‘‰ Subscribe `on` events in root machine

Image
Image
14
Reply

Did you know that state machines are used extensively in games?

Since it's all "just Typescript", you can use XState with excaliburjs as well πŸš€

And much much more

For completeness, here is what you can also explore:

  • Desktop apps: Tauri
  • Mobile apps: React native
  • Local first apps: Dxos
  • Web & Server: Bun
  • And pretty much any API everywhere provides a Typescript SDK πŸ’πŸΌβ€β™‚οΈ

There is no doubt that Typescript is a safe bet 🀝

You can then mix and match all the libraries in the ecosystem to build anything, at any scale.

And it's getting better and better πŸ‘€

See you next πŸ‘‹

Start here.

Every week I dive headfirst into a topic, uncovering every hidden nook and shadow, to deliver you the most interesting insights

Not convinced? Well, let me tell you more about it