Comments (3)
Hi @fonghou ! It’s so great you were able to test pre-release version of Rum. It’s also awesome you’re using it for ReactNative. In fact, I’d love to hear more about your experience with it. I’d like to support RN one day in Rum. Do you need to change a lot? Is it working as-is?
Regarding your problem, would something like that work?
(def ^:private batch
(if (exists? js/ReactNative)
js/ReactNative.unstable_batchedUpdates
js/ReactDOM.unstable_batchedUpdates))
...
(defn- render []
(let [queue @render-queue]
(vreset! render-queue empty-queue)
(batch render-all queue)))
from rum.
Hi @tonsky, I just checked out master. It works great! Thanks!
Rum actually works out of box as-is thanks to the awesome work from re-natal folks. For me, it's definitely the best workflow and environment for learning and/or prototyping mobile app.
Only thing that has to be excluded is sablono because of ReactDOM like this.
[rum "0.9.1" :exclusions [cljsjs/react cljsjs/react-dom sablono]]]
And define react comp factory functions as below.
(defn create-element [rn-comp opts & children]
(apply js/React.createElement rn-comp (clj->js opts) children))
(def ReactNative (js/require "react-native"))
(def app-registry (.-AppRegistry ReactNative))
(def view (partial create-element (.-View ReactNative)))
(def text (partial create-element (.-Text ReactNative)))
(def text-input (partial create-element (.-TextInput ReactNative)))
(def list-view (partial create-element (.-ListView ReactNative)))
...
In case you'd like to add some macro helper for above boilerplate (btw, I don't miss sablono that much as it's very DOM centric. Maybe a sepearte shorthand syntax for flexbox css?)
Regards
from rum.
I’ll try to figure out the best way to use Rum in both DOM and RN
environments, taking into account your advice. I’m very eager to try it out
for mobile development—the only problem being finding a free time for that
:(
On Fri, Jul 1, 2016 at 12:07 AM Fong Hou [email protected] wrote:
Hi @tonsky https://github.com/tonsky, I just checked out master. It
works great! Thanks!Rum actually works out of box as-is thanks to the awesome work from
re-natal folks. For me, it's definitely the best workflow and
environment for learning and/or prototyping mobile app.Only thing that has to be excluded is sablono because of ReactDOM like
this.[rum "0.9.1" :exclusions [cljsjs/react cljsjs/react-dom sablono]]]
And define react comp factory functions as below.
(defn create-element [rn-comp opts & children](apply js/React.createElement rn-comp %28clj->js opts%29 children))
(def ReactNative (js/require "react-native"))
(def app-registry (.-AppRegistry ReactNative))
(def view (partial create-element (.-View ReactNative)))
(def text (partial create-element (.-Text ReactNative)))
(def text-input (partial create-element (.-TextInput ReactNative)))
(def list-view (partial create-element (.-ListView ReactNative)))
...In case you'd like to add some macro helper for above boilerplate (btw, I
don't miss sablono that much as it's very DOM centric. Maybe a sepearte
shorthand syntax for flexbox css?)Regards
—
You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub
#77 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AARabOKOgFhe5nmB7-B2KQJVc0s5FHeLks5qRAXMgaJpZM4JBdN4
.
from rum.
Related Issues (20)
- rum/fragment with React components HOT 2
- optimizations :advanced (shadow-cljs) failing on simple :form :input
- defc error with shadow-cljs. Makes Rum unusable for me... :( HOT 22
- daiquiri: fragment? fails on vectors HOT 13
- Question about rendering performance when updating state asynchronously HOT 9
- should-update error
- Big performance regression between 0.11.5 and 0.12.3 HOT 9
- Server/client difference when rendering nil HOT 2
- require-lazy macro unnecessarily prescriptive about namespace/module structure HOT 1
- Error when use `rum/local` and `rum/use-callback` together HOT 2
- Hydration not fully compatible with React 18 HOT 4
- bind-context produces unfixable infer warnings HOT 3
- `with-key` and `with-ref` Removing children? HOT 2
- ClojureScript >=1.11.51 seems to break Rum HOT 4
- ClojureScript >=1.11.51 seems to break Rum HOT 3
- How to use daiquiri.core/html ? HOT 9
- How can I use npm based react library I rum ssr mode HOT 4
- Live Examples Missing HOT 1
- Hulunote(a tool for networked thought) use the rum😄
- Interpretation warnings print var symbol instead of the value
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 rum.