This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-01-11
Channels
- # admin-announcements (8)
- # announcements (1)
- # boot (343)
- # braid-chat (23)
- # cider (20)
- # clara (5)
- # cljsrn (48)
- # clojars (5)
- # clojure (90)
- # clojure-canada (3)
- # clojure-czech (1)
- # clojure-russia (107)
- # clojure-sg (2)
- # clojurebridge (2)
- # clojured (10)
- # clojurescript (70)
- # community-development (73)
- # cursive (106)
- # datavis (40)
- # datomic (40)
- # docs (4)
- # editors (1)
- # emacs (1)
- # events (4)
- # funcool (2)
- # hoplon (46)
- # jobs (2)
- # ldnclj (11)
- # mount (8)
- # om (214)
- # onyx (12)
- # re-frame (35)
- # reagent (31)
- # spacemacs (12)
- # yada (18)
Hi there! I have a part-web, part-node app. I have the source in two different src-folders. Since I’m using Reagent for the web-part, I currently have a reagent.core/atom
for the state, but that leaves me with a problem in the node-part, since I cannot/don’t want to require Reagent there.
Now, since the r-atom and the regular atom have the same interfaces (at least the part I am going to use), the solution could probably be to include a my-app.state
namespace in both src-folders, where the atom will be defined.
But in a way that seems like a hack to me. What do you reckon? Is it idiomatic to have two namespaces with the same “interface” in each their src-folder?
Or maybe I should have a shared namespace with a function taking an atom, and let each target initialize the app with an atom of their liking?
Kind of a shot in the dark I guess, but I’m getting an error in the console after compiling with optimizations for whitespace or advanced. Of course, it works with no optimizations. It’s an Om Next app. The console error for :advanced optimizations is:
Uncaught TypeError: Object prototype may only be an Object or null: undefined
is there a good resource for learning about how to set up :advanced optimizations? a lot of the instructions that I’ve seen are pretty straight-forward… which is great, but I don’t know how to go about debugging.
@mudphone: :pseudo-names[1] and Chrome DevTools is your best bet, I guess. Note, you should also be aware of the “Pretty print” feature in Sources panel. That will help you ,make sense of minified code. Look for “{}” in status line of source view in DevTools. https://github.com/clojure/clojurescript/wiki/Compiler-Options#pseudo-names
You should be able to break on uncaught exceptions and that with above two tools should give you pretty good idea where is the problem in optimized code
@mudphone: do you have other JS on the page?
IME runtime issues with advanced compilation are most often caused by other scripts redefining variables. There's an :output-wrapper
compiler option to avoid those clashes
Hi! Question regarding REPL with Node.js: Has anybody tried running cljs REPL to remote Node.js?
i.e. to run (for example) cider+java+clojurescript on one dev machine and hosting node on another?
as far as I can tell from src code, cljs.repl.node assumes that they are both on same machine and exchange code using shared filesystem
@dnolen thank you. The use case: remote nodejs runs on ARMv7 (like eg RapsberyPi) so I am looking to a way how to develop without running cljs in java
@skardan: if you just want to do some light interactive dev - the above should be enough
if you want something fancier you’ll probably want to consider a fancier custom REPL design a la Ambly
so you suggest nodejs runs cljs-in-cljs and I connect with socket repl (or inerior-lisp-mode)
anyone using https://github.com/STRML/react-grid-layout/ as a cljsjs
package?
@skardan: I suspect that, if you can mount a filesystem on your ARMv7 device (you could do this manually), with some slight tweaks to the Node REPL code (to use :output-dir
and to cope with connecting to a remote Node instance—dealing with stdout, for example), you could pull this off. Take a look at how Ambly works and you could envision a similar thing for Node.
@mfikes thanks, I guess something like nfs could be enough. I am looking to your source code in Ambly and you communicate the files using webdav, right?
@skardan: In fact, you can probably just pass :output-dir
as a compiler option to the existing Node REPL if you set up the mount point ahead of time.
@skardan Ambly actually has the OS do the WebDAV mounting. Beyond that, the ClojureScript compiler thinks it is talking to a regular local filesystem.
is there something like alter-var-root
for cljs?
or even a way to just redefine a var?
@eyelidlessness: doesn’t exist, but you can just set!
@dnolen: thanks!
@dnolen: I’ve looked in https://github.com/emezeske/lein-cljsbuild/blob/1.1.2/example-projects/advanced/project.clj and the only thing I can find is how to run the tests (eg :test-commands
). Doesn’t seem to specify a test build per se, just a build called “test"
@grav: if your cljsbuild build doesn't have an :id
, give it one (the old map format uses the key for the id i believe), then use lein cljsbuild test <whatever-id>
my build does have an id, but what you specify with lein cljsbuild test <id>
isn’t the target id, it’s the :test-commands
id
The :test-commands
id just specifies /how/ to run the tests. It doesn’t specify what to compile
@grav: that isn't what i'd expect, but a workaround would be to use a :notify-command
in the cljsbuild build, rather than :test-commands
Okay, it’s not the biggest of deals in a CI context. It’s more a matter of being able to quickly re-run tests locally, but then again, the compilation of the test-target alone is pretty slow.
@eyelidlessness: ok, i’ll look into that one
it takes a vector of the cli strings, just like the vector in :test-commands
(then call lein cljsbuild once <id>
rather than test)
@eyelidlessness: ah, great. and then can I use it with cljsbuild auto
to evaluate tests repeatedly?
@grav: I think you want to use lein with-profile
, this way you can limit what part of your cljsbuild map is effective
@grav: see the “test” profile here https://github.com/binaryage/chromex/blob/master/project.clj
@grav you might be interested in https://github.com/bensu/doo for running the tests without thinking about the runners
it works very well (on Linux) - I share a directory using sshfs (do not want to spend time setting up nfs)
then set :output-to "/tmp/cljs-repl" and invoke node using :node-command (which invokes remote node)
Does anyone have experiences with i18n w/ Closure? Tower does an ok job but I'm wondering if there might be something nice that could be built on top of Closure. Hard to find any sort of guide /cc @nullptr maybe you have some pointers?
not aware of any guides — have done a decent amount of i18n stuff but all “guidance” was via digging through closure-library source
Does Om Next support query subscriptions like Meteor? If not, now how would you go about that?
@faceyspacey: probably best to ask in #C06DT2YSY
I also recall that this has been asked before so maybe it's in some FAQ already
@martinklepsch: yes, I have a separate js file for the Phoenix Framework’s default JS.