2016-10-18 8:42 GMT+02:00 Daniel Compton <daniel.compton.li...@gmail.com>:

> > I'd really think twice before requiring your users to insert matching
> pairs of mutation in their code. It goes against the grain of clojure and
> is error-prone.
> > Why can’t on-jsload (is that figwheel's?) just run the update within a
> (binding [*warn-on-overwrite* false] ...)?
> The (simplified) structure of the Figwheel reload code is
> (do
>   (before-jsload)
>   (figwheel-reloads-code)
>   (on-jsload))
> I would prefer to use binding, but Figwheel doesn’t run it’s reload within
> the scope of my before-jsload function, so binding and with-redefs wouldn’t
> work here. I’m not in love with the matching mutations, but I’m not sure if
> there’s a better option? A PR to Figwheel is always possible, but this is a
> fairly niche requirement, so I’m hesitant to add more configuration to it.

Maybe you can get rid of load-time side-effects, such that a reload won't
trigger warnings, but only the main function, called by on-jsload, would?

Even though, this is out of scope for re-frame and figwheel alone, some
more thoughts: Setting up the environment of your program doesn't seem like
such a niche thing to me. Other use cases include reader tags, various
(pretty-)print variables, ... The tricky part is finding an approach that
works across:
a) cljs classic (where the macro environment is clj)
b) cljs self-hosted
c) repls / dynamic loaders, like figwheel

Note that posts from new members are moderated - please be patient with your 
first post.
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.

Reply via email to