This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-04-30
Channels
- # beginners (11)
- # boot (18)
- # cider (36)
- # cljs-dev (17)
- # cljsrn (5)
- # clojure (144)
- # clojure-android (4)
- # clojure-art (1)
- # clojure-brasil (1)
- # clojure-dev (5)
- # clojure-india (1)
- # clojure-russia (13)
- # clojure-spec (4)
- # clojurescript (15)
- # code-art (2)
- # cryogen (1)
- # defnpodcast (1)
- # hoplon (1)
- # leiningen (5)
- # off-topic (18)
- # om (4)
- # onyx (25)
- # parinfer (1)
- # pedestal (6)
- # portkey (1)
- # re-frame (16)
- # reagent (1)
- # uncomplicate (1)
- # unrepl (10)
- # yada (16)
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
you can work around it like I did in this commit: https://github.com/anmonteiro/om/commit/686921531c7bcbbd75804e6b9240b12d92eaaa5f
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 http://clojurescript.org. 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.https://github.com/anmonteiro/xact 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 http://proto.io, 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 om.next 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.