Shopify
Shopify logoShopify · Feature trail

JavaScript Runtime for Shopify Functions

2 posts · Feb 2023 – Apr 2023

What this trail covers

Shopify is expanding its Shopify Functions capabilities to support custom routing rules for order fulfillment. This involves leveraging Rust for default routing rules and enabling merchants to create their own rules using JavaScript compiled to WebAssembly (Wasm). The system utilizes a pipeline pattern for processing and a reducer for tie-breaking among rules. Future work will focus on opening up order routing for third-party developer-created rules. This post details the development of Javy, a toolchain for executing JavaScript in WebAssembly, addressing challenges with module size and the lack of dynamic linking in Wasm. It explores using QuickJS as the JavaScript engine and the trade-offs involved in compiling it to Wasm.

All Shopify trails