-
motoko (
moc
)-
Breaking change (minor):
-
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).
-