0.23.0
Major New Features
azle and azle/experimental
We have started to make the distinction between stable
and experimental
features. Azle is still in beta, but we are starting to put the separation in place now. Anything imported from azle
over time we will guarantee to be production-ready in our opinion. Anything imported from azle/experimental
will not be considered production-ready in our opinion.
Wasm binary manipulation during build process
Instead of automatically installing a Rust environment on the developer's machine, we now ship a pre-compiled Wasm binary. During build, the Wasm binary is manipulated automatically to swap out the final compiled JavaScript code and to change the exports to match the canister methods defined in the developer's source TypeScript or JavaScript code.
This should lead to a drastically simplified and quicker installation and build process generally.
Class-based syntax
We have introduced a new syntax/API that is simpler to implement and potentially use, and relies more directly on @dfinity/candid
. This is the syntax/API that we'll be taking to production-readiness/1.0 in the coming months.
Detailed info is in this chapter of The Azle Book.
Open Value Sharing (OVS)
Open Value Sharing (OVS) is a protocol that enables automatic revenue streams for software dependencies. This release has an MVP of OVS for ICP. It is turned off by default. We'll be working one-on-one with one or more teams for testing before enabling OVS by default.
The first draft of the spec is coming out soon.
Read more here:
- https://x.com/lastmjs/status/1796100080694415694
- https://x.com/lastmjs/status/1793348103346835683
- https://x.com/lastmjs/status/1791087284168650959
- https://x.com/lastmjs/status/1787808947119738994
chunk
chunk
imported from azle
and ic.chunk
imported from azle/experimental
has been introduced to help overcome the instruction limit in canister_update
methods.
Introducing an await chunk()
or await ic.chunk()
call into an @update
method will reset its instruction limit. Be careful to understand the nuances of issues such as global state when introducing this await
point, as it is a self-cross-canister call.
Jest
We have switched our testing framework away from a fully-custom testing solution to embracing Jest.
Major Breaking Changes
This release introduces many breaking changes. Not all are listed here. Our team is happy to answer questions on Discord during this transition period.
azle and azle/experimental
Many APIs have been removed from azle
and moved to azle/experimental
. The ic
object has been moved to azle/experimental
. Many of the ic
object's functions are now exported directly from azle
. azle
now focuses on exporting the decorators for the class-based syntax and the IC APIs directly.
Much of the functional Canister
syntax/API has been moved into azle/experimental
. We intend for anything imported from azle
to eventually be on the path to production-readiness and 1.0 (setOutgoingHttpOptions
has been exported from azle
by mistake and will be removed).
128 APIs removed
callRaw128
, canisterBalance128
, msgCyclesAccept128
, and msgCyclesRefunded128
have been removed. The non-128 named functions now include the 128 functionality by default. In the JavaScript runtime these will use bigint
, and in Rust they will use the u128
APIs.
Assets no longer included in Wasm binary
The assets
property in the canister config of the dfx.json
used to include up to ~90 MiB of assets in the Wasm binary during compilation. These assets were then available during canister_init
and canister_post_upgrade
. Assets are now no longer available in the Wasm binary and are instead uploaded after canister_init
and canister_post_upgrade
.
Some did files no longer included in Wasm binary
A canister's own did
file is no longer included in the Wasm binary by default. The /candid/icp/icrc.did
file is no longer included in the binary by default.
StableBTreeMap no longer returns Opt
Various StableBTreeMap
methods have had the Candid type object Opt
removed and replaced with a union of null
.
Raw APIs consolidated
callRaw
, notifyRaw
and replyRaw
have been consolidated into the call
, notify
, and reply
APIs.
Environment variables removed
AZLE_DOCKERFILE_HASH
, AZLE_SKIP_COMPILER_INFO
, and AZLE_USE_DOCKERFILE
environment variables have been removed.
Native compilation removed
The --native-compilation
command-line flag and functionality have been removed.
32-bit stable memory APIs removed
The 32-bit stable memory APIs stableGrow
, stableRead
, stableSize
, and stableWrite
are now 64-bit. The 64-bit versions have been removed.
Test framework changed
The examples, tests, and testing framework have seen a massive change. We've introduced Jest, removed ts-node, deleted some examples/tests, rearranged the directory structure, and changed some exports from our own testing framework.
Guard functions removed
Guard functions have been entirely removed from the Azle APIs.
Large assets removed
The large_assets
property of the canister config of dfx.json
has been removed. assets
now has the functionality that large_assets
had.
reload_js now always in the binary
The reload_js
Rust-defined update method is now compiled into every Wasm binary. Before it was only in the binary if AZLE_AUTORELOAD
was set to true.
What's Changed
- Open value sharing by @lastmjs in #1784
- Jest framework by @bdemann in #1817
- Update all examples that start with "a" to use jest by @bdemann in #1827
- Update all examples that start with "b" to use jest by @bdemann in #1828
- Update first half of examples that start with "c" to use jest by @bdemann in #1829
- Update second half of examples that start with "c" to use jest by @bdemann in #1830
- Update examples that start with "d" or "e" to use jest by @bdemann in #1831
- Update examples that start with "f" or "g" to use jest by @bdemann in #1832
- Update motoko examples to use jest by @bdemann in #1833
- update jest configs to transform azle by @bdemann in #1840
- Update examples that start with "h" to use jest by @bdemann in #1834
- Update examples that start with "i" to use jest by @bdemann in #1841
- update large files to use jest by @bdemann in #1843
- add stable structures tests, make global init and post upgrade state … by @lastmjs in #1845
- Class syntax init by @lastmjs in #1846
- Class syntax pre and post upgrade and inspect message by @lastmjs in #1847
- Class syntax heartbeat by @lastmjs in #1849
- Experimental passing by @bdemann in #1848
- Stable Canister API by @lastmjs in #1838
- implement cross_canister_calls example, notify, trap by @lastmjs in #1850
- Composite queries by @lastmjs in #1851
- Manual by @lastmjs in #1854
- Guard functions by @lastmjs in #1855
- Call raw by @lastmjs in #1856
- Improve tests just prop tests by @bdemann in #1861
- Jest final first part by @bdemann in #1865
- jest examples l-m by @bdemann in #1867
- jest examples n by @bdemann in #1868
- jest examples o-p by @bdemann in #1869
- jest examples r by @bdemann in #1870
- jest examples sqlite by @bdemann in #1871
- jest examples s by @bdemann in #1872
- Jest final by @bdemann in #1859
- Api refactor by @bdemann in #1853
- Wasm binary deploy process by @lastmjs in #1866
- Release 0.23.0-rc.1 by @lastmjs in #1884
- Clense ts node by @bdemann in #1890
- Misc class based syntax clean up by @bdemann in #1880
- remove benchmark.yml, attempt to only include npm on release and only… by @lastmjs in #1894
- remove candid from stable structures by @bdemann in #1898
- test a simpler version of link by @lastmjs in #1903
- reorganize examples and tests by @bdemann in #1905
- Candid generation by @bdemann in #1907
- Test stabilization by @bdemann in #1909
- update the documentation by @lastmjs in #1910
- add hello_world_candid_rpc example by @lastmjs in #1912
- update dfx to 0.21.0 by @lastmjs in #1911
- add the new examples to npmignore by @lastmjs in #1914
- update jest config by @bdemann in #1916
Full Changelog: 0.22.0...0.23.0