Skip to content

Releases: dfinity/motoko

0.14.3

04 Mar 12:25
429e9fb
Compare
Choose a tag to compare
  • motoko (moc)

    • Added primitive predicate isReplicatedExecution (#4929).
  • motoko-base

    • Added isRetryPossible : Error -> Bool to Error (dfinity/motoko-base⁠#692).

    • Made ExperimentalInternetComputer.replyDeadline to return
      an optional return type (dfinity/motoko-base⁠#693).
      Caveat: Breaking change (minor).

    • Added isReplicated : () -> Bool to ExperimentalInternetComputer (dfinity/motoko-base#694).

0.14.2

26 Feb 21:28
8add58e
Compare
Choose a tag to compare
  • motoko (moc)

    • Added support for sending cycles and setting a timeout in parentheticals.
      This is an experimental feature, with new syntax, and now also allowing best-effort
      message sends. The legacy call Cycles.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 for actors and actor classes (#4905).

    • bugfix: Error messages now won't suggest privileged/internal names (#4916).

0.14.1

13 Feb 09:44
ee6f75f
Compare
Choose a tag to compare
  • motoko (moc)

    • bugfix: Be more precise when reporting type errors in migration fields (#4888).

0.14.0

05 Feb 08:37
b0123f5
Compare
Choose a tag to compare
  • motoko (moc)

    • Add .values() as an alias to .vals() for arrays and Blobs (#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 to length,
      and change its type from Nat32 to Nat.

      See the documentation for full details.

0.13.7

03 Feb 12:11
80ba70c
Compare
Choose a tag to compare
  • motoko (moc)

    • Support passing cycles in primitive call_raw (resp. ExperimentalInternetComputer.call) (#4868).

0.13.6

20 Jan 23:31
6cb13b5
Compare
Choose a tag to compare
  • 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 and replace and instead of Keep and Replace:

        If using actor class instances with enhanced orthogonal persistence, you would need to recompile the program and upgrade with latest moc and dfx.
        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

06 Dec 01:26
76f9087
Compare
Choose a tag to compare
  • motoko (moc)

    • Breaking change (minor) (#4786):

      • Add new keyword transient with exactly the same meaning as the old keyword flexible (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 or var declaration is stable (not flexible or transient).

        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 to 0 and value, now implicitly stable, 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

0.13.4

29 Nov 19:46
7a72632
Compare
Choose a tag to compare
  • 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 be NaN in newer Motoko versions, while it was nan or -nan in older versions (dfinity/motoko-base⁠#589).

0.13.3

13 Nov 23:32
ef79879
Compare
Choose a tag to compare
  • motoko (moc)

    • typing: suggest conversions between primitive types from imported libraries
      and, with --ai-errors, all available package libraries (#4747).
  • motoko-base

    • Add modules OrderedMap and OrderedSet to replace RBTree with improved functionality, performance
      and ergonomics avoiding the need for preupgrade hooks (thanks to Serokell) (#662).

0.13.2

17 Oct 22:34
a18253d
Compare
Choose a tag to compare
  • motoko (moc)

    • Made the actor's self identifier available in the toplevel block. This also allows using
      functions that refer to self from the initialiser (e.g. calls to setTimer) (#4720).

    • bugfix: actor <exp> now correctly performs definedness tracking (#4731).