This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-01-29
Channels
- # aws (1)
- # aws-lambda (1)
- # beginners (34)
- # boot (61)
- # cljs-dev (126)
- # cljsjs (10)
- # cljsrn (4)
- # clojure (27)
- # clojure-russia (7)
- # clojure-spec (1)
- # clojure-uk (26)
- # clojurescript (42)
- # cursive (31)
- # datascript (4)
- # datomic (16)
- # hoplon (51)
- # klipse (1)
- # lein-figwheel (1)
- # lumo (79)
- # off-topic (16)
- # om (7)
- # parinfer (5)
- # planck (2)
- # re-frame (6)
- # reagent (3)
- # ring-swagger (5)
- # untangled (11)
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: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments
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
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?
because, e.g. https://security.stackexchange.com/questions/93395/how-to-do-client-side-hashing-of-password-using-bcrypt
https://security.stackexchange.com/questions/4936/what-to-transfer-password-or-its-hash
@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
goog.i18n.NumberFormat.Format
goog.i18n.NumberFormatSymbols))
(defn number-formatter
[locale]
(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 https://clojurescript.org/guides/javascript-modules 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
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 https://github.com/katlex/reagent-covered/ which demostrates the setup. And a sample coverage report for a file - https://katlex.github.io/reagent-covered/coverage/app/sources/list.js.html 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 https://github.com/honzabrecka/karma-cljs-test and you can use anything that supports karma
@U050487DQ thanks for the info https://github.com/honzabrecka/karma-cljs-test 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?
@U050487DQ @U17754ZAL I’m using https://github.com/karma-runner/karma-coverage with https://github.com/SitePen/remap-istanbul. The complete config with comments https://gist.github.com/honzabrecka/398c8bab56829648581e2b4fd534fc1b I’m happy with.
@U0GJRGV6G thank you for the note, I guess https://github.com/SitePen/remap-istanbul 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