Upcoming changes in Motoko 0.11.0

Hello everyone. Earlier this week, the Motoko team shipped the v0.11.0 version of Motoko. In addition to a few minor improvements, like the Option.equal method, and warnings for unused identifiers, a new safety mechanism was introduced that could cause breaking changes to existing code.

Overview

In previous Motoko versions, third-party library functions could make calls to sensitive functions such as ExperimentalCycles.add(...) and Timer.setTimer(...) without providing any indication to the caller that sensitive system functionality was being used.

In Motoko 0.11.0 and newer, the type system is used to detect and prevent this scenario while still allowing developers to grant access to sensitive functions.

Migration

You can find the migration guide here: Motoko v0.11.0: Safety feature migration guide | Internet Computer. Please take a look and update your code if necessary. It may be especially impactful for certain library authors or any Motoko canisters that made use of those libraries.

This change will be bundled with version 0.18.0 of dfx, which will be shipped by the end of the week, March 8, 2024.

If you have any questions, please drop them in the thread or email team-motoko@dfinity.org directly.

4 Likes

Is there a way to turn off(and then selectively turn off) the unused identifier warning? In projects that have (msg) for every actor function as a force of habit is is a bit verbose. For projects that have legacy libraries that they don’t control, it also gets a bit out of hand. I’d love to be able to tidy up my core project, but not have to wade through the 1000+ messages in my dependent libraries.

2 Likes

moc 0.11.1 is just out. It has 2 changes to reduce chattiness. Try swapping it in…

2 Likes

Wen weekly Motoko updates again?

2 Likes