We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
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], ...
[@@js.get ]
[@@js.global]
For example, cat node-test/bindings/imports.mli
cat node-test/bindings/imports.mli
[@@@js.scope "__LIB__NODE__IMPORTS"] val path: Ojs.t [@@js.global] val fs: Ojs.t [@@js.global]
cat node-test/bindings/imports.js
globalThis.__LIB__NODE__IMPORTS = { path: require('path'), fs: require('fs'), };
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.
external
The text was updated successfully, but these errors were encountered:
No branches or pull requests
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: