Transitioning from JavaScript to Rust for Discount Functions

I am in the process of replacing my current JavaScript implementation with Rust. Could you assist me in making this transition as smooth as possible?

Migration Steps and Inquiry:

  1. Develop and test Rust functions in the development environment.
  2. Deploy the Rust functions to the production environment.
  3. Migrate existing discount codes to be processed using the new Rust functions.

Is step 3 feasible? I am concerned that the functionId differs between the JavaScript and Rust implementations, which could potentially cause issues.

Hi Hirano,

We just shipped some JS → Rust migration guidelines to our dev docs here: Rust for Functions

Hope these help!

This dev docs is very helpful to me. Thank you very much.

@Hirano It does not mention anything about functionId being different. Renaming handle is enough?

@navdeep Yes. If you rename the configuration file and disable the JavaScript functionality, you can use the same functionId in Rust.

sorry my head is spinning right now :slight_smile:
the function id will be different even if we renamed the handles? what am i missing?

if function id remains same everything is sorted. right now my function id is different although handle name is same

Sorry, unless the handle is changed as per the documentation, the functionId will not be changed.

Oh looks like some bug at my end because all the older payment customizations are gone @Liam-Shopify