OCaml 5.x code using effect handlers can be compiled in two different ways: one can enable the CPS transformation from js_of_ocaml by passing the --effects=cps flag. Without the flag wasm_of_ocaml will instead default to --effects=jspi and emit code utilizing
Since the value representation is different, some adaptations are necessary.
The most notable change is that, except for integers, OCaml numbers are no longer mapped to JavaScript numbers. So, explicit conversions Js.to_float and Js.float are now necessary to convert between OCaml floats and JavaScript numbers. The typing of JavaScript Typed Arrays has also been changed to deal with this.