This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-12-10
Channels
- # admin-announcements (32)
- # announcements (4)
- # aws (25)
- # beginners (296)
- # boot (1)
- # cider (87)
- # clara (16)
- # cljs-dev (7)
- # cljsrn (41)
- # clojure (121)
- # clojure-art (26)
- # clojure-japan (4)
- # clojure-miami (190)
- # clojure-russia (168)
- # clojure-sg (3)
- # clojure-sweden (13)
- # clojurescript (138)
- # clojurex (7)
- # cursive (98)
- # data-science (2)
- # datomic (129)
- # devcards (10)
- # editors (5)
- # funcool (1)
- # hoplon (31)
- # jobs (1)
- # ldnclj (4)
- # lein-figwheel (3)
- # off-topic (2)
- # om (213)
- # onyx (33)
- # parinfer (7)
- # portland-or (1)
- # re-frame (19)
- # reagent (2)
- # ring-swagger (27)
- # slack-help (3)
@mfikes I thought these were indices to the components inside the registry, starting with 1
does anyone know how to get source maps to work in the chrome debugger?
X post: Does anyone have a link to some good examples of how to do interop between native iOS objects/functions and Om/React/ClJs?
can you elaborate a bit more? What are you trying to achieve?
So I have an existing app with a core data model and a bunch of business logic relating to those objects
And I have a uikit UI right now, but it's mostly just a placeholder. I want to try React out instead but I'm stuck on actually marshaling the objects into ClJs and getting events back out
Oh nice, I’m not the only one who is migrating the existing app to CLJS Most of the people here creating apps from the scratch
Like I want something akin to the Shrimp example attached to Goby, but using Om instead
Yeah it seems like everyone is just going pure cljs and I kind of like swift too
It seems like a good fit to have the UI layer in react and the rest of the app native
So, just to clarify - you would like to use React Native wrapped in Om-Next for UI and the *logic in native swift?
I kind of understand JSExport and such but React seems to resist this kind of thing to begin with
Yeah basically. I want my model objects in swift and the UI logic in Om
hm, let me think. I have the exact opposite currently - logic in CLJS and native UI
Well, have you checked this one first - https://facebook.github.io/react-native/docs/native-modules-ios.html#content
I looked at that but it was 4am so maybe I didn't quite understand what I was reading
re read what you wrote - your problem is to pass custom Swift class to JS world or what?
Yes, I want to be able to marshal my existing model objects (core data) into JS. I know to do that is JSExport but I don't know how that fits in with Om
Ah, got it - you want to go hardcore style
The fact that you use that word to describe this is mildly unsettling, but sure :)
Well it is possible for sure
Modules look like they're probably what I'm looking for. I'd just make a module encapsulating my data model... I see what you mean about hardcore though :p
well you can always pass data though RN *bridge, it support some basic types serialization by default + maps + arrays, but you would loose a context of core data
Hmm, that's awkward
I wouldn't exactly call that hardcore-- in any app, you're going to inevitably encounter the need for native modules. And they're actually quite easy to get rolling with
It makes sense, I suppose I'd just have to also pass an object id and retrieve it when I save or whatever
another way could be - find a reference to JSContext which is used inside by ReactNative and using JSValue just inject your model inside of JS context
Oh that sounds interesting
modules wouldn’t solve this problem actually - under the hood all the communication between JS and native world are still happening using bridge and some kind of serialization. I mean even though it’s a native module - you cannot transfer anything there. With JSValue you can
oh no, I guess I’m wrong, RN using JSContext and JSValues under the hood
Ahh okay. I have some new names to look up now :) thanks!
well yeah, you welcome. I’m not sure that RN exposes kind of stuff but maybe
I mean at worst I think I can just export some hooks from cljs and call into them using the context like you said
It's still very experimental right now so I'm happy to have at least a starting point
just checked - in RN it’s called executors and it looks like it’s private https://github.com/facebook/react-native/blob/master/React/Base/RCTBatchedBridge.m#L330
I had a bit different case at the beginning - I had to make a call from native to CLJS without any RN RootView and so on. So I’ve created react-native-eval https://github.com/artemyarulin/react-native-eval Which allows calling js eval from the native side
Maybe it would help if you going to build some kind of custom bridge between your native and cljs world
Yeah that looks helpful :)