Skip to content
New issue

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

Don't mutate joo_global_object / globalThis to define js_of_ocaml stubs #1617

Open
hhugo opened this issue Oct 10, 2024 · 4 comments
Open

Don't mutate joo_global_object / globalThis to define js_of_ocaml stubs #1617

hhugo opened this issue Oct 10, 2024 · 4 comments
Labels
type: bug Something isn't working

Comments

@hhugo
Copy link

hhugo commented Oct 10, 2024

This may prevent multiple programs from running concurrently.

See ocsigen/js_of_ocaml#1622

@smorimoto
Copy link
Collaborator

@hhugo Could you tell us more detailed ways to fix it?

@hhugo
Copy link
Author

hhugo commented Nov 19, 2024

Looking at this more. It seems that this repo replicated the design found in gen_js_api. I will open a ticket there.

First, joo_global_object is deprecated (a warning will be emitted with the upcoming release of jsoo. You should use globalThis instead.

One way to implement binding with jsoo is to rely on external primitives, documented succinctly in https://ocsigen.org/js_of_ocaml/latest/manual/linker.

When using gen_js_api, I don't know how to not mutate the global object. Let see what people say on the gen_js_api repo.

@hhugo
Copy link
Author

hhugo commented Nov 19, 2024

LexiFi/gen_js_api#177

@smorimoto
Copy link
Collaborator

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants