-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Experimental :fast-refresh feature is broken #29
Comments
In the future, please report what you mean by "broken." e.g. if it doesn't reload at all, or throws an error, etc. That was fixed in 7edfe88. I'll prepare a new release soon, but in the meantime you can depend directly on that commit using deps.edn. FWIW, the fast refresh support is still very experimental and does not work in all cases: edits to namespaces which components transitively dependent on will not trigger a proper refresh. |
@Lokeh sure. |
Ah, I think another change I made is biting you. Apologies for the out of date documentation. In order to enable fast refresh, you must also create a function to inject the global React devtools hooks, and an after-load hook that will call An example would be: (ns my-app.dev
(:require [helix.experimental.refresh :as refresh])
(refresh/inject-hook!)
(defn ^:dev/after-load after-load []
(refresh/refresh!)) And include this in your app at dev time. With shadow-cljs, adding it to your preloads should work. Let me know if this does or does not fix it for you. Thanks! |
Looks like |
You can use dep.edn with shadow-CLJS as laid out in their user guide. I will cut a new release tomorrow. |
@Lokeh thank you! |
Oh wow, thanks for pointing this out! Using that, I got fast-refresh working with react-native. I realized you actually want to tell react-native to "Disable Fast Refresh" in the simulator. Otherwise, it tries to do its own fast-refresh hooking which does not jive with shadow-cljs recompile/reload cycles. Anyway, here's a working example project for anyone interested: https://github.com/aiba/helix-react-native. I'm really excited to port all my hx code to helix and to be able to use fast-refresh! |
Yes, you should configure your project to only include this code in development - either by |
@Lokeh thank you. Everything works great! |
This feature was broken in this commit 0ac5b18
The text was updated successfully, but these errors were encountered: