DEV Community

​Andrzej Ressel
​Andrzej Ressel

Posted on

Pulumi WASM/Rust devlog #3

Welcome to the third devlog for the WASM/Rust support for Pulumi! This week, I focused on improving the versioning and release process, along with adding a new format!-like macro. Here's what's new:

Versioning

Previously, every version used the format 0.0.0-NIGHTLY-COMMITSHA. The main issue was that users did not know when a library version was released, making it difficult to check for updates.

To solve this, I've switched to calver. For example, today's release would be v25.1.12-47a9821.

This ensures users can quickly identify the release date of a version, making it easier to stay up to date.

Release Spam

Pulumi and binstall require a GitHub release for every deployed version. Currently, I deploy a new version after every commit to the main branch, which creates notification spam for users who star the repository.

To resolve this, I've created a separate repository just for releases: pulumi-wasm-releases. This keeps the main repository cleaner while ensuring users can still access the latest versions.

Additionally, the commands for downloading binaries have changed due to the separate release repository. Be sure to check the example repository for updated instructions.

Format Macro

The latest version of the library introduces the pulumi_format! macro. It works like Rust's format! macro but is designed specifically for Pulumi's Output types.

A key feature is that not all arguments need to be of type Output—you can seamlessly combine Output values with regular values.

For example:

let a = Output::new(&1);
let b = Output::new(&"test".to_string());
let formatted: Output<String> = pulumi_format!("{} {}", a, b); // "1 test"
Enter fullscreen mode Exit fullscreen mode

Replacement of combineX function with pulumi_combine! macro

Previously, there were multiple combineX methods for combining Outputs. These have now been replaced with a single pulumi_combine! macro for greater flexibility and simplicity. This change reduces redundancy and makes the API more intuitive.

For example:

let a = Output::new(&1);
let b = Output::new(&"test");
let combined: Output<(i32, &str)> = pulumi_combine!(a, b);
Enter fullscreen mode Exit fullscreen mode

That's all for this week's updates!. As always, feedback is welcome—let me know your thoughts or if you run into any issues!

Top comments (0)