ocaml.org icon indicating copy to clipboard operation
ocaml.org copied to clipboard

Adding more libraries to playground

Open nikochiko opened this issue 1 year ago • 3 comments

I am attempting to add a library to the playground - https://github.com/Sudha247/ocaml-joy - so that I can provide an editor and an SVG rendering side by side (I am doing it with a REPL-toplevel here - https://kaustubh.page/joy.ml/).

I need some help with doing this - I can then document the procedure that works.

I am able to load the cmi and the cma.js, but I get a JavaScript TypeError now when I try to do Joy.init_svg "pane-1" image

Note: this is the branch of Joy that needs to be pinned for this to work: https://github.com/Sudha247/ocaml-joy/tree/svg

nikochiko avatar Mar 14 '24 05:03 nikochiko

Now I think this might be an issue with Js_of_ocaml actually - other methods seem to work.

nikochiko avatar Mar 14 '24 05:03 nikochiko

Perhaps because it is trying to manipulate the DOM from a web worker.

nikochiko avatar Mar 14 '24 05:03 nikochiko

Hey @nikochiko! Sorry, this got lost under all the Outreachy PRs.

Thanks for taking the time to try this. I remember @gpetiot made an attempt at loading packages into the playground also. It would be great if he can comment on this. Also @jonludlam might have a few pointers.

sabine avatar Mar 29 '24 10:03 sabine

Closing this as it seems stalled. Thank you for the PR @nikochiko don't hesitate to pick this up again if you'd like.

I know there's been some exploration to generate build artifacts of the opam packages in the Docs pipeline for consumption from the playground. Maybe one day we'll be able to use any JS-compatible opam package from the playground!

tmattio avatar Oct 01 '24 07:10 tmattio