Fork me on GitHub
#fulcro
<
2020-02-02
>
otwieracz14:02:16

Is there anything wrong with my setup, or recomplilation of defmutation (server side) does not have immediate effect?

otwieracz14:02:06

I have to also regenerate handler and parser

mdhaney17:02:37

@slawek098 you probably want some kind of “reloaded” workflow. Look at the Fulcro template for a straightforward example of how to set this up with mount (although you can also use component or some variant if that’s your preference). Using this workflow, when I make a change I first reload the namespace (to make sure it compiles) then restart the system, by running (restart) at the REPL if you’re using the same setup as the Fulcro template. Also note that in Cursive or Emacs (and probably other editors) you can bind the reload command to a keyboard shortcut, so it’s really quick to do this as part of your normal development workflow.

otwieracz17:02:38

@mdhaney I am using component, so (reset) fixes everything - but I am surprised that redefinition of function in runtime does not resolve the issue.

mdhaney17:02:01

Yeah, I think there are a couple things going on there. I remember reading something about Ring and how handlers wouldn’t pick up changes without special steps being taken, and also something about the way Clojure deals with multimethods. TBH, I’ve been using the reloaded pattern so long, I’ve forgotten the details of some of the problems it was trying to solve. ☺️

holyjak18:02:46

A problem is if you pass a fn by value (the default) - changing the original fn's code then of course has no effect, that's why you typically give #'my-handler to ring. Mulrimethods, protocols etc are troublesome.

geraldodev20:02:32

which reactjs widgets do you use with fulcro, folks ?

currentoor22:02:24

we also have some authorization/permission stuff mixed in there

currentoor22:02:18

that NS is used by JVM and nodeJS envs

currentoor22:02:50

the JVM one has the internal function trick so you can re-eval a mutation definition and have it take affect immediately