News for hackers. Stuff that matters.

jaaamesey

Show HN: An async Pictionary-like, at 16x16 pixels and 8 colors (mobile web)

https://picto-rally.com/

Over the past few weeks, I've been working on a casual multiplayer game called "PictoRally". It's like Pictionary, but limited to 16x16 pixels, and 8 colors of your own choosing.The core game mode works by passing URLs with another player over some kind of messaging service (e.g. Discord, WhatsApp, and maybe even post?). There's no time limits here, you just exchange drawings and guesses at...

( Read More... | no comments | on HN )
Re:React's useState should require a dependency array on Friday May 30, 2025 @11:10PM (#44141619)
I'd agree that generally, using `key` to reset state at the component tree level is fine, and that good component structure or persisting state through other means makes it a lot harder for this issue to come up.

> my mental model is that each item in the list has it's own form, rather than sharing one

100% - it makes things a lot easier to reason about if you're guaranteed to have a fresh instance of a component for each item being switched to. In fact, if I saw that stale state issue come up again in production, and it wasn't the kind of thing avoiding state entirely could fix, my suggestion would just be `key` instead of reaching for a third party hook.

I wouldn't be suggesting a change to React itself if that change also didn't enforce that way of thinking, albeit at the hook level instead of component tree level. `key` always felt like a weird escape hatch to me in that:

- it's not a solution lint rules would nudge someone towards

- `key` needs to be applied by the consumer of the component, not the component itself

- we lose all state in the tree and re-create all DOM nodes

I'll admit that it's hard finding good examples of where that last thing is an issue. The only other one off the top of my head might be preserving component/DOM state between route changes, e.g. keeping the same scroll position in a list of filters between similar screens for searching products. These issues only really come up when you have a deep component tree and lifting components up gets much trickier than having state reset naturally and atomically.

Show HN: Parra – parallel compute in JavaScript/TS made easy

https://github.com/jaaamesey/parra

This is a wrapper around my existing run-with-worker library that allows for parallel computations to run in plain, type-safe (if you're using TS) JavaScript functions.Similar to run-with-worker, the niche here is for expensive computations that you just want to move to a pool of Web Workers, without the boilerplate and footguns that usually comes with that.TL;DR: it brings parallel map/reduce...

( Read More... | no comments | on HN )
Literally my favourite game of this year, thanks so much for making this!

Show HN: Easily compute expensive functions inside type safe Web Workers

https://github.com/jaaamesey/run-with-worker

This is the first public library I've written - let me know if I've inevitably messed something up here.In short, this JS library allows you to quickly compute functions in a separate thread like so:```const result = runWithWorker(() => 1 + 1); // TypeScript knows this is a `Promise<number>`!```There's some more examples outlined in the README. Communicating with Workers involves a few...

( Read More... | no comments | 2 points | on HN )
Thanks so much for the feedback! I'll see if I can do something to make that clearer.
Thanks for giving it a shot! Puzzles should swap out at around midnight local time.
Just played it, I'm a fan too (currently 30 puzzles ib)

Show HN: Daily puzzle game where you build a bridge of your own words (SolidJS)

https://bridj.link/

Hey HN,My partner and I made a daily puzzle game called "bridj.link" (the dot is not silent). Thought I'd give Hello World in SolidJS a shot but ended up taking things a bit too far (to the point where we're now on our 99th puzzle!)Each puzzle has thousands of valid solutions. The tutorial goes into a bit more detail, but basically, each puzzle consists of a top word and a bottom word. These...

( Read More... | 6 comments | on HN )