Fork me on GitHub

Hi guys 😃 , I using Re-frame + reagent-material-ui and i need reuse my header and footer in my other pages / components, how do i write this?


@anmonteiro Hi, I try to use :npm-deps according to your blog Requiring Node.js modules from ClojureScript namespaces. I declare {:npm-deps {:react "15.5.4", :react-dom "15.5.4"}}, when the page load, It complains Uncaught ReferenceError: process is not defined. It seems this is a internal dependency of React. how to solve this?


@doglooksgood yeah so React has the dependency on process.env.NODE_ENV which is available on Node.js


is that :npm-deps available for boot-cljs? and it seems like the only thing I need to do is :closure-defines {'process.env/NODE_ENV "production"} ? And I saw b/node-inputs in both this commit and the tutorial of JavaScript Modules on Is this necessary if I use :npm-deps?


this part really confuse me, since there're so many ways to require a foreign javascript library.


@doglooksgood you need to have the process.env namespace for closure-defines to override the goog-define. node-inputs is not necessary, that commit refers to a previous version of the ClojureScript compiler


and it works with boot-cljs, yes


still not work 😢 I have cljs task like this:

(cljs :source-map true
              :optimizations :none
              :compiler-options {:npm-deps {:react     "15.5.4"
                                            :react-dom "15.5.4"}
                                 :closure-defines {'process.env/NODE_ENV "development"}
                                 :closure-warnings {:non-standard-jsdoc :off
                                                    :global-this        :off}})
I add a src/process.env.cljs which contains (goog-define NODE_ENV "development") and I require process.env in my core.cljs. I can even use (println process.env/NODE_ENV) to print "development", but I still got the error. I guess I must missed something.

tianshu08:04:55 helped me a lot. It works fine on boot, now I'm trying to use it on figwheel.


Hey I'm in college and I'm working on my first app. After finishing a prototype in, I went on a hunt to discover the best technologies to use in making this actually happen. My goal is to learn Clojure and Clojurescript, then use with some react.js libraries to get an idea of how to build carousel component and node.js to connect with a serverless backend that has access to cloud functions like Firebase/Google Cloud or Lambda/AWS. I have a lot of learning to do since I just got in to college but Clojure with react has made me excited to actually make this dream come true. One question I had however was concerning connecting node.js with clojurescript. When I looked up solutions and how to do it, It seemed like you had to do a bunch of things regarding dependencies. At this point I don't even know if there is a solution for fully integrating the front end Clojure with the backend node.js cloud stuff. Does anyone know if there is a simple or clear way in doing this?


No there is no simple and clear way to do this. It is possible, but way too much risk to take on in a small project.


(and to be fair, you already have a ton of stuff to learn)


@tbaldridge thank you for the response. I guess I will just use datomic.