Sandro Maglione
banner
sandromaglione.bsky.social
Sandro Maglione
@sandromaglione.bsky.social
The Coding Explorer 💻・Sharing patterns to build type-safe web & mobile apps・Typescript・Effect・React・XState

Helping devs at http://typeonce.dev 🚀
Pinned
New project coming: Local-only calories tracker app

A key component of a local-first app is a local data store

This is how to implement a local postgres database 👇
www.typeonce.dev/course/calor...

@drizzle.team @pglite.dev @tailwindcss.com @vite.dev @tanstack.com @effect-ts.bsky.social
Local-only calories tracker app | Typeonce
A local-only calories tracker app made with TanStack Router, PGlite, Effect, XState and drizzle. The app is all client-side, fast, private, and reactive using a local postgres database.
www.typeonce.dev
Using @tailwindcss.com for styling?

Here are some not-obvious strategies to make your styles more composable (using v4) 🧱
December 23, 2024 at 4:01 PM
Last release of the year in the newsletter, with a look back at everything that happened in 2024

And it happened a lot 🤯

www.sandromaglione.com/newsletter
December 23, 2024 at 11:31 AM
✨ TypeScript tip ✨

A function that returns Tagged Classes
👉 Type a class with `new () => T`
👉 Required `Tag` type and value
👉 Return a class with `_tag`

Call the function from `extends` to get the class 🪄
December 16, 2024 at 3:44 PM
My writing 101 tips in this week newsletter

I have been writing on the web for (more than) a few years now

Exploring my setup and process this week 👇

www.sandromaglione.com/newsletter
December 16, 2024 at 11:25 AM
The example that made me get CSS subgrid ✨

A superpower that can be used for many layouts

www.typeonce.dev/article/the-...
December 14, 2024 at 3:55 PM
Articles are coming to typeonce.dev 👀

For everything that doesn’t require long explanations, but just short and to-the-point examples 👇
December 14, 2024 at 11:27 AM
New update on pubdev with package download count 👀

Turns out fpdart is downloaded 90_000 times each week 🙌 (number formatting intended)
December 12, 2024 at 2:50 PM
This is what you get when you bet on @effect-ts.bsky.social and the community around it ✨
December 11, 2024 at 3:02 PM
✨ TypeScript Tip ✨

Rest parameters: Allow passing any number of arguments to a function

Make your API easier to use, avoiding multiple function calls 🤝
December 10, 2024 at 3:56 PM
✨ TypeScript Tip ✨

Function overloads with types
👉 Wrap type in `{}`
👉 Provide 2 different signatures

Allows to call the same function with different parameters, and different results

Runtime problems may apply 🙌

This pattern is useful in library-land to provide a better API for the end user
December 9, 2024 at 5:31 PM
Programming literacy in this week newsletter 💡

> The ability to read, write, and understand code; programming concepts, syntax, and semantics, as well as applying skills to solve problems and communicate ideas

sandromaglione.com/newsletter
First-draft thoughts on programming, web, games | Sandro Maglione
Every week I explore the sharp edge of web technologies delivering you unfiltered insights on my discoveries, so you can avoid my same mistakes.
sandromaglione.com
December 9, 2024 at 2:46 PM
✨ TypeScript Tip ✨

Type classes using `new`
👉 `new` keyword
👉 Constructor parameters inside `()`
👉 Class parameters after `=>`

You can mark a type as a constructor signature, something that can be instantiated using `new` 👇
December 8, 2024 at 3:08 PM
✨ Introducing ECS for TypeScript ✨

typeonce/ecs is a zero dependencies library to bring the Entity Component System pattern in your game

Simple, working with any renderer, type safe and composable 🕹️

github.com/typeonce-dev...
GitHub - typeonce-dev/ecs: Entity Component System (ECS) implementation in TypeScript, extensible, working with any renderer, type safe and composable 🕹️
Entity Component System (ECS) implementation in TypeScript, extensible, working with any renderer, type safe and composable 🕹️ - typeonce-dev/ecs
github.com
December 6, 2024 at 4:06 PM
Systems in ECS just got a simple as it gets 🕹️

Define systems, dependencies, and input all type safe and inferred for you

☑️ Components
☑️ Systems
☑️ Entities

Closer to the full API 🔜
December 3, 2024 at 5:49 PM
ECS + @pixijs.com + MatterJS = 🕹️

Compose systems to build a complex game with physics and rendering

ECS keeps everything organized and under control 🫡
December 2, 2024 at 3:44 PM
Have you ever considered making a game?

Well, then you should learn about Entity Component System 🕹️

An introduction for you in this week newsletter 👇
sandromaglione.com/newsletter
December 2, 2024 at 11:51 AM
Integrate physics with matterjs and ECS in your game 🧱

Each system as simple as it gets, a function and a query is all you need 👇
December 1, 2024 at 3:43 PM
Making the API as simple and safe in my ECS in TypeScript 🕹️

Define a component with a simple class, auto tagged and ready to use

Simple and safe 🪄
December 1, 2024 at 10:18 AM
Working Entity Component System with TypeScript in action 🕹️

Simple architecture for organised code and powerful results 👇
November 28, 2024 at 5:47 PM
ECS implementation in TypeScript achieved 🫡

TypeScript only, extensible, working with any renderer, type safe and composable 🕹️

May be the beginning of something

#game-development #typescript #games #ecs
November 27, 2024 at 5:59 PM
Entity Component System (ECS) brings composability to game development 🪄

Split data and logic, and just compose entities with what they need to operate

Clean, composable and powerful 🔥
November 27, 2024 at 11:39 AM
Local-only calories tracker app project out now 🚀

Learn how to build a client-only app with database included in the browser with PGLite 🐘

@effect-ts.bsky.social + @drizzle.team + @tanstack.com router + XState

www.typeonce.dev/course/calor...
Local-only calories tracker app | Typeonce
A local-only calories tracker app made with TanStack Router, PGlite, Effect, XState and drizzle. The app is all client-side, fast, private, and reactive using a local postgres database.
www.typeonce.dev
November 26, 2024 at 5:58 PM
Functional programming in games? 🤨

I have been exploring a deep hole this week, and I may have found something

Some ideas in this week newsletter 👇
www.sandromaglione.com/newsletter
November 25, 2024 at 11:55 AM
New project landing next week Tuesday 26 November 🚀

Local-only calories tracker app
🏗️ @effect-ts.bsky.social
⚡️ @pglite.dev with live queries
📄 @drizzle.team
🔗 Actors with XState
🧱 @tanstack.com router

Your next local-first stack 👇
November 24, 2024 at 10:39 AM
Upcoming local-only project is going to be an interesting one 🫡

Local database with @effect-ts.bsky.social schemas, migrations, XState state management, @tanstack.com router and more 🪄

Preview link: www.typeonce.dev/course/calor...
November 23, 2024 at 11:54 AM