Fork me on GitHub
#ring
<
2021-10-04
>
mister_m00:10:03

just getting started with ring; this lein plugin enabling hot reloading of handlers I'm messing around with is pretty neat.

seancorfield00:10:58

@radicalmatt If you take a bit of care to write REPL-friendly code, you don't need any of that code reloading stuff.

seancorfield00:10:00

At work, we develop against a running REPL and don't use any plugins or middleware for reloading. We evaluate every change as we make it, we write "REPL-friendly" code using #'some-var references (instead of plain some-var) where we need the extra indirection, usually around Ring middleware stacks, and then we don't need to reload or restart anything: the web app is always running the latest code.

❤️ 1
mister_m00:10:30

This is what I am referring to https://github.com/ring-clojure/ring/wiki/Setup-for-development#setup-using-the-lein-ring-plugin - is this not necessary if I were to pass a handler reference to jetty/run-jetty ?

seancorfield00:10:10

Correct. And just start the server yourself from your REPL.

seancorfield00:10:23

That ring plugin is just a bad idea in my opinion.

seancorfield00:10:08

It's REPL-friendly and avoids any plugins.

mister_m00:10:37

I'll have a look Sean, thanks

mister_m20:10:49

For anyone interested, I found some supplementary material on Component used in Sean's example: https://www.youtube.com/watch?v=13cmHf_kt-Q (The author discussing the design and rationale behind Component)