Fork me on GitHub
#clojurescript
<
2016-03-04
>
danielcompton00:03:34

@lvh I would at least look at buffered channels, but I suspect that you need random access on the ones that are left, not just reading from the front of the queue? rrb-vector might be worth a look?

danielcompton00:03:15

@lvh from the rrb-vector README: > The new functionality is accessible through two functions: clojure.core.rrb-vector/subvec, which provides logarithmic-time non-view slicing (in contrast to clojure.core/subvec, which is a constant-time operation producing view vectors that prevent the underlying vector from becoming eligible for garbage collection) ...

venantius05:03:47

is there an obvious analog for java.lang.Object in JS?

venantius05:03:02

I’m working on adapting a clj library to cljs and wondering what the idiomatic equivalent would be

smw05:03:03

javascript prototype inheritance is very different than the java model, however

smw05:03:32

Every object in JavaScript is an instance of the object Object and therefore inherits all its properties and methods.

solicode06:03:49

@venantius: Not entirely, but depending on what you're doing there might already be a feature which covers what you want to do. Like for example, if you need to dispatch on type when working with protocols for object, yes you can do that. But I don't know what other things you might need. So it depends.

bensu09:03:10

also look at persistentqueues, they might have the semantics you are looking for but in cljs.core

hlolli12:03:18

jquery in clojurescript, Im using boot builder and it seems that including jquery in a script tag wont load it. What Im trying to achieve is using om-bootstrap with toggle button, but for that I need jquery to load up.

hlolli12:03:58

Looking deeper it seems that it has to be defined with :foreign-libs from boot?

lvh14:03:25

bensu: Thanks!

octahedrion16:03:52

source maps have stopped working for me & I can't see what I did to break them

bostonaholic17:03:11

@octo221: you need to have :source-map "public/js/main.js.map" instead of true

elsehow18:03:42

hi all. i’m a little confused about something - is it possible to use npm modules in client-side javascript, e.g. with figwheel? my point of reference here is browserify

octahedrion18:03:58

@bostonaholic: yes but if I do that I get: AssertionError Assert failed: :source-map must be true or false when compiling with :optimizations :none but it is: "public/js/main.js.map" (util/boolean? source-map) cljs.closure/check-source-map (closure.clj:1744)

octahedrion18:03:48

although I guess I could use :whitespace

bostonaholic18:03:02

ah, I didn't catch that

bostonaholic18:03:20

have you tried removing :source-map-path? I've never use that

bostonaholic18:03:52

did you change something with your webserver in regards to resource paths?

octahedrion18:03:36

yep, thanks you've got it I think - I was opening the index.html not serving it from my webserver doh!

octahedrion18:03:10

@bostonaholic: thankyou! that was it

nidu20:03:31

Hello. Have anyone had a problem of receiving JSON in ClojureScript and representing it in correct ClojureScript types automatically? For example JSON doesn't have date, uuid and keyword types, thus it can't be inferred fully automatically without some conventions. Is anybody using Schema coersions or internal JSON conventions (like specially formatted strings/objects for special types)? I just would like find a clean solution for a problem.

richiardiandrea20:03:14

if you are in control of the backend you should consider switching to it

jamesmintram21:03:07

Is there anyway to get a callstack when there is an error that relates to the cljs file? For example, I get an “Incorrect Arity” error - but have no idea what line of code caused this error.

mfikes22:03:25

@jamesmintram: What is the exact error message you are seeing? (Would like to reproduce it.)

ctford22:03:09

Unit testing question: I've got a test defined with deftest, and then I (run-tests) in the same namespace. Running this from lein-cljsbuild prints a report, but doesn't terminate. What do I need to do to make it suitable for use on a CI build?

richiardiandrea22:03:10

@ctford I would suggest to look at lein-doo, it makes everything easier

richiardiandrea22:03:38

The actual answer to your question might be here at the end: https://github.com/clojure/clojurescript/wiki/Testing

jamesmintram22:03:31

@mfikes: https://gist.github.com/jamesmintram/ebe750e6b9d51063c23e — I have found the issue. It was down to an incorrectly formatted anonymous function - so I assume the compiler (in this case) will struggle to provide a line number relating to the issue.

mfikes22:03:42

@jamesmintram: If you can log a minimal repro, maybe we can improve the compiler for that case: https://github.com/clojure/clojurescript/wiki/Reporting-Issues

venantius22:03:36

is there a quick way to check what interfaces a given cljs object satisfies?

venantius22:03:00

(not just checking against a specific one, but getting a list of all known ones, analogous to calling .getInterfaces on a class in Java?)

ctford22:03:54

@richiardiandrea: doo looks very nice. Trying it out now. One question - would you happen to know what it means when you get ERROR: Phantom couldn't find the script when you e.g. lein doo phantom test? I assume I've just set up the build wrongly.

bensu23:03:27

@ctford: it means that the whatever doo thought was being compiled was not there

bensu23:03:44

can you show your cljsbuild options for the test build?

bensu23:03:11

you are using :none without an :output-dir

ctford23:03:15

target/cljs/testable.js is present.

bensu23:03:10

can you try {:output-to "out/testable.js" :output-dir "out"}

ctford23:03:35

Without the :main?

bensu23:03:50

with the main

bensu23:03:25

@venantius: I'm not sure if there is an cljs.core fn for it, but if you really want it the object contains the info under _proto_

ctford23:03:54

@bensu: I get the couldn't find script message still, with or without the :optimizations option. It might be something simple - I don't understand CLJS building very well yet.

bensu23:03:24

try :optimizations :simple

ctford23:03:30

Hmm, same error message, though I think you've fixed some things - less out\testable.js is present and has the aggregated CLJS in it.

ctford23:03:12

testable.js has the test files in it.

bensu23:03:05

right, :optimizations :simple concatenates everything to the same file and doo should definitely be able to find it

ctford23:03:59

Does it just look at the :output-to of the build it's passed?

bensu23:03:12

for :simple yes, that is all it needs

bensu23:03:28

do you have a similar build that works otherwise?

ctford23:03:50

I don't have a working test build, no. The prod build in the same project works - https://github.com/ctford/klangmeister/blob/master/project.clj#L37

bensu23:03:21

everything looks good.

bensu23:03:18

if you can, add the simplest :compiler options that don't work to that project.clj in another branch, and post it as an issue on github with the error message

bensu23:03:21

we can handle it there

ctford23:03:25

Maybe there's a way I could ask doo to be more verbose as to what command it's trying to run?

bensu23:03:08

add this to your project.clj :doo {:verbose true :debug true}

richiardiandrea23:03:19

weird, everything looks good really

bensu23:03:21

I need to document that clearly

richiardiandrea23:03:05

the other thing we don't see and which is always a source of problems (with lein in particular) is profile.clj

richiardiandrea23:03:37

just putting it there 😄

bensu23:03:43

yeah, I think we should look at this in the issue and leave this channel alone

ctford23:03:51

Thanks all