π§© Code Puzzle, a little side project I made. Each level gives you a JS snippet split into pieces. Arrange them in the right order with drag and drop to solve the puzzle.
β‘οΈ code-puzzle.sandroroth.com
Built with #React and #XState
@davidkpiano.bsky.social
State machine. Building stately.ai
π§© Code Puzzle, a little side project I made. Each level gives you a JS snippet split into pieces. Arrange them in the right order with drag and drop to solve the puzzle.
β‘οΈ code-puzzle.sandroroth.com
Built with #React and #XState
Whoa
11.09.2025 13:13 β π 6 π 0 π¬ 0 π 0A dash of modern CSS accomplishes so many things that used to require abstractions, dependencies, and tricks (wink, wink).
This one from Christian Sabourin is a great example: custom properties, clamp()-ing, calc()-ing, counters, relational pseudo selectors, etc.
css-tricks.com/css-elevator...
the latest Web Dev Challenge is available to everyone!
@algolia.bsky.social asked 3 teams of devs to imagine what the UX of an AI-native web app might look like. featuring @davidkpiano.bsky.social, @shaw.city, Nadirah, @aguywhocodes.com, Syscily, and Camille, with @chuckm.bsky.social
new Web Dev Challege is up early for supporters!
watch Syscily, Camille, Nadirah, @aguywhocodes.com, @shaw.city, and @davidkpiano.bsky.social as they imagine what UX might look like in an AI-native app, sponsored by @algolia.bsky.social with @chuckm.bsky.social as our advisor
codetv.link/wdc/s2e6
Stephen and David of the Keyframers working at desks in CodeTV Studio
helping the Keyframers reunion happen over here @davidkpiano.bsky.social @shaw.city
18.06.2025 21:05 β π 29 π 3 π¬ 4 π 1Great to hear! Open to any suggestions or ideas
07.06.2025 23:51 β π 2 π 0 π¬ 0 π 0Yes it does! Since stores are atoms, you can combine/derive state from stores and other atoms.
In the future, atoms can be used inside store context reactively.
Yes, like Zustand and Jotai combined, but framework agnostic
13.05.2025 14:54 β π 2 π 0 π¬ 1 π 0// Regular atoms const countAtom = createAtom(1); countAtom.get(); // 1 const flavorAtom = createAtom('chocolate'); // Derived atom that combines both const donutMessageAtom = createAtom(() => { const count = countAtom.get(); const flavor = flavorAtom.get(); return `${count} ${flavor} donut${count === 1 ? '' : 's'}`; }); console.log(donutMessageAtom.get()); // "1 chocolate donut" countAtom.set(3); console.log(donutMessageAtom.get()); // "3 chocolate donuts" flavorAtom.set('strawberry'); console.log(donutMessageAtom.get()); // "3 strawberry donuts"
import { createAsyncAtom } from '@xstate/store'; const donutOrderAtom = createAsyncAtom(async () => { const order = { flavor: 'glazed', quantity: 12 }; const data = await submitDonutOrder(order); return data; }); donutOrderAtom.subscribe((state) => { if (state.status === 'pending') { console.log('π§Ύ Placing your order...'); } else if (state.status === 'done') { console.log('π©', state.data); } else if (state.status === 'error') { console.log('π’ Order failed:', state.error); } });
βοΈ XState Store now has atoms, and they're *really* simple.
β atom.get()
β atom.set(β¦)
β Derived atoms (reactive)
β Async atoms
β Stores are atoms too!
npm i @xstate/store
stately.ai/docs/xstate-...
Yes, there's a guide here:
stately.ai/docs/xstate-...
May even make a codemod π€
XState Store!
05.03.2025 22:32 β π 0 π 0 π¬ 1 π 0I like state machines. I still struggle a bit to get my mind bent into state machine shape, but Iβm always so happy with the quality of what I build when I do
07.01.2025 23:48 β π 79 π 2 π¬ 5 π 0Fixing that soon!
13.01.2025 16:27 β π 3 π 0 π¬ 0 π 0That's it, I'm switching to xstate store
26.12.2024 22:06 β π 65 π 3 π¬ 6 π 1How would you simplify XState?
Planning for the next major version, and would love to hear your thoughts and ideas βοΈ
Would love to hear your ideas!
12.12.2024 23:54 β π 0 π 0 π¬ 0 π 0The Angular+ Show logo. S8E811. βState Machines and XState in Angular with David Khourshid. Hosts Q, Lara Newsom, Jan-Niklas Vortmann, Chau Tran and Brian Love." Photos of the hosts. Photo of David .
Join us on today's episode as we interview David Khourshid @davidkpiano.bsky.social. We will learn about state machines and how XState plays nice with #Angular right out of the box! #ngconf
πhttps://apple.co/4ipNHcP
π’ spoti.fi/3VxlGGq
I now *really* enjoy reading articles that are so obviously human-written, mistakes and all
07.12.2024 22:43 β π 148 π 2 π¬ 6 π 1I'd love to! Next year.
06.12.2024 19:49 β π 7 π 0 π¬ 2 π 0I don't like default exports.
They exist in JS because they're "simpler", even though they're more verbose:
export default Thing
import Thing from './thing'
vs.
export { Thing }
import { Thing } from './thing'
Just use consistent naming & don't be afraid of typing curly braces.
Updated demo of Decode generating state-machines from diagrams, this time with streaming generation support
Then I do the reverse, generating a diagram from an implementation.
The diagram auto-layout is still rough. I'll work work on more robust auto-layout soon.
This is incredible
02.12.2024 05:51 β π 1 π 0 π¬ 1 π 0π² Merge Conflict: Accept All Current
π² Merge Conflict: Accept All Incoming
βοΈ Merge Conflict: Accept the things I cannot change, the courage to change the things I can, and the wisdom to know the difference
I wrote an essay about relationships that may be helpful for personal career development (and maybe devrel).
Mentioned in the post (by name): @davidkpiano.bsky.social, @kentcdodds.com, @joshuakgoldberg.com, @jennytru.bsky.social, @acemarke.dev, and others
tej.as/blog/how-to-...
I love it
25.11.2024 21:42 β π 2 π 0 π¬ 0 π 02025?
23.11.2024 04:40 β π 3 π 0 π¬ 0 π 0Component State Management in React:
- useState
- useMachine
That's it. That's all I use anymore.
AI is trained on all code, not good code
18.11.2024 22:55 β π 1 π 0 π¬ 0 π 0Oh my God
15.11.2024 03:35 β π 7 π 0 π¬ 0 π 0