Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update rust functions #600

Merged
merged 5 commits into from
Mar 17, 2025
Merged

Update rust functions #600

merged 5 commits into from
Mar 17, 2025

Conversation

devisscher
Copy link
Contributor

Updating rust functions to match mock-http-server.

@devisscher devisscher force-pushed the update-rust-functions branch from 10da959 to 6a86cbc Compare March 17, 2025 16:56
@@ -19,6 +19,8 @@ description = "t:description"

[extensions.build]
command = "cargo build --target=wasm32-wasip1 --release"
path = "target/wasm32-wasip1/release/{{handle | replace: " ", "-" | downcase}}.wasm"
path = "target/wasm32-wasip1/release/discount-function-rust.wasm/{{handle | replace: " ", "-" | downcase}}.wasm"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems wrong

watch = [ "src/**/*.rs" ]

[extensions.ui]
handle = "{{handle}}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want this in default? I don't think so?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to use the handle from the extension generate command.

#[serde(default)]
add_product_discounts: Option<ProductDiscounts>,
#[serde(default)]
add_order_discounts: Option<OrderDiscounts>,
#[serde(default)]
add_discount_code_validations: Option<ValidDiscountCodes>,
// Ignore other operation types that might be in the response but we don't use in cart context
#[serde(flatten)]
_other: std::collections::HashMap<String, serde_json::Value>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting

Copy link
Contributor

@jonathanhamel4 jonathanhamel4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm. Left some notes cause I think some of the changes are wrong (some I had to manually change after the script). I also made the change to 2025-04 thinking that this is what we wanted, as we generally don't ask devs to use unstable, but I guess that is our only option until this api is released.

@devisscher
Copy link
Contributor Author

Lgtm. Left some notes cause I think some of the changes are wrong (some I had to manually change after the script). I also made the change to 2025-04 thinking that this is what we wanted, as we generally don't ask devs to use unstable, but I guess that is our only option until this api is released.

We should update to 2025-04 as soon as we're ready to release, but I wanted the template to still work for our internal testing. 🙇‍♂️

@devisscher devisscher merged commit 43c003d into main Mar 17, 2025
4 checks passed
@devisscher devisscher deleted the update-rust-functions branch March 17, 2025 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants