Fork me on GitHub
#helix
<
2020-07-24
>
aiba19:07:08

i was also curious about this (helix.experimental.refresh in dev vs prod)

aiba19:07:36

in my case, i created my own namespace that is in the :preloads for the dev build, but not the prod build, which looks like:

aiba19:07:10

(ns my-app.dev.refresh
  (:require [helix.experimental.refresh :as refresh]))

(refresh/inject-hook!)

(defn ^:dev/after-load after-load []
  (refresh/refresh!))

aiba19:07:29

and then the dev build has

:preloads '[helix.experimental.refresh
            my-app.dev.refresh]

aiba19:07:57

But what i could not figure out is how to have my custom defnc macro avoid passing {:helix/features {:fast-refresh true}} to helix.core/defnc, since that is evaluated at compile-time. I'd be curious if anyone is using their own custom defnc macro and has figured out a way to pass different features for dev vs. prod.

lilactown19:07:04

looking back at the code, you should not need to toggle :fast-refresh

lilactown19:07:33

defnc emits code that should be removed under advanced optimizations for fast refresh

aiba19:07:02

yeah, that's what i was hoping (relying on). i just have {:fast-refresh true} in prod and it seems to work

lilactown19:07:14

yep, that should be fine

lilactown19:07:43

@mmakgaba I’d be curious to know what your issue was with preloads then

MorongÖa08:07:15

Yes, that seems to be the issue.