Fork me on GitHub
#clojurescript
<
2016-08-13
>
mfikes01:08:04

^ Also, the slew of ns form improvements are all described via (doc ns) 馃檪

fenton01:08:32

the above is from the spec guide but in cljs generates the following error:

fenton01:08:24

not sure if i should raise a jira error or not.

fenton01:08:31

gotta run.

dnolen01:08:05

@fenton fixed in master, will cut a release on Monday - thanks for the report!

mangr3n02:08:38

are there any community groups focused on cljs on node in the clojurians slack community?

timothypratley05:08:50

Could ClojureScript ever support destructuring JavaScript objects? I can't help but think that I'd like to write:

(fn on-mouse-down [{:keys [client-x client-y]}]
  (prn client-x client-y))
instead of the interop equivalent... does it make sense to want this?

miikka07:08:08

@timothypratley: if you really want it, you could write your own macro to do it. This is just a quick hack: https://gist.github.com/miikka/ed0106b8b8a99a710cd2dd65e02b0b34

bur07:08:53

Is there a way to minify cljsbuild even further? I got optimizations :advanced and :pretty-print false and still getting 800kb in total for a OM hello world example

martinklepsch08:08:38

Not sure how big the impact is but you can set goog.DEBUG to false via :closure-defines

martinklepsch08:08:26

@bur: also do gzip, usually that helps a lot

pesterhazy09:08:27

goog.DEBUG had a massive impact on our bundle size

pesterhazy09:08:02

as in -30% or so

pesterhazy09:08:25

gzipping is essential of course

bur10:08:13

I'm a bit of a noob, so I am unsure how to accomplish this

pesterhazy10:08:46

add :closure-defines {'goog.DEBUG false} to your cljs compiler options

pesterhazy10:08:36

as for gzip, teach your web server to gzip static resources, serve through a cdn, or use a gzipping ring middleware if you're using jetty etc

savelichalex11:08:33

Hi guys! I have a question about cljs code as artifact. Let鈥檚 say I have react native app with cljs and I have parser in a different namespace. I want to move it in artifact and use from my react-native app and probably from os x app with javascript core. Is it possible?

bur11:08:24

:closure-defines {'goog.DEBUG false} cut my filesize in half 馃檪 still 750kb tho 馃槙

bur11:08:43

looking into gzip, i am using http-kit

anmonteiro12:08:56

@bur: probably also worth adding :elide-asserts true

anmonteiro12:08:04

Should save you a bit more

bur12:08:07

thanks @anmonteiro but i can't try that out because unfortunately my clojure application won't start and i cannot debug it

bur12:08:13

all i did was update the dependencies

anmonteiro12:08:39

hrm, I meant :elide-asserts is a CLJS compiler option

bur12:08:39

my clojure application works again

bur12:08:47

i accidentally ring jetty adapter but now its back in

pauldelany13:08:08

Hey - basic question re spec: Using latest clojurescript 1.9.198 and having read http://blog.fikesfarm.com/index.html I'm :require'ing [clojure.spec :as s] as described, but s/and still giving me a compile error - anything obvious I should check?

anmonteiro13:08:01

@pauldelany: probably a bug. I think I鈥檓 currently working on a patch to fix just that

anmonteiro13:08:21

could you see if that issue resonates with you?

pauldelany13:08:53

@anmonteiro: thanks - unsure: my error is somewhat different but can't confirm not the same issue. Error I have is: clojure.lang.ExceptionInfo : failed compiling file:src/cljs/dailrecord/handlers.cljs clojure.lang.ExceptionInfo : nth not supported on this type: Symbol at line 10 src/cljs/dailrecord/handlers.cljs java.lang.UnsupportedOperationException : nth not supported on this type: Symbol Error on file src/cljs/dailrecord/handlers.cljs, line 10, column 1

pauldelany13:08:32

caused by minimal case (from spec tutorial docs): (s/def ::big-even (s/and int? even? #(> % 1000)))

anmonteiro13:08:02

doesn鈥檛 sound related, no

pauldelany13:08:35

I think my problem is something quite basic I'm overlooking - just getting into cljs and spec.

dnolen15:08:37

@pauldelany: going to need more information (s/def ::big-even (s/and int? even? #(> % 1000))) works fine for me

dnolen15:08:46

a complete example that leads to the error would be useful

timothypratley15:08:03

@miikka ooo nice, thank you

bur15:08:16

@anmonteiro: did not help. still at 780kb for basic om hello world cljs 馃槶馃槶

dnolen16:08:39

@bur but what is it gzipped? that鈥檚 all that really matters

bur16:08:09

no it's not I guess :(

bur16:08:37

I'm two days into clojure/closure script

pauldelany16:08:21

@dnolen: - got to the bottom of it - my spec def was nested in a clairvoyant.core macro - moving the definition outside resolved.

bur16:08:42

found a gzip middleware but it's years old

dnolen16:08:42

Or a CDN will do it for you

bur16:08:18

I will do research on that

bur16:08:25

getting confused :(

bur16:08:10

but kudos to clojure, exciting so far

shaun-mahood16:08:11

@bur: have you got a specific target for when you host your finished app?

bur16:08:48

specific target?

bur16:08:53

as in device?

shaun-mahood16:08:43

Sorry, I meant like heroku or another hosting service, or your own server running particular website hosting software.

bur16:08:48

https://blooming-sands-22561.herokuapp.com/ this is the app currently hosted on heroku

shaun-mahood16:08:26

There should be something available to fit into your deployment steps - I think it's much more related to that then anything on the cljs side. I don't usually worry about it at all until I start having particular deployment and hosting needs, but if you know those up front that might help. If it's just a toy or learning app it really doesn't matter imo.

bur17:08:01

yea it does not matter to be honest

bur17:08:19

but I want to see what the impact of a sample cljs application will be in terms of size that needs to be transfered to the client

shaun-mahood17:08:55

@bur: you should be able to just manually gzip your app then and not worry about middleware or anything else like that.

bur19:08:35

trying to debug this error now:

WARNING: uuid? already refers to: cljs.core/uuid? being replaced by: cognitect.transit/uuid? at line 342 resources/public/js/out/cognitect/transit.cljs
WARNING: ident? already refers to: cljs.core/ident? being replaced by: om.util/ident? at line 19 resources/public/js/out/om/util.cljc

bur19:08:57

my dependencies

[org.clojure/clojure "1.8.0"]
                 [compojure "1.5.1"]
                 [http-kit "2.2.0"]
                 [environ "1.1.0"]
                 [com.taoensso/carmine "2.14.0"]
                 [ring/ring-core "1.5.0"]
                 [ring/ring-devel "1.5.0"]
                 [ring/ring-jetty-adapter "1.5.0"]
                 [org.clojure/clojurescript "1.9.198"]
                 [org.omcljs/om "1.0.0-alpha34"]

porglezomp19:08:00

I don鈥檛 think that鈥檚 an error, I鈥檝e been getting messages like that all day with everything working perfectly.

bur19:08:14

my compilation fails 馃槥

porglezomp19:08:27

Is that the cause of the failure though?

bur19:08:30

i didnt change the code, just the dependencies (i think)

bur19:08:44

Compiling "resources/public/js/app.js" failed.
clojure.lang.ExceptionInfo: failed compiling file:resources/public/js/out/om/util.cljc

bur19:08:46

i really wonder how people run compojure servers with clojurescript in production

bur19:08:57

prolly behind nginx or something

akiva20:08:45

It鈥檚 ring with jetty usually.

bur20:08:01

do you use a gzip middleware?

bur20:08:16

i attempted manual gzip but i somehow messed up

akiva20:08:39

I don鈥檛, actually.

bur20:08:10

that's curious

akiva21:08:31

I haven鈥檛 built anything massively large in ClojureScript for production so size wasn鈥檛 an issue. The stuff I do use CLJS for is rather minimal.