Playing Board Games with Scala JS
summary
Built a mobile PWA companion for 7 Wonders that persists recent games and scores using Scala.js + Scala 3 and Scala.js React components. Uses algebraic data types for UI props, automatic derivation for IndexedDB encoding, and a custom IndexedDB free-monad layer to avoid premature transaction closing and callback hell. Shows how pages, lifecycle hooks, and repository-backed components work, integrates with Next.js via explicit bindings, and reports a working app with persistent storage while warning about larger bundle size and the need to write JS facades.
AI-written summary · about
chapters (16)
- 0:00Introduction to talk
- 1:48Building a simple web app
- 3:31Why Scala.js over alternatives
- 6:49Imperative vs functional DOM
- 9:38Introducing Scala.js React
- 13:12Application structure overview
- 15:23Modeling routes with opaque types
- 17:11Reusable UI components
- 23:22Fetching external data
- 27:34Component lifecycle and state
- 30:21Persistent storage with IndexedDB
- 32:27Challenges with IndexedDB
- 39:36Functional IndexedDB wrapper
- 43:26Implementing the games page
- 46:14Conclusion and future of web apps
- 48:49Q&A session
