Fork me on GitHub
#clojurescript
<
2017-12-29
>
phlie00:12:24

(start-repl) is from the boot-cljs-repl library.

dpsutton00:12:59

try (setq cider-repl-type "cljs")

dpsutton00:12:22

you can see exactly what CIDER does to a new clojurescript repl in cider-create-sibling-cljs-repl

dpsutton00:12:54

and also probably want to M-x clojurescript-mode @phlie

phlie00:12:36

Thanks, I will play around with that for a bit @dpsutton

Miloslav13:12:08

could you please help me with production build error?

ERROR: JSC_MISSING_PROVIDE_ERROR. required "clj_pouchdb.core" namespace never provided at /home/uyouthe/Repos/frontend/target/cljsbuild-compiler-1/frontend_boilerplate/db.js line 6 : 0
ERROR: JSC_MISSING_PROVIDE_ERROR. required "frontend_boilerplate.pages" namespace never provided at /home/uyouthe/Repos/frontend/target/cljsbuild-compiler-1/frontend_boilerplate/routes.js line 7 : 0
Idk why there's an error. Both namespaces are present and it also works in dev mode with figwheel

Miloslav13:12:31

that happens in re-frame

mfikes14:12:50

@melvoloskov Curious if those two namespaces are in a :require ns spec in your code. (I'm guessing that Figwheel may process all the code it sees, but when doing an :advanced build you get the transitive closure from the :main namespace.)

iperdomo16:12:23

hi all, what's the cljs approach to define JS constructors and assign the .prototype property ? 😕 ... i'm trying see if i can implement the DeleteMenu explained in this document - https://developers.google.com/maps/documentation/javascript/examples/delete-vertex-menu

souenzzo17:12:52

Using #lumo with -v option, I can see what is "emitted" in JS, for every cljs line.

cljs.user=> (aset js/DeleteMenu "prototype" "onAdd" #(+ 1 1))
Evaluating (aset js/DeleteMenu "prototype" "onAdd" #(+ 1 1))
(DeleteMenu["prototype"]["onAdd"] = (function (){
return ((1) + (1));
}))
This is what you need?

iperdomo19:12:36

@U2J4FRT2T thanks for the reply ... i was attempting to define DeleteMenu ...

iperdomo19:12:42

will try lumo and see the output

souenzzo19:12:31

var deleteMenu = new DeleteMenu(); => (def delete-menu (new js/DeleteMenu))

souenzzo19:12:21

oh, (defn delete-menu [] (as-this [x] (aset x "div_" (.createElement js/document "div"))))

iperdomo19:12:37

will try it out

iperdomo19:12:19

many thanks, this seems to be the way to go ...

James Vickers19:12:08

What kind of charting (data visualization) libraries are popular these days, that don't involve buying into React? (standalone)

seako07:12:29

d3 is react-free

noisesmith20:12:23

there’s nothing gui based for clojure outside react bindings that I would say qualifies as “popular”

tomaas22:12:18

hi, firebase returns a collection which I only can map with js native forEach. (js->clj col) does not convert it to clojure collection, which I then could map

noisesmith22:12:02

also js->clj is a kind of clumsy tool, often you can do better with a combination of goog.object and aget / aset etc.

tomaas22:12:33

hmm, I don't get what's happening there. Using firebase-database you can do (js->clj (.toJSON snapshot). Even without doing js->clj you can see/print a plain js object. Now, with firestore the snapshot return is diferent (one does not have .toJSON method). I can do forEach on it, which is not usefull for me, I want to see/print that snapshot as plain js object (thing that firebase-database did with .toJSON method on snaphot) and store it somewhere

noisesmith22:12:43

shouldn’t toJSON return a string?

noisesmith22:12:19

just because you can call forEach on a thing doesn’t mean it’s an array that js->clj can do anything useful with

noisesmith22:12:26

if it looks like a plain object you can iterate or map over it with goog.object also, without needing to turn it into a clojure value

noisesmith22:12:34

ahh - json serializable representation - super weird

noisesmith22:12:51

so I would just use (goog.object/map (.toJSON snapshot) f)