figwheel-main

figwheel-main http://figwheel.org
ozzloy 2020-10-07T03:18:20.028500Z

i'd like to run figwheel and use sente for web sockets in my own code. it seems like this might be possible, but i haven't been able to figure out how

ozzloy 2020-10-07T06:57:03.030500Z

got figwheel working alongside my own server. i get the feeling there's a better way to do this. any pointers much appreciated: https://gitlab.com/ozzloy/figserv

Jan K 2020-10-07T11:47:40.040700Z

https://gitlab.com/jan_k/doomlist This project uses devtime-only figwheel that starts via the scripting API (shares JVM with the app) and also runs it's own httpkit + sente.

ozzloy 2020-10-07T06:57:53.031300Z

idk what i'm doing, so i would be more surprised to find out there isn't a better way to do this than to find out this is a pretty reasonable way to do this

Jan K 2020-10-07T11:01:00.032Z

I use figwheel and sente in my project without issues. You mean you want them to share one web server? Figwheel needs to run its own AFAIK

dominicm 2020-10-07T11:10:41.032700Z

Figwheel was designed to be part of your server if you so choose, but it's very uncommon

Jan K 2020-10-07T11:28:18.036100Z

I don't think you can set up figwheel to run in your server like httpkit, it needs to use its own builtin jetty server. See https://github.com/bhauman/figwheel-main/issues/214

Jan K 2020-10-07T11:31:59.037600Z

But of course you can run your app in httpkit with sente and also use Figwheel reloading, the servers can coexist https://figwheel.org/docs/your_own_server.html

dominicm 2020-10-07T11:43:58.039600Z

I'm pretty sure the handler exists in isolation in Figwheel-repl

dominicm 2020-10-07T11:44:40.040600Z

There's comments in the source indicating that it was the intention, but web sockets and jetty required this to be a thing.

ozzloy 2020-10-07T23:19:47.042200Z

@jkr.sw i want to use sente, which i think requires some http server. i was under the impression that figwheel had to be that http server in order for it to do all the reloading goodness.

ozzloy 2020-10-07T23:20:31.043100Z

i'm also just not sure in general about all of this. web dev is all new to me. i'm new to things like http requests, middleware, routing, etc.

ozzloy 2020-10-07T23:21:46.044500Z

at this point, i got http-kit up and running and got figwheel to open the page served by it. next thing i'll work on is getting emacs integration. right now i launch figwheel via command line, but i'd rather have cider do it and i think there's a way to get that to happen

ozzloy 2020-10-07T23:22:27.045200Z

@jkr.sw @dominicm thanks for the help! it's nice to know that figwheel is supposed to be capable of this and i'm not doing something weird at a system level

ozzloy 2020-10-07T23:24:13.045800Z

on this page https://figwheel.org/docs/your_own_server.html it says "You will need to run Figwheel as well as your application server.", but i misread it

ozzloy 2020-10-07T23:26:19.046100Z

brb