helix

https://github.com/Lokeh/helix
aiba 2020-07-24T19:43:08.349800Z

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

aiba 2020-07-24T19:43:36.350400Z

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:

aiba 2020-07-24T19:44:10.351200Z

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

(refresh/inject-hook!)

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

aiba 2020-07-24T19:45:29.351800Z

and then the dev build has

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

aiba 2020-07-24T19:47:57.353400Z

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.

lilactown 2020-07-24T19:48:47.353600Z

hmm

lilactown 2020-07-24T19:49:04.354Z

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

lilactown 2020-07-24T19:49:33.354700Z

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

aiba 2020-07-24T19:50:02.355200Z

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

lilactown 2020-07-24T19:50:14.355500Z

yep, that should be fine

lilactown 2020-07-24T19:50:43.355900Z

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

MorongÖa 2020-07-30T08:03:15.361600Z

Yes, that seems to be the issue.