Releases: dfinity/motoko
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).
-
0.13.5
-
motoko (
moc
)-
Breaking change (minor) (#4786):
-
Add new keyword
transient
with exactly the same meaning as the old keywordflexible
(but a more familiar reading). -
Add keyword
persistent
.When used to modify the
actor
keyword in an actor or actor class definition, the keyword declares that the default stability of a
let
orvar
declaration isstable
(notflexible
ortransient
).For example, a stateful counter can now be declared as:
persistent actor { // counts increments since last upgrade transient var invocations = 0; // counts increments since first installation var value = 0; // implicitly `stable` public func inc() : async () { value += 1; invocations += 1; } }
On upgrade, the transient variable
invocations
will be reset to0
andvalue
, now implicitlystable
, will retain its current value.Legacy actors and classes declared without the
persistent
keyword have the same semantics as before.
-
-
Added new primitive
replyDeadline : () -> Nat64
to obtain when a response for a best-effort message is due (#4795). -
bugfix: fail-fast by limiting subtyping depth to avoid reliance on unpredictable stack overflow (#3057, #4798).
-
-
motoko-base
-
Added
Text.fromList
andText.toList
functions (dfinity/motoko-base#676). -
Added
Text.fromArray/fromVarArray
functions (dfinity/motoko-base#674). -
Added
replyDeadline
toExperimentalInternetComputer
(dfinity/motoko-base#677).
-
0.13.4
-
motoko (
moc
)- refactoring: Updating and simplifying the runtime system dependencies (#4677).
-
motoko-base
-
Breaking change (minor):
Float.format(#hex)
is no longer supported.
This is because newer versions of Motoko (such as with enhanced orthogonal persistence)
rely on the Rust-native formatter that does not offer this functionality.
It is expected that this formatter is very rarely used in practice (dfinity/motoko-base#589). -
Formatter change (minor): The text formatting of
NaN
, positive or negative,
will beNaN
in newer Motoko versions, while it wasnan
or-nan
in older versions (dfinity/motoko-base#589).
-
0.13.3
-
motoko (
moc
)- typing: suggest conversions between primitive types from imported libraries
and, with--ai-errors
, all available package libraries (#4747).
- typing: suggest conversions between primitive types from imported libraries
-
motoko-base
- Add modules
OrderedMap
andOrderedSet
to replaceRBTree
with improved functionality, performance
and ergonomics avoiding the need for preupgrade hooks (thanks to Serokell) (#662).
- Add modules