docs: 嵌入示例中包含了 0.40 之前的移动签名
Deferred from #1219. > **Correction (2026-08-01):** the heading half of this issue was wrong. See the retraction at the end. Only the embedded-examples half stands. ### Embedded examples encode the pre-0.40 move signature `TypeScript.md` line 22 links to the TypeScript Playground. Decoding the payload gives: `TypeScript const move: Move<MyGameState> = (G, ctx) => {};` The snippet immediately above it on line 15 uses the current signature, `({ G, ctx }) => {}`. A reader who clicks through gets the opposite of what they just read. The seven CodeSandbox links carry the same drift. Each sandbox's own preview host serves the API without the Cloudflare challenge, e.g. `curl https://ewyyt.csb.app/api/v1/sandboxes/ewyyt`: | sandbox | linked from | pins | move signature | --- | --- | --- | --- | | `bgio-plain-js-tutorial-ewyyt` | `tutorial.md:95` | 0.45.0 | `(G, ctx)` | | `boardgameio-wlvi2` | `tutorial.md:116` | 0.37.2 | `(G, ctx)` | | `bgio-plain-js-multiplayer-re48t` | `multiplayer.md:84` | 0.45.0 | `(G, ctx)` | | `boardgameio-dibw3` | `multiplayer.md:113` | 0.37.2 | `(G, ctx)` | | `boardgameio-fsl8y` | `multiplayer.md:289` | 0.37.2 | `(G, ctx)` | | `bgio-plain-js-multiplayer-server-742oh` | `multiplayer.md:290` | 0.45.0 | `(G, ctx)` | | `boardgame-io-react-TypeScript-demo-u5uvm` | `TypeScript.md:62` | 0.49.10 | `(G, ctx)` | All seven also still use `turn.moveLimit`. They run — the pinned versions are old and `moveLimit` is shimmed — so this is a doc-vs-example contradiction rather than a broken sample. `ewyyt/src/Game.js` has `clickCell: (G, ctx, id) =>` against `clickCell: ({ G, playerID }, id) =>` at `tutorial.md:151`. Updating them needs write access to the sandbox accounts, which we don't have. Either someone with access refreshes them, or the links are replaced with in-repo examples. ### ~~Inconsistent top-level heading depth~~ — retracted The original section claimed `###` was the house style and asked for the `##` headings in `deployment.md`, `multiplayer.md`, `random.md` and `tutorial.md` to be changed. That is backwards. `docs/documentation/index.html` sets docsify's `subMaxLevel: 2`, so only `##` headings reach the sidebar's in-page table of contents — and `sidebar.md` lists pages only, so that TOC is the site's only in-page navigation. The split is deliberate: in #714 nicolodavis asked for the tutorial's sub-steps to be kept out of the navigation (comment) and delucis grouped them under a new `## Game Improvements` in reply (comment). The structure has not changed since. `##` is therefore correct for a top-level section that should appear in the navigation, and those four files are right as they are. If anything the drift runs the other way: 19 of 24 doc pages have no `##` at all and so no in-page navigation. Whether `events.md`, `phases.md`, `stages.md` and the rest …
内容来源: boardgameio/boardgame.io