惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
C
CERT Recently Published Vulnerability Notes
C
Cisco Blogs
Cloudbric
Cloudbric
The Last Watchdog
The Last Watchdog
L
LINUX DO - 热门话题
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Application and Cybersecurity Blog
Application and Cybersecurity Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Security Archives - TechRepublic
Security Archives - TechRepublic
TaoSecurity Blog
TaoSecurity Blog
V2EX - 技术
V2EX - 技术
H
Heimdal Security Blog
S
Security Affairs
L
Lohrmann on Cybersecurity
Hacker News - Newest:
Hacker News - Newest: "LLM"
Simon Willison's Weblog
Simon Willison's Weblog
WordPress大学
WordPress大学
小众软件
小众软件
Security Latest
Security Latest
AWS News Blog
AWS News Blog
Apple Machine Learning Research
Apple Machine Learning Research
GbyAI
GbyAI
Engineering at Meta
Engineering at Meta
阮一峰的网络日志
阮一峰的网络日志
罗磊的独立博客
F
Full Disclosure
S
Schneier on Security
L
LangChain Blog
MyScale Blog
MyScale Blog
Know Your Adversary
Know Your Adversary
P
Privacy International News Feed
Google Online Security Blog
Google Online Security Blog
Scott Helme
Scott Helme
Stack Overflow Blog
Stack Overflow Blog
爱范儿
爱范儿
A
Arctic Wolf
Martin Fowler
Martin Fowler
B
Blog RSS Feed
大猫的无限游戏
大猫的无限游戏
博客园 - 三生石上(FineUI控件)
The Register - Security
The Register - Security
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
博客园_首页
Latest news
Latest news
F
Fortinet All Blogs
G
GRAHAM CLULEY
T
The Exploit Database - CXSecurity.com
Hacker News: Ask HN
Hacker News: Ask HN

Echo JS

Desktop apps Introducing mermaid-lint: Stop Shipping Broken Diagrams How We Cut Slow Responses by 80% Migrating to Next.js App Router The quiet problem with unnecessary async - Matt Smith GitHub - ant-design/ant-design-cli: Ant Design on your command line. Query component knowledge, analyze project usage, and guide migrations — fully offline. Uncovering the Magic Behind Playwright React Performance Isn’t About useMemo — It’s About Render Boundaries T2 No Escape Hatches · Prickles GitHub - auto-agent-protocol/auto-agent-protocol: Automotive Agent Protocol GitHub - coactionjs/coaction: Zustand-style state management with built-in render tracking and cached computed state GitHub - williamtroup/Rattribute.js: ❓ A lightweight JavaScript library for automatically changing HTML element attributes based on responsive screen sizes. GitHub - williamtroup/Rink.js: 🔗 A JavaScript library for generating responsive HTML link targets. SVAR Kanban: Interactive Task Board Component for Svelte, React, and Vue Performance Cost of Popular 3rd Party Scripts date-light - Tiny date utilities for JavaScript When React Hooks Stop Scaling: Moving Complex State to Zustand - Oren Farhi GitHub - jskits/loggerjs: A faster, more powerful isomorphic logger Out Loud — Free AI Text to Speech Pocket DB — Embedded single-file NoSQL for Node.js billboard.js 4.0 release: Canvas rendering mode, 94.3% faster! GitHub - thegruber/linkpeek: Secure TypeScript link preview and URL metadata extractor for Open Graph, Twitter Cards, JSON-LD, Node/Bun/Deno/edge. GitHub - evoluteur/healing-frequencies: Play the healing frequencies of various sets of tuning forks: Solfeggio, Organs, Mineral nutrients, Ohm, Chakras, Cosmic octave, Otto, DNA nucleotides... or custom. Animated sine waves - 27 lines of pure JavaScript Framework | Neutralinojs GitHub - AllThingsSmitty/typescript-tips-everyone-should-know: ✅ A curated collection of practical TypeScript patterns that improve safety, readability, maintainability, and developer experience. 🧠 Heat.js : JavaScript Heat Map GitHub - iDev-Games/State-JS: State.js is a CSS‑reactive framework that makes UI state and updates flow through CSS instead of JavaScript logic. GitHub - yankouskia/get-browser: 💻 Lightweight tool to identify the browser (mobile+desktop detection)📱 GitHub - yankouskia/is-incognito-mode: Identify whether browser is in incognito mode 👀
GitHub - yankouskia/gameplate: :video_game: Boilerplate for creating game with WebGL & Redux :game_die:
2026-07-09 · via Echo JS

gameplate

The tiny TypeScript game framework. Zero deps. Any renderer.

State. Loop. Input. Scenes. Selectors. Seeded RNG. Timers. Ship a game today.

npm CI gzip types license

👉 Docs · Live demo · API

import { createGame, defineActions } from 'gameplate';

const actions = defineActions<{ x: number }>()({
  moveBy: (s, dx: number) => ({ x: s.x + dx }),
});

const game = createGame({
  state: { x: 0 },
  actions,
  update: (state, dt, actions) => {
    if (game.keyboard.isDown('ArrowRight')) actions.moveBy(200 * dt);
  },
  render: (state) => draw(state), // 👈 your renderer, any tech
});

game.start();

That's the whole API surface. Read it, write it, ship it.


Why you'll like it

  • 🪶 ~4 KB gzipped, fully tree-shakeable. Import only the primitives you use; zero runtime deps, forever.
  • 🦺 TypeScript-first. strict: true + every noUnchecked* flag. Inference does the work — no as any, ever.
  • 🎯 Renderer-agnostic. Canvas · WebGL · WebGPU · PIXI · Three.js · DOM · terminal. Pick one. Switch tomorrow.
  • ⏱️ Deterministic loop. Variable timestep by default; opt into fixed-step + interpolation when physics need to be reproducible.
  • 🎮 Input, normalized. Keyboard + pointer + gamepad (with radial-deadzoned sticks and edge detection). Headless no-ops cleanly — same API on Node.
  • 🎬 Typed scene FSM. menu → start → playing with compile-time checks. Send a wrong event? TypeScript stops you.
  • 🧠 Memoized selectors. Reselect-style derived state, ~30 LOC, exact same shape.
  • 🎲 Seeded RNG. Reproducible procedural generation — int/pick/shuffle/fork, JSON-serializable state for save & resume.
  • ⏲️ Game-time timers. after / every driven by your loop's dt — pause, slow-mo, and fixed-step just work. Unlike setTimeout.
  • 🎞️ Record & replay. Capture every dispatched action; replay it deterministically. Bug repro, regression tests, server-authoritative validation — all in JSON.
  • 🖥️ Browser & Node. Headless simulation, server-authoritative play, CI snapshot tests — same code, two runtimes.
  • 📦 Dual ESM + CJS. publint clean. Provenance signed. Tree-shakeable.

In 30 seconds

type State = { player: { x: number; y: number }; score: number };

const actions = defineActions<State>()({
  move: (s, dx: number, dy: number) => ({
    ...s,
    player: { x: s.player.x + dx, y: s.player.y + dy },
  }),
  score: (s, pts: number) => ({ ...s, score: s.score + pts }),
});

const game = createGame({ state: { player: { x: 0, y: 0 }, score: 0 }, actions });

game.actions.move(10, 0); // ✅ typed
game.actions.move('lol', 0); // ❌ TS error — caught at compile time

That's state + actions. Add update for input handling, render for drawing, and you have a game.


What's in the box

createGame One-call setup — state + loop + input wired together.
createStore The underlying typed store (subscribe, getState, setState).
defineActions Curried generic that gives perfect IntelliSense without retyping S.
createLoop Bare loop — variable or fixed-step with interpolation alpha.
createKeyboard / createPointer / createGamepad Normalized input — keys, pointer, and Standard Gamepad with edge detection. No-op stubs on the server.
createMachine Compile-time-checked finite state machine for scenes/menus.
createSelector Reselect-style memoization, ~30 LOC.
createRandom Seeded deterministic RNG — int/pick/shuffle/fork, serializable state for save & replay.
createTimers Game-time after / every scheduling, driven by your loop's dt (respects pause & slow-mo).
createRecorder / replay Deterministic record + replay of every action. JSON-serialisable.

→ Full API reference


Built for every stack

gameplate doesn't ship a renderer — it ships the glue. Drop into:

three.js PIXI v8 regl WebGPU Canvas 2D

Switch renderers without changing one line of game logic. Patterns for each →


How it fits together

   ⌨ keyboard ─┐
   🖱 pointer ─┼──▶ actions ──▶ store ──▶ selectors ──▶ render ──▶ 🎨 your renderer
   🛰 network ─┘                  │                       ▲
                                  ▼                       │
                              scene FSM ──────────────────┘

         loop (dt, alpha) ──▶ update ──▶ actions

A handful of composable functions. Pick the ones you need. Ignore the rest.


Quality bar

  • ✅ 204/204 tests, ≥ 90 % line coverage
  • ✅ CI matrix: Node 20 / 22 / 24 × Ubuntu / macOS / Windows
  • publint + @arethetypeswrong/cli clean on every PR
  • ✅ Size limit: < 5 KB gzipped ESM (full barrel), enforced in CI — and tree-shakeable
  • ✅ CodeQL security analysis on every PR
  • ✅ npm provenance on every release (OIDC trusted publishing)

Contributing

PRs welcome. See CONTRIBUTING.md. Architecture decisions are recorded in DECISIONS.md.

git clone https://github.com/yankouskia/gameplate
cd gameplate
pnpm install
pnpm test:watch

License

MIT © Alex Yankouski · Sponsor →

If gameplate saved you a weekend, ⭐ star it — it's the easiest way to say thanks.