Skip to content

chore: bump Motoko to v2.2.4 - #463

Open
pr-automation-bot-public[bot] wants to merge 1 commit into
mainfrom
infra/bump-motoko-v2.2.4
Open

pr-automation-bot-public[bot] wants to merge 1 commit into
mainfrom
infra/bump-motoko-v2.2.4

Conversation

@pr-automation-bot-public

Copy link
Copy Markdown
Contributor

Summary

Automated bump of .sources/motoko from v1.16.1 to v2.2.4.

  • Ran npm run sync:motoko — synced docs from the new release
  • Build passed ✓

Checklist

  • Review synced content for breaking changes
  • Check release notes for API or syntax changes that affect hand-written docs
  • Verify any new sections or renamed files are handled correctly

Sync recommendation

sync from caffeinelabs/motoko doc/md

@pr-automation-bot-public
pr-automation-bot-public Bot requested a review from a team as a code owner November 23, 2026 08:03
Copilot AI balanced review requested due to automatic review settings November 23, 2026 08:03
@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

🤖 Preview build failed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved navigation references, a broken migration link, compiler-invalid examples, and inaccurate persistence and contextual-dot guidance still need correction.

6 open issues
What changed in this PR

Updates the recorded Motoko version from v1.16.1 to v2.2.4 and synchronizes the developer documentation with the new compiler behavior.

Changes:

  • Adds a moc 1-to-2 migration guide and release notes through v2.2.4.
  • Updates examples and references for persistent-by-default actors, lighter syntax, stricter diagnostics, and expanded function resolution.
  • Removes documentation for classical persistence and generated view queries, which are no longer supported.

Verified: Checked targeted documentation and navigation references. No build was run.

File Description
docs/​languages/​motoko/​reference/​style-guide.md Updates control-flow and function-body conventions.
docs/​languages/​motoko/​reference/​language-manual.md Documents revised syntax, types, resolution, and persistence.
docs/​languages/​motoko/​reference/​error-codes.md Clarifies async-result and variant-pattern diagnostics.
docs/​languages/​motoko/​reference/​compiler-ref.md Updates compiler usage and supported flags.
docs/​languages/​motoko/​reference/​changelog.md Adds releases through v2.2.4.
docs/​languages/​motoko/​moc-v2-migration.md Adds migration instructions for moc 2.
docs/​languages/​motoko/​index.md Updates persistence introduction and links migration guidance.
docs/​languages/​motoko/​icp-features/​view-queries.md Removes obsolete generated-query documentation.
docs/​languages/​motoko/​icp-features/​system-functions.md Documents hook deprecation and updates examples.
docs/​languages/​motoko/​icp-features/​stable-memory.md Clarifies persistent heap and stable-memory roles.
docs/​languages/​motoko/​icp-features/​randomness.md Simplifies actor declarations.
docs/​languages/​motoko/​icp-features/​candid-serialization.md Updates actor, loop, and pattern syntax.
docs/​languages/​motoko/​icp-features/​caller-identification.md Simplifies the actor-class example.
docs/​languages/​motoko/​fundamentals/​types/​variants.md Updates variant matching examples.
docs/​languages/​motoko/​fundamentals/​types/​type-conversions.md Updates actor and iteration syntax.
docs/​languages/​motoko/​fundamentals/​types/​tuples.md Updates conditional syntax.
docs/​languages/​motoko/​fundamentals/​types/​subtyping.md Updates the control-flow example.
docs/​languages/​motoko/​fundamentals/​types/​stable-types.md Revises persistence defaults and type terminology.
docs/​languages/​motoko/​fundamentals/​types/​results.md Updates result construction and matching examples.
docs/​languages/​motoko/​fundamentals/​types/​records.md Documents copying mutable fields during record updates.
docs/​languages/​motoko/​fundamentals/​types/​options.md Updates option matching and conditionals.
docs/​languages/​motoko/​fundamentals/​types/​objects-classes.md Updates conditional bodies in examples.
docs/​languages/​motoko/​fundamentals/​types/​mutable-arrays.md Updates actor and control-flow syntax.
docs/​languages/​motoko/​fundamentals/​types/​immutable-arrays.md Updates iteration and chessboard matching examples.
docs/​languages/​motoko/​fundamentals/​types/​function-types.md Updates actor declarations and loops.
docs/​languages/​motoko/​fundamentals/​types/​advanced-types.md Updates matching, actor, and conditional examples.
docs/​languages/​motoko/​fundamentals/​pattern-matching.md Revises pattern syntax and exhaustiveness behavior.
docs/​languages/​motoko/​fundamentals/​modules-imports.md Updates actor-class and loop examples.
docs/​languages/​motoko/​fundamentals/​implicit-parameters.md Documents nested-module lookup and updates examples.
docs/​languages/​motoko/​fundamentals/​hello-world.md Introduces persistent-by-default actors.
docs/​languages/​motoko/​fundamentals/​error-handling.md Updates the trapping example's conditional syntax.
docs/​languages/​motoko/​fundamentals/​declarations/​module-declarations.md Updates conditional and actor examples.
docs/​languages/​motoko/​fundamentals/​declarations/​function-declarations.md Updates recursive-function syntax.
docs/​languages/​motoko/​fundamentals/​declarations/​class-declarations.md Simplifies actor declarations.
docs/​languages/​motoko/​fundamentals/​control-flow/​switch.md Updates switch syntax and exhaustiveness diagnostics.
docs/​languages/​motoko/​fundamentals/​control-flow/​loops.md Updates loop, break, and continue examples.
docs/​languages/​motoko/​fundamentals/​control-flow/​conditionals.md Documents stricter inference and updates conditionals.
docs/​languages/​motoko/​fundamentals/​control-flow/​blocks.md Updates conditional block syntax.
docs/​languages/​motoko/​fundamentals/​control-flow/​basic-control-flow.md Updates loops, branches, and labeled blocks.
docs/​languages/​motoko/​fundamentals/​contextual-dot.md Documents default warnings and nested-module lookup.
docs/​languages/​motoko/​fundamentals/​basic-syntax/​whitespace.md Simplifies actor declarations in formatting examples.
docs/​languages/​motoko/​fundamentals/​basic-syntax/​operators.md Updates Boolean conditional syntax.
docs/​languages/​motoko/​fundamentals/​basic-syntax/​functions.md Updates actor and conditional examples.
docs/​languages/​motoko/​fundamentals/​basic-syntax/​defining-an-actor.md Explains automatic state persistence.
docs/​languages/​motoko/​fundamentals/​basic-syntax/​characters-text.md Updates text-processing examples.
docs/​languages/​motoko/​fundamentals/​actors/​orthogonal-persistence/​overview.md Centers the overview on enhanced persistence.
docs/​languages/​motoko/​fundamentals/​actors/​orthogonal-persistence/​index.md Removes the obsolete persistence-model comparison.
docs/​languages/​motoko/​fundamentals/​actors/​orthogonal-persistence/​enhanced.md Updates migration requirements and recovery guidance.
docs/​languages/​motoko/​fundamentals/​actors/​orthogonal-persistence/​classical.md Removes classical-persistence documentation.
docs/​languages/​motoko/​fundamentals/​actors/​mixins.md Updates conditional syntax.
docs/​languages/​motoko/​fundamentals/​actors/​messaging.md Updates actor and publisher examples.
docs/​languages/​motoko/​fundamentals/​actors/​enhanced-multi-migration.md Removes obsolete flags and clarifies restrictions.
docs/​languages/​motoko/​fundamentals/​actors/​data-persistence.md Revises persistence defaults and migration guidance.
docs/​languages/​motoko/​fundamentals/​actors/​compatibility.md Clarifies migration-field behavior and upgrade checks.
docs/​languages/​motoko/​fundamentals/​actors/​actors-async.md Updates actor, conditional, and catch syntax.
docs/​languages/​motoko/​base-core-migration.md Updates examples and the removed-module list.
.sources/​VERSIONS Records Motoko v2.2.4 and its commit identifier.

Review effort: Balanced


You can only use the `stable`, `transient` (or legacy `flexible`) modifier on `let` and `var` declarations that are **actor fields**. You cannot use these modifiers anywhere else in your program.
* `stable` fields are persisted across upgrades. This is the default; you generally don't need to write it.
* `transient` fields are not. They are re-initialized on upgrade, unless they are transitively reachable from a persisted field. Use `transient` only for temporary state or references to higher-order types, such as local function references.
- It requires the receiving value to be the first parameter, named `self`.
- Any function must be declared in a module that is imported or otherwise in scope: function in object, actors or nested modules are not considered.
- If there is more than one available module function, and none is more general than all the others, the call is considered ambigious and rejected at compile-time.
- Any function must be declared in a module that is imported or otherwise in scope, or in a module nested inside one (up to a depth of 8): functions in objects or actors are not considered.
@@ -87,9 +87,9 @@ Pattern matching supports literal patterns, which look like constant values (e.g

```motoko no-repl
switch ("Adrienne", #female) {
switch (person) {
case ({ name = fullName; age }) { fullName # " is " # Nat.toText(age) # " years old." };
switch person {
case { name = fullName; age } { fullName # " is " # Nat.toText(age) # " years old." }

Stable variables must have types that belong to the set of stable types.
Transient variables are not subject to this restriction and may have any type, including non-stable types such as functions or objects with function members.
Under the pre-v2 compiler, actors were not persistent by default and fields were not persisted unless explicitly marked `stable`.

## 2.0.0 (2026-10-06)

* Upgrading from `moc` 1.x? The [moc v1 → v2 migration guide](doc/md/moc-v2-migration.md)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant