Releases: dfinity/motoko
0.14.7
-
motoko (
moc
)-
Preserve and infer named types both to improve displayed types in error messages, and to preserve function signatures when deriving Candid types (#4943).
The names remain semantically insignificant and are ignored when comparing types for subtyping and equality.For example,
func add(x : Int, y : Int) : (res : Int) = x + y;
now has inferred type:
(x : Int, y: Int) -> (res : Int)
Previously, the type would be inferred as:
(Int, Int) -> Int
-
Refine the
*.most
stable signature file format to distinguish stable variables that are strictly required by the migration function rather than propagated from the actor body (#4991).
This enables the stable compatibility check to verify that a migration function will not fail due to missing required fields.
Required fields are declaredin
, notstable
, in the actor's pre-signature. -
Added improved LSP cache for typechecking (thanks to Serokell) (#4931).
-
Reduce enhanced-orthogonal-persistence memory requirements using incremental allocation within partitions (#4979).
-
-
motoko-base
- Deprecated
ExperimentalCycles.add
, use a parenthetical(with cycles = <amount>) <send>
instead (dfinity/motoko-base#703).
- Deprecated
0.14.6
-
motoko (
moc
)-
To prevent implicit data loss due to upgrades, stable fields may no longer be dropped or promoted to lossy supertypes (#4970).
Removing a stable variable, or promoting its type to a lossy supertype by, for example, dropping nested record fields,
now requires an explicit migration expression.
Promotion to non-lossy supertypes, such asNat
toInt
or{#version1}
to{#version1; #version2}
, is still supported. -
Now we detect (and warn for) fields in literal objects and record extensions,
(as well aspublic
fields or types inobject
andclass
) that are inaccessible
due to a user-specified type constraint (#4978, #4981). -
We now provide release artefacts for
Darwin-arm64
andLinux-aarch64
platforms (#4952).
-
0.14.5
0.14.4
-
motoko (
moc
)- Added
canisterSubnet
primitive (#4857).
- Added
-
motoko-base
-
Added
burn : <system>Nat -> Nat
toExperimentalCycles
(dfinity/motoko-base#699). -
Added
ExperimentalInternetComputer.subnet
(dfinity/motoko-base#700).
-
0.14.3
-
motoko (
moc
)- Added primitive predicate
isReplicatedExecution
(#4929).
- Added primitive predicate
-
motoko-base
-
Added
isRetryPossible : Error -> Bool
toError
(dfinity/motoko-base#692). -
Made
ExperimentalInternetComputer.replyDeadline
to return
an optional return type (dfinity/motoko-base#693).
Caveat: Breaking change (minor). -
Added
isReplicated : () -> Bool
toExperimentalInternetComputer
(dfinity/motoko-base#694).
-
0.14.2
-
motoko (
moc
)-
Added support for sending
cycles
and setting atimeout
in parentheticals.
This is an experimental feature, with new syntax, and now also allowing best-effort
message sends. The legacy callCycles.add<system>
is still supported (#4608).For example, if one wants to attach cycles to a message send, one can prefix it with a parenthetical
(with cycles = 5_000) Coins.mine(forMe);
Similarly a timeout for best-effort execution (also called bounded-wait) can be specified like
let worker = (with timeout = 15) async { /* worker loop */ };
A common base for fields optionally goes before the
with
and can be customised with both fields
after it. Please consult the documentation for more usage information. -
bugfix:
mo-doc
will now generate documentation foractor
s andactor class
es (#4905). -
bugfix: Error messages now won't suggest privileged/internal names (#4916).
-
0.14.1
0.14.0
-
motoko (
moc
)-
Add
.values()
as an alias to.vals()
for arrays andBlob
s (#4876). -
Support explicit, safe migration of persistent data allowing arbitrary
transformations on a selected subset of stable variables.
Additional static checks warn against possible data loss (#4812).As a very simple example:
import Nat32 "mo:base/Nat32"; (with migration = func (old : { var size : Nat32 }) : { var length : Nat } = { var length = Nat32.toNat(old.size) } ) persistent actor { var length : Nat = 0; }
may be used during an upgrade to rename the stable field
size
tolength
,
and change its type fromNat32
toNat
.See the documentation for full details.
-
0.13.7
0.13.6
-
motoko (
moc
)-
Support the low Wasm memory hook:
system func lowmemory() : async* () { ... }
(#4849). -
Breaking change (minor) (#4854):
-
For enhanced orthogonal persistence: The Wasm persistence modes used internally for canister upgrades have been changed to lower case names,
keep
andreplace
and instead ofKeep
andReplace
:If using actor class instances with enhanced orthogonal persistence, you would need to recompile the program and upgrade with latest
moc
anddfx
.
Otherwise, no action is needed.
-
-
bugfix: Checks and mitigations that timer servicing works (#4846).
-
bugfix: Some valid upgrades deleting a stable variable could fail the
--enhanced-orthogonal-persistence
stable compatibility check due to a bug (#4855).
-