This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-04-30
Channels
- # admin-announcements (3)
- # arachne (8)
- # beginners (5)
- # boot (52)
- # braveandtrue (4)
- # cider (17)
- # cljsrn (1)
- # clojure (36)
- # clojure-dusseldorf (2)
- # clojure-india (1)
- # clojure-russia (30)
- # clojure-uk (1)
- # clojurebridge (1)
- # clojurescript (47)
- # clojutre (1)
- # component (1)
- # core-async (3)
- # cursive (5)
- # datascript (1)
- # datomic (4)
- # emacs (1)
- # error-message-catalog (62)
- # garden (3)
- # hoplon (16)
- # jobs (5)
- # luminus (11)
- # mount (1)
- # om (32)
- # onyx (17)
- # spacemacs (4)
- # untangled (20)
- # yada (4)
I have a naive question. I’ve made an uberjar, but every time I try to run it (java -j myuberjar.jar) it just starts the repl.
I’m not a java guy, but I don’t understand what would you want that uberjar to do in clojurescript context. Are you using leiningen?
in clojure context I understand that uberjar runs your clojure (java) code, but clojurescript is javascript
Whole point of CLJS is that it compiles into standard ES5 Javascript without the need for Java
I’ve been googling and I can’t find anywhere that tells me what I need to do to package it up.
I assume it needs the html as well as the compile js. Is there a tool for deploying a cljs web site?
Essentially, once you compile the code, you should be able to just load it onto any web-server and it should work. Its just javascript.
If you’re curious about stats for Replete (iOS ClojureScript REPL), here they are: (That’s right, no crashes!): http://blog.fikesfarm.com/replete-stats.png
I personally like reagent and reframe because I prefer frp however, om next and rum are both fantastic choices as well. maybe try making a simple app in each and see which one fits your mental model the best?
@adamkowalski: Where can I find good learning ressources about reagent
https://reagent-project.github.io/ then read this: https://github.com/Day8/re-frame
Has anyone here been able to successfully use cljsjs/react-dom-server
on Node.js? I’m trying it out and am encountering a Node.js module problem:
1. When I compile any CLJS code that uses both cljsjs/react
and cljsjs/react-dom-server
(versions 15.0.1-1), with CLJS-compiler option {:target :nodejs}
,
2. and then run the code in Node.js,
3. when cljs.react.dom.server
is required,
4. line 16 of out/react-dom-server.inc.js
is run,
5. which causes Node.js to attempt to run require(‘react’)
,
6. which Node.js then fails to find, throwing the error Error: Cannot find module ‘react’
.
The responsible line is the fifth one (when copyright is excluded) in https://github.com/facebook/react/blob/master/vendor/react-dom-server.js#L5.
I suppose I could put a root-level package.json
, with a dependency on react
’s NPM package, into my compiler-output folder…but that strikes me as kind of weird and convoluted.
What do people who use cljsjs/react-dom-server
do?
I'm trying to get optimizations:none
to work in my chrome extension. The trick is to get Closure to load stuff from the right places. The obvious thing to do was to set asset-path
to the chrome extension URL, like "chrome-extension//[some-id]". That sort of works in that it finds and loads my cljs_deps
file. The problem is that that file looks like:
goog.adddependency("base.js", ['goog'], []);
goog.adddependency("../cljs/core.js", ['cljs.core'], ['goog.string', 'goog.object', 'goog.string.stringbuffer', 'goog.array']);
//more stuff
In other words, it seems to assume that cljs_deps
is in the goog
subdir. Does providing an absolute URL for asset-path
just not work, or am I missing something obvious?@isaac_cambron: All I can add is that all of the :none
environments I’ve worked with end up having to cope with that directory structure.
Hmm, yeah, it doesn't seem to have anything to do with :asset-path
, actually
I'm not sure how it's supposed to fit together, i guess
Meaning, I’ve had to specifically add tiny bits of code in each thing to accommodate it. In other words, what you are seeing is a real thing, FWIW.
hmm, ok, thanks
Here is one small example where goog
crops up (they all end up involving something along these lines): https://github.com/omcljs/ambly/blob/master/ObjectiveC/src/ABYContextManager.m#L145
that's disheartening. i was hoping you'd say "You're just misunderstanding how closure loads code. Do this one obvious thing."
I think this may be the same… but it has been over a year since I’ve looked at this bit of code: https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/repl/node.clj#L124
yeah, that does look the same
cool, i'll start there
It typically involves an extra ”goog”
and then things like ”../“
take care of popping back out of it and it all pans out in the end.
yup, makes sense
a little confused on why it's like this in the first place, though
yeah, I must be missing something. The compiler goes out of its way to remove that goog
: https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/closure.clj#L1661
@isaac_cambron: not sure what is your exact issue without providing full project.clj - in my sample extension project I didn’t have any issues using leiningen + cljsbuild in both dev and release modes, using relative :asset-path
tough
Cool, I'll check it out (though I'm not using Leing). I'm increasingly confident my issue is some of the build wackiness I'm doing, which is reassuring, actually
yeah, it's very cool. If I were starting a new project, I'd almost certainly use it