Breaking changes were released in Forc version 36.0 for importing libraries and using constants defined in the Forc.toml file.
-
Defining and structuring modules in Sway project has been reworded. The
depkeyword has been removed from the language in favour ofmod:moddeclarations include a single ident specifying the name of the submodule. Note that this is different fromdepdeclarations which would supply a/-separated file system path to the submodule. Since the name of the submodule is specified in the declaration, submodules no longer need to supply their name via alibrary name;header at the start of the file and can instead use the plainlibrary;. The name of a submodule is used to find the source file for that submodule. For a submodule namedbarof a modulefoo, either the filefoo/bar.sworbar.swmust exist. These paths are relative to the file defining thefoomodule containing themod bar;declaration. It is an error for both or none of these paths to exist. Module paths behave the same as they previously did except that they use module names instead of library names. -
Definition constants in
Forc.tomlis no longer supported. Instead, configurable constants defined in aconfigurableblock should be used. These constants do not change throughout the execution of a Sway program, but they can be changed at “configuration time” using the Rust SDK for example.