Fork me on GitHub

Hi for cljsjs packaging, which is the recommended syntax? (deps-cljsjs :provides...) or (deps-cljsjs :foreign-libs [{:provides...}])


And I see both syntax being used in cljsjs/react

Digital Baboon08:09:30

Hey! Do any of you have a "listen to pushState" tutorial by any chance saved somewhere? Would love a link. Examples I've tried thus far lead to no avail.


@im Off the top of my head, you could look at implementations of pushy and accountant. They are very limited in scope and not too hard to read.

👍 4
Digital Baboon08:09:42

@ingesol pushy works like a charm. Made it work with secretary. Thank you!

👍 4
Pieter Koornhof12:09:28

Does anyone know about a 2d vector math lib for clojurescript. There are many js ones but all of them do the state mutation dance

Digital Baboon14:09:27

Hi! Consider this code that I have, which fires login-action on click, how can I get a hold of the email and password within login-action?

Digital Baboon14:09:23

I figured it out! I simply :onChange #(set-email %) and then (defn set-email [event] (js/console.log (-> event .-target .-value)))


is there a standard way of creating a commonjs module from a cljs namespace using cljs.main?


I'd like to use a few compiled cljs functions from a node javascript project


hi, a basic question - i'm getting an error when trying to require hiccup in a cljs file and then doing lein figwheel: No such namespace: hiccup.core, could not locate hiccup/core.cljs, hiccup/core.cljc, or JavaScript source providing "hiccup.core" - is there any way around this? i am very new to cljs so think i'm just missing something basic on how to use clj libraries in cljs.


@atmalagon are you using deps.edn or lein?


hi @bhurlow! i'm using lein


is hiccup in :dependencies in your project.clj?


ah yes, good point; i've got [hiccup "1.0.5"] in my :dependencies and ran lein deps before doing lein figwheel, and if i try requiring hiccup in a lein repl, everything seems to import without error

👍 4

As far as i know hiccup provides some macros. You might need to :require-macros for some hiccup functionality with cljs. Clj doesn't need to require macros explicitely


hiccup is a clojure library and can not be used from clojurescript - there is a hiccup/core.clj but no hiccup/core.cljs


@atmalagon a clojurescript alternative is goog.dom in the google closure library for generating html. If you are using react, there is, uses hiccup style data and react to render html from clojurescript. Reagent also uses hiccup style data and react.

aisamu22:09:58 is also pretty nice ( plain html with reconciliation!) (@atmalagon)