joelburget / react-haskell

React bindings for Haskell
MIT License
351 stars 26 forks source link

How to run the examples? #7

Open ryskajakub opened 9 years ago

ryskajakub commented 9 years ago

After installing with haste-inst install, I run: hastec --with-js=lib/stubs.js example/simple/simple.hs --out=example/simple/main.js from the root of the project And then open the file in chrome. And when I type in the input box, the texts doesn't change.

Does it depend on some fixed version of ghc? I use 7.6.3

maks83 commented 9 years ago

I use 7.8.3 hastec --with-js=lib/stubs.js example/src/Main.hs --out=example/src/Main.js When create example/src/Main.html

<!DOCTYPE html>
<html>
    <head>
        <meta charset='utf-8'>
        <title>test</title>
        <link rel="stylesheet" href="todomvc/base.css">
        <script src="http://fb.me/react-with-addons-0.12.0.js"></script>
        <script src="Main.js"></script>
    </head>
    <body>
        <div id="simple-demo"></div>
        <div id="circles-demo"></div>
        <div id="chain-demo"></div>
    <div id="easing-demo"></div>
    <div id="slide-demo"></div>
    </body>
</html>

And all works fine!

johncant commented 9 years ago

I'm using: GHC 7.8.4 haste 0.5.0 (master from a few weeks ago) and out of those 5 examples, I could only get 3 to work. I had to use --ddisable-js-opts, otherwise only chain-demo worked.

Use HTML from @maks83 , comment out the easing and slide examples in examples/src/Main.hs, then compile with (from the top-level dir):

haste-inst install
hastec --with-js=lib/stubs.js example/src/Main.hs example/src/Circles.hs example/src/Easing.hs example/src/Simple.hs example/src/Slide.hs example/src/Chain.hs --out=example/src/Main.js --debug --ddisable-js-opts