Open erikkaplun opened 8 years ago
Thanks for asking. Until recently, diagrams-ghcjs
depended on ghcjs-canvas
, which wasn't on Hackage, so I didn't see any benefit to a Hackage release. I think we still need ghcjs-base
from git, so the same problem. If you're using stack, the solution is easy - add the git repo and a particular commit to the packages section. That's how stack.yaml in this repo pulls in ghcjs-base
(ghcjs-jquery
is only needed for the tests).
I think this or diagrams-reflex (which is even less mature) are the preferred ways to use Diagrams within a GHCJS program. diagrams-canvas
runs it's own webserver IIRC; I've never used diagrams-html5
.
ghcjs-base
is installed by ghcjs-boot
though, and should come with a GHCJS installation.
@bergey so then, do you reckon using Diagrams with GHCJS is even at least remotely suitable for production, as of currently?
I'm waiting on https://github.com/ghcjs/ghcjs/issues/452 before uploading to Hackage.
@eallik At least remotely =) I think it's about as suitable as most of the GHCJS libraries I've seen, right now.
I guess I will just have to let you know how it worked in production for me. :)
@bergey ghcjs/ghcjs#452 got fixed, are there any other showstoppers?
I tried adding
diagrams-ghcjs
to my.cabal
but it appears it cannot be auto-fetched as a dependency. Is that intentional? If yes, what is the best way to getdiagrams-ghcjs
installed into e.g. a Stack based project?Alternatively, does one even need this package to use Diagrams from a GHCJS based project and render directly onto an HTML5 Canvas from Diagrams code running as JavaScript? I've gotten the sense the diagrams-html5 and diagrams-canvas packages are more about sending Javascript from server to browser via AJAX and "piping" it to a canvas, not rendering to a canvas directly within a browser "process".