ghcjs / diagrams-ghcjs

diagrams backend that renders directly to an HTML5 canvas
Other
23 stars 6 forks source link

Hackage Release / git tags #9

Open erikkaplun opened 8 years ago

erikkaplun commented 8 years ago

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 get diagrams-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".

bergey commented 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.

luite commented 8 years ago

ghcjs-base is installed by ghcjs-boot though, and should come with a GHCJS installation.

erikkaplun commented 8 years ago

@bergey so then, do you reckon using Diagrams with GHCJS is even at least remotely suitable for production, as of currently?

bergey commented 8 years ago

I'm waiting on https://github.com/ghcjs/ghcjs/issues/452 before uploading to Hackage.

bergey commented 8 years ago

@eallik At least remotely =) I think it's about as suitable as most of the GHCJS libraries I've seen, right now.

erikkaplun commented 8 years ago

I guess I will just have to let you know how it worked in production for me. :)

dimsuz commented 8 years ago

@bergey ghcjs/ghcjs#452 got fixed, are there any other showstoppers?