hot reloading code and html templates for web app development

74 views
Skip to first unread message

Matthew Eric Bassett

unread,
Jan 6, 2016, 2:32:57 PM1/6/16
to racket users list
Hi all,

I often use serve/servlet to launch my webapp. Often from the repl
while I'm developing.

One major annoyance I have, however, is that I cannot easily hot-swap
code. If I change a required dependency I then need to kill the process
(usually re-enter! from the repl to update the changed dependency) and
serve/servlet again. It's an annoying process, but as enter! only
updates changed files it only takes a few seconds.

Things get worse when I change templates. These don't reload until I've
exited out of the repl and come in again - enter! doesn't seem to notice
that templates have changed. This is an intolerable annoyance!

I must be doing something silly, as this is a very inefficient process.
Is there a way to get racket to hotswap templates and updated
dependencies without having to explicitly restart the serve/servlet
thread, or worse the entire racket machine ?

Thanks,

--
Matthew Eric Bassett | http://mebassett.info

signature.asc

Sam Tobin-Hochstadt

unread,
Jan 6, 2016, 2:39:16 PM1/6/16
to meba...@gegn.net, racket users list
Matthew,

There's a nice package for helping with this here:
https://github.com/tonyg/racket-reloadable/

It's maybe not quite as automatic as having the templates be
dynamically loaded, so probably we should add a way to do that too.

Sam
> --
> You received this message because you are subscribed to the Google Groups "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to racket-users...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Jay McCarthy

unread,
Jan 6, 2016, 2:39:40 PM1/6/16
to Matthew Eric Bassett, racket users list
Hi Matthew,

The Web server doesn't do any special to prevent or make possible what
you're talking about. Other orthogonal Racket features will help you
though. The key is dynamic-rerequire. A great library for doing stuff
like this the reloadable package:

https://github.com/tonyg/racket-reloadable

Jay

On Wed, Jan 6, 2016 at 2:32 PM, Matthew Eric Bassett <meba...@gegn.net> wrote:
> --
> You received this message because you are subscribed to the Google Groups "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to racket-users...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Jay McCarthy
Associate Professor
PLT @ CS @ UMass Lowell
http://jeapostrophe.github.io

"Wherefore, be not weary in well-doing,
for ye are laying the foundation of a great work.
And out of small things proceedeth that which is great."
- D&C 64:33
Reply all
Reply to author
Forward
0 new messages