Open asheshambasta opened 4 years ago
It depends on the useWarp
flag (see project.nix). If it is set, reflex-dom's use-warp cabal flag is set by reflex-platform, which in turn instructs its mainWidget[WithHead]
to use jsaddle-warp instead of jsaddle-gtk (the latter is the default for GHC).
Hi @srid. Yes I read through the code as I posted the issue and maybe I should've clarified further. The issue is that in my case, the flag seems to have no effect. I see that this has also been observed in the past (see issue I opened on Reflex-platform). And it's been showing some very weird behaviour in my case. I've pushed my changes on asheshambasta/flowerpower
As I play with this further, another thing is very confusing: when do we use JSaddle-warp and when not? Here's what I did:
reflex-stone
as my template, and created a multi-project cabal.project based project. The project had the following directories:(since I was planning to use Servant and Servant reflex).
The
frontend.cabal
file remained mostly unchanged from the initial state. The perplexing thing is (and I cannot see any reason why this is happening), is that in the original (stone) project, runningmain
callsmainWidget ...
; which seems to fire up a warp server when called from the REPL (GHCI). In my project, when I try to do the same, for some reason, I'm greeted with a GUI (with some sort of DOM based UI).There are some extra dependencies in the derived project, but everything else seems identical. And I've so far been unable to find out why.
A good discussion on JSaddle warp etc. may help with this kind of confusion.
I'm now looking into JSaddle warp on how to call
run
explicitly that fires up a warp server instead of the GUI. I've also opened https://github.com/reflex-frp/reflex-platform/issues/696 since I feel this must be documented on reflex-platform too.