fix: replace mo:base references in optimization and randomness guides

オープン
#122 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
ドキュメント
明瞭さ
おおむね明確
活発さ
静か
技術スタック
rust

調査の方向性

docs/guides/backends/randomness.md、docs/guides/canister-management/optimization.md、およびリージョン別の例に関する dfinity/examples リポジトリの構成から始めます。random_lottery の例とそのマーカーおよび mops.toml を作成し、.sources/examples サブモジュールを更新し、randomness.md を CodeExample とともに randomness.mdx に移行して、古い最適化に関する注記を削除します。完了条件は、ガイドで legacy の mo:base 参照を推奨しなくなり、新しい例が指定された3つのリージョンをカバーしていることです。

索引モデルが issue の本文から書いたものです。

説明

documentation

Two docs pages reference `mo:base` in notes about upstream examples. Rather than patching the notes, the right fix is a purpose-built example and a full guide rewrite.

Current state

  • `docs/guides/backends/randomness.md` — notes that `motoko/random_maze` in `dfinity/examples` uses `mo:base/Random.Finite`
  • `docs/guides/canister-management/optimization.md` — notes that `motoko/low_wasm_memory` uses legacy `mo:base`

Plan

randomness.md (primary scope)

Per issue #44, create a new `random_lottery` example (Motoko + Rust, Ninja-enabled) with three focused regions:

Region What it shows
`raw_rand_call` Calling the management canister's `raw_rand`
`random_in_range` Deriving a bounded `Nat` from the 32-byte result
`fair_selection` Picking a winner from a list

Then:

  1. Add region markers + `mops.toml` in a PR to `dfinity/examples`
  2. Bump `.sources/examples` submodule
  3. Rewrite `randomness.md` → `randomness.mdx` using `` — the `mo:base` note disappears naturally
  4. Keep `random_maze` as a "see also" link (no note about `mo:base`)

The example is backend-only; ICP Ninja provides the UI for calling canister methods.

optimization.md (separate, smaller fix)

Remove the note about `motoko/low_wasm_memory` using legacy `mo:base` — the inline snippet in the page is already the correct `mo:core` reference. This is a one-line text change, independent of the `random_lottery` work.

Out of scope

Updating `random_maze` itself — the maze algorithm is too complex to serve as a teaching example for randomness patterns.

主要言語
JavaScript
スター
4
フォーク
5
平均マージ
1日 6時間
マージ済み PR(30日)
30

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

dfinity/developer-docs のほかの issue

dfinity/developer-docs の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。