Fork me on GitHub

@darwin : are you aware of any codebases that writes a nrepl client in cljs over websocket? (I'm looking for codebases to read / study)


(pinging you directly given the insane things you've already done with dirac / nrepls)


what is the most lightweight websocket library out there?


just use js/websocket !


no library needed afaict


Is there a way to have google closure minify in such a way that symbols do not start alphabetically (a,b,c,d). Tried confuscate.js but it slows down the code too much. I'm in a bit of "my boss told me so" situation, the symbols just can't start alphabetically. Someone has ideas?


there's :pseudo-names?


nice nice, didn't know of that one, thanks!


it's even less obfuscating than the default, so it may not help with your problem


@qqq there is no nrepl client implementation in cljs AFAIK


yes, it's used seemingly for debugging. It's not helping with my problem, but I'm glad to learn about this anyway.


what could possible be a reason for the "non-alphabetical" requirement?


we want to "make it harder" to decypher the production code. How I see it, if someone wants to decypher a js code, he's/she's going to succeed, just a question of how much pain that person needs to go trough.


we were using yps gen from yahoo (before I started), I'm hoping we can stop using that.


I think I may end up with using confuscate on a low setting, (still almost 2x larger), describing symbols in unicode bloats the code. But hides it a bit yes.


I have an older cljs codebase that integrates fine with a third-party js library in both simple and advanced optimizations. Without changing any code, I upgraded to cljsj 1.7+. It still runs fine in simple opts. But when I compile my codebase with advanced, I get strange undefined errors from the other library. My guess is renaming is at issue. However, the functions it says are not defined are not functions I call in my own code. Any idea what could be the cause of this when simply upgrading cljs?


@ajs multiple possible reasons: 1) upgrade of Google Closure Compiler which does different/more aggressive renaming 2) new version of ClojureScript compiler which emits javascript with different structure 3) undefined behaviour - your code was invalid before, but the bug didn’t manifest until the code got shuffled in a different way 4) something else


if I call out to a third-party js function, that function should be in an extern. but if that function then calls another function in its own internal library, that shouldn't concern my extern file, right?


ok, that's strange. runtime error for a function i never knew existed, but only with advanced. i'll keep digging.


:pseudo-names is your friend


so that 3rd party library is outside of your cljs build, right? is it minified?


yes it is


that is, i include it directly on the html page with a script tag, and then i call functions within it using js/


this sounds like a naming clash, some fn in your 3rd party lib got renamed to abc and cljs :advanced build happened to rename some of its function to abc, then your 3rd party lib is calling your lib unintentionally


if you use non-minified version of your 3rd party lib, the problem is much less likely, because closure compiler tries to generate very short names and the names in the lib will likely be human-readable 🙂


the actual undefined/not-found error is for a var that is human readable. the minified library isn't as minifed as an advanced compilation, so it contains functions like "readFile"


but that is an idea to try the non-minified and see what happens


have to go, good luck


Does anyone know how to get figwheel to work with Electron? I'm having trouble. When I run Electron it says "Figwheel: trying to open cljs reload socket" and then nothing else.


Hi all, what do I need to do to bring in clojure.spec into my project? Just :require [clojure.spec :as s]? On cljs v. "1.9.229" Do I need the clojure 1.9 alpha? thx!


@fedreg You can use Clojure 1.8.0. The only thing you lose by not having the clojure.spec.alpha Clojure namespace available is having macro specs checked.


@mfikes Ahh, I see. Well no need for that at this point anyways. Thanks for the info!


@fedreg With ClojureScript 1.9.229 you’d also need an older Clojure (one that has the clojure.spec namespace) anyway. FWIW, in case you go down that path.


(For the same reason—macro checks.)


Hi! What framework are you using for interface? Should I learn some bootstrap after basic cljs?


The ClojureScript compiler has a guard, and if it can’t find that namespace, it just skips checking macro specs.


So apparently I have much still to learn. I am at a loss as to how to use the output of clojurescript for development when the html is served by a server and not localhost.


I'm getting Not allowed to load local resource: file:///.../out/goog/base.js . Could someone kindly point me to what I should study to understand and resolve this?


@urbank - of the top of my head - I am thinking you might need to compile with "min" profile if you'r using lein


I am also new to clojurescript


wait, does that mean you have a file:/// url in your script tags?


@urbank are you using the cljs REPL?


was my fault as it turned out


@bajrachar Yeah, I think it would work then, but I need the non-single-file version for development (figwheel). @noisesmith Hm.. yes. In the other version it is localhost. I suppose it's because I used an absolute path, because my lein project isn't in the same folder as the actual application @pesterhazy Yep using cljs REPL, figwheel. I'll check out if the issue is relevant to me. I have a feeling I'm making some more fundamental mistake because I don't know what I'm doing when it comes to this.


what url are you opening in the browser?


@pesterhazy So um, excuse my ignorance, but turns out I actually am on local host. So the original question is the wrong one. I'm just not using the figwheel server, but just the output from the compiler. Accessing url localhost:8000/WebSite/default/index. The index.html has a script tag that loads the main.js file which in turn writes a goog/base.js and cljs_deps.js, however the path to goog/base.js and cljs_deps.js is an absolute path from "C:/...". So the browser doesn't allow those two to load. Hm... is it that my :output-to/`:output-dir`/`:asset-path` are absolute paths? I think there's quite a few things here that I don't know that I don't know.


yeah - a file:/// url in an actual app makes no sense - because your client won’t have the files in the right place right? and it would be a security issue even if they did - you need to serve up all the proper artifacts from your webserver - even in dev mode you should not have file urls in your html


@noisesmith Yeah, I assumed I could do this for development, whereas in production it would just be one file anyway.


I'll get rid of the absolute paths


Ok, I've managed to get it working. It was mostly the absolute path. It's working, but for some reason react isn't getting mounted on the #app div.


Eh, never mind. It was just that the div was before script file requiring the main.js file