Fork me on GitHub
#clojurescript
<
2017-05-16
>
john02:05:16

so I just wasted 30 minutes on the "can't have numbers as the first character in a keyword" gotcha

xiongtx02:05:50

john: AFAIK this applies to symbols:

(def 1a 1)    
;; => clojure.lang.ExceptionInfo: Invalid number format [1a]
But you can get away with it with keywords:
:1a    ;; => :1a
Similarly with periods in symbols/keywords. Keep in mind that the clj reference says that keywords have the same restrictions as symbols: https://clojure.org/reference/reader But in practice keywords are more lax.

john04:05:30

Yeah, my issue is with using pr-str and cljs.reader/read-string specifically

noisesmith02:05:46

+cljs.user=> :1a
:1a

john04:05:59

@noisesmith (cljs.reader/read-string (pr-str :1a)) => #object[TypeError TypeError: Cannot read property '0' of null]

john04:05:22

If you can't read 'em, you shouldn't be able to print 'em

john04:05:11

and while the docs say :1a isn't allowed, CLJ made a command decision to allow them, after fixing the behavior broke jdbc and other libs in the wild. So they grandfathered it in.

john04:05:46

and while I can see how edn is more restrictive, CLJS should try to follow CLJ's behavior in this case, IMO

john04:05:55

garbage out, nothing in

melindazheng06:05:29

Calling all Singaporean clojurians or anyone who might be traveling to this part of the world, we have a dedicated clojurians slack channel #clojure-sg, please join to this channel if wants to share or wondering what we do over Singapore Clojure.

pesterhazy08:05:20

@olivergeorge, it's a well-known gotcha

pesterhazy08:05:53

I think that reagent does warn if you return a lazy seq but perhaps it can't catch all cases

qqq09:05:46

is there every a point to have a boot-watch which comples :optimizations :advanced

qqq09:05:56

am I better of just manually firing off the task whenever I need it

dominicm10:05:02

Has there been much exploration into re-frame–like state management for other libs, e.g. rum?

boyanb12:05:26

Hey guys, quick qustion on the status of bundling commonjs modules into an app or packaging for cljsjs. While it's easy to achieve it with webpack et al, do we actually have facilities that would allow us to either build package directly with boot or require with figwheel without pre-processing?

borkdude13:05:23

I upgraded to the newest ClojureScript and I’m getting:

WARNING: No such namespace: cljs-time, could not locate cljs_time.cljs, cljs_time.cljc, or Closure namespace "" at line 567 /Users/Borkdude/.boot/cache/tmp/Users/Borkdude/dre/DataHub/app/1cn1/-xybho3/public/js/app.out/cljs_time/core.cljs
Is anyone familiar with this error?

borkdude13:05:10

it’s about time for a release I guess then

borkdude15:05:50

I get an error with a cljsjs library extern:

SEVERE: file:/Users/Borkdude/.m2/repository/cljsjs/selectize/0.12.1-1/selectize-0.12.1-1.jar!/cljsjs/selectize/common/selectize.ext.js:54: ERROR
- Object literal contains illegal duplicate key "clearOptionGroups", disallowed in ES5 strict mode
  clearOptionGroups: function(){},

borkdude15:05:25

while upgrading to a newer ClojureScript

thheller15:05:54

that looks like a Closure error

borkdude15:05:29

Ah there is a new one (1-2) available, I try that one

m15:05:32

hi! does anybody know a JavaScript library that comes closest to Clojure.Spec?

m15:05:49

oh, just seeing that there's js.spec...

richiardiandrea17:05:54

@m using js.spec here, not everything is super. But it is usable

rarous17:05:58

I’m trying to use :npm-deps and require npm module submobule (eg. material-ui/styles). Is there any supported syntax for it? (:require material-ui.styles) or (:require material-ui/styles) does not work for me. I can define JS file with import styles from "material-ui/styles" and then goog.provide it, but it will be much nicer if I don’t have to.

anmonteiro17:05:02

not supported

rarous17:05:13

ok, thanks 🙂

grav19:05:32

I’ve messed with Arcadia (Unity 3D), and though it does work, it’s pretty crashy on me. Any thoughts on using CLJS instead, since Unity runs Javascript?

dnolen19:05:40

it’s not actually JavaScript so it’s unlikely to work

grav20:05:40

Oh I see. Apparently it’s called UnityScript. Well, maybe I should fork the cljs compiler then 😉

dnolen20:05:24

the issue won’t be the compiler

dnolen20:05:11

but that the codegen and Google Closure Library expects a proper JS implementation

dnolen20:05:47

also ClojureScript persistent datastructures kind of assume a modern high performance JS engine

dnolen20:05:12

hacking on Arcadia would probably be more productive use of time 🙂

grav22:05:40

hehe, you’re probably right 🙂