Comments (6)
Per #29 I got this working with the latest helix code.
I'd suggest putting a note in the documentation that helix works with react-native, and that you need to tell the react-native dev simulator to "Disable Fast Refresh" when you do your own helix fast-refresh hooking.
from helix.
I haven’t used React Native since they introduced the Fast Refresh feature. Would you be willing to open a PR with instructions on how to get started with it? I bet others would appreciate it!
from helix.
Yes, I'd be happy to.
Hooking into react's own fast-refresh feature is a huge selling point for anyone working with react-native. Especially when using navigation libraries like react-navigation, which don't quite work with the other clojurescript ways of doing live code reloading. With helix, however, I have confirmed react-navigation works perfectly.
I will open a PR with instructions and examples, based on what I've learned.
from helix.
Great!
Please be aware, there's currently a couple WIP things about the React Refresh integration:
- Custom hooks are not invalidated correctly all the time; there are plans to leverage
defhook
to provide this functionality - When testing with web, transitive namespaces do not trigger a refresh. Example:
(ns app.a
(:require
[app.b]
[helix.core :refer [defnc]])
(defnc app
[]
(app.b/greet "Refresh"))
(ns app.b
(:require
[app.c]))
(defn greet
[name]
(str app.c/greeting ", " name "!"))
(ns app.c)
(def greeting "Bonjour")
Editing app.c/greeting
to "Hello"
will not trigger app.a/app
to refresh.
I'm not sure if this behavior is different in React Native; it is dependent on whether app.a
gets reloaded when transitive namespaces are edited. shadow-cljs on the web currently only reloads namespaces that directly depend on the edited namespace.
from helix.
shadow-cljs on the web currently only reloads namespaces that directly depend on the edited namespace.
Funny you should mention this. For this exact scenario, shadow-cljs now has a {:reload-strategy :full}
option. See thheller/shadow-cljs#349 (comment)
from helix.
Oh! That's actually fantastic; it had been on my mind to try and create PR for shadow for that and haven't had nearly the time to get spun up on it.
Noting that config option in the Fast Refresh docs would also be a good addition.
from helix.
Related Issues (20)
- Any good way to make multimethods work as component functions? HOT 8
- gensym / anonymous function syntax breaks fast refresh HOT 2
- Include resources in deps.edn :paths
- $ clj-kondo hook fails to lint & right when component is not a symbol HOT 1
- The $ macro and new JSX transform HOT 14
- `wrap-fx` is public HOT 1
- Wrappers for useTransition, useDeferredValue, etc. HOT 1
- Is it possible to bypass the camel-casing of properties? HOT 7
- Add wrapper around createRef with atom protocols HOT 2
- How to use with uikit? HOT 2
- Running tests in nodejs with jsdom HOT 4
- Companies using Helix HOT 1
- indent metadata on helix.dom macros HOT 3
- Create use-isomorphic-layout-effect HOT 6
- Make self-hosted CLJS compatible HOT 2
- Fix indentation with CIDER HOT 3
- Release request HOT 1
- Warning: React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead. HOT 2
- `helix.dom/tags` removed HOT 2
- defnc taking pre- & post-conditions HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from helix.