No description
React 18 StrictMode runs effects twice on mount in dev. The previous state-based guard (joining) couldn't prevent the second invocation from firing room.join because both passes see the deferred state as null. The server accepts the first join as black, rejects the second with ROOM_FULL, and the user sees an incorrect error toast. Switching to useRef gives synchronous visibility — the second pass sees joinedCodeRef.current already set and bails. Ref is reset on .catch so a legitimate retry from the lobby isn't permanently blocked. |
||
|---|---|---|
| .github/workflows | ||
| .sisyphus | ||
| docs | ||
| packages | ||
| scripts | ||
| .gitignore | ||
| eslint.config.js | ||
| lefthook.yml | ||
| LICENSE | ||
| package.json | ||
| playwright.config.ts | ||
| README.md | ||
| tsconfig.base.json | ||
| tsconfig.json | ||
| vitest.workspace.ts | ||
@paratype
A Doorenbos-style Rete II rules engine for TypeScript games, with an authoritative WebSocket chess demo.
Packages
packages/rete— Rete II engine corepackages/chess— Browser chess demo (React + Vite)packages/server— Authoritative Bun WebSocket server
Docs
- SPEC.md — Engine specification
- PHASES.md — Development phases & perf budgets
- RULES.md — Chess rule presets
- PROTOCOL.md — WebSocket message protocol
Getting Started
bun install && bun run check