Fork me on GitHub
#cljsrn
<
2016-01-05
>
mjmeintjes02:01:38

Hi. Just wanted to let you know that I've released a new version of https://github.com/mjmeintjes/boot-react-native today - 0.1.0. You can test it out by including [mattsum/boot-react-native "0.1.0-SNAPSHOT"] in your dependencies, and adding (before-cljsbuild) and (after-cljsbuild) to your boot build pipeline. This release features a major cleanup of the code, and copies decker405's figwheel functionality - hot reloading now works for both normal and Chrome modes. Also added some documentation and an example app. I also played around using Appium to test the reloading functionality - pretty cool for integration level testing of mobile apps, and definitely something that I'm going to investigate more. Check it out in example/integration-tests.boot.

artemyarulin06:01:22

@mjmeintjes: thank you! Really cool to hear about testing, gonna play with your project today

artemyarulin06:01:45

btw - hot reloading are coming to the react native, so I guess in boot-react-native you may drop the figwheel eventually. And actually re-natal and ktoa may also shift to the react packager as well. This is btw PR regarding appium and testing: https://github.com/mjmeintjes/boot-react-native/pull/5/files Another cool thing that happened during the night (I feel like a news reporter lol) is this one https://github.com/drapanjanas/re-natal/commit/768f191a635e4eda9feda075420f453c5f9cf3e4 Now with re-natal you can specify CLI params with a package name that you want to use and viola! you can simply use (js/require ‘react-super-package). Same thing should work for images as well, no more hassle with looking for package ID and hardcoding that into your source and so on

dvcrn07:01:01

might be a newbie question but I'm not that deep into clojure yet. What would boot give me that lein doesn't

jethroksy07:01:13

composability

jethroksy07:01:36

you can define your own tasks like:

jethroksy07:01:29

(deftask dev
  "Run a restartable system in the Repl"
  []
  (comp
   (environ :env {:http-port "3000"})
   (watch :verbose true)
   (system :sys #'dev-system :auto-start true :hot-reload true :files ["handler.clj"])
   (reload)
   (cljs :source-map true)
   (repl :server true)))

jethroksy07:01:23

so if you want to have sass stylesheet compilation and stuff you just slot it in then run boot dev in your command line

artemyarulin08:01:29

yeah, with mobile development where we have to take care about different things and where build process is more complicated boot approach looks better

mjmeintjes09:01:54

What I like about boot is that it gives you a lot of control over your build process. From my experience, with lein you are mostly stuck with what is provided to you, with boot you can very easily add some functionality into your build pipeline. For example, in boot-react-native I only had to focus on implementing react-native specific functionality, and got the rest (repl, reloading) for free.

mjmeintjes09:01:19

@artemyarulin Cool, didn't know hot reloading was coming to RN. I'm not using figwheel, rather the normal cljs-reload task. Basically, all boot-rn does is override Google Closure js loader functionality to work in react-native environment.

artemyarulin09:01:41

@mjmeintjes: You mentioned and copies decker405's figwheel functionality so I thought that you started to use figwheel as well, no?

mjmeintjes10:01:50

No, just re-used a lot of the JavaScript code from decker405's project. Boot reload is pretty heavily based on figwheel (in fact I think they are busy replacing the back end with figwheel core) so most of the code from decker405's project was transferrable.

artemyarulin10:01:21

oh, that’s cool

artemyarulin10:01:43

so just to clarify - with boot and boot-reload there is no need to use figwheel?

magomimmo10:01:08

@artemyarulin: you could eventually take a look at https://github.com/magomimmo/modern-cljs and particularly at the 16th tutorial https://github.com/magomimmo/modern-cljs/blob/master/doc/second-edition/tutorial-16.md That said, your work is awesome!

artemyarulin10:01:52

Thanks, I’ll have a look

mjmeintjes10:01:53

@artemyarulin Yeah, no need for figwheel or lein - all you do is add the 2 tasks (before-cljsbuild and after-cljsbuild) to your build pipeline and everything (reload and repl) should just work. See example project's build.boot for working example.

artemyarulin10:01:29

nice, really cool, didn’t know that boot has to much staff.

mjmeintjes10:01:22

The more I use boot the more I like it. Recently discovered it has shebang support for writing single file, self contained clojure scripts that automatically pulls in its own dependencies - really cool for writing quick scripts.

adamfrey16:01:21

Related to ^boot scripts^, be sure to add these BOOT_JVM_OPTIONS to your environment: https://github.com/boot-clj/boot/wiki/JVM-Options. Doing that yesterday caused my script to startup about twice as fast.