chore(motoko): migrate @sdk examples to mo:core 2.4.0#1330
Merged
Conversation
- canister_factory: bump moc/core in mops.toml (already used mo:core) - query_stats: swap 3 mo:base imports to mo:core - pub-sub: create mops.toml; replace mo:base/List with mo:core/Array - ic-pos: create mops.toml; migrate Trie→mo:core/Map, Buffer→Array, ExperimentalCycles→await-with-cycles - icrc2-swap: create mops.toml; migrate TrieMap→mo:core/Map, remove preupgrade/postupgrade (Map is stable by default) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- pub-sub: add explicit `: async ()` return types (M0242) - icrc2-swap: remove unused `msg` binding in deposit/swap (M0240); consolidate double Nat subtraction into single deduction var (M0155)
`: async ()` caused a type error in sub/Main.mo which calls Publisher.subscribe without await. The correct M0242 fix is explicit oneway annotation since fire-and-forget is intentional here.
[compiler] warnings = "error" is a mops-only setting not read by dfx in CI. [moc] args = ["-W", "M0236", ...] passes flags directly to moc and is effective in both mops check and dfx builds.
viviveevee
approved these changes
Apr 20, 2026
These examples require @dfinity/languages approval and will be handled in a separate PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates 5
@dfinity/sdk-owned Motoko examples frommo:basetomo:core 2.4.0.moc/coreinmops.toml(already usedmo:core/Principal)mo:baseimports tomo:core; create newmops.tomlmops.toml; replacemo:base/List(functional linked list) withmo:core/Array—List.push/List.toArray→concat/valsmops.toml; migrateTrie→mo:core/Map(dropsmerchantKeyhelper),Buffer→Array(for ephemeral log),ExperimentalCycles.add→await (with cycles = N)mops.toml; migrateTrieMap→mo:core/Map, removepreupgrade/postupgradesystem hooks (Map is stable by default inpersistent actor)