This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-02-09
Channels
- # announcements (4)
- # beginners (71)
- # boot (258)
- # braid-chat (7)
- # business (3)
- # cider (5)
- # cljs-dev (5)
- # cljsrn (64)
- # clojure (154)
- # clojure-canada (1)
- # clojure-poland (112)
- # clojure-russia (290)
- # clojurebridge (1)
- # clojurescript (60)
- # community-development (1)
- # core-async (25)
- # cursive (9)
- # data-science (1)
- # datomic (40)
- # editors (14)
- # events (2)
- # hoplon (2)
- # jobs (3)
- # ldnclj (51)
- # lein-figwheel (2)
- # luminus (1)
- # off-topic (5)
- # om (57)
- # onyx (29)
- # overtone (1)
- # parinfer (52)
- # portland-or (1)
- # proton (17)
- # quil (2)
- # re-frame (77)
- # reagent (1)
- # ring-swagger (20)
- # spacemacs (1)
- # test-check (4)
- # testing (13)
- # yada (1)
I’m trying something like this but I don’t think it’s equivalent: (def codepush (.-CodePush (js/require "react-native-code-push")))
nevermind, fixed my issue. if anyone’s using re-natal and wants to require js libs, run re-natal use-component <name>
@wei, your line is equivalent to codePush = require("react-native-code-push") .codePush;
in cljs that would be (def code-push (.-codePush (js/require "react-native-code-push")))
, I think
@pesterhazy: not quite. import codePush from "react-native-code-push"
would be codePush = require("react-native-code-push")
.
What you mean is import { codePush } from "react-native-code-push"
. That expands to codePush = require("react-native-code-push").codePush
can't say I care much for es2015 syntax
I wish I could use clojurescript but right now I'm deep inside a js project 😕 At least es2015 is better than what we had before
better yes
I'm updating a natal based om.next project to use RN 0.19, and I’m getting linker errors for Ambly classes. It looks like the lib files for the pods haven’t been built. How can I force the pods to be built?
@hugod: is it similar to this error? https://github.com/omcljs/ambly/issues/116
@hugod: Interesting. The first thing I’d try is opening the project in Xcode and doing a clean
I suspect I have messed something up in the project - I’ll try creating a new project and comparing the settings. My experience with xcode is pretty minimal, so that is probably not helping.
@hugod: I first successfully upgraded Ambly (changed the native/ios/Podfile
and did a pod update
), but and then tried upgrading to RN 0.19 (changed native/package.json
and did an npm update
), but then encountered the fact that RCTContextExecutor.h
has evidently been removed.
You can see that the React Native team shifted around the way JavaScript contexts are handled.
Oh…, the one in the Ambly Demo project? That AppDelegate just sets up a skeletal iOS app that can run the embedded JavaScriptCore instance, etc., but it is not doing anything related to (or in support of) React Native.
Yes, the one in the demo project. It looks like I should manually update the old AppDelegate.m file for RN 0.19 then, iiuc.
Yes… I think we need to figure out how to essentially replace the use of RCTContextExecutor
with whatever is appropriate for the newest React Native (crossing my fingers that we actually can), and submit a patch to Dan to incorporate into Natal if it is sorted out.
@hugod: On the surface, that looks easy to do. I’m going to give it a shot now. It looks like they simply moved from the C API to the Obj-C API (the opposite of what I did here http://blog.fikesfarm.com/posts/2015-05-23-ambly-using-javascriptcore-c-api.html)
@hugod: It turned out to be trivial: Replace the few references to RCTContextExecutor
to RCTJSCExecutor
and it cleanly compiles and works.
@hugod: No problem Hugo. I’m in debt to you anyway for Criterium Maybe paying off a little.
@hugod: Here is the actual change I made to the Natal generated project: https://github.com/mfikes/upgrade-natal-react-native/commit/e8d5bde809eda9c37f60a50e722e2986f8a81e26
@mfikes: Thanks. I’m glad you find Criterium useful. It still seems I have some problem in my project though, as I’m still getting the linker errors. I’ll keep comparing with a newly generated project, or just copy my source files into a new project.
@hugod: Cool. Yeah, after making those two upgrades (Ambly and RN), things actually work for me. So that’s at least a sample of a working project 😕
PR has been submitted to Dan https://github.com/dmotz/natal/pull/51
Can we currently add assets such as images directly via folder structure or do we need to do that via Xcode currently?
I’m using natal, cannot find doc or by trial/error where to put images for them to be found and loaded into the bundle without using Xcode’s mechanism
with boot-react-native and a recent version of react-native, like 0.19, you can just use the packager for that
not sure how that translates to natal
@hugod, (def code-push (.-codePush (js/require "react-native-code-push")))
something like that
Thanks, @pesterhazy, I’ve been trying something like that, but haven’t been able to get it to find anything that I js/require
.
what does the packager say?
also, are you using advanced compilation?
I’m using :optimizations :none
. I don’t see the component name (react-native-camera) in the packager output. Should I?
The problem is most probably because natal (same as re-natal) loads code bypassing the packager. Packager scans for all require(..)
statements and then knows what modules have to be bundled. So when code is not scanned the module you require is not available.
I guess :optimizations :simple would solve it, but then hot reloading will not work
it works with boot-react-native, because it fully embraces the packager
@pesterhazy: Does boot-react-native work with ios?
@pesterhazy: exactly, in re-natal there is a working solution command re-natal use-component
does the trick, but I do not know to implement that in natal.
I added a few changes lately to make it work pretty nicely with iOS (automatically start simulator and tail logs)
@drapanjanas: how does it work in re-natal?
@pesterhazy: I’ll take a look. @drapanjanas what does that command actually do, and would doing the same thing work in natal?
well, the command adds a require()
for you components to index.*.js files so that these are statically scanned by packager, results are stored in a map. Then the figwheel-bridge.js shims the require
which returns the components from that map
ah, that makes sense I guess
that works for sure
but solution depends on figwheel-bridge, natal is implemented differently I guess
same done for images in re-natal. The “images" dir is scanned for images and calls require
for all images are added to index.*.js