Currently, there is no such feature, but would be nice to have. I will think about it!
Another question about dependencies. When I write in mops.toml
for example
[dependencies]
base = "0.9.7"
and run mops i
then that will download exactly that version (0.9.7) even if I already have a newer version (say 0.9.8) installed.
Now I am wondering what happens if I have a project that depends on two packages, A and B, both of which in turn depend on base but on different versions. Say A depends on 0.9.7 and B on 0.9.8. When I build this project then both base versions get installed and used. Does that increase the binary size because two copies of the same library get compiled into the wasm?
No, there can be only one package resolved to specific name. So base
will be resolved to 0.9.7
, you can run mops sources
and see which package will actually be used in the build.
both will be downloaded but only one of them will be used. Probably I will move downloading and resolution out of local .mops
cache dir to global cache dir, so .mops
folder will remain simple.
That’s strange. I made a tool two months ago that imports files based on their content hashes and it reduced the compiled binary with 20-30kb
Update

Reducing mops.one load time
Thanks to certification v2 and more aggresive caching, https://mops.one now loads much faster.
Package changelog
On package “Versions” tab now you can see what changed in each package version including:
- Release notes from CHANGELOG.md
- Dependencies changes
- Tests changes
Dependency and test changes computed automatically.
Release notes parsed on mops publish
from CHANGELOG.md
file from packge version paragraph
For example CHANGELOG.md
# Motoko compiler changelog
## 0.10.0 (2023-09-11)
* Added a new stable `Region` type of dynamically allocated, independently growable and
isolated regions of IC stable memory (#580). See documentation.
* Exposed conversions between adjacent fixed-width types (#585).
## 0.9.8 (2023-08-11)
* motoko (`moc`)
* Added numerical type conversions between adjacent fixed-width types (#4139).
* Administrative: legacy-named release artefacts are no longer created (#4111).
...
When publishing package version 0.10.0
, mops will:
- parse
CHANGELOG.md
- find header with our package version → ## 0.10.0 (2023-09-11)
- publish whole paragraph:
* Added a new stable `Region` type of dynamically allocated, independently growable and
isolated regions of IC stable memory (#580). See documentation.
* Exposed conversions between adjacent fixed-width types (#585).
How it looks like:
Integration with VSCode Motoko extension
Added new command “Motoko: Import Mops Package…”.
-
Hit
Ctrl+Shift+P
then typemops
to find the command -
Select “Import Mops Package…”
- Search for Motoko package
- Select package and press
Enter
The package will be installed and saved to the mops.toml
file, then the package import line will be added to the currently open *.mo
file.