Fork me on GitHub
#cljsrn
<
2018-09-03
>
dottedmag12:09:26

Is there an explanation of what RN packager exactly does? I haven't found any in RN docs.

vikeri12:09:18

@dottedmag The packager is now called the Metro bundler. It does two things: 1. Bundles all the js code into a single file and adds some magic around it to make it run properly. 2. Runs a server in dev mode that serves the js file to the native layer (simulator or real device)

dottedmag12:09:31

So, is it really needed for ClojureScript environment, where we have Figwheel for development and cljs compiler compiling bundles for releases?

dottedmag12:09:56

"Needed" in the sense "cannot be avoided in principle", not in "has to be used right now".

vikeri12:09:44

@dottedmag In theory yes, some clear obstacles atm: 1. cljs not working as seamlessly with npm modules as metro 2. The “magic” that wraps the compiled JS Number 1 could be solved with something like shadow-cljs or additional progress in the npm-deps property, as long as they seamlessly can consume the RN npm packages Number 2 is probably a lot easier to solve as soon as you understand what it actually does

dottedmag13:09:35

@vikeri By magic you mean some kind of boilerplate code added by bundler, or transformation?

mfikes13:09:41

@dottedmag The very first foray into ClojureScript with React Native avoided using the bundler. Some discussion of that history is here https://clojurians-log.clojureverse.org/cljsrn/2018-05-07