You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here, Ojs.runtime would serve as an alias for (pure_js_expr "globalThis.jsoo_runtime").
More generally, I’m not aware of any established "good practice" for writing a js_of_ocaml library that loads modules using require in its stubs. Do you know of any examples that follow such an approach?
gen_js_api seems to advertise mutating the global object in order to make js values accessible on the OCaml side using
[@@js.get ]
,[@@js.global]
, ...For example,
cat node-test/bindings/imports.mli
cat node-test/bindings/imports.js
This causes problems when loading multiple js files generated by jsoo because one could override a global value with an incompatible one , see ocsigen/js_of_ocaml#1622 and ocamllabs/vscode-ocaml-platform#1617.
I'm opening this to understand if this issue has already been solved, if it has already been identified and discuss possible solutions.
Note that jsoo is able to bind to js libs relying on
external
primitives without mutating the global object.The text was updated successfully, but these errors were encountered: