Closed AesaKamar closed 5 years ago
I, and others it seems, have found similar difficulty using reflex
, another Haskell front-end library which uses a similar approach to builds.
https://github.com/reflex-frp/reflex-platform/issues/18
@AesaKamar This PR should resolve that issue. https://github.com/dmjio/miso/pull/441
Outstanding! Thanks for the update 🍜
@AesaKamar, this should be possible now.
Once I do some testing, I'll note it here and close the issue out.
@AesaKamar sounds great!
Still no luck getting the Nix build via GHCJS and ghc-mod to play nicely together. (Specifically on OSX)
I'll take another stab at integration with intero.
@AesaKamar, I'd check out using miso
with jsaddle
. This way you can use ghcid
, ghc-mod
, etc.
git clone https://github.com/dmjio/miso
cd miso
nix-shell jsaddle.nix -A miso-shell.env
cabal new-run -f+jsaddle mario
@AesaKamar let me know if this should be re-opened. jsaddle
is still supported with miso
and has helped with cross-compilation support to ARM. For day-to-day work in building websites I normally do not use it. I just use a tool like entr
to detect file changes and invoke cabal build
. Then use nix-shell --run web-runner
in its own shell for the server, and nix-shell --run web-runner shell-ghcjs.nix
in another shell. The server will serve the static assets from the static
folder, the client automatically copies them into static
upon successful build. The functions below are defined in the shellHook
section of the shell.nix
and shell-ghcjs.nix
Server compilation:
function web-runner() {
entr time -c 'runghc Setup.hs configure --disable-optimization --builddir=dist-web\
\&\& runghc Setup.hs build web --builddir=dist-web \
\&\& dist-web/build/web/web'
}
Client compilation:
function research-runner() {
mkdir -p static/
runghc util/Runner.hs runghc Setup.hs configure --disable-optimization --ghcjs --build-dir=dist-web-ghcjs \
\&\& runghc Setup.hs build web-client --builddir=dist-web-ghcjs\&\&\
cp -v dist-web-ghcjs/build/web-client/web-client.jsexe/all.js static/all.js \&\&\
cp -v web/client/style.css static/style.css \&\&\
cp -v web/*.png static/ \&\&\
cp -v web/common/*.ico static/
}
I would like to be able to use tools like
ghc-mod
andhdevtools
with this project.I've been able to successfully build some of the example projects with
ghcjs
vianix
However, I'm unable to get linting tools to work. This has more generally been a problem I've found in using front-end Haskell libraries using
ghcjs
andnix
.Any suggestions for how I would be able to remedy this?