Fork me on GitHub

When my cljsjs packages requires cljsjs.classnames, its javascript file instead of running “window.classNames = classNames” it runs “module.exports = classNames” and then, well, classNames is not defined. What am I missing here?


This is probably simpler than I am making it but is there a way to get the javascript arguments object of a function? The equivalent to this: I think that cljs.core has an a js-arguments macro but there is a comment saying it is for internal use only... is there something publicly facing?


Can someone explain to me in simple terms how to handle authentication for my cljs app? Is it a viable strategy to use sockets for the authentication ?


That is the same question as how to authentication in any js app, and there are a lot of different answers if you are building that from scratch


As far as JavaScript libraries that handle auth, there are TOOONS


A quick starter is auth0, which is already bundled on cljsjs


It's a service, but it has a pretty good free plan, so that is a definite plus


I have a security concern that might not be one... So a user submits username + password across the wire unencrypted, and i pass back a key, and then they use that key to authenticate successive requests.


i'm wondering: doesn't it make more sense to hash the password clientside, before i send it to the server box


anyway, maybe that's a frivolous concern.. but i'm gonna do it that way. any recommendations on crypto libraries for cljs? thanks by the way


@sova why are you sending password on the wire unencrypted?


also, what were you thinking, something like bcrypt?


@sova tl;dr "If a user can login by sending the hash to the server, then the hash is effectively the password."


anyone have experience getting i18n from google closure to work in cljs?


i'm really struggling to get number formatting working 😞


specifically with the advanced compilation on


(ns i18n.number
 (:require goog.i18n.NumberFormat

(defn number-formatter
 (set! goog.i18n.NumberFormatSymbols (aget goog.i18n (str "NumberFormatSymbols_" (clojure.string/replace locale "-" "_"))))
 (goog.i18n.NumberFormat. goog.i18n.NumberFormat.Format.DECIMAL))

(-> (number-formatter "en-IN") (.format 1000000) prn)
(-> (number-formatter "en-IN") (.parse "1,000,000.00") prn)

(-> (number-formatter "en") (.format 1000000) prn)
(-> (number-formatter "en") (.parse "1,000,000.00") prn)

(-> (number-formatter "fr") (.format 1000000) prn)
(-> (number-formatter "fr") (.parse "1,000,000.00") prn)


works fine with compilation in :none


two issues (so far) with :advanced compilation


WARNING - incomplete alias created for namespace goog.i18n
goog.i18n.NumberFormatSymbols = (goog.i18n[[cljs.core.str("NumberFormatSymbols_"),cljs.core.str(clojure.string.replace(locale,"-","_"))].join('')]);


Uncaught TypeError: Cannot read property '$DEF_CURRENCY_CODE$' of undefined


normally i see issues like this when i haven't set up externs, but i had assumed externs would not be needed for google closure?


nm, sorted it out


Anybody got :preprocess playing nicely with lein-cljsbuild ? Feeling​ tempted to hack the latter,


Hi, i'm following this tutorial and have the following error when trying this at the repl: (require '[js.hello :as hello] :reload) => SyntaxError: Identifier 'sayHello$$module$src$js$hello' has already been declared


does anyone had this too?


so cool. I must say I was a little bit skeptical wrt externs inference. But now it seems that if your libraries don't do anything fancy (i.e. ugly dynamic JS stuff) your resulting bundle may actually decrease in size - by just not using externs 🙂


Any reason to prefer cljs-http over happy, or is there a preferred http library for clojurescript?


hello everybody, I’m interested in how people are measuring test coverage for their clojurescript projects. Quick googling didn’t find a lot of info so I went and worked out a solution based on doo test runner via Istanbul and karma-coverage. It required to do some changes to the doo (still in review) and karma-reporter projects. This is a sample project which demostrates the setup. And a sample coverage report for a file - I know so far it’s kinda ugly, but it’s enough to understand which parts aren’t covered and to maintain automatic checking of minimum coverage requirements for a project. Eager to hear any thoughts on it. Thanks.


alun: For aws-lambda code we are using Istanbul with sourcemaps. For browser code, there is and you can use anything that supports karma


@U050487DQ thanks for the info can be used by doo and I’m using it with my example as well, for Instanbul with source maps did you manage to show you the coverage on original CLJS code?


@U0GJRGV6G thank you for the note, I guess is the thing that I was looking for. I think we need to make it a standart part of doo runner , that must be simpler solution that porting cloverage to clojurescript


@U17754ZAL my script for lambda coverage:

lein cljsbuild once test
LOCAL_DYNAMO_URL= istanbul cover target/test/test.js --type json --print none
remap-istanbul -i coverage/coverage.json -o coverage/html-report --type html
remap-istanbul -i coverage/coverage.json -o coverage/summary.txt --type text-summary
cat coverage/summary.txt


Mapped result aint perfect, but better then nothing. 🙂