This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-08-05
Channels
- # admin-announcements (3)
- # architecture (1)
- # beginners (16)
- # boot (14)
- # cljsrn (205)
- # clojars (4)
- # clojure (100)
- # clojure-austin (2)
- # clojure-india (1)
- # clojure-poland (7)
- # clojure-russia (95)
- # clojure-spec (25)
- # clojure-uk (127)
- # clojurescript (32)
- # core-async (7)
- # cursive (2)
- # datascript (4)
- # datomic (3)
- # editors-rus (1)
- # emacs (8)
- # events (10)
- # funcool (5)
- # gorilla (2)
- # hoplon (6)
- # jobs (1)
- # lein-figwheel (7)
- # leiningen (2)
- # luminus (11)
- # om (7)
- # onyx (119)
- # other-languages (31)
- # proto-repl (1)
- # proton (37)
- # protorepl (3)
- # re-frame (60)
- # reagent (8)
- # spacemacs (9)
- # specter (21)
- # spirituality-ethics (2)
- # yada (10)
So advanced compilation doesn’t work with react-native? Anyone know the reason and if it’s fixable?
@seantempesta: It works, did you add rn externs?
You mean requiring other react-native libraries?
No, I mean you need https://github.com/artemyarulin/react-native-externs
or any other way how to obtain externs for RN
and then externs for other libs yeah 🙂
oh…wow, that sounds like a lot of work. I’m using a lot of libraries. So it won’t work without the externs?
It looks like the js/require statements are still in the output. Shouldn’t the react native packager work normally?
well, this is a way how advanced compilation works - without externs file Google Closure rename a lot of important staff
bummer. I saw a huge reduction in code size.
indeed, or another way you can always communicate with external libs not like jQuery.addClass
but jQuery[‘addClass’]
so the name would be the same. But it’s ugly as well 🙂
I guess you should check other minifiers which are not that aggressive, although the result wouldn’t be that good
nah, it’s okay
I’ll worry about this kind of stuff when my app is actually making money
what are you building if I may ask?
Contact management application for non-profits (specifically after school programs). Maybe targeting schools too (attendance tracking, parental communication, etc.)
both OS?
iOS and Android and web
oh nice - have you found a way how to share code between RN and web?
I’ve heard about react-native-web and other projects
Well, the majority of my code is in re-frame subscriptions, so that should transfer well.
I haven’t thought about react-native-web yet
Cool, do you use clojure on backend as well?
eventually I’d like to, but I’m using Firebase at the moment
I think advanced compilation is not necessarily worth the effort
oh yeah, heard good things about it. But yeah - I really like that I can use Clojure almost everywhere nowadays
on react native
because bundle size doesn't matter as much as on the web
It already feels like a monumental amount of work to develop for 3 platforms without tackling authentication, authorization, secure websocket connections, etc..
@pesterhazy: There are still to cases for that: 1) If you want to do hot deploys and do it daily or more often (like we used to do in web) 2) GC is best obfuscator - not a big deal for certain cases, but it drives me crazy a bit that somebody can unpack bundle and recreate the app in 10 minutes 🙂
both valid points
plus :advanced gives you speed benefits too
you mean JS performance? Haven’t heard about it
well I assumed that given a whole view would enable optimizations like inlining code
oh yeah, true
e.g. disable code due to goog.DEBUG=false
but I think it's not a monumental gain
but in general yeah - it’s time consuming to create externs for different libs. So like @seantempesta said - only when you get some money from app 🙂
also, create externs and publish them at cljsjs, for everyone's benefit 🙂
yeah, I was thinking about it for rn-externs, but was too lazy for that, shame on me 🙂
to tie in web, maybe this? https://github.com/artemyarulin/ktoa
Anyone can send me an product hunt invite? Finally get app to beta test, thought maybe product hunt and hacker news are good places. Suggestions welcome!
By the way, I've made a website, https://www.lymchat.com/
@tiensonqin: looks great
@pesterhazy: Thanks, It took me nearly 2 months to build this, actually it's my first app, 😄
congrats
is it cljrn based?
Yes, backend is clojure, web and app both re-frame
really nice!
I use realm.js in app, It really saves me
@savelichalex: Thank you!
Even with realm, I still really want datomic/datascript for mobile.
I thought about using realm, but ended up using datascript. It’s been a love/hate relationship. 🙂
hey @pesterhazy. How do you require images in boot-react-native? The react native packager can’t seem to find them.
I have to store contacts and chat history in disk, so datascript along not works for me.
@seantempesta: let me check
that'd be a good next post for my blog series
ok so I use this macro to point to the file:
(defmacro static-img [filename]
`(js/require ~(str "../../../app/imgs/" filename)))
second, for reloading I always use defonce
d vars for images so the packager doesn't get confused
third, you need to make sure the imgs
folder is in packager root (I think!)
cool, that works.
thanks!
well done @tiensonqin! The second app goes so much faster 🙂
@coyotespike: Thanks!
It's both cljs and rn communities' merit, especially the big @dnolen and @mfikes. Really thanks!
@tiensonqin: why not do blog post about our experience?
I'd be interested
Actually I'm writing it now!
I'm chinese, and now it's 9:42pm here, Maybe tomorrow I can finish it. Not good at writing in english, will try my best.
I've noticed there's a lot of interest in RN from china
@pesterhazy: All i can say on my experience is: Clojurescript rocks and npm sucks!
a lot of npm RN packages are built by people with Chinese names, at least
Yeah, a lot guys around me are interested in RN, clojure, erlang
@seantempesta: I've added https://github.com/mjmeintjes/boot-react-native/issues/67 to track the lack of documentation
@tiensonqin: that's awesome to see people interested in those technologies
Since there are a lot companies can't find native developers in china.
@pesterhazy: with logging all rolled together in BRN, how do I get a pretty-print of an object with console.log?
if people are interested in React and RN, I think it shows they have a good sense of what's important in computing
@boorad: what are you using to show the log?
actually we're looking for an Android freelancer at the moment, and it's not easy find someone
in which command?
yeah react-native log-ios
is a good start. What's your issue with it?
yeah that's a bug in an older version
so you shouldn't use boot print-ios-log
anymore
instead, use react-native log-ios
directly
in a separate terminal window
that'll give you the complete output
@pesterhazy: Hope you find the right person.
hehe 🙂
yeah I found that it's pretty confusing to ahve all the output intermingled
@boorad: I also use this filter: https://gist.github.com/pesterhazy/a26da0130fd735f66c4f7542f5e3bf12
to remove all output not related to my app
it's necessary because the iOS simulator is incredibly chatty
“chatty” is a kind way of putting it
logorrhoea
@boorad: thanks, removed the reference in SimpleExampleApp: https://github.com/mjmeintjes/boot-react-native/commit/f9010e681f404b4aa32cb4d63a62380e6af63e09
@boorad: is latest master working for you? I'm thinking of making a clojars release of 0.3.0 soon
I have most of our patches in master, but was just about to look at any changes you may have made
matt's master, yes -- I've force-pushed develop to replace master
no, that's gone
here's my blog post on how to get things working with 0.3: http://presumably.de/boot-react-native.html
also check the new troubleshooting section 🙂
I was seeing weird things with 0.30 and just grasping at straws… so I am on 1.9.89 of cljs. Like I said, tearing things apart.
cool. remember to boot inst
to install it into your maven repo
does the cljs version make a difference?
not sure yet on cljs version - so many errors from RN version mismatches and release cycle
@boorad: it should be boot inst
: https://github.com/mjmeintjes/boot-react-native/blob/master/build.boot#L25
yeah, I've been working on the RN update of our app for a whole week now
all the deps need to be updated because of the react-native/react-dom split
ah maybe build-jar works too, who knows 🙂
@seantempesta: now I'm seeing "FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory" as well with latest RN packager
I almost fell out of my chair when the upgrade from RN 0.25 —> 0.30 "just worked"
@pesterhazy: well, you could try my patch/hack?
I will
Has anyone tried using react-native-navigation? I’m currently living with an iOS developer and he’s been rolling his eyes at the non-native transition stutters in my app. https://github.com/wix/react-native-navigation/
I’m not sure that’s the best reason to replace navigation, but this solution seems promising.
@seantempesta: I’ve been trying to use your RNRF - should I abandon?
the whole situation is so confusing
so there's
hmm, that’s your call. I’ve pretty much got my whole app running on it.
1. NavigationIOS
2. Navigator (pure js)
it certainly works, but it helps if you never look at that codebase. it’s a shit show.
3. Navigation
NavigationIOS works ok (and uses native transitions) but sort of (?) deprecated
yeah, I just loaded up the example app in react-native-navigation and it’s buttery smooth
My iOS developer friend just said, “yeah, use that"
I’m trying to get it running on the Android simulator so I can see what it looks like there
@seantempesta: how's the api of that?
is it a bit less ... cumbersome than the stock Navigator?
It seems similar to most. You’ve got global access to some things, and others you’ve got to deal with navigator objects passed through props.
I’m trying to think of a way to abstract all that crap away, but it’s not a functional solution at all so it’s going to be messy
but that company, Wix, seems dedicated to building a truly multiplatform native solution. I’ve been watching their issues for a while and they are super responsive. Might be safer to wait for the version 2.0, but it actually seems pretty usable as is as long as you aren’t too picky about some styling.
sounds good
I'm looking to replace my use of navigatorios soon
our code is icky
I can imagine. When I saw Facebook was deprecating it I didn’t even try it out.
as far as I know @madvas create some wrapper around react-native-navigation
that'd be interesting
oh yeah? I’d love to not start from zero
it'd be great to build a library of components, already pre-wrapped for cljs
with usage examples 🙂
UIExplorer)
pretty much
I’m create navigation smth like this: https://github.com/savelichalex/friends-teach/blob/master/src/teach_by_friends/shared/ui.cljs#L86-L116 Sorry for formatting)
Okay, I just got the android emulator working and it’s not running well
Like many options in the same example that works great on iOS just crash
plus the tabs are on the bottom, which isn’t standard for Android right?
yeah, okay, since I need to support Android I think I’ll let this bake a little while longer
You can see some react-native-navigation here https://github.com/madvas/catlantis . May be a bit outdated though
holy crap those are long lines, savelichalex
@pesterhazy: did that gc hack fix your packaging woes?
smth bad happened with my code 🙂
main idea is control navigation by app db in re-frame terms
yeah, I like it
@seantempesta: I tried setting goog.DEBUG to false first, didn't help
trying your hack now
@seantempesta: does the command line also affect the worker processes?
I guess GC is more difficult if it runs across multiple processes
That hack works for all of the launched processes
which might be redundant. I don’t really know much about node. 🙂
@seantempesta: holy moly, that worked
kind of amazing, right?
@seantempesta: :medal:
also kind of sad
thinking about it
maybe you can also just make it only use a single worker
personally, I’m just happy it works
because evidently the issue is to do GC when you don't have a shared view of the system, effectively fragmenting the available memory
it also seems to cache intermediate output files, because if I re-run it it works
@seantempesta: I tried it, and just adding --max_old_space_size=4096
also does the job for me
yeah, that worked with me for a while, and then I added another require
and then that stopped working too
it's definitely a step in the right direction
@seantempesta: added that part to boot-react-native
: https://github.com/mjmeintjes/boot-react-native/commit/de752982cfc850f80c67ee472b3891b404844221
try setting goog.DEBUG too, may help
what's a good android phone to get nowadays, for testing?