This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # aleph (1)
- # aws (2)
- # beginners (69)
- # boot (79)
- # braid-chat (1)
- # cider (221)
- # clara (13)
- # cljs-dev (9)
- # cljs-edn (1)
- # cljsrn (7)
- # clojure (128)
- # clojure-chicago (1)
- # clojure-russia (196)
- # clojure-sanfrancisco (1)
- # clojure-uk (13)
- # clojurescript (166)
- # community-development (2)
- # css (2)
- # cursive (8)
- # datomic (4)
- # emacs (11)
- # hoplon (54)
- # instaparse (2)
- # jobs (16)
- # jobs-discuss (54)
- # jobs-rus (7)
- # luminus (4)
- # off-topic (33)
- # om (37)
- # onyx (8)
- # proton (10)
- # quil (8)
- # re-frame (29)
- # reagent (7)
- # remote-jobs (2)
- # untangled (140)
- # yada (1)
I suspect many people must be rolling their own input validation and remote synchronization code.
I suppose it could be tough to write something configurable enough to satisfy the use cases of a wide audience.
Hello, I had a "logged" middleware that was checking for a value in cookie so that was working fine but I now need to make an http call so now I'm dealing with async code and I have no idea how to keep this functionality as middleware
I'm coming back to a projet that was using reframe 0.3.0 so I may have missed some new features but the wiki didnt seem to change, at least for the talking to server and middleware sections
(defn logged [handler] (fn logged-handler [db v] (if (is-logged?) (handler db v) db))
Should I create an logged handler in opposition of a middleware that will take a follow-up action as param and decide to dispatch it or not
wonder if anyone using reframe as frontend, clojure as backend, and managed to use figwheel to do the frontend stuff?
I am a bit confused. when using figwheel, js is served at 3449 port, normally backend will be at 8080 port. how does frontend fire ajax to backend? in prod, you could use relative url, but in dev, they are using different ports.
@rui.yang: I had the exact same problem a few weeks ago! Are you already using http-kit or jetty or any webserver for the backend, or were you like me and tried to go as long as possible using figwheel itself to run the backend 😛 ?
So my setup (I've been meaning to write this up but haven't yet, so this might be a bit rough): in
defproject, I have
:main app.handler, and in
src/clj/app/handler.clj I have set up my Compojure app as well as http-kit startup.
I also have a Compojure route:
(route/resources "/") so that http://localhost:3600/index.html (in your case, 8080 will be the port) will load index.html and pull down whatever cljs assets have been built by
lein fighweel dev.
When you open that URL, the browser will try to connect to the figwheel websocket (http://localhost:3449) once a second, and will console.error if it can't reach it. If you run
lein figwheel dev, that starts up figwheel's server, and your client connects to it and figwheel is running.
So I have two terminals, one running
lein run and another running
lein fighweel dev. (The third is a
lein repl connected to the nrepl server running inside my app 😄)
This whole aspect of Clojure/Script was really confusing for me to figure out, and I'm sure the above was unclear so let me know where I can clarify. I would like to make a stand-alone repo showing how I at least do this… after my deadline next week
Chestnut is a lein template that sets this up for you. It uses om, but you could pull that out.
@fasiha: great tips, I have copied all your comments in case slack lose history. will have a play later if chestnut not working.
@danielcompton: thanks for pointing me to chestnut. it is great that figwheel has :ring-handler option, but I am trying out https://github.com/pedestal/pedestal. any idea how to incorporate pedestal with figwheel?