i was also curious about this (helix.experimental.refresh in dev vs prod)
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:
(ns my-app.dev.refresh
(:require [helix.experimental.refresh :as refresh]))
(refresh/inject-hook!)
(defn ^:dev/after-load after-load []
(refresh/refresh!))
and then the dev build has
:preloads '[helix.experimental.refresh
my-app.dev.refresh]
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.
hmm
looking back at the code, you should not need to toggle :fast-refresh
defnc
emits code that should be removed under advanced optimizations for fast refresh
yeah, that's what i was hoping (relying on). i just have {:fast-refresh true}
in prod and it seems to work
yep, that should be fine
@mmakgaba I’d be curious to know what your issue was with preloads then
Yes, that seems to be the issue.