fix: replace mo:base references in optimization and randomness guides
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Documentazione
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- rust
- Ambito
- backend, documentation
Direzione di ricerca
Inizia da docs/guides/backends/randomness.md, docs/guides/canister-management/optimization.md e dalla struttura del repository dfinity/examples per gli esempi regionali. Crea l’esempio random_lottery e i relativi marker e mops.toml, aggiorna il sottomodulo .sources/examples, migra randomness.md a randomness.mdx con CodeExample e rimuovi la nota di ottimizzazione obsoleta. Il lavoro è completato quando le guide non raccomandano più riferimenti legacy a mo:base e il nuovo esempio copre le tre regioni specificate.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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:
- Add region markers + `mops.toml` in a PR to `dfinity/examples`
- Bump `.sources/examples` submodule
- Rewrite `randomness.md` → `randomness.mdx` using `` — the `mo:base` note disappears naturally
- 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.
- Lingua principale
- JavaScript
- Stelle
- 4
- Fork
- 5
- Merge medio
- 1g 6h
- PR unite (30g)
- 30
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di dfinity/developer-docs
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
dfinity/developer-docs#281 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
dfinity/developer-docs#279 ·
-
docs: cycle cost docs follow-up — ICP formula, worked example, instruction profiling, cost traps Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 68/100
dfinity/developer-docs#274 ·
-
documentation enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
dfinity/developer-docs#232 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 65/100
dfinity/developer-docs#228 ·
Tutte le issue di dfinity/developer-docs
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
avniproject/avni-client#2135 ·
-
automated broken-link
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
-
agent/security hive/hosted-available-lke648397-260827-5n31 security
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
babalae/bettergi-scripts-list#3674 ·
-
A-Release-Notes C-Editing D-Modest S-Ready-For-Implementation
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
bevyengine/bevy-website#2595 ·